streamlit-nightly 1.41.2.dev20250102__py2.py3-none-any.whl → 1.41.2.dev20250103__py2.py3-none-any.whl
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.
- streamlit/elements/widgets/time_widgets.py +62 -2
- streamlit/error_util.py +8 -2
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.CNoj4-Mv.js → FileDownload.esm.CRoG5i8r.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.CDUcNE9t.js → FormClearHelper.DWef4hWz.js} +1 -1
- streamlit/static/static/js/{Hooks.DMpj-RLb.js → Hooks.-GVqTMyj.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DaNtjCNr.js → InputInstructions.BohKIZFT.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BRPIMM7l.js → ProgressBar.ByDCgAp7.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.Cfc5-09w.js → RenderInPortalIfExists.DJNskB1V.js} +1 -1
- streamlit/static/static/js/{Toolbar._8UjRFMn.js → Toolbar.B93Vwnd4.js} +1 -1
- streamlit/static/static/js/{base-input.BKegJgWw.js → base-input.CTx0gvzT.js} +4 -4
- streamlit/static/static/js/{createSuper.jxh1FiCj.js → createSuper.BwPw7vsr.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BB33zQGs.js → data-grid-overlay-editor.CLQHI5MN.js} +1 -1
- streamlit/static/static/js/{downloader.Cm-5-MSJ.js → downloader.WO6ZA_Co.js} +1 -1
- streamlit/static/static/js/{es6.OcNPOAdx.js → es6.55gLy6L6.js} +2 -2
- streamlit/static/static/js/{getPrototypeOf.BY5XPmcO.js → getPrototypeOf.DJw8FwRX.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.BFAgAgvG.js → iframeResizer.contentWindow.B4_zxk6k.js} +1 -1
- streamlit/static/static/js/index.4oltPSDN.js +1 -0
- streamlit/static/static/js/{index.DvnQilxK.js → index.9Y5ek_7z.js} +1 -1
- streamlit/static/static/js/{index.DASuqVzI.js → index.B9uAqDdL.js} +1 -1
- streamlit/static/static/js/{index.DUIN-jsB.js → index.BJ_D3md2.js} +1 -1
- streamlit/static/static/js/{index.Vds5Jt2I.js → index.BW_GOkH1.js} +1 -1
- streamlit/static/static/js/index.BdQidO-z.js +197 -0
- streamlit/static/static/js/{index.tzlSUp7h.js → index.BeYh1C02.js} +3 -3
- streamlit/static/static/js/{index.C77ezkzE.js → index.BqdO5rz5.js} +7 -7
- streamlit/static/static/js/{index.CzlkG9Fr.js → index.CA049ZDW.js} +2 -2
- streamlit/static/static/js/{index.CxdjcKNq.js → index.CGGiK-tN.js} +2 -2
- streamlit/static/static/js/{index.De2k2c-U.js → index.CIwb9X9s.js} +1 -1
- streamlit/static/static/js/index.CQk_PsCc.js +1 -0
- streamlit/static/static/js/{index.CAMMqKeD.js → index.CTKJYGMX.js} +1 -1
- streamlit/static/static/js/index.CVKTpi5B.js +2 -0
- streamlit/static/static/js/{index.ATVdLDmC.js → index.CkBAk1pS.js} +1 -1
- streamlit/static/static/js/{index.VoGEnWSD.js → index.CwosDieY.js} +2 -2
- streamlit/static/static/js/{index.DJTR-TvF.js → index.D1JevM_2.js} +1 -1
- streamlit/static/static/js/{index.CVx5m08a.js → index.DBkgIii2.js} +1 -1
- streamlit/static/static/js/{index.wdIHSIcW.js → index.DD9fCaBj.js} +1 -1
- streamlit/static/static/js/{index.BtYb1969.js → index.DE7Cx7jU.js} +1 -1
- streamlit/static/static/js/{index.QGeCkb2Q.js → index.DNYJVjE8.js} +1 -1
- streamlit/static/static/js/{index.6vjR_n-y.js → index.DXat8gQf.js} +4 -4
- streamlit/static/static/js/{index.CGzczlx9.js → index.D_6VpY6P.js} +1 -1
- streamlit/static/static/js/{index.K-tM-X1m.js → index.Dk0ptJZt.js} +1 -1
- streamlit/static/static/js/{index.CUh8Rsc7.js → index.J7Vrq5lQ.js} +1 -1
- streamlit/static/static/js/{index.Bu-D_kDf.js → index.R8aPyg_g.js} +4 -4
- streamlit/static/static/js/{index.7hDSQs9w.js → index.SLtqkRJD.js} +1 -1
- streamlit/static/static/js/{index.De_q7lv4.js → index.St5APQjJ.js} +1 -1
- streamlit/static/static/js/{index.C-rNevaH.js → index._bgPbXSL.js} +2 -2
- streamlit/static/static/js/index.bOS3gI2u.js +1 -0
- streamlit/static/static/js/{index.CBHLGMyy.js → index.bkgZHDpc.js} +1 -1
- streamlit/static/static/js/{index.DMr0rZjG.js → index.gqEzZP5J.js} +1 -1
- streamlit/static/static/js/{index.qUb9zYOr.js → index.oYpNgdlw.js} +1 -1
- streamlit/static/static/js/{index.DMDxcX2K.js → index.pU7vIfXj.js} +1 -1
- streamlit/static/static/js/{index.BF39aXr4.js → index.ts8s7CAI.js} +1 -1
- streamlit/static/static/js/{index.BfhP6PDz.js → index.uc9sf5pQ.js} +1 -1
- streamlit/static/static/js/{index.uWSBHHII.js → index.zMOhoVg6.js} +3 -3
- streamlit/static/static/js/{input.C3o7UqTF.js → input.CXSAsjSZ.js} +2 -2
- streamlit/static/static/js/{memory.DAjIQM15.js → memory.DdFkwmdB.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.YLsBH7YM.js → number-overlay-editor.BwYQjq5H.js} +1 -1
- streamlit/static/static/js/{sandbox.5Z6Ir5FQ.js → sandbox.Di7DT8TM.js} +1 -1
- streamlit/static/static/js/{slicedToArray.Dr1mYLAX.js → slicedToArray.yExWK_Ke.js} +2 -2
- streamlit/static/static/js/{textarea.BjNH-nD-.js → textarea.B7FAzJHc.js} +2 -2
- streamlit/static/static/js/{timepicker.B5grIdSj.js → timepicker.Cvt746F5.js} +1 -1
- streamlit/static/static/js/{uniqueId.DGVuWfUI.js → uniqueId.Dme_RYod.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.BMoJJAfz.js → useBasicWidgetState.BrxTjxxP.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.D4-GhwNq.js → useOnInputChange.8aWa7n-i.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.qbbU-bZp.js → withFullScreenWrapper.BBIHM2Cb.js} +1 -1
- {streamlit_nightly-1.41.2.dev20250102.dist-info → streamlit_nightly-1.41.2.dev20250103.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.41.2.dev20250102.dist-info → streamlit_nightly-1.41.2.dev20250103.dist-info}/RECORD +71 -71
- streamlit/static/static/js/index.B4QbLNs0.js +0 -1
- streamlit/static/static/js/index.BNduMvHL.js +0 -1
- streamlit/static/static/js/index.BxB51OcG.js +0 -1
- streamlit/static/static/js/index.Cpt1ZWEY.js +0 -2
- streamlit/static/static/js/index.QhNU1B5h.js +0 -197
- {streamlit_nightly-1.41.2.dev20250102.data → streamlit_nightly-1.41.2.dev20250103.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.41.2.dev20250102.dist-info → streamlit_nightly-1.41.2.dev20250103.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.41.2.dev20250102.dist-info → streamlit_nightly-1.41.2.dev20250103.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250102.dist-info → streamlit_nightly-1.41.2.dev20250103.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import{g as zk,
|
1
|
+
import{g as zk,aa as Qu,A as Jy,J as bE,ab as rL,ac as sL,ad as ga,ae as Pd,Y as eo,af as oL,ag as aL,ah as vE,ai as uL,B as lL,X as cL,n as fL,M as dL,j as fd,r as hL,D as xE,aj as pL,a0 as ym,a8 as gL,ak as mL,al as wE}from"./index.DXat8gQf.js";import{a as oc,n as yL,b as bL,c as fp,t as Oo,f as vL,d as j0,p as xL,e as wL,g as EL,h as Ik,i as SL,j as Bs,k as Nc,l as _L,m as $L,o as AL,q as kL,r as dp,s as EE,u as ku,v as Qy,w as hp,x as SE,y as fs,z as Va,A as CL,B as Us,C as FL,D as TL,E as ML,F as DL}from"./threshold.skajmqVB.js";import{d as Zy,e as eb,R as pp,C as tb,r as Bk,b as _E,a as $E,h as gp,c as q0,n as Pt,f as OL,g as RL,i as NL,j as LL,k as PL,l as zL,m as IL,o as zd}from"./string.Bl9OLDCw.js";import{i as BL,a as UL,n as jL,T as qL,t as WL}from"./timer.DwZfkapc.js";import{F as HL}from"./FormClearHelper.DWef4hWz.js";import{S as AE,T as GL}from"./Toolbar.B93Vwnd4.js";import{w as VL,u as XL,E as YL}from"./withFullScreenWrapper.BBIHM2Cb.js";/*!
|
2
2
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
3
3
|
* (c) 2017-2022 Joachim Wester
|
4
4
|
* MIT licensed
|
@@ -14,10 +14,10 @@ import{g as zk,a9 as Qu,A as Jy,J as bE,aa as rL,ab as sL,ac as ga,ad as Pd,S as
|
|
14
14
|
`)}function a(f,d){return d==null&&(d=TE(f)),s(f,d).join(`
|
15
15
|
`)}function u(f){return f.map(l).join(`
|
16
16
|
`)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?AP(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:o,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function CP(e){return e}function FP(e){if(e==null)return CP;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],o=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+s,f[1]=(n+=a[1])*r+o;l<c;)f[l]=a[l],++l;return f}}function TP(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function MP(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ME(e,n)})}:ME(e,t)}function ME(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=gC(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function gC(e,t){var n=FP(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));c<0&&TP(f,p)}function s(c){return n(c)}function o(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=o(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=s(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(s);break;case"LineString":d=o(c.arcs);break;case"MultiLineString":d=c.arcs.map(o);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function DP(e,t){var n={},i={},r={},s=[],o=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++o],t[o]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,p;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,p=i[d]){delete i[p.start];var g=p===h?h:h.concat(p);i[g.start=h.start]=r[g.end=p.end]=g}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,p=r[f]){delete r[p.end];var m=p===h?h:p.concat(h);i[m.start=p.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),s.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||s.push([l])}),s}function OP(e){return gC(e,RP.apply(this,arguments))}function RP(e,t,n){var i,r,s;if(arguments.length>1)i=NP(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);r<s;++r)i[r]=r;return{type:"MultiLineString",arcs:DP(e,i)}}function NP(e,t,n){var i=[],r=[],s;function o(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:s})}function a(f){f.forEach(o)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(s=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function LP(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function PP(e,t){const n=LP(e,t);return n&&Math.sqrt(n)}class nn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],o=t+s,a=Math.abs(t)<Math.abs(s)?t-(o-s):s-(o-t);a&&(n[i++]=a),t=o}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,o=0;if(n>0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class DE extends Map{constructor(t,n=bC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(Y0(this,t))}has(t){return super.has(Y0(this,t))}set(t,n){return super.set(mC(this,t),n)}delete(t){return super.delete(yC(this,t))}}class qd extends Set{constructor(t,n=bC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(Y0(this,t))}add(t){return super.add(mC(this,t))}delete(t){return super.delete(yC(this,t))}}function Y0({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function mC({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function yC({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function bC(e){return e!==null&&typeof e=="object"?e.valueOf():e}function zP(e,t){return Array.from(t,n=>e[n])}function IP(e=oc){if(e===oc)return vC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function vC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function $o(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function K0(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function xC(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?vC:IP(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));xC(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(el(e,n,t),r(e[i],s)>0&&el(e,n,i);o<a;){for(el(e,o,a),++o,--a;r(e[o],s)<0;)++o;for(;r(e[a],s)>0;)--a}r(e[n],s)===0?el(e,n,a):(++a,el(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function el(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function J0(e,t,n){if(e=Float64Array.from(yL(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return K0(e);if(t>=1)return $o(e);var i,r=(i-1)*t,s=Math.floor(r),o=$o(xC(e,s).subarray(0,s+1)),a=K0(e.subarray(s+1));return o+(a-o)*(r-s)}}function wC(e,t,n=bL){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function BP(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function EC(e,t){return J0(e,.5,t)}function*UP(e){for(const t of e)yield*t}function SC(e){return Array.from(UP(e))}function Fn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function _C(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function jP(e,...t){e=new qd(e),t=t.map(qP);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function qP(e){return e instanceof qd?e:new qd(e)}function WP(...e){const t=new qd;for(const n of e)for(const i of n)t.add(i);return t}const Em=new Date,Sm=new Date;function ut(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o<a-s?o:a},r.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const u=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s<o)||!(a>0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(l<s&&s<o);return u},r.filter=s=>ut(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(Em.setTime(+s),Sm.setTime(+o),e(Em),e(Sm),Math.floor(n(Em,Sm))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const Xa=ut(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Xa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ut(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Xa);Xa.range;const kr=1e3,qn=kr*60,Cr=qn*60,Br=Cr*24,mb=Br*7,OE=Br*30,_m=Br*365,Fr=ut(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*kr)},(e,t)=>(t-e)/kr,e=>e.getUTCSeconds());Fr.range;const xp=ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kr)},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getMinutes());xp.range;const wp=ut(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getUTCMinutes());wp.range;const Ep=ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kr-e.getMinutes()*qn)},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getHours());Ep.range;const Sp=ut(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getUTCHours());Sp.range;const Or=ut(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qn)/Br,e=>e.getDate()-1);Or.range;const Es=ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Br,e=>e.getUTCDate()-1);Es.range;const $C=ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Br,e=>Math.floor(e/Br));$C.range;function Qo(e){return ut(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())*qn)/mb)}const Du=Qo(0),Wd=Qo(1),HP=Qo(2),GP=Qo(3),Ya=Qo(4),VP=Qo(5),XP=Qo(6);Du.range;Wd.range;HP.range;GP.range;Ya.range;VP.range;XP.range;function Zo(e){return ut(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)/mb)}const Ou=Zo(0),Hd=Zo(1),YP=Zo(2),KP=Zo(3),Ka=Zo(4),JP=Zo(5),QP=Zo(6);Ou.range;Hd.range;YP.range;KP.range;Ka.range;JP.range;QP.range;const uc=ut(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());uc.range;const lc=ut(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());lc.range;const Qi=ut(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());Qi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ut(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)});Qi.range;const Zi=ut(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());Zi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ut(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)});Zi.range;function AC(e,t,n,i,r,s){const o=[[Fr,1,kr],[Fr,5,5*kr],[Fr,15,15*kr],[Fr,30,30*kr],[s,1,qn],[s,5,5*qn],[s,15,15*qn],[s,30,30*qn],[r,1,Cr],[r,3,3*Cr],[r,6,6*Cr],[r,12,12*Cr],[i,1,Br],[i,2,2*Br],[n,1,mb],[t,1,OE],[t,3,3*OE],[e,1,_m]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),p=h?h.range(l,+c+1):[];return d?p.reverse():p}function u(l,c,f){const d=Math.abs(c-l)/f,h=fp(([,,m])=>m).right(o,d);if(h===o.length)return e.every(Oo(l/_m,c/_m,f));if(h===0)return Xa.every(Math.max(Oo(l,c,f),1));const[p,g]=o[d/o[h-1][2]<o[h][2]/d?h-1:h];return p.every(g)}return[a,u]}const[ZP,ez]=AC(Zi,lc,Ou,$C,Sp,wp),[tz,nz]=AC(Qi,uc,Du,Or,Ep,xp),At="year",mn="quarter",Ut="month",st="week",yn="date",Lt="day",er="dayofyear",Nn="hours",Ln="minutes",Kn="seconds",bi="milliseconds",yb=[At,mn,Ut,st,yn,Lt,er,Nn,Ln,Kn,bi],$m=yb.reduce((e,t,n)=>(e[t]=1+n,e),{});function bb(e){const t=Y(e).slice(),n={};return t.length||N("Missing time unit."),t.forEach(r=>{J($m,r)?n[r]=1:N(`Invalid time unit: ${r}.`)}),(n[st]||n[Lt]?1:0)+(n[mn]||n[Ut]||n[yn]?1:0)+(n[er]?1:0)>1&&N(`Incompatible time units: ${e}`),t.sort((r,s)=>$m[r]-$m[s]),t}const iz={[At]:"%Y ",[mn]:"Q%q ",[Ut]:"%b ",[yn]:"%d ",[st]:"W%U ",[Lt]:"%a ",[er]:"%j ",[Nn]:"%H:00",[Ln]:"00:%M",[Kn]:":%S",[bi]:".%L",[`${At}-${Ut}`]:"%Y-%m ",[`${At}-${Ut}-${yn}`]:"%Y-%m-%d ",[`${Nn}-${Ln}`]:"%H:%M"};function kC(e,t){const n=ce({},iz,t),i=bb(e),r=i.length;let s="",o=0,a,u;for(o=0;o<r;)for(a=i.length;a>o;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const mo=new Date;function vb(e){return mo.setFullYear(e),mo.setMonth(0),mo.setDate(1),mo.setHours(0,0,0,0),mo}function CC(e){return TC(new Date(e))}function FC(e){return Q0(new Date(e))}function TC(e){return Or.count(vb(e.getFullYear())-1,e)}function Q0(e){return Du.count(vb(e.getFullYear())-1,e)}function Z0(e){return vb(e).getDay()}function rz(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function MC(e){return OC(new Date(e))}function DC(e){return e1(new Date(e))}function OC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Es.count(t-1,e)}function e1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Ou.count(t-1,e)}function t1(e){return mo.setTime(Date.UTC(e,0,1)),mo.getUTCDay()}function sz(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function RC(e,t,n,i,r){const s=t||1,o=xe(e),a=(y,b,v)=>(v=v||y,oz(n[v],i[v],y===o&&s,b)),u=new Date,l=yi(e),c=l[At]?a(At):Ht(2012),f=l[Ut]?a(Ut):l[mn]?a(mn):cs,d=l[st]&&l[Lt]?a(Lt,1,st+Lt):l[st]?a(st,1):l[Lt]?a(Lt,1):l[yn]?a(yn,1):l[er]?a(er,1):Cu,h=l[Nn]?a(Nn):cs,p=l[Ln]?a(Ln):cs,g=l[Kn]?a(Kn):cs,m=l[bi]?a(bi):cs;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function oz(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function Ja(e,t,n){return t+e*7-(n+6)%7}const az={[At]:e=>e.getFullYear(),[mn]:e=>Math.floor(e.getMonth()/3),[Ut]:e=>e.getMonth(),[yn]:e=>e.getDate(),[Nn]:e=>e.getHours(),[Ln]:e=>e.getMinutes(),[Kn]:e=>e.getSeconds(),[bi]:e=>e.getMilliseconds(),[er]:e=>TC(e),[st]:e=>Q0(e),[st+Lt]:(e,t)=>Ja(Q0(e),e.getDay(),Z0(t)),[Lt]:(e,t)=>Ja(1,e.getDay(),Z0(t))},uz={[mn]:e=>3*e,[st]:(e,t)=>Ja(e,0,Z0(t))};function NC(e,t){return RC(e,t||1,az,uz,rz)}const lz={[At]:e=>e.getUTCFullYear(),[mn]:e=>Math.floor(e.getUTCMonth()/3),[Ut]:e=>e.getUTCMonth(),[yn]:e=>e.getUTCDate(),[Nn]:e=>e.getUTCHours(),[Ln]:e=>e.getUTCMinutes(),[Kn]:e=>e.getUTCSeconds(),[bi]:e=>e.getUTCMilliseconds(),[er]:e=>OC(e),[st]:e=>e1(e),[Lt]:(e,t)=>Ja(1,e.getUTCDay(),t1(t)),[st+Lt]:(e,t)=>Ja(e1(e),e.getUTCDay(),t1(t))},cz={[mn]:e=>3*e,[st]:(e,t)=>Ja(e,0,t1(t))};function LC(e,t){return RC(e,t||1,lz,cz,sz)}const fz={[At]:Qi,[mn]:uc.every(3),[Ut]:uc,[st]:Du,[yn]:Or,[Lt]:Or,[er]:Or,[Nn]:Ep,[Ln]:xp,[Kn]:Fr,[bi]:Xa},dz={[At]:Zi,[mn]:lc.every(3),[Ut]:lc,[st]:Ou,[yn]:Es,[Lt]:Es,[er]:Es,[Nn]:Sp,[Ln]:wp,[Kn]:Fr,[bi]:Xa};function Ru(e){return fz[e]}function Nu(e){return dz[e]}function PC(e,t,n){return e?e.offset(t,n):void 0}function zC(e,t,n){return PC(Ru(e),t,n)}function IC(e,t,n){return PC(Nu(e),t,n)}function BC(e,t,n,i){return e?e.range(t,n,i):void 0}function UC(e,t,n,i){return BC(Ru(e),t,n,i)}function jC(e,t,n,i){return BC(Nu(e),t,n,i)}const _l=1e3,$l=_l*60,Al=$l*60,_p=Al*24,hz=_p*7,RE=_p*30,n1=_p*365,qC=[At,Ut,yn,Nn,Ln,Kn,bi],kl=qC.slice(0,-1),Cl=kl.slice(0,-1),Fl=Cl.slice(0,-1),pz=Fl.slice(0,-1),gz=[At,st],NE=[At,Ut],WC=[At],tl=[[kl,1,_l],[kl,5,5*_l],[kl,15,15*_l],[kl,30,30*_l],[Cl,1,$l],[Cl,5,5*$l],[Cl,15,15*$l],[Cl,30,30*$l],[Fl,1,Al],[Fl,3,3*Al],[Fl,6,6*Al],[Fl,12,12*Al],[pz,1,_p],[gz,1,hz],[NE,1,RE],[NE,3,3*RE],[WC,1,n1]];function HC(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Pc(t))/n;let r=fp(a=>a[2]).right(tl,i),s,o;return r===tl.length?(s=WC,o=Oo(t[0]/n1,t[1]/n1,n)):r?(r=tl[i/tl[r-1][2]<tl[r][2]/i?r-1:r],s=r[0],o=r[1]):(s=qC,o=Math.max(Oo(t[0],t[1],n),1)),{units:s,step:o}}function Am(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 km(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 nl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function GC(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,o=e.shortDays,a=e.months,u=e.shortMonths,l=il(r),c=rl(r),f=il(s),d=rl(s),h=il(o),p=rl(o),g=il(a),m=rl(a),y=il(u),b=rl(u),v={a:P,A:z,b:U,B:te,c:null,d:UE,e:UE,f:zz,g:Xz,G:Kz,H:Nz,I:Lz,j:Pz,L:VC,m:Iz,M:Bz,p:ne,q:de,Q:WE,s:HE,S:Uz,u:jz,U:qz,V:Wz,w:Hz,W:Gz,x:null,X:null,y:Vz,Y:Yz,Z:Jz,"%":qE},x={a:Se,A:we,b:Pe,B:Di,c:null,d:jE,e:jE,f:tI,g:fI,G:hI,H:Qz,I:Zz,j:eI,L:YC,m:nI,M:iI,p:Zs,q:es,Q:WE,s:HE,S:rI,u:sI,U:oI,V:aI,w:uI,W:lI,x:null,X:null,y:cI,Y:dI,Z:pI,"%":qE},E={a:C,A:T,b:O,B:k,c:F,d:IE,e:IE,f:Mz,g:zE,G:PE,H:BE,I:BE,j:kz,L:Tz,m:Az,M:Cz,p:$,q:$z,Q:Oz,s:Rz,S:Fz,u:xz,U:wz,V:Ez,w:vz,W:Sz,x:A,X:M,y:zE,Y:PE,Z:_z,"%":Dz};v.x=S(n,v),v.X=S(i,v),v.c=S(t,v),x.x=S(n,x),x.X=S(i,x),x.c=S(t,x);function S(Q,he){return function(ge){var W=[],vt=-1,Te=0,Tt=Q.length,ct,Oi,Af;for(ge instanceof Date||(ge=new Date(+ge));++vt<Tt;)Q.charCodeAt(vt)===37&&(W.push(Q.slice(Te,vt)),(Oi=LE[ct=Q.charAt(++vt)])!=null?ct=Q.charAt(++vt):Oi=ct==="e"?" ":"0",(Af=he[ct])&&(ct=Af(ge,Oi)),W.push(ct),Te=vt+1);return W.push(Q.slice(Te,vt)),W.join("")}}function w(Q,he){return function(ge){var W=nl(1900,void 0,1),vt=_(W,Q,ge+="",0),Te,Tt;if(vt!=ge.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(he&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Te=km(nl(W.y,0,1)),Tt=Te.getUTCDay(),Te=Tt>4||Tt===0?Hd.ceil(Te):Hd(Te),Te=Es.offset(Te,(W.V-1)*7),W.y=Te.getUTCFullYear(),W.m=Te.getUTCMonth(),W.d=Te.getUTCDate()+(W.w+6)%7):(Te=Am(nl(W.y,0,1)),Tt=Te.getDay(),Te=Tt>4||Tt===0?Wd.ceil(Te):Wd(Te),Te=Or.offset(Te,(W.V-1)*7),W.y=Te.getFullYear(),W.m=Te.getMonth(),W.d=Te.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Tt="Z"in W?km(nl(W.y,0,1)).getUTCDay():Am(nl(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Tt+5)%7:W.w+W.U*7-(Tt+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,km(W)):Am(W)}}function _(Q,he,ge,W){for(var vt=0,Te=he.length,Tt=ge.length,ct,Oi;vt<Te;){if(W>=Tt)return-1;if(ct=he.charCodeAt(vt++),ct===37){if(ct=he.charAt(vt++),Oi=E[ct in LE?he.charAt(vt++):ct],!Oi||(W=Oi(Q,ge,W))<0)return-1}else if(ct!=ge.charCodeAt(W++))return-1}return W}function $(Q,he,ge){var W=l.exec(he.slice(ge));return W?(Q.p=c.get(W[0].toLowerCase()),ge+W[0].length):-1}function C(Q,he,ge){var W=h.exec(he.slice(ge));return W?(Q.w=p.get(W[0].toLowerCase()),ge+W[0].length):-1}function T(Q,he,ge){var W=f.exec(he.slice(ge));return W?(Q.w=d.get(W[0].toLowerCase()),ge+W[0].length):-1}function O(Q,he,ge){var W=y.exec(he.slice(ge));return W?(Q.m=b.get(W[0].toLowerCase()),ge+W[0].length):-1}function k(Q,he,ge){var W=g.exec(he.slice(ge));return W?(Q.m=m.get(W[0].toLowerCase()),ge+W[0].length):-1}function F(Q,he,ge){return _(Q,t,he,ge)}function A(Q,he,ge){return _(Q,n,he,ge)}function M(Q,he,ge){return _(Q,i,he,ge)}function P(Q){return o[Q.getDay()]}function z(Q){return s[Q.getDay()]}function U(Q){return u[Q.getMonth()]}function te(Q){return a[Q.getMonth()]}function ne(Q){return r[+(Q.getHours()>=12)]}function de(Q){return 1+~~(Q.getMonth()/3)}function Se(Q){return o[Q.getUTCDay()]}function we(Q){return s[Q.getUTCDay()]}function Pe(Q){return u[Q.getUTCMonth()]}function Di(Q){return a[Q.getUTCMonth()]}function Zs(Q){return r[+(Q.getUTCHours()>=12)]}function es(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var he=S(Q+="",v);return he.toString=function(){return Q},he},parse:function(Q){var he=w(Q+="",!1);return he.toString=function(){return Q},he},utcFormat:function(Q){var he=S(Q+="",x);return he.toString=function(){return Q},he},utcParse:function(Q){var he=w(Q+="",!0);return he.toString=function(){return Q},he}}}var LE={"-":"",_:" ",0:"0"},yt=/^\s*\d+/,mz=/^%/,yz=/[\\^$*+?|[\]().{}]/g;function Ae(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function bz(e){return e.replace(yz,"\\$&")}function il(e){return new RegExp("^(?:"+e.map(bz).join("|")+")","i")}function rl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function vz(e,t,n){var i=yt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function xz(e,t,n){var i=yt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function wz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Ez(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Sz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function PE(e,t,n){var i=yt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function zE(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function _z(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function $z(e,t,n){var i=yt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Az(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function IE(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function kz(e,t,n){var i=yt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function BE(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Cz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Fz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Tz(e,t,n){var i=yt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Mz(e,t,n){var i=yt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Dz(e,t,n){var i=mz.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Oz(e,t,n){var i=yt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Rz(e,t,n){var i=yt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function UE(e,t){return Ae(e.getDate(),t,2)}function Nz(e,t){return Ae(e.getHours(),t,2)}function Lz(e,t){return Ae(e.getHours()%12||12,t,2)}function Pz(e,t){return Ae(1+Or.count(Qi(e),e),t,3)}function VC(e,t){return Ae(e.getMilliseconds(),t,3)}function zz(e,t){return VC(e,t)+"000"}function Iz(e,t){return Ae(e.getMonth()+1,t,2)}function Bz(e,t){return Ae(e.getMinutes(),t,2)}function Uz(e,t){return Ae(e.getSeconds(),t,2)}function jz(e){var t=e.getDay();return t===0?7:t}function qz(e,t){return Ae(Du.count(Qi(e)-1,e),t,2)}function XC(e){var t=e.getDay();return t>=4||t===0?Ya(e):Ya.ceil(e)}function Wz(e,t){return e=XC(e),Ae(Ya.count(Qi(e),e)+(Qi(e).getDay()===4),t,2)}function Hz(e){return e.getDay()}function Gz(e,t){return Ae(Wd.count(Qi(e)-1,e),t,2)}function Vz(e,t){return Ae(e.getFullYear()%100,t,2)}function Xz(e,t){return e=XC(e),Ae(e.getFullYear()%100,t,2)}function Yz(e,t){return Ae(e.getFullYear()%1e4,t,4)}function Kz(e,t){var n=e.getDay();return e=n>=4||n===0?Ya(e):Ya.ceil(e),Ae(e.getFullYear()%1e4,t,4)}function Jz(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ae(t/60|0,"0",2)+Ae(t%60,"0",2)}function jE(e,t){return Ae(e.getUTCDate(),t,2)}function Qz(e,t){return Ae(e.getUTCHours(),t,2)}function Zz(e,t){return Ae(e.getUTCHours()%12||12,t,2)}function eI(e,t){return Ae(1+Es.count(Zi(e),e),t,3)}function YC(e,t){return Ae(e.getUTCMilliseconds(),t,3)}function tI(e,t){return YC(e,t)+"000"}function nI(e,t){return Ae(e.getUTCMonth()+1,t,2)}function iI(e,t){return Ae(e.getUTCMinutes(),t,2)}function rI(e,t){return Ae(e.getUTCSeconds(),t,2)}function sI(e){var t=e.getUTCDay();return t===0?7:t}function oI(e,t){return Ae(Ou.count(Zi(e)-1,e),t,2)}function KC(e){var t=e.getUTCDay();return t>=4||t===0?Ka(e):Ka.ceil(e)}function aI(e,t){return e=KC(e),Ae(Ka.count(Zi(e),e)+(Zi(e).getUTCDay()===4),t,2)}function uI(e){return e.getUTCDay()}function lI(e,t){return Ae(Hd.count(Zi(e)-1,e),t,2)}function cI(e,t){return Ae(e.getUTCFullYear()%100,t,2)}function fI(e,t){return e=KC(e),Ae(e.getUTCFullYear()%100,t,2)}function dI(e,t){return Ae(e.getUTCFullYear()%1e4,t,4)}function hI(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ka(e):Ka.ceil(e),Ae(e.getUTCFullYear()%1e4,t,4)}function pI(){return"+0000"}function qE(){return"%"}function WE(e){return+e}function HE(e){return Math.floor(+e/1e3)}var ma,xb,JC,wb,QC;gI({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 gI(e){return ma=GC(e),xb=ma.format,JC=ma.parse,wb=ma.utcFormat,QC=ma.utcParse,ma}function Tl(e){const t={};return n=>t[n]||(t[n]=e(n))}function mI(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=yI(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function yI(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function ZC(e){const t=Tl(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=j0(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return mI(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=j0(o??",f");const a=Oo(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=EL(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=wL(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=xL(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let i1;eF();function eF(){return i1=ZC({format:Ik,formatPrefix:SL})}function tF(e){return ZC(vL(e))}function Gd(e){return arguments.length?i1=tF(e):i1}function GE(e,t,n){n=n||{},X(n)||N(`Invalid time multi-format specifier: ${n}`);const i=t(Kn),r=t(Ln),s=t(Nn),o=t(yn),a=t(st),u=t(Ut),l=t(mn),c=t(At),f=e(n[bi]||".%L"),d=e(n[Kn]||":%S"),h=e(n[Ln]||"%I:%M"),p=e(n[Nn]||"%I %p"),g=e(n[yn]||n[Lt]||"%a %d"),m=e(n[st]||"%b %d"),y=e(n[Ut]||"%B"),b=e(n[mn]||"%B"),v=e(n[At]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:s(x)<x?h:o(x)<x?p:u(x)<x?a(x)<x?g:m:c(x)<x?l(x)<x?y:b:v)(x)}function nF(e){const t=Tl(e.format),n=Tl(e.utcFormat);return{timeFormat:i=>K(i)?t(i):GE(t,Ru,i),utcFormat:i=>K(i)?n(i):GE(n,Nu,i),timeParse:Tl(e.parse),utcParse:Tl(e.utcParse)}}let r1;iF();function iF(){return r1=nF({format:xb,parse:JC,utcFormat:wb,utcParse:QC})}function rF(e){return nF(GC(e))}function cc(e){return arguments.length?r1=rF(e):r1}const s1=(e,t)=>ce({},e,t);function sF(e,t){const n=e?tF(e):Gd(),i=t?rF(t):cc();return s1(n,i)}function Eb(e,t){const n=arguments.length;return n&&n!==2&&N("defaultLocale expects either zero or two arguments."),n?s1(Gd(e),cc(t)):s1(Gd(),cc())}function bI(){return eF(),iF(),Eb()}const vI=/^(data:|([A-Za-z]+:)?\/\/)/,xI=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,wI=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,VE="file://";function EI(e,t){return n=>({options:n||{},sanitize:_I,load:SI,fileAccess:!!t,file:$I(t),http:kI(e)})}async function SI(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function _I(e,t){t=ce({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=xI.test(e.replace(wI,""));(e==null||typeof e!="string"||!a)&&N("Sanitize failure, invalid URI: "+H(e));const u=vI.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(VE))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(VE.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function $I(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):AI}async function AI(){N("No file system access.")}function kI(e){return e?async function(t,n){const i=ce({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?fe(s[r])?s[r]():s.text():N(s.status+""+s.statusText)}:CI}async function CI(){N("No HTTP fetch method available.")}const FI=e=>e!=null&&e===e,TI=e=>e==="true"||e==="false"||e===!0||e===!1,MI=e=>!Number.isNaN(Date.parse(e)),oF=e=>!Number.isNaN(+e)&&!(e instanceof Date),DI=e=>oF(e)&&Number.isInteger(+e),o1={boolean:hb,integer:zt,number:zt,date:pb,string:gb,unknown:Wt},Cf=[TI,DI,oF,MI],OI=["boolean","integer","number","date"];function aF(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Cf.length,r=Cf.map((s,o)=>o+1);for(let s=0,o=0,a,u;s<n;++s)for(u=t?e[s][t]:e[s],a=0;a<i;++a)if(r[a]&&FI(u)&&!Cf[a](u)&&(r[a]=0,++o,o===Cf.length))return"string";return OI[r.reduce((s,o)=>s===0?o:s,0)-1]}function uF(e,t){return t.reduce((n,i)=>(n[i]=aF(e,i),n),{})}function XE(e){const t=function(n,i){const r={delimiter:e};return Sb(n,i?ce(i,r):r)};return t.responseType="text",t}function Sb(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
|
17
|
-
`+e),kP(t.delimiter).parse(e+"")}Sb.responseType="text";function RI(e){return typeof Buffer=="function"&&fe(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function _b(e,t){const n=t&&t.property?Yn(t.property):Wt;return X(e)&&!RI(e)?NI(n(e),t):n(JSON.parse(e))}_b.responseType="json";function NI(e,t){return!L(e)&&aC(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const LI={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function lF(e,t){let n,i,r,s;return e=_b(e,t),t&&t.feature?(n=MP,r=t.feature):t&&t.mesh?(n=OP,r=t.mesh,s=LI[t.filter]):N("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):N("Invalid TopoJSON object: "+r),i&&i.features||[i]}lF.responseType="json";const dd={dsv:Sb,csv:XE(","),tsv:XE(" "),json:_b,topojson:lF};function $b(e,t){return arguments.length>1?(dd[e]=t,this):J(dd,e)?dd[e]:null}function cF(e){const t=$b(e);return t&&t.responseType||"text"}function fF(e,t,n,i){t=t||{};const r=$b(t.type||"json");return r||N("Unknown data format type: "+t.type),e=r(e,t),t.parse&&PI(e,t.parse,n,i),J(e,"columns")&&delete e.columns,e}function PI(e,t,n,i){if(!e.length)return;const r=cc();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=uF(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!o1[p])throw Error("Illegal format pattern: "+h+":"+p);return o1[p]});for(u=0,c=e.length,f=s.length;u<c;++u)for(o=e[u],l=0;l<f;++l)a=s[l],o[a]=d[l](o[a])}const $p=EI(typeof fetch<"u"&&fetch,null);function Ap(e){const t=e||Wt,n=[],i={};return n.add=r=>{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function hd(e,t){try{await t(e)}catch(n){e.error(n)}}const dF=Symbol("vega_id");let zI=1;function kp(e){return!!(e&&re(e))}function re(e){return e[dF]}function hF(e,t){return e[dF]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return re(t)?t:hF(t,zI++)}function Ab(e){return Cp(e,Ce({}))}function Cp(e,t){for(const n in e)t[n]=e[n];return t}function pF(e,t){return hF(t,re(e))}function ea(e,t){return e?t?(n,i)=>e(n,i)||re(t(n))-re(t(i)):(n,i)=>e(n,i)||re(n)-re(i):null}function gF(e){return e&&e.constructor===ta}function ta(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:ta,insert(a){const u=Y(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=fe(a)?i:t,l=Y(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Ht(l)};return fe(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return fe(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return s=a,this},reflow(){return o=!0,this},pulse(a,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[re(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[re(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],u.forEach(b=>{p(b)&&(l[re(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=re(g),l[m]?l[m]=1:a.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[re(g)]<0&&a.rem.push(g);function y(b,v,x){x?b[v]=x(b):a.encode=v,o||(c[re(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[re(g)],m>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,u.forEach(b=>{p(b)&&l[re(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[re(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const pd="_:mod:_";function Fp(){Object.defineProperty(this,pd,{writable:!0,value:{}})}Fp.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[pd];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=L(n)?1+n.length:-1),r},modified(e,t){const n=this[pd];if(arguments.length){if(L(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[pd]={},this}};let II=0;const BI="pulse",UI=new Fp,jI=1,qI=2;function ze(e,t,n,i){this.id=++II,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function YE(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}ze.prototype={targets(){return this._targets||(this._targets=Ap(Lc))},set(e){return this.value!==e?(this.value=e,1):0},skip:YE(jI),modified:YE(qI),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Fp,r=this._argops=this._argops||[],s=[];let o,a,u,l;const c=(f,d,h)=>{h instanceof ze?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===BI)Y(a).forEach(f=>{f instanceof ze?f!==this&&(f.targets().add(this),s.push(f)):N("Pulse parameters must be operator instances.")}),this.source=a;else if(L(a))for(i.set(o,-1,Array(u=a.length)),l=0;l<u;++l)c(o,l,a[l]);else c(o,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||UI,n=this._argops;let i,r,s,o;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],s=i.op,o=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,o);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function WI(e,t,n,i){let r=1,s;return e instanceof ze?s=e:e&&e.prototype instanceof ze?s=new e:fe(e)?s=new ze(null,e):(r=0,s=new ze(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function HI(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let GI=0;function Tp(e,t,n){this.id=++GI,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function is(e,t,n){return new Tp(e,t,n)}Tp.prototype={_filter:Rn,_apply:Wt,targets(){return this._targets||(this._targets=Ap(Lc))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=is(e);return this.targets().add(t),t},apply(e){const t=is(null,e);return this.targets().add(t),t},merge(){const e=is();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=is();return this.targets().add(is(null,null,fb(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(is(null,null,()=>n=!0)),t.targets().add(is(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Rn,this._targets=null}};function VI(e,t,n,i){const r=this,s=is(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=Y(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,o);return s}function XI(e,t){const n=this.locale();return fF(e,t,n.timeParse,n.utcParse)}function YI(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function KI(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:cF(t&&t.type)});try{r=n.parse(r,t)}catch(s){i=-2,n.warn("Data ingestion failed",e,s)}}catch(s){i=-1,n.warn("Loading failed",e,s)}return{data:r,status:i}}async function JI(e,t,n){const i=this,r=i._pending||QI(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(Rn).insert(s.data||[])),r.done(),s}function QI(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const ZI={skip:!0};function e4(e,t,n,i,r){return(e instanceof ze?n4:t4)(this,e,t,n,i,r),this}function t4(e,t,n,i,r,s){const o=ce({},s,ZI);let a,u;fe(n)||(n=Ht(n)),i===void 0?a=l=>e.touch(n(l)):fe(i)?(u=new ze(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;gF(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function n4(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new ze(null,i4(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function i4(e,t){return t=fe(t)?t:Ht(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function r4(e){e.rank=++this._rank}function s4(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&N("Cycle detected in dataflow graph.")}const Vd={},Ii=1,os=2,Er=4,o4=Ii|os,KE=Ii|Er,ya=Ii|os|Er,JE=8,sl=16,QE=32,ZE=64;function Ss(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Cm(e,t){const n=[];return ss(e,t,i=>n.push(i)),n}function eS(e,t){const n={};return e.visit(t,i=>{n[re(i)]=1}),i=>n[re(i)]?null:i}function Ff(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ss.prototype={StopPropagation:Vd,ADD:Ii,REM:os,MOD:Er,ADD_REM:o4,ADD_MOD:KE,ALL:ya,REFLOW:JE,SOURCE:sl,NO_SOURCE:QE,NO_FIELDS:ZE,fork(e){return new Ss(this.dataflow).init(this,e)},clone(){const e=this.fork(ya);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(ya|sl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ss(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&ZE)&&(n.fields=e.fields),t&Ii?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&os?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Er?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&QE?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||ya;return t&Ii&&this.add.length||t&os&&this.rem.length||t&Er&&this.mod.length},reflow(e){if(e)return this.fork(ya).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Er,eS(this,Ii))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return L(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?L(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Ii&&(n.addF=Ff(n.addF,t)),e&os&&(n.remF=Ff(n.remF,t)),e&Er&&(n.modF=Ff(n.modF,t)),e&sl&&(n.srcF=Ff(n.srcF,t)),n},materialize(e){e=e||ya;const t=this;return e&Ii&&t.addF&&(t.add=Cm(t.add,t.addF),t.addF=null),e&os&&t.remF&&(t.rem=Cm(t.rem,t.remF),t.remF=null),e&Er&&t.modF&&(t.mod=Cm(t.mod,t.modF),t.modF=null),e&sl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&sl)return ss(n.source,n.srcF,i),n;e&Ii&&ss(n.add,n.addF,i),e&os&&ss(n.rem,n.remF,i),e&Er&&ss(n.mod,n.modF,i);const r=n.source;if(e&JE&&r){const s=n.add.length+n.mod.length;s===r.length||(s?ss(r,eS(n,KE),i):ss(r,n.srcF,i))}return n}};function kb(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}G(kb,Ss,{fork(e){const t=new Ss(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?L(e)?e.some(i=>n[i]):n[e]:0},filter(){N("MultiPulse does not support filtering.")},materialize(){N("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});async function a4(e,t,n){const i=this,r=[];if(i._pulse)return mF(i);if(i._pending&&await i._pending,t&&await hd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new Ss(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Ap(Lc);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Vd),u!==Vd&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await hd(i,c[f].callback)}return n&&await hd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function u4(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function l4(e,t,n){return this._pulse?mF(this):(this.evaluate(e,t,n),this)}function c4(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function mF(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function f4(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function d4(e,t){const n=e.source,i=this._clock;return n&&L(n)?new kb(this,i,n.map(r=>r.pulse),t):this._input[e.id]||h4(this._pulse,n&&n.pulse)}function h4(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Vd&&(e.source=t.source),e)}const Cb={skip:!1,force:!1};function p4(e,t){const n=t||Cb;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function g4(e,t,n){const i=n||Cb;return(e.set(t)||i.force)&&this.touch(e,i),this}function m4(e,t,n){this.touch(e,n||Cb);const i=new Ss(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function y4(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),yF(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,b4(t,0,e)):i=n,i}}}function yF(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function b4(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o<r;)a=o+1,a<r&&n(e[o],e[a])>=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,yF(e,i,t,n)}function za(){this.logger(ob()),this.logLevel(rb),this._clock=0,this._rank=0,this._locale=Eb();try{this._loader=$p()}catch{}this._touched=Ap(Lc),this._input={},this._pulse=null,this._heap=y4((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ol(e){return function(){return this._log[e].apply(this,arguments)}}za.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:ol("error"),warn:ol("warn"),info:ol("info"),debug:ol("debug"),logLevel:ol("level"),cleanThreshold:1e4,add:WI,connect:HI,rank:r4,rerank:s4,pulse:m4,touch:p4,update:g4,changeset:ta,ingest:YI,parse:XI,preload:JI,request:KI,events:VI,on:e4,evaluate:a4,run:l4,runAsync:u4,runAfter:c4,_enqueue:f4,_getPulse:d4};function D(e,t){ze.call(this,e,null,t)}G(D,ze,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Qa={};function bF(e){const t=vF(e);return t&&t.Definition||null}function vF(e){return e=e&&e.toLowerCase(),J(Qa,e)?Qa[e]:null}function*xF(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Fb(e,t,n){const i=Float64Array.from(xF(e,n));return i.sort(oc),t.map(r=>wC(i,r))}function Tb(e,t){return Fb(e,[.25,.5,.75],t)}function Mb(e,t){const n=e.length,i=PP(e,t),r=Tb(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function wF(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=s<c?c-a:c,o=Math.ceil(o/a)*a),{start:s,stop:o===s?s+a:o,step:a}}var Jn=Math.random;function v4(e){Jn=e}function EF(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(xF(e,i)),s=r.length,o=t;let a,u,l,c;for(l=0,c=Array(o);l<o;++l){for(a=0,u=0;u<s;++u)a+=r[~~(Jn()*s)];c[l]=a/s}return c.sort(oc),[J0(c,n/2),J0(c,1-n/2)]}function SF(e,t,n,i){i=i||(d=>d);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;o<a;++o)s[o]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;o<a;++o)s[o]=l;return n?x4(s,t+t/4):s}function x4(e,t){const n=e.length;let i=0,r=1,s,o;for(;e[i]===e[r];)++r;for(;r<n;){for(s=r+1;e[r]===e[s];)++s;if(e[r]-e[r-1]<t){for(o=r+(i+s-r-r>>1);o<r;)e[o++]=e[r];for(;o>r;)e[o--]=e[i]}i=r,r=s}return e}function w4(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function E4(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Jn())},pdf(o){return o===Math.floor(o)&&o>=n&&o<i?1/r:0},cdf(o){const a=Math.floor(o);return a<n?0:a>=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const _F=Math.sqrt(2*Math.PI),S4=Math.SQRT2;let al=NaN;function Mp(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(al===al)n=al,al=NaN;else{do n=Jn()*2-1,i=Jn()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,al=i*s}return e+n*t}function Db(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*_F)}function Dp(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function Op(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*S4*_4(2*e-1)}function _4(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}function Ob(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Mp(n,i),pdf:s=>Db(s,n,i),cdf:s=>Dp(s,n,i),icdf:s=>Op(s,n,i)};return r.mean(e).stdev(t)}function Rb(e,t){const n=Ob();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=Mb(e)),r):t},sample(){return e[~~(Jn()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;a<i;++a)o+=n.pdf((s-e[a])/t);return o/t/i},cdf(s){let o=0,a=0;for(;a<i;++a)o+=n.cdf((s-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Nb(e,t){return e=e||0,t=t??1,Math.exp(e+Mp()*t)}function Lb(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*_F*e)}function Pb(e,t,n){return Dp(Math.log(e),t,n)}function zb(e,t,n){return Math.exp(Op(e,t,n))}function $F(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Nb(n,i),pdf:s=>Lb(s,n,i),cdf:s=>Pb(s,n,i),icdf:s=>zb(s,n,i)};return r.mean(e).stdev(t)}function AF(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=o[l]==null?1:+o[l];for(l=0;l<n;++l)a[l]/=u;return a}const s={weights(o){return arguments.length?(i=r(t=o||[]),s):t},distributions(o){return arguments.length?(o?(n=o.length,e=o):(n=0,e=[]),s.weights(t)):e},sample(){const o=Jn();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(o<u){a=e[l];break}return a.sample()},pdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(o);return a},cdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(o);return a},icdf(){throw Error("Mixture icdf not supported.")}};return s.distributions(e).weights(t)}function Ib(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Jn()}function Bb(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Ub(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function jb(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function kF(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Ib(n,i),pdf:s=>Bb(s,n,i),cdf:s=>Ub(s,n,i),icdf:s=>jb(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function qb(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function zc(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Rp(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)s[a]-=u,o[a]-=l;return[s,o,u,l]}function Ic(e,t,n,i){let r=-1,s,o;for(const a of e)s=t(a),o=n(a),s!=null&&(s=+s)>=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function Lu(e,t,n,i,r){let s=0,o=0;return Ic(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function Wb(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ic(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=zc(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function CF(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ic(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=zc(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function FF(e,t,n){const[i,r,s,o]=Rp(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;Ic(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=zc(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:Lu(e,t,n,o,y)}}function TF(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;Ic(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,s+=(h*p-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=zc(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Lu(e,t,n,a,c)}}function Hb(e,t,n){const[i,r,s,o]=Rp(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h<a;)p=i[h],g=r[h++],m=p*p,u+=(m-u)/h,l+=(m*p-l)/h,c+=(m*m-c)/h,f+=(p*g-f)/h,d+=(m*g-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,E=-v*u,S=w=>(w=w-s,v*w*w+x*w+E+o);return{coef:[E-x*s+v*s*s+o,x-2*v*s,v],predict:S,rSquared:Lu(e,t,n,o,S)}}function MF(e,t,n,i){if(i===0)return qb(e,t,n);if(i===1)return Wb(e,t,n);if(i===2)return Hb(e,t,n);const[r,s,o,a]=Rp(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d)*s[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d+h);m[h]=g}c.push(m)}c.push(l);const y=A4(c),b=v=>{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:$4(f,y,-o,a),predict:b,rSquared:Lu(e,t,n,a,b)}}function $4(e,t,n,i){const r=Array(e);let s,o,a,u;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function A4(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;i<t;++i){for(o=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][o])&&(o=r);for(s=i;s<t+1;++s)a=e[s][i],e[s][i]=e[s][o],e[s][o]=a;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;s<t;++s)a+=e[s][r]*n[s];n[r]=(e[t][r]-a)/e[r][r]}return n}const tS=2,nS=1e-12;function DF(e,t,n,i){const[r,s,o,a]=Rp(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=tS;){const p=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=p[0],v=p[1],x=y-r[b]>r[v]-y?b:v;let E=0,S=0,w=0,_=0,$=0;const C=1/Math.abs(r[x]-y||1);for(let k=b;k<=v;++k){const F=r[k],A=s[k],M=k4(Math.abs(y-F)*C)*d[k],P=F*M;E+=M,S+=P,w+=A*M,_+=A*P,$+=F*P}const[T,O]=zc(S/E,w/E,_/E,$/E);c[m]=T+O*y,f[m]=Math.abs(s[m]-c[m]),C4(r,m+1,p)}if(h===tS)break;const g=EC(f);if(Math.abs(g)<nS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?nS:(b=1-y*y)*b}return F4(r,c,o,a)}function k4(e){return(e=1-e*e*e)*e*e}function C4(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function F4(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o<r;++o)l=e[o]+n,u[0]===l?u[1]+=(t[o]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[o]],s.push(u));return u[1]+=i,s}const T4=.5*Math.PI/180;function Np(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(s+g/n*a));return l.push(r(o)),l}else{c.push(r(o));for(let g=n;--g>0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=M4(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&D4(f,g,d,h,p)>T4?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function M4(e,t){let n=e,i=e;const r=t.length;for(let s=0;s<r;++s){const o=t[s][1];o<n&&(n=o),o>i&&(i=o)}return 1/(i-n)}function D4(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function O4(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function a1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:O4(e)}function OF(e,t,n){return n||e+(t?"_"+t:"")}const Fm=()=>{},R4={init:Fm,add:Fm,rem:Fm,idx:0},fc={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Bc=Object.keys(fc).filter(e=>e!=="__count__");function N4(e,t){return(n,i)=>ce({name:e,aggregate_param:i,out:n||e},R4,t)}[...Bc,"__count__"].forEach(e=>{fc[e]=N4(e,fc[e])});function RF(e,t,n){return fc[e](n,t)}function NF(e,t){return e.idx-t.idx}function L4(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=fc[r]())})};return e.forEach(n),Object.values(t).sort(NF)}function P4(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function z4(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function I4(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function B4(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function LF(e,t){const n=t||Wt,i=L4(e),r=e.slice().sort(NF);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=P4,s.prototype.add=z4,s.prototype.rem=I4,s.prototype.set=B4,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function Gb(e){this._key=e?Yn(e):re,this.reset()}const Ft=Gb.prototype;Ft.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Ft.add=function(e){this._add.push(e)};Ft.rem=function(e){this._rem.push(e)};Ft.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a<r;++a)o[n(t[a])]=1;for(a=0,u=0;a<i;++a)o[n(l=e[a])]?o[n(l)]=0:s[u++]=l;return this._rem=[],this._add=s};Ft.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",J(n,s)||(n[s]=1,++r);return r};Ft.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=sC(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Ft.argmin=function(e){return this.extent(e)[0]||{}};Ft.argmax=function(e){return this.extent(e)[1]||{}};Ft.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Ft.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Ft.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=Tb(this.values(),e),this._get=e),this._q};Ft.q1=function(e){return this.quartile(e)[0]};Ft.q2=function(e){return this.quartile(e)[1]};Ft.q3=function(e){return this.quartile(e)[2]};Ft.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=EF(this.values(),1e3,.05,e),this._get=e),this._ci};Ft.ci0=function(e){return this.ci(e)[0]};Ft.ci1=function(e){return this.ci(e)[1]};function ks(e){D.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ks.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Bc},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};G(ks,D,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}s(e._prev),s(t);function o(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?o(h,u,l):t[h]||e.cell(h,u)}}o("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=Y(Bt(b)),x=v.length;let E=0,S;for(;E<x;++E)i[S=v[E]]||(i[S]=1,t.push(S))}this._dims=Y(e.groupby),this._dnames=this._dims.map(b=>{const v=Je(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:a1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,h,p,g,m,y;for(l!==o.length&&N("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=s[y],d=o[y],h=a[y]||null,f==null&&d!=="count"&&N("Null aggregate field specified."),g=Je(f),m=OF(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(RF(d,h,m))}return this._measures=this._measures.map(b=>LF(b,b.field)),Object.create(null)},cellkey:a1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let s=0;s<r;++s)n.agg[s]=new i[s](n)}return n.store&&(n.data=new Gb),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let o=0;o<r;++o)s[n[o]]=i[o](e);return t?pF(t.tuple,s):Ce(s)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,s=i.length;r<s;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,o=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&o.push(u.tuple);for(c=0,f=this._alen;c<f;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?o:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const U4=1e-14;function Vb(e){D.call(this,null,e)}Vb.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};G(Vb,D,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,s=i.step,o=e.as||["bin0","bin1"],a=o[0],u=o[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Bt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=wF(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=zt(t(l));return c==null?null:c<r?-1/0:c>s?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(U4+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=En(u,Bt(t),e.name||"bin_"+Je(t))}});function PF(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?fC(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Xb(e){D.call(this,[],e)}Xb.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(Xb,D,{transform(e,t){const n=t.fork(t.ALL),i=PF(re,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(ea(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function zF(e){ze.call(this,null,j4,e)}G(zF,ze);function j4(e){return this.value&&!e.modified()?this.value:cb(e.fields,e.orders)}function Yb(e){D.call(this,null,e)}Yb.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function q4(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(Yb,D,{transform(e,t){const n=f=>d=>{for(var h=q4(a(d),e.case,s)||[],p,g=0,m=h.length;g<m;++g)o.test(p=h[g])||f(p)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,o=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Ce({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function Kb(e){D.call(this,null,e)}Kb.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(Kb,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=W4(a,r,s,e.filter||Rn)):n.mod=a,n.source=this.value,n.modifies(i)}});function W4(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;a<o;++a)for(s[t]=l=e[a],u=0;u<o;++u)s[n]=e[u],i(s)&&(r.push(Ce(s)),s={},s[t]=l);return r}const iS={kde:Rb,mixture:AF,normal:Ob,lognormal:$F,uniform:kF},H4="distributions",rS="function",G4="field";function IF(e,t){const n=e[rS];J(iS,n)||N("Unknown distribution function: "+n);const i=iS[n]();for(const r in e)r===G4?i.data((e.from||t()).map(e[r])):r===H4?i[r](e[r].map(s=>IF(s,t))):typeof i[r]===rS&&i[r](e[r]);return i}function Jb(e){D.call(this,null,e)}const BF=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],V4={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:BF},{name:"weights",type:"number",array:!0}]};Jb.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:BF.concat(V4)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(Jb,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=IF(e.distribution,X4(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&N("Invalid density method: "+o),!e.extent&&!i.data&&N("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||Ji(i.data()),l=Np(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function X4(e){return()=>e.materialize(e.SOURCE).source}function UF(e,t){return e?e.map((n,i)=>t[i]||Je(n)):null}function Qb(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;o<a;++o)u=e[o],l=t.map(r),c=s[l],c||(s[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const jF="bin";function Zb(e){D.call(this,null,e)}Zb.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:jF}]};const Y4=(e,t)=>Pc(Ji(e,t))/30;G(Zb,D,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Qb(t.source,e.groupby,Wt),r=e.smooth||!1,s=e.field,o=e.step||Y4(n,s),a=ea((p,g)=>s(p)-s(g)),u=e.as||jF,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const p=i[d].sort(a);h=-1;for(const g of SF(p,o,r,s))g<c&&(c=g),g>f&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function qF(e){ze.call(this,null,K4,e),this.modified(!0)}G(qF,ze);function K4(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:En(n=>t(n,e),Bt(t),Je(t))}function ev(e){D.call(this,[void 0,void 0],e)}ev.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(ev,D,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=zt(i(a));u!=null&&(u<s&&(s=u),u>o&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Je(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function tv(e,t){ze.call(this,e),this.parent=t,this.count=0}G(tv,ze,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function Lp(e){D.call(this,{},e),this._keys=Mu();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(Lp,D,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=J(r,e)&&r[e],o,a;return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new tv(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,s=this._keys,o=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=re(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(re(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=re(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(re(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=re(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function WF(e){ze.call(this,null,J4,e)}G(WF,ze);function J4(e){return this.value&&!e.modified()?this.value:L(e.name)?Y(e.name).map(t=>Yn(t)):Yn(e.name,e.as)}function nv(e){D.call(this,Mu(),e)}nv.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G(nv,D,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=re(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(re(f),1)});function c(f){const d=re(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function iv(e){D.call(this,[],e)}iv.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};G(iv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=UF(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=Ab(a),f=0;f<o;++f)d[r[f]]=(h=u[f][c])==null?null:h;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function rv(e){D.call(this,[],e)}rv.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};G(rv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Je),s=e.as||["key","value"],o=s[0],a=s[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Ab(l),f[o]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function sv(e){D.call(this,null,e)}sv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(sv,D,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(s,o=>o[i]=n(o,e))}});function HF(e){D.call(this,[],e)}G(HF,D,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=Ce(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const Tf={value:"value",median:EC,mean:BP,min:K0,max:$o},Q4=[];function ov(e){D.call(this,[],e)}ov.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function Z4(e){var t=e.method||Tf.value,n;if(Tf[t]==null)N("Unrecognized imputation method: "+t);else return t===Tf.value?(n=e.value!==void 0?e.value:0,()=>n):Tf[t]}function e9(e){const t=e.field;return n=>n?t(n):NaN}G(ov,D,{transform(e,t){var n=t.fork(t.ALL),i=Z4(e),r=e9(e),s=Je(e.field),o=Je(e.key),a=(e.groupby||[]).map(Je),u=t9(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],E={_impute:!0},y=0,x=p.length;y<x;++y)E[a[y]]=p[y];E[o]=g,E[s]=Number.isNaN(h)?h=i(d,r):h,l.push(Ce(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function t9(e,t,n,i){var r=y=>y(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],p=n(m),h=a[p]||(a[p]=o.push(p)),c=(l=t?t.map(r):Q4)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[h-1]=m;return s.domain=o,s}function av(e){ks.call(this,e)}av.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Bc},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(av,ks,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,s=>n.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{ce(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function uv(e){D.call(this,null,e)}uv.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(uv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Qb(i,e.groupby,e.field),s=(e.groupby||[]).map(Je),o=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&N("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Ji(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const p=Rb(h,o)[a],g=e.counts?h.length:1,m=c||Ji(h);Np(p,m,f,d).forEach(y=>{const b={};for(let v=0;v<s.length;++v)b[s[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function GF(e){ze.call(this,null,n9,e)}G(GF,ze);function n9(e){return this.value&&!e.modified()?this.value:db(e.fields,e.flat)}function VF(e){D.call(this,[],e),this._pending=null}G(VF,D,{transform(e,t){const n=t.dataflow;return this._pending?Tm(this,t,this._pending):i9(e)?t.StopPropagation:e.values?Tm(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=Y(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Tm(this,t,Y(i.data)))}});function i9(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Tm(e,t,n){n.forEach(Ce);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function lv(e){D.call(this,{},e)}lv.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};G(lv,D,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&N('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&N('The "as" parameter has too few output field names.'),c=c||r.map(Je),f=function(p){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](p)),b==null)for(y=0;y<d;++y,++m)p[c[m]]=s;else for(y=0;y<d;++y,++m)p[c[m]]=r[y](b)}):(c||N("Missing output field names."),f=function(p){for(var g=0,m;g<a;++g)m=i.get(n[g](p)),p[c[g]]=m??s}),o?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function XF(e){ze.call(this,null,r9,e)}G(XF,ze);function r9(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;s<n;++s)o=t[s],o[0]<i&&(i=o[0]),o[1]>r&&(r=o[1]);return[i,r]}function YF(e){ze.call(this,null,s9,e)}G(YF,ze);function s9(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function KF(e){D.call(this,null,e)}G(KF,D,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function cv(e){ks.call(this,e)}cv.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Bc,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(cv,ks,{_transform:ks.prototype.transform,transform(e,t){return this._transform(o9(e,t),t)}});function o9(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=Bt(n).concat(Bt(i)),o=u9(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>a9(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function a9(e,t,n,i){return En(r=>t(r)===e?n(r):NaN,i,e+"")}function u9(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(vp),t?r.slice(0,t):r}function JF(e){Lp.call(this,e)}G(JF,Lp,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(re(s),n,t,s);return(e.modified("field")||i&&t.modified(Bt(i)))&&N("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(Ce(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function fv(e){D.call(this,null,e)}fv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(fv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=UF(e.fields,e.as||[]),s=i?(a,u)=>l9(a,u,i,r):Cp;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=re(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,Ce({}));o[re(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[re(a)]))}),n}});function l9(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function QF(e){D.call(this,null,e)}G(QF,D,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function dv(e){D.call(this,null,e)}dv.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const c9=1e-14;G(dv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,s=Qb(r,e.groupby,e.field),o=(e.groupby||[]).map(Je),a=[],u=e.step||.01,l=e.probs||Fn(u/2,1-c9,u),c=l.length;return s.forEach(f=>{const d=Fb(f,l);for(let h=0;h<c;++h){const p={};for(let g=0;g<o.length;++g)p[o[g]]=f.dims[g];p[i[0]]=l[h],p[i[1]]=d[h],a.push(Ce(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function ZF(e){D.call(this,null,e)}G(ZF,D,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const s=re(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=Ab(r);i[re(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[re(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function hv(e){D.call(this,[],e),this.count=0}hv.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(hv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[re(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length<r?o.push(c):(d=~~((a+1)*Jn()),d<o.length&&d>=u&&(f=o[d],s[re(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=re(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[re(c)]!==-1)),(t.rem.length||i)&&o.length<r&&t.source&&(u=a=o.length,t.visit(t.SOURCE,c=>{s[re(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f<c;++f)s[re(o[f])]=-1,n.rem.push(o[f]);o=o.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[re(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[re(c)])),this.count=a,this.value=n.source=o,n}});function pv(e){D.call(this,null,e)}pv.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};G(pv,D,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Fn(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,Ce(s)}),n.add=t.add.concat(this.value),n}});function eT(e){D.call(this,null,e),this.modified(!0)}G(eT,D,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function gv(e){D.call(this,null,e)}const tT=["unit0","unit1"];gv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:yb,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:tT}]};G(gv,D,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?Nu:Ru)(s.unit).offset,a=e.as||tT,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Bt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=s(g),i&&(p[l]=y=o(m,c)),m<f&&(f=m),y>d&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:HC({extent:e.extent||Ji(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=bb(i),o=this.value||{},a=(n?LC:NC)(s,r);return a.unit=xe(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function nT(e){D.call(this,Mu(),e)}G(nT,D,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function iT(e){D.call(this,null,e)}G(iT,D,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ea(e.sort)):t.source).map(e.field))}});function f9(e,t,n,i){const r=dc[e](t,n);return{init:r.init||cs,update:function(s,o){o[i]=r.next(s)}}}const dc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=dc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||N("ntile num must be greater than zero.");const n=dc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||N("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=d9(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function d9(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const h9=Object.keys(dc);function rT(e){const t=Y(e.ops),n=Y(e.fields),i=Y(e.params),r=Y(e.aggregate_params),s=Y(e.as),o=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(p){Y(Bt(p)).forEach(g=>u[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Je(m),x=OF(p,v,s[g]);if(h(m),o.push(x),J(dc,p))a.push(f9(p,m,y,x));else{if(m==null&&p!=="count"&&N("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(RF(p,b,x))}}),(c.length||f.length)&&(this.cell=p9(f,c,d)),this.inputs=Object.keys(u)}const sT=rT.prototype;sT.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};sT.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o<e.i0;++o)n.rem(r[o]);for(o=e.p1;o<e.i1;++o)n.add(r[o]);n.set(t)}for(o=0;o<s;++o)i[o].update(e,t)};function p9(e,t,n){e=e.map(u=>LF(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;o<r;++o)s[o]=new e[o](i);if(i.store)var a=i.data=new Gb;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)s[l].add(s[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)s[l].rem(s[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=s.length;l<c;++l)s[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)s[u].init()},i}function mv(e){D.call(this,{},e),this._mlen=0,this._mods=[]}mv.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:h9.concat(Bc)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};G(mv,D,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ea(e.sort),r=a1(e.groupby),s=a=>this.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new rT(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)g9(this._mods[a],o,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(o.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=PF(re),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function g9(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,o=i.frame||[null,0],a=e.data(n),u=a.length,l=s?fp(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Ht(-1)};t.init();for(let f=0;f<u;++f)m9(c,o,f,u),s&&y9(c,l),t.update(c,a[f])}function m9(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function y9(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,o=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<o&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}const b9=Object.freeze(Object.defineProperty({__proto__:null,aggregate:ks,bin:Vb,collect:Xb,compare:zF,countpattern:Yb,cross:Kb,density:Jb,dotbin:Zb,expression:qF,extent:ev,facet:Lp,field:WF,filter:nv,flatten:iv,fold:rv,formula:sv,generate:HF,impute:ov,joinaggregate:av,kde:uv,key:GF,load:VF,lookup:lv,multiextent:XF,multivalues:YF,params:KF,pivot:cv,prefacet:JF,project:fv,proxy:QF,quantile:dv,relay:ZF,sample:hv,sequence:pv,sieve:eT,subflow:tv,timeunit:gv,tupleindex:nT,values:iT,window:mv},Symbol.toStringTag,{value:"Module"}));function Fe(e){return function(){return e}}const sS=Math.abs,Mt=Math.atan2,to=Math.cos,v9=Math.max,Mm=Math.min,Ri=Math.sin,wo=Math.sqrt,Ot=1e-12,Za=Math.PI,Xd=Za/2,oT=2*Za;function x9(e){return e>1?0:e<-1?Za:Math.acos(e)}function oS(e){return e>=1?Xd:e<=-1?-Xd:Math.asin(e)}const u1=Math.PI,l1=2*u1,po=1e-6,w9=l1-po;function aT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function E9(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return aT;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let yv=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?aT:E9(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,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,o){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,u=i-t,l=r-n,c=o-t,f=a-n,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>po)if(!(Math.abs(f*u-l*c)>po)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((u1-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,E=v/y;Math.abs(x-1)>po&&this._append`L${t+x*c},${n+x*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+E*u},${this._y1=n+E*l}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>po||Math.abs(this._y1-c)>po)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%l1+l1),d>w9?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>po&&this._append`A${i},${i},0,${+(d>=u1)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function Pp(){return new yv}Pp.prototype=yv.prototype;function zp(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new yv(t)}function S9(e){return e.innerRadius}function _9(e){return e.outerRadius}function $9(e){return e.startAngle}function A9(e){return e.endAngle}function k9(e){return e&&e.padAngle}function C9(e,t,n,i,r,s,o,a){var u=n-e,l=i-t,c=o-r,f=a-s,d=f*u-c*l;if(!(d*d<Ot))return d=(c*(t-s)-f*(e-r))/d,[e+d*u,t+d*l]}function Mf(e,t,n,i,r,s,o){var a=e-n,u=t-i,l=(o?s:-s)/wo(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,p=n+c,g=i+f,m=(d+p)/2,y=(h+g)/2,b=p-d,v=g-h,x=b*b+v*v,E=r-s,S=d*g-p*h,w=(v<0?-1:1)*wo(v9(0,E*E*x-S*S)),_=(S*v-b*w)/x,$=(-S*b-v*w)/x,C=(S*v+b*w)/x,T=(-S*b+v*w)/x,O=_-m,k=$-y,F=C-m,A=T-y;return O*O+k*k>F*F+A*A&&(_=C,$=T),{cx:_,cy:$,x01:-c,y01:-f,x11:_*(r/E-1),y11:$*(r/E-1)}}function F9(){var e=S9,t=_9,n=Fe(0),i=null,r=$9,s=A9,o=k9,a=null,u=zp(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-Xd,g=s.apply(this,arguments)-Xd,m=sS(g-p),y=g>p;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Ot))a.moveTo(0,0);else if(m>oT-Ot)a.moveTo(h*to(p),h*Ri(p)),a.arc(0,0,h,p,g,!y),d>Ot&&(a.moveTo(d*to(g),d*Ri(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,E=g,S=m,w=m,_=o.apply(this,arguments)/2,$=_>Ot&&(i?+i.apply(this,arguments):wo(d*d+h*h)),C=Mm(sS(h-d)/2,+n.apply(this,arguments)),T=C,O=C,k,F;if($>Ot){var A=oS($/d*Ri(_)),M=oS($/h*Ri(_));(S-=A*2)>Ot?(A*=y?1:-1,x+=A,E-=A):(S=0,x=E=(p+g)/2),(w-=M*2)>Ot?(M*=y?1:-1,b+=M,v-=M):(w=0,b=v=(p+g)/2)}var P=h*to(b),z=h*Ri(b),U=d*to(E),te=d*Ri(E);if(C>Ot){var ne=h*to(v),de=h*Ri(v),Se=d*to(x),we=d*Ri(x),Pe;if(m<Za)if(Pe=C9(P,z,Se,we,ne,de,U,te)){var Di=P-Pe[0],Zs=z-Pe[1],es=ne-Pe[0],Q=de-Pe[1],he=1/Ri(x9((Di*es+Zs*Q)/(wo(Di*Di+Zs*Zs)*wo(es*es+Q*Q)))/2),ge=wo(Pe[0]*Pe[0]+Pe[1]*Pe[1]);T=Mm(C,(d-ge)/(he-1)),O=Mm(C,(h-ge)/(he+1))}else T=O=0}w>Ot?O>Ot?(k=Mf(Se,we,P,z,h,O,y),F=Mf(ne,de,U,te,h,O,y),a.moveTo(k.cx+k.x01,k.cy+k.y01),O<C?a.arc(k.cx,k.cy,O,Mt(k.y01,k.x01),Mt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,O,Mt(k.y01,k.x01),Mt(k.y11,k.x11),!y),a.arc(0,0,h,Mt(k.cy+k.y11,k.cx+k.x11),Mt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,O,Mt(F.y11,F.x11),Mt(F.y01,F.x01),!y))):(a.moveTo(P,z),a.arc(0,0,h,b,v,!y)):a.moveTo(P,z),!(d>Ot)||!(S>Ot)?a.lineTo(U,te):T>Ot?(k=Mf(U,te,ne,de,d,-T,y),F=Mf(P,z,Se,we,d,-T,y),a.lineTo(k.cx+k.x01,k.cy+k.y01),T<C?a.arc(k.cx,k.cy,T,Mt(k.y01,k.x01),Mt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,T,Mt(k.y01,k.x01),Mt(k.y11,k.x11),!y),a.arc(0,0,d,Mt(k.cy+k.y11,k.cx+k.x11),Mt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,T,Mt(F.y11,F.x11),Mt(F.y01,F.x01),!y))):a.arc(0,0,d,E,x,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Za/2;return[to(f)*c,Ri(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Fe(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Fe(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Fe(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Fe(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Fe(+c),l):r},l.endAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Fe(+c),l):s},l.padAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Fe(+c),l):o},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function uT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lT(e){this._context=e}lT.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 bv(e){return new lT(e)}function cT(e){return e[0]}function fT(e){return e[1]}function dT(e,t){var n=Fe(!0),i=null,r=bv,s=null,o=zp(a);e=typeof e=="function"?e:e===void 0?cT:Fe(e),t=typeof t=="function"?t:t===void 0?fT:Fe(t);function a(u){var l,c=(u=uT(u)).length,f,d=!1,h;for(i==null&&(s=r(h=o())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(f,l,u),+t(f,l,u));if(h)return s=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Fe(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Fe(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Fe(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(s=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=s=null:s=r(i=u),a):i},a}function hT(e,t,n){var i=null,r=Fe(!0),s=null,o=bv,a=null,u=zp(l);e=typeof e=="function"?e:e===void 0?cT:Fe(+e),t=typeof t=="function"?t:Fe(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?fT:Fe(+n);function l(f){var d,h,p,g=(f=uT(f)).length,m,y=!1,b,v=new Array(g),x=new Array(g);for(s==null&&(a=o(b=u())),d=0;d<=g;++d){if(!(d<g&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return dT().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Fe(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Fe(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Fe(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const T9={draw(e,t){const n=wo(t/Za);e.moveTo(n,0),e.arc(0,0,n,0,oT)}};function M9(e,t){let n=null,i=zp(r);e=typeof e=="function"?e:Fe(e||T9),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:Fe(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:Fe(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function Cs(){}function Yd(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 Ip(e){this._context=e}Ip.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:Yd(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:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function D9(e){return new Ip(e)}function pT(e){this._context=e}pT.prototype={areaStart:Cs,areaEnd:Cs,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:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function O9(e){return new pT(e)}function gT(e){this._context=e}gT.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,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function R9(e){return new gT(e)}function mT(e,t){this._basis=new Ip(e),this._beta=t}mT.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 i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*s),this._beta*t[a]+(1-this._beta)*(r+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const N9=function e(t){function n(i){return t===1?new Ip(i):new mT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Kd(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 vv(e,t){this._context=e,this._k=(1-t)/6}vv.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:Kd(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:Kd(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}};const L9=function e(t){function n(i){return new vv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function xv(e,t){this._context=e,this._k=(1-t)/6}xv.prototype={areaStart:Cs,areaEnd:Cs,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:Kd(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}};const P9=function e(t){function n(i){return new xv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function wv(e,t){this._context=e,this._k=(1-t)/6}wv.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:Kd(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}};const z9=function e(t){function n(i){return new wv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Ev(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>Ot){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Ot){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function yT(e,t){this._context=e,this._alpha=t}yT.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ev(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}};const I9=function e(t){function n(i){return t?new yT(i,t):new vv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bT(e,t){this._context=e,this._alpha=t}bT.prototype={areaStart:Cs,areaEnd:Cs,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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ev(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}};const B9=function e(t){function n(i){return t?new bT(i,t):new xv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function vT(e,t){this._context=e,this._alpha=t}vT.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ev(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}};const U9=function e(t){function n(i){return t?new vT(i,t):new wv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function xT(e){this._context=e}xT.prototype={areaStart:Cs,areaEnd:Cs,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 j9(e){return new xT(e)}function aS(e){return e<0?-1:1}function uS(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(aS(s)+aS(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function lS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Dm(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function Jd(e){this._context=e}Jd.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:Dm(this,this._t0,lS(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,Dm(this,lS(this,n=uS(this,e,t)),n);break;default:Dm(this,this._t0,n=uS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function wT(e){this._context=new ET(e)}(wT.prototype=Object.create(Jd.prototype)).point=function(e,t){Jd.prototype.point.call(this,t,e)};function ET(e){this._context=e}ET.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,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function q9(e){return new Jd(e)}function W9(e){return new wT(e)}function ST(e){this._context=e}ST.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 i=cS(e),r=cS(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[o],t[o]);(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 cS(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),o=new Array(n);for(r[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,o[t]-=i*o[t-1];for(r[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function H9(e){return new ST(e)}function Bp(e,t){this._context=e,this._t=t}Bp.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 G9(e){return new Bp(e,.5)}function V9(e){return new Bp(e,0)}function X9(e){return new Bp(e,1)}function _s(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const Y9=()=>typeof Image<"u"?Image:null,c1=Symbol("implicit");function Sv(){var e=new DE,t=[],n=[],i=c1;function r(s){let o=e.get(s);if(o===void 0){if(i!==c1)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new DE;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return Sv(t,n).unknown(i)},Bs.apply(r,arguments),r}const _T=Math.PI/180,$T=180/Math.PI,Qd=18,AT=.96422,kT=1,CT=.82521,FT=4/29,Ia=6/29,TT=3*Ia*Ia,K9=Ia*Ia*Ia;function MT(e){if(e instanceof Vi)return new Vi(e.l,e.a,e.b,e.opacity);if(e instanceof Tr)return DT(e);e instanceof pp||(e=Bk(e));var t=Lm(e.r),n=Lm(e.g),i=Lm(e.b),r=Om((.2225045*t+.7168786*n+.0606169*i)/kT),s,o;return t===n&&n===i?s=o=r:(s=Om((.4360747*t+.3850649*n+.1430804*i)/AT),o=Om((.0139322*t+.0971045*n+.7141733*i)/CT)),new Vi(116*r-16,500*(s-r),200*(r-o),e.opacity)}function Zd(e,t,n,i){return arguments.length===1?MT(e):new Vi(e,t,n,i??1)}function Vi(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}Zy(Vi,Zd,eb(tb,{brighter(e){return new Vi(this.l+Qd*(e??1),this.a,this.b,this.opacity)},darker(e){return new Vi(this.l-Qd*(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=AT*Rm(t),e=kT*Rm(e),n=CT*Rm(n),new pp(Nm(3.1338561*t-1.6168667*e-.4906146*n),Nm(-.9787684*t+1.9161415*e+.033454*n),Nm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Om(e){return e>K9?Math.pow(e,1/3):e/TT+FT}function Rm(e){return e>Ia?e*e*e:TT*(e-FT)}function Nm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Lm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function J9(e){if(e instanceof Tr)return new Tr(e.h,e.c,e.l,e.opacity);if(e instanceof Vi||(e=MT(e)),e.a===0&&e.b===0)return new Tr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*$T;return new Tr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function eh(e,t,n,i){return arguments.length===1?J9(e):new Tr(e,t,n,i??1)}function Tr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function DT(e){if(isNaN(e.h))return new Vi(e.l,0,0,e.opacity);var t=e.h*_T;return new Vi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Zy(Tr,eh,eb(tb,{brighter(e){return new Tr(this.h,this.c,this.l+Qd*(e??1),this.opacity)},darker(e){return new Tr(this.h,this.c,this.l-Qd*(e??1),this.opacity)},rgb(){return DT(this).rgb()}}));var OT=-.14861,_v=1.78277,$v=-.29227,Up=-.90649,hc=1.97294,fS=hc*Up,dS=hc*_v,hS=_v*$v-Up*OT;function Q9(e){if(e instanceof Ao)return new Ao(e.h,e.s,e.l,e.opacity);e instanceof pp||(e=Bk(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(hS*i+fS*t-dS*n)/(hS+fS-dS),s=i-r,o=(hc*(n-r)-$v*s)/Up,a=Math.sqrt(o*o+s*s)/(hc*r*(1-r)),u=a?Math.atan2(o,s)*$T-120:NaN;return new Ao(u<0?u+360:u,a,r,e.opacity)}function f1(e,t,n,i){return arguments.length===1?Q9(e):new Ao(e,t,n,i??1)}function Ao(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Zy(Ao,f1,eb(tb,{brighter(e){return e=e==null?_E:Math.pow(_E,e),new Ao(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$E:Math.pow($E,e),new Ao(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*_T,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new pp(255*(t+n*(OT*i+_v*r)),255*(t+n*($v*i+Up*r)),255*(t+n*(hc*i)),this.opacity)}}));function Z9(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function e7(e,t){var n=gp(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}var t7=1e-12;function pS(e){return((e=Math.exp(e))+1/e)/2}function n7(e){return((e=Math.exp(e))-1/e)/2}function i7(e){return((e=Math.exp(2*e))-1)/(e+1)}const r7=function e(t,n,i){function r(s,o){var a=s[0],u=s[1],l=s[2],c=o[0],f=o[1],d=o[2],h=c-a,p=f-u,g=h*h+p*p,m,y;if(g<t7)y=Math.log(d/l)/t,m=function(w){return[a+w*h,u+w*p,l*Math.exp(t*w*y)]};else{var b=Math.sqrt(g),v=(d*d-l*l+i*g)/(2*l*n*b),x=(d*d-l*l-i*g)/(2*d*n*b),E=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(x*x+1)-x);y=(S-E)/t,m=function(w){var _=w*y,$=pS(E),C=l/(n*b)*($*i7(t*_+E)-n7(E));return[a+C*h,u+C*p,l*$/pS(t*_+E)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(s){var o=Math.max(.001,+s),a=o*o,u=a*a;return e(o,a,u)},r}(Math.SQRT2,2,4);function RT(e){return function(t,n){var i=e((t=q0(t)).h,(n=q0(n)).h),r=Pt(t.s,n.s),s=Pt(t.l,n.l),o=Pt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const s7=RT(gp);var o7=RT(Pt);function a7(e,t){var n=Pt((e=Zd(e)).l,(t=Zd(t)).l),i=Pt(e.a,t.a),r=Pt(e.b,t.b),s=Pt(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=i(o),e.b=r(o),e.opacity=s(o),e+""}}function NT(e){return function(t,n){var i=e((t=eh(t)).h,(n=eh(n)).h),r=Pt(t.c,n.c),s=Pt(t.l,n.l),o=Pt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const u7=NT(gp);var l7=NT(Pt);function LT(e){return function t(n){n=+n;function i(r,s){var o=e((r=f1(r)).h,(s=f1(s)).h),a=Pt(r.s,s.s),u=Pt(r.l,s.l),l=Pt(r.opacity,s.opacity);return function(c){return r.h=o(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const c7=LT(gp);var f7=LT(Pt);function Av(e,t){t===void 0&&(t=e,e=Nc);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(o){var a=Math.max(0,Math.min(i-1,Math.floor(o*=i)));return s[a](o-a)}}function d7(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const h7=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Nc,interpolateArray:_L,interpolateBasis:OL,interpolateBasisClosed:RL,interpolateCubehelix:c7,interpolateCubehelixLong:f7,interpolateDate:$L,interpolateDiscrete:Z9,interpolateHcl:u7,interpolateHclLong:l7,interpolateHsl:s7,interpolateHslLong:o7,interpolateHue:e7,interpolateLab:a7,interpolateNumber:NL,interpolateNumberArray:AL,interpolateObject:kL,interpolateRgb:LL,interpolateRgbBasis:PL,interpolateRgbBasisClosed:zL,interpolateRound:dp,interpolateString:IL,interpolateTransformCss:BL,interpolateTransformSvg:UL,interpolateZoom:r7,piecewise:Av,quantize:d7},Symbol.toStringTag,{value:"Module"}));function PT(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,EE),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return PT(e).unknown(t)},e=arguments.length?Array.from(e,EE):[0,1],ku(n)}function zT(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return s<r&&(o=n,n=i,i=o,o=r,r=s,s=o),e[n]=t.floor(r),e[i]=t.ceil(s),e}function gS(e){return Math.log(e)}function mS(e){return Math.exp(e)}function p7(e){return-Math.log(-e)}function g7(e){return-Math.exp(-e)}function m7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function y7(e){return e===10?m7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function b7(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 yS(e){return(t,n)=>-e(-t,n)}function kv(e){const t=e(gS,mS),n=t.domain;let i=10,r,s;function o(){return r=b7(i),s=y7(i),n()[0]<0?(r=yS(r),s=yS(s),e(p7,g7)):e(gS,mS),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),p,g;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<i;++p)if(g=d<0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=SE(l,c,m))}else y=SE(d,h,Math.min(h-d,m)).map(s);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=j0(u)).precision==null&&(u.trim=!0),u=Ik(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(zT(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function IT(){const e=kv(Qy()).domain([1,10]);return e.copy=()=>hp(e,IT()).base(e.base()),Bs.apply(e,arguments),e}function bS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Cv(e){var t=1,n=e(bS(t),vS(t));return n.constant=function(i){return arguments.length?e(bS(t=+i),vS(t)):t},ku(n)}function BT(){var e=Cv(Qy());return e.copy=function(){return hp(e,BT()).constant(e.constant())},Bs.apply(e,arguments)}function xS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function v7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function x7(e){return e<0?-e*e:e*e}function Fv(e){var t=e(fs,fs),n=1;function i(){return n===1?e(fs,fs):n===.5?e(v7,x7):e(xS(n),xS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},ku(t)}function Tv(){var e=Fv(Qy());return e.copy=function(){return hp(e,Tv()).exponent(e.exponent())},Bs.apply(e,arguments),e}function w7(){return Tv.apply(null,arguments).exponent(.5)}function UT(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o<a;)n[o-1]=wC(e,o/a);return s}function s(o){return o==null||isNaN(o=+o)?i:t[Va(n,o)]}return s.invertExtent=function(o){var a=t.indexOf(o);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let a of o)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(oc),r()},s.range=function(o){return arguments.length?(t=Array.from(o),r()):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.quantiles=function(){return n.slice()},s.copy=function(){return UT().domain(e).range(t).unknown(i)},Bs.apply(s,arguments)}function jT(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function o(u){return u!=null&&u<=u?r[Va(i,u,0,n)]:s}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},o.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},o.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return jT().domain([e,t]).range(r).unknown(s)},Bs.apply(ku(o),arguments)}function E7(e){return new Date(e)}function S7(e){return e instanceof Date?+e:+new Date(+e)}function Mv(e,t,n,i,r,s,o,a,u,l){var c=CL(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function E(S){return(u(S)<S?h:a(S)<S?p:o(S)<S?g:s(S)<S?m:i(S)<S?r(S)<S?y:b:n(S)<S?v:x)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?d(Array.from(S,S7)):d().map(E7)},c.ticks=function(S){var w=d();return e(w[0],w[w.length-1],S??10)},c.tickFormat=function(S,w){return w==null?E:l(w)},c.nice=function(S){var w=d();return(!S||typeof S.range!="function")&&(S=t(w[0],w[w.length-1],S??10)),S?d(zT(w,S)):c},c.copy=function(){return hp(c,Mv(e,t,n,i,r,s,o,a,u,l))},c}function _7(){return Bs.apply(Mv(tz,nz,Qi,uc,Du,Or,Ep,xp,Fr,xb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function $7(){return Bs.apply(Mv(ZP,ez,Zi,lc,Ou,Es,Sp,wp,Fr,wb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jp(){var e=0,t=1,n,i,r,s,o=fs,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:o(r===0?.5:(f=(s(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),i=s(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(o=f,l):o};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,o=f(h,p),l):[o(0),o(1)]}}return l.range=c(Nc),l.rangeRound=c(dp),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return s=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function qs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Dv(){var e=ku(jp()(fs));return e.copy=function(){return qs(e,Dv())},Us.apply(e,arguments)}function qT(){var e=kv(jp()).domain([1,10]);return e.copy=function(){return qs(e,qT()).base(e.base())},Us.apply(e,arguments)}function WT(){var e=Cv(jp());return e.copy=function(){return qs(e,WT()).constant(e.constant())},Us.apply(e,arguments)}function Ov(){var e=Fv(jp());return e.copy=function(){return qs(e,Ov()).exponent(e.exponent())},Us.apply(e,arguments)}function A7(){return Ov.apply(null,arguments).exponent(.5)}function qp(){var e=0,t=.5,n=1,i=1,r,s,o,a,u,l=fs,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-s)*(i*g<i*s?a:u),l(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,r=c(e=+e),s=c(t=+t),o=c(n=+n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Av(g,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=p(Nc),h.rangeRound=p(dp),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,r=g(e),s=g(t),o=g(n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h}}function HT(){var e=ku(qp()(fs));return e.copy=function(){return qs(e,HT())},Us.apply(e,arguments)}function GT(){var e=kv(qp()).domain([.1,1,10]);return e.copy=function(){return qs(e,GT()).base(e.base())},Us.apply(e,arguments)}function VT(){var e=Cv(qp());return e.copy=function(){return qs(e,VT()).constant(e.constant())},Us.apply(e,arguments)}function Rv(){var e=Fv(qp());return e.copy=function(){return qs(e,Rv()).exponent(e.exponent())},Us.apply(e,arguments)}function k7(){return Rv.apply(null,arguments).exponent(.5)}function ar(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const C7=ar("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),F7=ar("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),T7=ar("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),M7=ar("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),D7=ar("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),O7=ar("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),R7=ar("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),N7=ar("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),L7=ar("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),P7=ar("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function Nv(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const z7="identity",eu="linear",Ur="log",Uc="pow",jc="sqrt",Wp="symlog",Ro="time",No="utc",Xi="sequential",Pu="diverging",tu="quantile",Hp="quantize",Gp="threshold",Lv="ordinal",d1="point",XT="band",Pv="bin-ordinal",lt="continuous",qc="discrete",Wc="discretizing",ti="interpolating",zv="temporal";function I7(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function B7(e){return function(t){const n=e.range();let i=t[0],r=t[1],s=-1,o,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Iv(){const e=Sv().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],p=Nv(f,a,u);let g=i[d-0];r=(h-g)/(p||1),o&&(r=Math.floor(r)),g+=(h-g-r*(f-a))*l,s=r*(1-a),o&&(g=Math.round(g),s=Math.round(s));const m=Fn(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],m=+f[1],y,b,v;if(!(g!==g||m!==m)&&(m<g&&(v=g,g=m,m=v),!(m<h[0]||g>i[1-d])))return y=Math.max(0,Va(h,g)-1),b=g===m?y:Va(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Iv().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function YT(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return YT(t())},e}function U7(){return YT(Iv().paddingInner(1))}var j7=Array.prototype.map;function q7(e){return j7.call(e,zt)}const W7=Array.prototype.slice;function KT(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Va(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=q7(i),n):e.slice()},n.range=function(i){return arguments.length?(t=W7.call(i),n):t.slice()},n.tickFormat=function(i,r){return ML(e[0],xe(e),i??10,r)},n.copy=function(){return KT().domain(n.domain()).range(n.range())},n}const th=new Map,JT=Symbol("vega_scale");function QT(e){return e[JT]=!0,e}function H7(e){return e&&e[JT]===!0}function G7(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?I7(s):s.invertExtent?B7(s):void 0),s.type=e,QT(s)};return i.metadata=yi(Y(n)),i}function ke(e,t,n){return arguments.length>1?(th.set(e,G7(e,t,n)),this):ZT(e)?th.get(e):void 0}ke(z7,PT);ke(eu,FL,lt);ke(Ur,IT,[lt,Ur]);ke(Uc,Tv,lt);ke(jc,w7,lt);ke(Wp,BT,lt);ke(Ro,_7,[lt,zv]);ke(No,$7,[lt,zv]);ke(Xi,Dv,[lt,ti]);ke(`${Xi}-${eu}`,Dv,[lt,ti]);ke(`${Xi}-${Ur}`,qT,[lt,ti,Ur]);ke(`${Xi}-${Uc}`,Ov,[lt,ti]);ke(`${Xi}-${jc}`,A7,[lt,ti]);ke(`${Xi}-${Wp}`,WT,[lt,ti]);ke(`${Pu}-${eu}`,HT,[lt,ti]);ke(`${Pu}-${Ur}`,GT,[lt,ti,Ur]);ke(`${Pu}-${Uc}`,Rv,[lt,ti]);ke(`${Pu}-${jc}`,k7,[lt,ti]);ke(`${Pu}-${Wp}`,VT,[lt,ti]);ke(tu,UT,[Wc,tu]);ke(Hp,jT,Wc);ke(Gp,TL,Wc);ke(Pv,KT,[qc,Wc]);ke(Lv,Sv,qc);ke(XT,Iv,qc);ke(d1,U7,qc);function ZT(e){return th.has(e)}function na(e,t){const n=th.get(e);return n&&n.metadata[t]}function Bv(e){return na(e,lt)}function nu(e){return na(e,qc)}function h1(e){return na(e,Wc)}function eM(e){return na(e,Ur)}function V7(e){return na(e,zv)}function tM(e){return na(e,ti)}function nM(e){return na(e,tu)}const X7=["clamp","base","constant","exponent"];function iM(e,t){const n=t[0],i=xe(t)-n;return function(r){return e(n+r*i)}}function Vp(e,t,n){return Av(Uv(t||"rgb",n),e)}function rM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function sM(e,t,n){const i=n-t;let r,s,o;return!i||!Number.isFinite(i)?Ht(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),o=ke(s)().domain([t,n]).range([0,1]),X7.forEach(a=>e[a]?o[a](e[a]()):0),o)}function Uv(e,t){const n=h7[Y7(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function Y7(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const K7={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},J7={accent:F7,category10:C7,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:T7,observable10:M7,paired:D7,pastel1:O7,pastel2:R7,set1:N7,set2:L7,set3:P7,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function oM(e){if(L(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function aM(e,t){for(const n in e)jv(n,t(e[n]))}const wS={};aM(J7,oM);aM(K7,e=>Vp(oM(e)));function jv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(wS[e]=t,this):wS[e]}const gd="symbol",Q7="discrete",Z7="gradient",e8=e=>L(e)?e.map(t=>String(t)):String(e),t8=(e,t)=>e[1]-t[1],n8=(e,t)=>t[1]-e[1];function qv(e,t,n){let i;return $e(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Pc(e.domain())/n||1)+1))),X(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Ro?Ru(t):e.type==No?Nu(t):N("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function uM(e,t,n){let i=e.range(),r=i[0],s=xe(i),o=t8;if(r>s&&(i=s,s=r,r=i,o=n8),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],xe(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Wv(e,t){return e.bins?uM(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function lM(e,t,n,i,r,s){const o=t.type;let a=e8;if(o===Ro||r===Ro)a=e.timeFormat(i);else if(o===No||r===No)a=e.utcFormat(i);else if(eM(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=cM(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function cM(e,t,n){const i=Wv(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r<r-.5&&(l*=r),l<=o};return n?i.filter(a):a}const p1={[tu]:"quantiles",[Hp]:"thresholds",[Gp]:"domain"},fM={[tu]:"quantiles",[Hp]:"domain"};function dM(e,t){return e.bins?s8(e.bins):e.type===Ur?cM(e,t,!0):p1[e.type]?r8(e[p1[e.type]]()):Wv(e,t)}function i8(e,t,n){const i=t[fM[t.type]](),r=i.length;let s=r>1?i[1]-i[0]:i[0],o;for(o=1;o<r;++o)s=Math.min(s,i[o]-i[o-1]);return e.formatSpan(0,s,3*10,n)}function r8(e){const t=[-1/0].concat(e);return t.max=1/0,t}function s8(e){const t=e.slice(0,-1);return t.max=xe(e),t}const o8=e=>p1[e.type]||e.bins;function hM(e,t,n,i,r,s,o){const a=fM[t.type]&&s!==Ro&&s!==No?i8(e,t,r):lM(e,t,n,r,s,o);return i===gd&&o8(t)?a8(a):i===Q7?u8(a):l8(a)}const a8=e=>(t,n,i)=>{const r=ES(i[n+1],ES(i.max,1/0)),s=SS(t,e),o=SS(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},ES=(e,t)=>e??t,u8=e=>(t,n)=>n?e(t):null,l8=e=>t=>e(t),SS=(e,t)=>Number.isFinite(e)?t(e):null;function c8(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+xe(t),s=r-i;if(e.type===Gp){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function f8(e,t,n,i){const r=i||t.type;return K(n)&&V7(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ro?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===No?e.utcFormat("%A, %d %B %Y, %X UTC"):hM(e,t,5,null,n,i,!0)}function pM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=f8(e,t,n.format,n.formatType);if(h1(t.type)){const s=dM(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(nu(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(xe(s))}`}}let gM=0;function d8(){gM=0}const nh="p_";function Hv(e){return e&&e.gradient}function mM(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?nh:"";return r||(r=e.id="gradient_"+gM++,i==="radial"?(e.x1=Ni(e.x1,.5),e.y1=Ni(e.y1,.5),e.r1=Ni(e.r1,0),e.x2=Ni(e.x2,.5),e.y2=Ni(e.y2,.5),e.r2=Ni(e.r2,.5),s=nh):(e.x1=Ni(e.x1,0),e.y1=Ni(e.y1,0),e.x2=Ni(e.x2,1),e.y2=Ni(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Ni(e,t){return e??t}function yM(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const _S={basis:{curve:D9},"basis-closed":{curve:O9},"basis-open":{curve:R9},bundle:{curve:N9,tension:"beta",value:.85},cardinal:{curve:L9,tension:"tension",value:0},"cardinal-open":{curve:z9,tension:"tension",value:0},"cardinal-closed":{curve:P9,tension:"tension",value:0},"catmull-rom":{curve:I9,tension:"alpha",value:.5},"catmull-rom-closed":{curve:B9,tension:"alpha",value:.5},"catmull-rom-open":{curve:U9,tension:"alpha",value:.5},linear:{curve:bv},"linear-closed":{curve:j9},monotone:{horizontal:W9,vertical:q9},natural:{curve:H9},step:{curve:G9},"step-after":{curve:X9},"step-before":{curve:V9}};function Gv(e,t,n){var i=J(_S,e)&&_S[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const h8={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},p8=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,g8=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,m8=/^((\s+,?\s*)|(,\s*))/,y8=/^[01]/;function iu(e){const t=[];return(e.match(p8)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=h8[s],a=b8(s,o,i.slice(1).trim()),u=a.length;if(u<o||u&&u%o!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,o)]),u!==o){s==="m"&&(r=r==="M"?"L":"l");for(let l=o;l<u;l+=o)t.push([r,...a.slice(l,l+o)])}}),t}function b8(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const o=e==="a"&&(s===3||s===4)?y8:g8,a=n.slice(r).match(o);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(m8);u!==null&&(r+=u[0].length)}return i}const Fs=Math.PI/180,v8=1e-14,yo=Math.PI/2,ji=Math.PI*2,ba=Math.sqrt(3)/2;var Pm={},zm={},bM=[].join;function x8(e,t,n,i,r,s,o,a,u){const l=bM.call(arguments);if(Pm[l])return Pm[l];const c=o*Fs,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,E=b*a+v*u,S=m*e+y*t,w=b*e+v*t;let $=1/((S-x)*(S-x)+(w-E)*(w-E))-.25;$<0&&($=0);let C=Math.sqrt($);s==r&&(C=-C);const T=.5*(x+S)-C*(w-E),O=.5*(E+w)+C*(S-x),k=Math.atan2(E-O,x-T);let A=Math.atan2(w-O,S-T)-k;A<0&&s===1?A+=ji:A>0&&s===0&&(A-=ji);const M=Math.ceil(Math.abs(A/(yo+.001))),P=[];for(let z=0;z<M;++z){const U=k+z*A/M,te=k+(z+1)*A/M;P[z]=[T,O,U,te,n,i,f,d]}return Pm[l]=P}function w8(e){const t=bM.call(e);if(zm[t])return zm[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],l=e[7];const c=l*o,f=-u*a,d=u*o,h=l*a,p=Math.cos(r),g=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),E=n+p-x*g,S=i+g+x*p,w=n+m,_=i+y,$=w+x*y,C=_-x*m;return zm[t]=[c*E+f*S,d*E+h*S,c*$+f*C,d*$+h*C,c*w+f*_,d*w+h*_]}const In=["l",0,0,0,0,0,0,0];function E8(e,t,n){const i=In[0]=e[0];if(i==="a"||i==="A")In[1]=t*e[1],In[2]=n*e[2],In[3]=e[3],In[4]=e[4],In[5]=e[5],In[6]=t*e[6],In[7]=n*e[7];else if(i==="h"||i==="H")In[1]=t*e[1];else if(i==="v"||i==="V")In[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)In[r]=(r%2==1?t:n)*e[r];return In}function pc(e,t,n,i,r,s){var o,a=null,u=0,l=0,c=0,f=0,d,h,p,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),s==null&&(s=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(o=t[b],(r!==1||s!==1)&&(o=E8(o,r,s)),o[0]){case"l":u+=o[1],l+=o[2],e.lineTo(u+n,l+i);break;case"L":u=o[1],l=o[2],e.lineTo(u+n,l+i);break;case"h":u+=o[1],e.lineTo(u+n,l+i);break;case"H":u=o[1],e.lineTo(u+n,l+i);break;case"v":l+=o[1],e.lineTo(u+n,l+i);break;case"V":l=o[1],e.lineTo(u+n,l+i);break;case"m":u+=o[1],l+=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=o[1],l=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+o[5],h=l+o[6],c=u+o[3],f=l+o[4],e.bezierCurveTo(u+o[1]+n,l+o[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=o[5],l=o[6],c=o[3],f=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+o[3],h=l+o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+o[1]+n,l+o[2]+i,d+n,h+i),c=u+o[1],f=l+o[2],u=d,l=h;break;case"S":d=o[3],h=o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"q":d=u+o[3],h=l+o[4],c=u+o[1],f=l+o[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=o[3],h=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"t":d=u+o[1],h=l+o[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-p,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+o[1],f=l+o[2];break;case"T":d=o[1],h=o[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":$S(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+u+n,o[7]+l+i]),u+=o[6],l+=o[7];break;case"A":$S(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),u=o[6],l=o[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=o}}function $S(e,t,n,i){const r=x8(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let s=0;s<r.length;++s){const o=w8(r[s]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}const AS=.5773502691896257,kS={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,ji)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*AS,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*AS;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function vM(e){return J(kS,e)?kS[e]:S8(e)}var Im={};function S8(e){if(!J(Im,e)){const t=iu(e);Im[e]={draw:function(n,i){pc(n,t,0,0,Math.sqrt(i)/2)}}}return Im[e]}const ts=.448084975506;function _8(e){return e.x}function $8(e){return e.y}function A8(e){return e.width}function k8(e){return e.height}function br(e){return typeof e=="function"?e:()=>+e}function Df(e,t,n){return Math.max(t,Math.min(e,n))}function xM(){var e=_8,t=$8,n=A8,i=k8,r=br(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Df(+r.call(this,c),0,b),x=Df(+s.call(this,c),0,b),E=Df(+o.call(this,c),0,b),S=Df(+a.call(this,c),0,b);if(u||(u=h=Pp()),v<=0&&x<=0&&E<=0&&S<=0)u.rect(p,g,m,y);else{var w=p+m,_=g+y;u.moveTo(p+v,g),u.lineTo(w-x,g),u.bezierCurveTo(w-ts*x,g,w,g+ts*x,w,g+x),u.lineTo(w,_-S),u.bezierCurveTo(w,_-ts*S,w-ts*S,_,w-S,_),u.lineTo(p+E,_),u.bezierCurveTo(p+ts*E,_,p,_-ts*E,p,_-E),u.lineTo(p,g+v),u.bezierCurveTo(p,g+ts*v,p+ts*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=br(c),l):e},l.y=function(c){return arguments.length?(t=br(c),l):t},l.width=function(c){return arguments.length?(n=br(c),l):n},l.height=function(c){return arguments.length?(i=br(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=br(c),s=f!=null?br(f):r,a=d!=null?br(d):r,o=h!=null?br(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function wM(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,ji);r.closePath()}else s=1;o=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=Pp()),d=0;d<=h;++d)!(d<h&&i(p=f[d],d,f))===g&&(g=!g)&&(s=0),g&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function Hc(e,t){return e??t}const Gc=e=>e.x||0,Vc=e=>e.y||0,C8=e=>e.width||0,F8=e=>e.height||0,T8=e=>(e.x||0)+(e.width||0),M8=e=>(e.y||0)+(e.height||0),D8=e=>e.startAngle||0,O8=e=>e.endAngle||0,R8=e=>e.padAngle||0,N8=e=>e.innerRadius||0,L8=e=>e.outerRadius||0,P8=e=>e.cornerRadius||0,z8=e=>Hc(e.cornerRadiusTopLeft,e.cornerRadius)||0,I8=e=>Hc(e.cornerRadiusTopRight,e.cornerRadius)||0,B8=e=>Hc(e.cornerRadiusBottomRight,e.cornerRadius)||0,U8=e=>Hc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,j8=e=>Hc(e.size,64),q8=e=>e.size||1,Xp=e=>e.defined!==!1,W8=e=>vM(e.shape||"circle"),H8=F9().startAngle(D8).endAngle(O8).padAngle(R8).innerRadius(N8).outerRadius(L8).cornerRadius(P8),G8=hT().x(Gc).y1(Vc).y0(M8).defined(Xp),V8=hT().y(Vc).x1(Gc).x0(T8).defined(Xp),X8=dT().x(Gc).y(Vc).defined(Xp),Y8=xM().x(Gc).y(Vc).width(C8).height(F8).cornerRadius(z8,I8,B8,U8),K8=M9().type(W8).size(j8),J8=wM().x(Gc).y(Vc).defined(Xp).size(q8);function Vv(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Q8(e,t){return H8.context(e)(t)}function Z8(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?V8:G8).curve(Gv(i,n.orient,n.tension)).context(e)(t)}function eB(e,t){const n=t[0],i=n.interpolate||"linear";return X8.curve(Gv(i,n.orient,n.tension)).context(e)(t)}function zu(e,t,n,i){return Y8.context(e)(t,n,i)}function tB(e,t){return(t.mark.shape||t.shape).context(e)(t)}function nB(e,t){return K8.context(e)(t)}function iB(e,t){return J8.context(e)(t)}var EM=1;function SM(){EM=1}function Xv(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+EM++),o=r.clipping[s]||(r.clipping[s]={id:s});return fe(i)?o.path=i(null):Vv(n)?o.path=zu(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function nt(e){this.clear(),e&&this.union(e)}nt.prototype={clone(){return new nt(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Yp(e){this.mark=e,this.bounds=this.bounds||new nt}function Kp(e){Yp.call(this,e),this.items=this.items||[]}G(Kp,Yp);class _M{constructor(t){this._pending=0,this._loader=t||$p()}pending(){return this._pending}sanitizeURL(t){const n=this;return CS(n),n._loader.sanitize(t,{context:"href"}).then(i=>(ul(n),i)).catch(()=>(ul(n),null))}loadImage(t){const n=this,i=Y9();return CS(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=J(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>ul(n),o.onerror=()=>ul(n),o.src=s,o}).catch(r=>(ul(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function CS(e){e._pending+=1}function ul(e){e._pending-=1}function Hr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?rB(t,i):0))}return e}function rB(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const sB=ji-1e-8;let Jp,md,yd,Eo,g1,bd,m1,y1;const ds=(e,t)=>Jp.add(e,t),vd=(e,t)=>ds(md=e,yd=t),FS=e=>ds(e,Jp.y1),TS=e=>ds(Jp.x1,e),bo=(e,t)=>g1*e+m1*t,vo=(e,t)=>bd*e+y1*t,Bm=(e,t)=>ds(bo(e,t),vo(e,t)),Um=(e,t)=>vd(bo(e,t),vo(e,t));function Xc(e,t){return Jp=e,t?(Eo=t*Fs,g1=y1=Math.cos(Eo),bd=Math.sin(Eo),m1=-bd):(g1=y1=1,Eo=bd=m1=0),oB}const oB={beginPath(){},closePath(){},moveTo:Um,lineTo:Um,rect(e,t,n,i){Eo?(Bm(e+n,t),Bm(e+n,t+i),Bm(e,t+i),Um(e,t)):(ds(e+n,t+i),vd(e,t))},quadraticCurveTo(e,t,n,i){const r=bo(e,t),s=vo(e,t),o=bo(n,i),a=vo(n,i);MS(md,r,o,FS),MS(yd,s,a,TS),vd(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=bo(e,t),a=vo(e,t),u=bo(n,i),l=vo(n,i),c=bo(r,s),f=vo(r,s);DS(md,o,u,c,FS),DS(yd,a,l,f,TS),vd(c,f)},arc(e,t,n,i,r,s){if(i+=Eo,r+=Eo,md=n*Math.cos(r)+e,yd=n*Math.sin(r)+t,Math.abs(r-i)>sB)ds(e-n,t-n),ds(e+n,t+n);else{const o=l=>ds(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%ji,i<0&&(i+=ji),r=r%ji,r<0&&(r+=ji),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=ji,a=i-i%yo,u=0;u<4&&a>r;++u,a-=yo)o(a);else for(a=i-i%yo+yo,u=0;u<4&&a<r;++u,a=a+yo)o(a)}}};function MS(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function DS(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(s)>v8?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0<u&&u<1&&r(OS(u,e,t,n,i)),0<l&&l<1&&r(OS(l,e,t,n,i))}function OS(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var $s=($s=_s(1,1))?$s.getContext("2d"):null;const b1=new nt;function Yv(e){return function(t,n){if(!$s)return!0;e($s,t),b1.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=b1;for(let a=r;a<=o;++a)for(let u=i;u<=s;++u)if($s.isPointInPath(u,a))return!0;return!1}}function Kv(e,t){return t.contains(e.x||0,e.y||0)}function $M(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(b1.set(n,i,n+r,i+s))}function AM(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,s=e.y2!=null?e.y2:i;return Oa(t,n,i,r,s)}function Oa(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,p,g,m;for(m=0;m<4;++m){if(m===0&&(h=-l,p=-(s-t)),m===1&&(h=l,p=a-t),m===2&&(h=-c,p=-(o-n)),m===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function ru(e,t){e.globalCompositeOperation=t.blend||"source-over"}function si(e,t){return e??t}function RS(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function aB(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+si(t.x1,.5)*i,n.y1+si(t.y1,.5)*r,Math.max(i,r)*si(t.r1,0),n.x1+si(t.x2,.5)*i,n.y1+si(t.y2,.5)*r,Math.max(i,r)*si(t.r2,.5));else{const o=si(t.x1,0),a=si(t.y1,0),u=si(t.x2,1),l=si(t.y2,0);if(o===u||a===l||i===r)s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=_s(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=RS(f.createLinearGradient(o,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return RS(s,t.stops)}function kM(e,t,n){return Hv(n)?aB(e,n,t.bounds):n}function ih(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=kM(e,t,t.fill),!0):!1}var uB=[];function su(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=kM(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||uB),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function lB(e,t){return e.zindex-t.zindex||e.index-t.index}function Jv(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r<s;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(lB)}function vi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=Jv(e);if(s&&s.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=s}for(i=0,r=n.length;i<r;++i)t(n[i])}function rh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=Jv(e);for(s&&s.length&&(n=s),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Qv(e){return function(t,n,i){vi(n,r=>{(!i||i.intersects(r.bounds))&&CM(e,t,r,r)})}}function cB(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&CM(e,t,n.items[0],n.items)}}function CM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(ru(t,n),n.fill&&ih(t,n,r)&&t.fill(),n.stroke&&su(t,n,r)&&t.stroke()))}function Qp(e){return e=e||Rn,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,rh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function Yc(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function Zv(e){return Qp(Yc(e))}function ko(e,t){return"translate("+e+","+t+")"}function ex(e){return"rotate("+e+")"}function fB(e,t){return"scale("+e+","+t+")"}function FM(e){return ko(e.x||0,e.y||0)}function dB(e){return ko(e.x||0,e.y||0)+(e.angle?" "+ex(e.angle):"")}function hB(e){return ko(e.x||0,e.y||0)+(e.angle?" "+ex(e.angle):"")+(e.scaleX||e.scaleY?" "+fB(e.scaleX||1,e.scaleY||1):"")}function tx(e,t,n){function i(o,a){o("transform",dB(a)),o("d",t(null,a))}function r(o,a){return t(Xc(o,a.angle),a),Hr(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=Fs),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Qv(s),pick:Zv(s),isect:n||Yv(s)}}var pB=tx("arc",Q8);function gB(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<s&&(s=a,o=e[r]));return o}function mB(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,s,o;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o<n))return e[i];return null}function yB(e,t){for(var n=e.length,i,r,s;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s<i*i))return e[n];return null}function nx(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Xc(u),c),Hr(u,c[0]))}function s(u,l){u.beginPath(),t(u,l)}const o=Yc(s);function a(u,l,c,f,d,h){var p=l.items,g=l.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,o(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:cB(s),pick:a,isect:Kv,tip:n}}var bB=nx("area",Z8,gB);function vB(e,t){var n=t.clip;e.save(),fe(n)?(e.beginPath(),n(e),e.clip()):TM(e,t.group)}function TM(e,t){e.beginPath(),Vv(t)?zu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function MM(e){const t=si(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function xB(e,t){e("transform",FM(t))}function DM(e,t){const n=MM(t);e("d",zu(null,t,n,n))}function wB(e,t){e("class","background"),e("aria-hidden",!0),DM(e,t)}function EB(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?DM(e,t):e("d","")}function SB(e,t,n){const i=t.clip?Xv(n,t,t):null;e("clip-path",i)}function _B(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Hr(e,t),e.translate(t.x||0,t.y||0)}function gc(e,t,n,i){const r=MM(t);e.beginPath(),zu(e,t,(n||0)+r,(i||0)+r)}const $B=Yc(gc),AB=Yc(gc,!1),kB=Yc(gc,!0);function CB(e,t,n,i){vi(t,r=>{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(gc(e,r,s,o),ru(e,r),r.fill&&ih(e,r,u)&&e.fill(),r.stroke&&!a&&su(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&TM(e,r),n&&n.translate(-s,-o),vi(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(gc(e,r,s,o),ru(e,r),su(e,r,u)&&e.stroke())})}function FB(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return rh(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(r<c||r>h||s<f||s>p))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Vv(u)&&!kB(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&AB(e,u,o,a)?(e.restore(),u):(l=rh(u,b=>TB(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&$B(e,u,o,a)&&(l=u),e.restore(),l||null)})}function TB(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var MB={type:"group",tag:"g",nested:!1,attr:xB,bound:_B,draw:CB,pick:FB,isect:$M,content:SB,background:wB,foreground:EB},mc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function ix(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function rx(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function sx(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Zp(e,t){return e==="center"?t/2:e==="right"?t:0}function eg(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function DB(e,t,n){const i=ix(t,n),r=rx(t,i),s=sx(t,i),o=(t.x||0)-Zp(t.align,r),a=(t.y||0)-eg(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,mc["xmlns:xlink"],"xlink:href"),e("transform",ko(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function OB(e,t){const n=t.image,i=rx(t,n),r=sx(t,n),s=(t.x||0)-Zp(t.align,i),o=(t.y||0)-eg(t.baseline,r);return e.set(s,o,s+i,o+r)}function RB(e,t,n){vi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=ix(i,this);let s=rx(i,r),o=sx(i,r);if(s===0||o===0)return;let a=(i.x||0)-Zp(i.align,s),u=(i.y||0)-eg(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=s/c,u+=(o-d)/2,o=d):(d=o*c,a+=(s-d)/2,s=d))),(r.complete||r.toDataURL)&&(ru(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,s,o))})}var NB={type:"image",tag:"image",nested:!1,attr:DB,bound:OB,draw:RB,pick:Qp(),isect:Rn,get:ix,xOffset:Zp,yOffset:eg},LB=nx("line",eB,mB);function PB(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",hB(t)),e("d",t.path)}function xd(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*Fs,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=iu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),pc(e,u,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):pc(e,u,i,r,s,o)}function zB(e,t){return xd(Xc(e,t.angle),t)?e.set(0,0,0,0):Hr(e,t,!0)}var IB={type:"path",tag:"path",nested:!1,attr:PB,bound:zB,draw:Qv(xd),pick:Zv(xd),isect:Yv(xd)};function BB(e,t){e("d",zu(null,t))}function UB(e,t){var n,i;return Hr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function NS(e,t){e.beginPath(),zu(e,t)}var jB={type:"rect",tag:"path",nested:!1,attr:BB,bound:UB,draw:Qv(NS),pick:Zv(NS),isect:$M};function qB(e,t){e("transform",FM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function WB(e,t){var n,i;return Hr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function OM(e,t,n){var i,r,s,o;return t.stroke&&su(e,t,n)?(i=t.x||0,r=t.y||0,s=t.x2!=null?t.x2:i,o=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0):!1}function HB(e,t,n){vi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&OM(e,i,r)&&(ru(e,i),e.stroke())}})}function GB(e,t,n,i){return e.isPointInStroke?OM(e,t,1)&&e.isPointInStroke(n,i):!1}var VB={type:"rule",tag:"line",nested:!1,attr:qB,bound:WB,draw:HB,pick:Qp(GB),isect:AM},XB=tx("shape",tB),YB=tx("symbol",nB,Kv);const LS=cC();var Mn={height:ur,measureWidth:ox,estimateWidth:sh,width:sh,canvas:RM};RM(!0);function RM(e){Mn.width=e&&$s?ox:sh}function sh(e,t){return NM(Ms(e,t),ur(e))}function NM(e,t){return~~(.8*e.length*t)}function ox(e,t){return ur(e)<=0||!(t=Ms(e,t))?0:LM(t,tg(e))}function LM(e,t){const n=`(${t}) ${e}`;let i=LS.get(n);return i===void 0&&($s.font=t,i=$s.measureText(e).width,LS.set(n,i)),i}function ur(e){return e.fontSize!=null?+e.fontSize||0:11}function Ts(e){return e.lineHeight!=null?e.lineHeight:ur(e)+2}function KB(e){return L(e)?e.length>1?e:e[0]:e}function Kc(e){return KB(e.lineBreak&&e.text&&!L(e.text)?e.text.split(e.lineBreak):e.text)}function ax(e){const t=Kc(e);return(L(t)?t.length-1:0)*Ts(e)}function Ms(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?QB(e,n):n}function JB(e){if(Mn.width===ox){const t=tg(e);return n=>LM(n,t)}else if(Mn.width===sh){const t=ur(e);return n=>NM(n,t)}else return t=>Mn.width(e,t)}function QB(e,t){var n=+e.limit,i=JB(e);if(i(t)<n)return t;var r=e.ellipsis||"…",s=e.dir==="rtl",o=0,a=t.length,u;if(n-=i(r),s){for(;o<a;)u=o+a>>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o<a;)u=1+(o+a>>>1),i(t.slice(0,u))<n?o=u:a=u-1;return t.slice(0,o)+r}}function Jc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function tg(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+ur(e)+"px "+Jc(e,t)}function ux(e){var t=e.baseline,n=ur(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Ts(e):t==="line-bottom"?.29*n-.5*Ts(e):0)}const ZB={left:"start",center:"middle",right:"end"},Hl=new nt;function ng(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-yo,t+=i*Math.cos(r),n+=i*Math.sin(r)),Hl.x1=t,Hl.y1=n,Hl}function eU(e,t){var n=t.dx||0,i=(t.dy||0)+ux(t),r=ng(t),s=r.x1,o=r.y1,a=t.angle||0,u;e("text-anchor",ZB[t.align]||"start"),a?(u=ko(s,o)+" "+ex(a),(n||i)&&(u+=" "+ko(n,i))):u=ko(s+n,o+i),e("transform",u)}function lx(e,t,n){var i=Mn.height(t),r=t.align,s=ng(t),o=s.x1,a=s.y1,u=t.dx||0,l=(t.dy||0)+ux(t)-Math.round(.8*i),c=Kc(t),f;if(L(c)?(i+=Ts(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Mn.width(t,h)),0)):f=Mn.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Fs,o,a);else if(n===2)return e.rotatedPoints(t.angle*Fs,o,a);return e}function tU(e,t,n){vi(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=tg(i),e.textAlign=i.align||"left",s=ng(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*Fs),o=a=0),o+=i.dx||0,a+=(i.dy||0)+ux(i),c=Kc(i),ru(e,i),L(c))for(l=Ts(i),u=0;u<c.length;++u)f=Ms(i,c[u]),i.fill&&ih(e,i,r)&&e.fillText(f,o,a),i.stroke&&su(e,i,r)&&e.strokeText(f,o,a),a+=l;else f=Ms(i,c),i.fill&&ih(e,i,r)&&e.fillText(f,o,a),i.stroke&&su(e,i,r)&&e.strokeText(f,o,a);i.angle&&e.restore()}})}function nU(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=ng(t),a=o.x1,u=o.y1,l=lx(Hl,t,1),c=-t.angle*Fs,f=Math.cos(c),d=Math.sin(c),h=f*r-d*s+(a-f*a+d*u),p=d*r+f*s+(u-d*a-f*u);return l.contains(h,p)}function iU(e,t){const n=lx(Hl,e,2);return Oa(t,n[0],n[1],n[2],n[3])||Oa(t,n[0],n[1],n[4],n[5])||Oa(t,n[4],n[5],n[6],n[7])||Oa(t,n[2],n[3],n[6],n[7])}var rU={type:"text",tag:"text",nested:!1,attr:eU,bound:lx,draw:tU,pick:Qp(nU),isect:iU},sU=nx("trail",iB,yB),Pn={arc:pB,area:bB,group:MB,image:NB,line:LB,path:IB,rect:jB,rule:VB,shape:XB,symbol:YB,text:rU,trail:sU};function v1(e,t,n){var i=Pn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new nt),e,n)}var PS={mark:null};function PM(e,t,n){var i=Pn[e.marktype],r=i.bound,s=e.items,o=s&&s.length,a,u,l,c;if(i.nested)return o?l=s[0]:(PS.mark=e,l=PS),c=v1(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new nt,o)for(a=0,u=s.length;a<u;++a)t.union(v1(s[a],r,n));return e.bounds=t}const oU=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function zM(e,t){return JSON.stringify(e,oU,t)}function IM(e){const t=typeof e=="string"?JSON.parse(e):e;return BM(t)}function BM(e){var t=e.marktype,n=e.items,i,r,s;if(n)for(r=0,s=n.length;r<s;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&BM(n[r]);return t&&PM(e),e}class UM{constructor(t){arguments.length?this.root=IM(t):(this.root=zS({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Kp(this.root)])}toJSON(t){return zM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=zS(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function zS(e,t){const n={bounds:new nt,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function hs(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function cx(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function rt(e,t,n,i){var r=e.childNodes[t],s;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(s=r||null,r=hs(e.ownerDocument,n,i),e.insertBefore(r,s)),r}function Un(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function jM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function ig(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function aU(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=Pn[r.marktype]).tip){for(o=ig(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let fx=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||$p(),this._tooltip=n||uU}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=hs(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=aU(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function uU(e,t,n,i){e.element().setAttribute("title",i||"")}class Qc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new _M(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const lU="keydown",cU="keypress",fU="keyup",qM="dragenter",wd="dragleave",WM="dragover",x1="pointerdown",dU="pointerup",oh="pointermove",Ed="pointerout",HM="pointerover",w1="mousedown",hU="mouseup",GM="mousemove",ah="mouseout",VM="mouseover",uh="click",pU="dblclick",gU="wheel",XM="mousewheel",lh="touchstart",ch="touchmove",fh="touchend",mU=[lU,cU,fU,qM,wd,WM,x1,dU,oh,Ed,HM,w1,hU,GM,ah,VM,uh,pU,gU,XM,lh,ch,fh],E1=oh,Gl=ah,S1=uh;class Zc extends fx{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=mU,this.pointermove=BS([oh,GM],[HM,VM],[Ed,ah]),this.dragover=BS([WM],[qM],[wd]),this.pointerout=US([Ed,ah]),this.dragleave=US([wd])}initialize(t,n,i){return this._canvas=t&&cx(t,"canvas"),[uh,w1,x1,oh,Ed,wd].forEach(r=>IS(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(XM,t)}pointerdown(t){this._down=this._active,this.fire(x1,t)}mousedown(t){this._down=this._active,this.fire(w1,t)}click(t){this._down===this._active&&(this.fire(uh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(lh,t,!0)}touchmove(t){this.fire(ch,t,!0)}touchend(t){this.fire(fh,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===S1&&r&&r.href?this.handleHref(n,r,r.href):(t===E1||t===Gl)&&this.handleTooltip(n,r,t!==Gl),s)for(let o=0,a=s.length;o<a;++o)s[o].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(IS(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&r.splice(s,1),this}pickEvent(t){const n=ig(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return Pn[t.marktype].pick.call(this,o,t,n,i,r,s)}}const yU=e=>e===lh||e===ch||e===fh?[lh,ch,fh]:[e];function IS(e,t){yU(t).forEach(n=>bU(e,n))}function bU(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Ml(e,t,n){t.forEach(i=>e.fire(i,n))}function BS(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Ml(this,e,i):((!r||!r.exit)&&Ml(this,n,i),this._active=s,Ml(this,t,i),Ml(this,e,i))}}function US(e){return function(t){Ml(this,e,t),this._active=null}}function vU(){return typeof window<"u"&&window.devicePixelRatio||1}function xU(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?vU():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class dh extends Qc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new nt,this._tempb=new nt}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:_s(1,1,this._options.type),t&&this._canvas&&(Un(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)xU(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||N("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=wU(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):EU(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=Pn[n.marktype];n.clip&&vB(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const wU=(e,t,n)=>new nt().set(0,0,t,n).translate(-e[0],-e[1]);function EU(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class YM extends fx{constructor(t,n){super(t,n);const i=this;i._hrefHandler=jm(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=jm(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Gl)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(S1,this._hrefHandler),r.removeEventListener(E1,this._tooltipHandler),r.removeEventListener(Gl,this._tooltipHandler)),this._svg=r=t&&cx(t,"svg"),r&&(r.addEventListener(S1,this._hrefHandler),r.addEventListener(E1,this._tooltipHandler),r.addEventListener(Gl,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:jm(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const jm=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},KM="aria-hidden",dx="aria-label",hx="role",px="aria-roledescription",JM="graphics-object",gx="graphics-symbol",QM=(e,t,n)=>({[hx]:e,[px]:t,[dx]:n||void 0}),SU=yi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),jS={axis:{desc:"axis",caption:AU},legend:{desc:"legend",caption:kU},"title-text":{desc:"title",caption:e=>`Title text '${WS(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${WS(e)}'`}},qS={ariaRole:hx,ariaRoleDescription:px,description:dx};function ZM(e,t){const n=t.aria===!1;if(e(KM,n||void 0),n||t.description==null)for(const i in qS)e(qS[i],void 0);else{const i=t.mark.marktype;e(dx,t.description),e(hx,t.ariaRole||(i==="group"?JM:gx)),e(px,t.ariaRoleDescription||`${i} mark`)}}function eD(e){return e.aria===!1?{[KM]:!0}:SU[e.role]?null:jS[e.role]?$U(e,jS[e.role]):_U(e)}function _U(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return QM(n?JM:gx,`${t} mark container`,e.description)}function $U(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return QM(t.role||gx,t.desc,n.description||i(n))}catch{return null}}function WS(e){return Y(e.text).join(" ")}function AU(e){const t=e.datum,n=e.orient,i=t.title?tD(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${nu(a)?"discrete":a} scale with ${pM(o,s,e)}`}function kU(e){const t=e.datum,n=t.title?tD(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return FU(i)+(n?` titled '${n}'`:"")+` for ${CU(s)} with ${pM(u,a,e)}`}function tD(e){try{return Y(xe(e.items).items[0].text).join(" ")}catch{return null}}function CU(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+xe(e)}function FU(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const nD=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),TU=e=>nD(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function mx(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${TU(l)}"`),a),a={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)o(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:o,text:u=>(n+=nD(u),a),toString:()=>e};return a}const iD=e=>rD(mx(),e)+"";function rD(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):rD(e,i)}return e.close()}const hh={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},ph={blend:"mix-blend-mode"},sD={fill:"none","stroke-miterlimit":10},ll=0,HS="http://www.w3.org/2000/xmlns/",it=mc.xmlns;class yx extends Qc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,s){return this._defs={},this._clearDefs(),t&&(this._svg=rt(t,0,"svg",it),this._svg.setAttributeNS(HS,"xmlns",it),this._svg.setAttributeNS(HS,"xmlns:xlink",mc["xmlns:xlink"]),this._svg.setAttribute("version",mc.version),this._svg.setAttribute("class","marks"),Un(t,1),this._root=rt(this._svg,ll,"g",it),ps(this._root,sD),Un(this._svg,ll+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,s)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(ps(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=rt(t,ll,"rect",it),ps(i,{width:this._width,height:this._height,fill:n}));const r=iD(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Un(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,s,o,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==s&&(s=r.marktype,o=Pn[s]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,GS(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,GS(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=Pn[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=VS(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Un(c,0),n._svg;c.setAttribute("class",jM(n));const f=eD(n);for(const g in f)Xt(c,g,f[g]);l||Xt(c,"pointer-events",u),Xt(c,"clip-path",n.clip?Xv(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=VS(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&OU(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):vi(n,p),Un(c,h),c}_update(t,n,i){Mr=n,Nt=n.__values__,ZM(Vl,i),t.attr(Vl,i,this);const r=NU[t.type];r&&r.call(this,t,n,i),Mr&&this.style(Mr,i)}style(t,n){if(n!=null){for(const i in hh){let r=i==="font"?Jc(n):n[i];if(r===Nt[i])continue;const s=hh[i];r==null?t.removeAttribute(s):(Hv(r)&&(r=mM(r,this._defs.gradient,oD())),t.setAttribute(s,r+"")),Nt[i]=r}for(const i in ph)Sd(t,ph[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=rt(t,ll+1,"defs",it)),r=MU(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=rt(t,ll+1,"defs",it)),r=DU(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Un(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function GS(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function MU(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=rt(e,n++,"pattern",it);ps(o,{id:nh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=rt(o,0,"rect",it),ps(o,{width:1,height:1,fill:`url(${oD()}#${t.id})`}),e=rt(e,n++,"radialGradient",it),ps(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=rt(e,n++,"linearGradient",it),ps(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=rt(e,i,"stop",it),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return Un(e,i),n}function DU(e,t,n){let i;return e=rt(e,n,"clipPath",it),e.setAttribute("id",t.id),t.path?(i=rt(e,0,"path",it),i.setAttribute("d",t.path)):(i=rt(e,0,"rect",it),ps(i,{x:0,y:0,width:t.width,height:t.height})),Un(e,1),n+1}function OU(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;vi(n,o=>{r=e.mark(t,o,r,i),++s}),Un(t,1+s)}function VS(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=hs(o,i,it),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=hs(o,"path",it);s.appendChild(a),a.__data__=e;const u=hs(o,"g",it);s.appendChild(u),u.__data__=e;const l=hs(o,"path",it);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||RU(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function RU(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Mr=null,Nt=null;const NU={group(e,t,n){const i=Mr=t.childNodes[2];Nt=i.__values__,e.foreground(Vl,n,this),Nt=t.__values__,Mr=t.childNodes[1],e.content(Vl,n,this);const r=Mr=t.childNodes[0];e.background(Vl,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Nt.events&&(Xt(i,"pointer-events",s),Xt(r,"pointer-events",s),Nt.events=s),n.strokeForeground&&n.stroke){const o=n.fill;Xt(i,"display",null),this.style(r,n),Xt(r,"stroke",null),o&&(n.fill=null),Nt=i.__values__,this.style(i,n),o&&(n.fill=o),Mr=null}else Xt(i,"display","none")},image(e,t,n){n.smooth===!1?(Sd(t,"image-rendering","optimizeSpeed"),Sd(t,"image-rendering","pixelated")):Sd(t,"image-rendering",null)},text(e,t,n){const i=Kc(n);let r,s,o,a;L(i)?(s=i.map(u=>Ms(n,u)),r=s.join(`
|
18
|
-
`),r!==Nt.text&&(Un(t,0),o=t.ownerDocument,a=Ts(n),s.forEach((u,l)=>{const c=hs(o,"tspan",it);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Nt.text=r)):(s=Ms(n,i),s!==Nt.text&&(t.textContent=s,Nt.text=s)),Xt(t,"font-family",Jc(n)),Xt(t,"font-size",ur(n)+"px"),Xt(t,"font-style",n.fontStyle),Xt(t,"font-variant",n.fontVariant),Xt(t,"font-weight",n.fontWeight)}};function Vl(e,t,n){t!==Nt[e]&&(n?LU(Mr,e,t,n):Xt(Mr,e,t),Nt[e]=t)}function Sd(e,t,n){n!==Nt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Nt[t]=n)}function ps(e,t){for(const n in t)Xt(e,n,t[n])}function Xt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function LU(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function oD(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class aD extends Qc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=mx();n.open("svg",ce({},mc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",sD,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Pn[n.marktype],r=i.tag,s=[ZM,i.attr];t.open("g",{class:jM(n),"clip-path":n.clip?Xv(this,n,n.group):null},eD(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Kc(a);if(L(l)){const c={x:0,dy:Ts(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Ms(a,l[f])).close()}else t.text(Ms(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),vi(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):vi(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&PU(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:nh+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const s in i){const o=i[s];t.open("clipPath",{id:s}),o.path?t.open("path",{d:o.path}).close():t.open("rect",{x:0,y:0,width:o.width,height:o.height}).close(),t.close()}t.close()}}}function PU(e,t,n,i,r){let s;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Jc(t),e["font-size"]=ur(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const o in hh){let a=t[o];const u=hh[o];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Hv(a)&&(a=mM(a,r.gradient,"")),e[u]=a)}for(const o in ph){const a=t[o];a!=null&&(s=s||[],s.push(`${ph[o]}: ${a};`))}return s&&(e.style=s.join(" ")),e}const ai={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function zU(e){ai.svgMarkTypes=e.svgMarkTypes??["text"],ai.svgOnTop=e.svgOnTop??!0,ai.debug=e.debug??!1}class _1 extends Qc{constructor(t){super(t),this._svgRenderer=new yx(t),this._canvasRenderer=new dh(t)}initialize(t,n,i,r,s){this._root_el=rt(t,0,"div");const o=rt(this._root_el,0,"div"),a=rt(this._root_el,1,"div");return this._root_el.style.position="relative",ai.debug||(o.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=ai.svgOnTop?a:o,this._canvasEl=ai.svgOnTop?o:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,s),this._svgRenderer.initialize(this._svgEl,n,i,r,s),super.initialize(t,n,i,r,s)}dirty(t){return ai.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(s=>!ai.svgMarkTypes.includes(s));this._svgRenderer.render(t,ai.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return ai.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class uD extends Zc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=rt(rt(t,0,"div"),ai.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const lD="canvas",cD="hybrid",fD="png",dD="svg",hD="none",gs={Canvas:lD,PNG:fD,SVG:dD,Hybrid:cD,None:hD},Lo={};Lo[lD]=Lo[fD]={renderer:dh,headless:dh,handler:Zc};Lo[dD]={renderer:yx,headless:aD,handler:YM};Lo[cD]={renderer:_1,headless:_1,handler:uD};Lo[hD]={};function rg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Lo[e]=t,this):Lo[e]}function pD(e,t,n){const i=[],r=new nt().union(t),s=e.marktype;return s?gD(e,r,n,i):s==="group"?mD(e,r,n,i):N("Intersect scene must be mark node or group item.")}function gD(e,t,n,i){if(IU(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a<o;++a)mD(r[a],t,n,i);else for(const u=Pn[s].isect;a<o;++a){const l=r[a];yD(l,t,u)&&i.push(l)}}return i}function IU(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function mD(e,t,n,i){n&&n(e.mark)&&yD(e,t,Pn.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const o=e.x||0,a=e.y||0;t.translate(-o,-a);for(let u=0;u<s;++u)gD(r[u],t,n,i);t.translate(o,a)}return i}function yD(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const qm=new nt;function bD(e){const t=e.clip;if(fe(t))t(Xc(qm.clear()));else if(t)qm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(qm)}const BU=1e-9;function bx(e,t,n){return e===t?!0:n==="path"?vD(e,t):e instanceof Date&&t instanceof Date?+e==+t:$e(e)&&$e(t)?Math.abs(e-t)<=BU:!e||!t||!X(e)&&!X(t)?e==t:UU(e,t)}function vD(e,t){return bx(iu(e),iu(t))}function UU(e,t){var n=Object.keys(e),i=Object.keys(t),r,s;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),s=n.length-1;s>=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!bx(e[r],t[r],r))return!1;return typeof e==typeof t}function jU(){SM(),d8()}const ou="top",ci="left",fi="right",Ds="bottom",qU="top-left",WU="top-right",HU="bottom-left",GU="bottom-right",vx="start",$1="middle",Yt="end",VU="x",XU="y",sg="group",xx="axis",wx="title",YU="frame",KU="scope",Ex="legend",xD="row-header",wD="row-footer",ED="row-title",SD="column-header",_D="column-footer",$D="column-title",JU="padding",QU="symbol",AD="fit",kD="fit-x",CD="fit-y",ZU="pad",Sx="none",Of="all",A1="each",_x="flush",ms="column",ys="row";function FD(e){D.call(this,null,e)}G(FD,D,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=Pn[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Rf(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===sg||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Rf(l,o))),i.role){case xx:case Ex:case wx:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Rf(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Rf(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return bD(i),t.modifies("bounds")}});function Rf(e,t,n){return t(e.bounds.clear(),e,n)}const XS=":vega_identifier:";function $x(e){D.call(this,0,e)}$x.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G($x,D,{transform(e,t){const n=ej(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function ej(e){return e._signals[XS]||(e._signals[XS]=e.add(0))}function TD(e){D.call(this,null,e)}G(TD,D,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,tj(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===sg?Kp:Yp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function tj(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function MD(e){D.call(this,null,e)}const YS={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!DD(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},DD=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),KS=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(DD(r,s=e[n].bounds,t))return!0},nj=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},ij=(e,t,n)=>{var i=e.range(),r=new nt;return t===ou||t===Ds?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},JS=e=>(e.forEach(t=>t.opacity=1),e),QS=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(MD,D,{transform(e,t){const n=YS[e.method]||YS.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(JS(r),t=QS(t,e)),t;if(r=r.filter(nj),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=JS(r),t=QS(t,e),s.length>=3&&KS(s,i)){do s=n(s,i);while(s.length>=3&&KS(s,i));s.length<3&&!xe(r).opacity&&(s.length>1&&(xe(s).opacity=0),xe(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=ij(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function OD(e){D.call(this,null,e)}G(OD,D,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Rt=new nt;function Ra(e,t,n){return e[t]===n?0:(e[t]=n,1)}function rj(e){var t=e.items[0].orient;return t===ci||t===fi}function sj(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function oj(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=sj(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&ax(p),b=0,v=0,x,E;switch(Rt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case ou:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),p&&Nf(e,p,E,g,y,0,-1,m);break;case ci:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),p&&Nf(e,p,E,g,y,1,-1,m);break;case fi:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),p&&Nf(e,p,E,g,y,1,1,m);break;case Ds:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),p&&Nf(e,p,E,g,0,0,1,m);break;default:b=r.x,v=r.y}return Hr(m.translate(b,v),r),Ra(r,"x",b+o)|Ra(r,"y",v+o)&&(r.bounds=Rt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Nf(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const ZS=(e,t)=>Math.floor(Math.min(e,t)),e_=(e,t)=>Math.ceil(Math.max(e,t));function aj(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],s=r.items,r.marktype===sg)switch(r.role){case xx:case Ex:case wx:break;case xD:o.rowheaders.push(...s);break;case wD:o.rowfooters.push(...s);break;case SD:o.colheaders.push(...s);break;case _D:o.colfooters.push(...s);break;case ED:o.rowtitle=s[0];break;case $D:o.coltitle=s[0];break;default:o.marks.push(...s)}return o}function uj(e){return new nt().set(0,0,e.width||0,e.height||0)}function lj(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function je(e,t,n){const i=X(e)?e[t]:e;return i??(n!==void 0?n:0)}function t_(e){return e<0?Math.ceil(-e):0}function RD(e,t,n){var i=!n.nodirty,r=n.bounds===_x?uj:lj,s=Rt.set(0,0,0,0),o=je(n.align,ms),a=je(n.align,ys),u=je(n.padding,ms),l=je(n.padding,ys),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),S,w,_,$,C,T,O,k,F,A,M;for(w=0;w<c;++w)p[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)T=t[w],C=E[w]=r(T),T.x=T.x||0,v[w]=0,T.y=T.y||0,x[w]=0,_=w%c,$=~~(w/c),g=Math.max(g,O=Math.ceil(C.x2)),b=Math.max(b,k=Math.ceil(C.y2)),p[_]=Math.max(p[_],O),y[$]=Math.max(y[$],k),h[w]=u+t_(C.x1),m[w]=l+t_(C.y1),i&&e.dirty(t[w]);for(w=0;w<d;++w)w%c===0&&(h[w]=0),w<c&&(m[w]=0);if(o===A1)for(_=1;_<c;++_){for(M=0,w=_;w<d;w+=c)M<h[w]&&(M=h[w]);for(w=_;w<d;w+=c)h[w]=M+p[_-1]}else if(o===Of){for(M=0,w=0;w<d;++w)w%c&&M<h[w]&&(M=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=M+g)}else for(o=!1,_=1;_<c;++_)for(w=_;w<d;w+=c)h[w]+=p[_-1];if(a===A1)for($=1;$<f;++$){for(M=0,w=$*c,S=w+c;w<S;++w)M<m[w]&&(M=m[w]);for(w=$*c;w<S;++w)m[w]=M+y[$-1]}else if(a===Of){for(M=0,w=c;w<d;++w)M<m[w]&&(M=m[w]);for(w=c;w<d;++w)m[w]=M+b}else for(a=!1,$=1;$<f;++$)for(w=$*c,S=w+c;w<S;++w)m[w]+=y[$-1];for(F=0,w=0;w<d;++w)F=h[w]+(w%c?F:0),v[w]+=F-t[w].x;for(_=0;_<c;++_)for(A=0,w=_;w<d;w+=c)A+=m[w],x[w]+=A-t[w].y;if(o&&je(n.center,ms)&&f>1)for(w=0;w<d;++w)C=o===Of?g:p[w%c],F=C-E[w].x2-t[w].x-v[w],F>0&&(v[w]+=F/2);if(a&&je(n.center,ys)&&c!==1)for(w=0;w<d;++w)C=a===Of?b:y[~~(w/c)],A=C-E[w].y2-t[w].y-x[w],A>0&&(x[w]+=A/2);for(w=0;w<d;++w)s.union(E[w].translate(v[w],x[w]));switch(F=je(n.anchor,VU),A=je(n.anchor,XU),je(n.anchor,ms)){case Yt:F-=s.width();break;case $1:F-=s.width()/2}switch(je(n.anchor,ys)){case Yt:A-=s.height();break;case $1:A-=s.height()/2}for(F=Math.round(F),A=Math.round(A),s.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)T=t[w],T.x+=v[w]+=F,T.y+=x[w]+=A,s.union(T.mark.bounds.union(T.bounds.translate(v[w],x[w]))),i&&e.dirty(T);return s}function cj(e,t,n){var i=aj(t),r=i.marks,s=n.bounds===_x?fj:dj,o=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,p,g,m;const y=RD(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=je(n.headerBand,ys,null),c=Lf(e,i.rowheaders,r,a,u,-je(o,"rowHeader"),ZS,0,s,"x1",0,a,1,g)),i.colheaders&&(g=je(n.headerBand,ms,null),f=Lf(e,i.colheaders,r,a,a,-je(o,"columnHeader"),ZS,1,s,"y1",0,1,a,g)),i.rowfooters&&(g=je(n.footerBand,ys,null),d=Lf(e,i.rowfooters,r,a,u,je(o,"rowFooter"),e_,0,s,"x2",a-1,a,1,g)),i.colfooters&&(g=je(n.footerBand,ms,null),h=Lf(e,i.colfooters,r,a,a,je(o,"columnFooter"),e_,1,s,"y2",l-a,1,a,g)),i.rowtitle&&(p=je(n.titleAnchor,ys),m=je(o,"rowTitle"),m=p===Yt?d+m:c-m,g=je(n.titleBand,ys,.5),n_(e,i.rowtitle,m,0,y,g)),i.coltitle&&(p=je(n.titleAnchor,ms),m=je(o,"columnTitle"),m=p===Yt?h+m:f-m,g=je(n.titleBand,ms,.5),n_(e,i.coltitle,m,1,y,g))}function fj(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function dj(e,t){return e.bounds[t]}function Lf(e,t,n,i,r,s,o,a,u,l,c,f,d,h){var p=n.length,g=0,m=0,y,b,v,x,E,S,w,_,$;if(!p)return g;for(y=c;y<p;y+=f)n[y]&&(g=o(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(S=t[b],E=S.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(_=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),$=g):(_=g,$=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(S.bounds.translate(_-(S.x||0),$-(S.y||0))),S.x=_,S.y=$,e.dirty(S),m=o(m,E[l])}return m}function n_(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function hj(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function pj(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function gj(e,t,n,i,r,s,o){const a=hj(n,t),u=pj(e,a("offset",0)),l=a("anchor",vx),c=l===Yt?1:l===$1?.5:0,f={align:A1,bounds:a("bounds",_x),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case ci:f.anchor={x:Math.floor(i.x1)-u,column:Yt,y:c*(o||i.height()+2*i.y1),row:l};break;case fi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case ou:f.anchor={y:Math.floor(r.y1)-u,row:Yt,x:c*(s||r.width()+2*r.x1),column:l};break;case Ds:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case qU:f.anchor={x:u,y:u};break;case WU:f.anchor={x:s-u,y:u,column:Yt};break;case HU:f.anchor={x:u,y:o-u,row:Yt};break;case GU:f.anchor={x:s-u,y:o-u,column:Yt,row:Yt};break}return f}function mj(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),bj(e,n,n.items[0].items[0]),s=yj(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===QU&&vj(n.items[0].items[0].items[0].items),r!==Sx&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,Hr(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function yj(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function bj(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&cl(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case ci:r+=Math.ceil(o.bounds.width())+u;break;case fi:case Ds:break;default:s+=o.bounds.height()+u}switch((r||s)&&cl(e,n,r,s),o.orient){case ci:c+=va(t,n,o,a,1,1);break;case fi:l+=va(t,n,o,Yt,0,0)+u,c+=va(t,n,o,a,1,1);break;case Ds:l+=va(t,n,o,a,0,0),c+=va(t,n,o,Yt,-1,0,1)+u;break;default:l+=va(t,n,o,a,0,0)}(l||c)&&cl(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(cl(e,n,-l,0),cl(e,o,-l,0))}}function va(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:ax(n);return Math.round(i===vx?f:i===Yt?d-h:.5*(c-h))}function cl(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function vj(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function xj(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===ci||a===fi?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==sg?a===ci?(p=r.y2,h=r.y1):a===fi?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===ci&&(p=i,h=0),v=u===vx?p:u===Yt?h:(p+h)/2,d&&d.text){switch(a){case ou:case Ds:b=f.bounds.height()+c;break;case ci:y=f.bounds.width()+c;break;case fi:y=-f.bounds.width()-c;break}Rt.clear().union(d.bounds),Rt.translate(y-(d.x||0),b-(d.y||0)),Ra(d,"x",y)|Ra(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Rt),d.mark.bounds.clear().union(Rt),e.dirty(d)),Rt.clear().union(d.bounds)}else Rt.clear();switch(Rt.union(f.bounds),a){case ou:g=v,m=r.y1-Rt.height()-l;break;case ci:g=r.x1-Rt.width()-l,m=v;break;case fi:g=r.x2+Rt.width()+l,m=v;break;case Ds:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return Ra(s,"x",g)|Ra(s,"y",m)&&(Rt.translate(g,m),e.dirty(s),s.bounds.clear().union(Rt),t.bounds.clear().union(Rt),e.dirty(s)),s.bounds}function ND(e){D.call(this,null,e)}G(ND,D,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&cj(n,i,e.layout),Ej(n,i,e)}),wj(e.mark.group)?t.reflow():t}});function wj(e){return e&&e.mark.role!=="legend-entry"}function Ej(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new nt().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p<g;++p)switch(f=i[p],f.role){case xx:h=rj(f)?a:u,h.union(oj(e,f,r,s));break;case wx:c=f;break;case Ex:l.push(mj(e,f));break;case YU:case KU:case xD:case wD:case ED:case SD:case _D:case $D:a.union(f.bounds),u.union(f.bounds);break;default:o.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||fi,d!==Sx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];RD(e,b,gj(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===AD||n.autosize.type===kD||n.autosize.type===CD))switch(y.orient){case ci:case fi:o.add(b.x1,0).add(b.x2,0);break;case ou:case Ds:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(xj(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),Sj(e,t,o,n)}function Sj(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===JU){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===Sx?(l=0,f=0,u=o,c=a):s===AD?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===kD?(u=Math.max(0,o-l-d),a=c+f+h):s===CD?(o=u+l+d,c=Math.max(0,a-f-h)):s===ZU&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const _j=Object.freeze(Object.defineProperty({__proto__:null,bound:FD,identifier:$x,mark:TD,overlap:MD,render:OD,viewlayout:ND},Symbol.toStringTag,{value:"Module"}));function LD(e){D.call(this,null,e)}G(LD,D,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=qv(s,o,e.minstep),u=e.format||lM(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?uM(s,e.values,a):Wv(s,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function PD(e){D.call(this,null,e)}function $j(){return Ce({})}function Aj(e){const t=Mu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(PD,D,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||$j,s=e.key||re,o=this.value;return L(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&N("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=Aj(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function zD(e){D.call(this,null,e)}G(zD,D,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(L(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||ns,u=r.enter||ns,l=r.exit||ns,c=(s&&!o?r[s]:a)||ns;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==ns&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ns&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==ns){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function ID(e){D.call(this,[],e)}G(ID,D,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||gd,o=e.scale,a=+e.limit,u=qv(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===gd,c=e.format||hM(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||dM(o,u),d,h,p,g,m;return r&&(i.rem=r),s===gd?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,fe(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=Ht(g=p||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===Z7?(d=o.domain(),h=sM(o,d[0],xe(d)),f.length<3&&!e.values&&d[0]!==xe(d)&&(f=[d[0],xe(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=c8(o),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const kj=e=>e.source.x,Cj=e=>e.source.y,Fj=e=>e.target.x,Tj=e=>e.target.y;function Ax(e){D.call(this,{},e)}Ax.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};G(Ax,D,{transform(e,t){var n=e.sourceX||kj,i=e.sourceY||Cj,r=e.targetX||Fj,s=e.targetY||Tj,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=i_.get(u+"-"+a)||i_.get(u);return l||N("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const BD=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,Mj=(e,t,n,i)=>BD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),UD=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},Dj=(e,t,n,i)=>UD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),jD=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},Oj=(e,t,n,i)=>jD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),Rj=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Nj=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,Lj=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},Pj=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},zj=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},Ij=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a},i_=Mu({line:BD,"line-radial":Mj,arc:UD,"arc-radial":Dj,curve:jD,"curve-radial":Oj,"orthogonal-horizontal":Rj,"orthogonal-vertical":Nj,"orthogonal-radial":Lj,"diagonal-horizontal":Pj,"diagonal-vertical":zj,"diagonal-radial":Ij});function kx(e){D.call(this,null,e)}kx.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};G(kx,D,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||Cu,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/_C(l),h=Fn(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)m=l[h[p]],g=u[h[p]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const Bj=5;function Uj(e){const t=e.type;return!e.bins&&(t===eu||t===Uc||t===jc)}function qD(e){return Bv(e)&&e!==Xi}const jj=yi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function WD(e){D.call(this,null,e),this.modified(!0)}G(WD,D,{transform(e,t){var n=t.dataflow,i=this.value,r=qj(e);(!i||r!==i.type)&&(this.value=i=ke(r)());for(r in e)if(!jj[r]){if(r==="padding"&&qD(i.type))continue;fe(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return Yj(i,e,Xj(i,e,Hj(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function qj(e){var t=e.type,n="",i;return t===Xi?Xi+"-"+eu:(Wj(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Xi+"-":i===3?Pu+"-":""),(n+t||eu).toLowerCase())}function Wj(e){const t=e.type;return Bv(t)&&t!==Ro&&t!==No&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function Hj(e,t,n){const i=Gj(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&Uj(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return qD(s)&&t.padding&&r[0]!==xe(r)&&(r=Vj(s,r,t.range,t.padding,t.exponent,t.constant)),e.domain(HD(s,r,n)),s===Lv&&e.unknown(t.domainImplicit?c1:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&qv(e,t.nice)||null),r.length}function Gj(e,t,n){return t?(e.domain(HD(e.type,t,n)),t.length):-1}function Vj(e,t,n,i,r,s){var o=Math.abs(xe(n)-n[0]),a=o/(o-2*i),u=e===Ur?ub(t,null,a):e===jc?jd(t,null,a,.5):e===Uc?jd(t,null,a,r||1):e===Wp?lb(t,null,a,s||1):ab(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function HD(e,t,n){if(eM(e)){var i=Math.abs(t.reduce((r,s)=>r+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function Xj(e,t,n){let i=t.bins;if(i&&!L(i)){const r=e.domain(),s=r[0],o=xe(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||N("Scale bins parameter missing step property."),u<s&&(u=a*Math.ceil(s/a)),l>o&&(l=a*Math.floor(o/a)),i=Fn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Pv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function Yj(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=Kj(i,t,n);else if(t.scheme&&(s=Jj(i,t,n),fe(s))){if(e.interpolator)return e.interpolator(s);N(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&tM(i))return e.interpolator(Vp(k1(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Uv(t.interpolate,t.interpolateGamma)):fe(e.round)?e.round(r):fe(e.rangeRound)&&e.interpolate(r?dp:Nc),s&&e.range(k1(s,t.reverse))}function Kj(e,t,n){e!==XT&&e!==d1&&N("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===d1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Nv(n,r,i)]}function Jj(e,t,n){var i=t.schemeExtent,r,s;return L(t.scheme)?s=Vp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=jv(r),s||N(`Unrecognized scheme name: ${t.scheme}`)),n=e===Gp?n+1:e===Pv?n-1:e===tu||e===Hp?+t.schemeCount||Bj:n,tM(e)?r_(s,i,t.reverse):fe(s)?rM(r_(s,i),n):e===Lv?s:s.slice(0,n)}function r_(e,t,n){return fe(e)&&(t||n)?iM(e,k1(t||[0,1],n)):e}function k1(e,t){return t?e.slice().reverse():e}function GD(e){D.call(this,null,e)}G(GD,D,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ea(e.sort)),this.modified(n),t}});const s_="zero",VD="center",XD="normalize",YD=["y0","y1"];function Cx(e){D.call(this,null,e)}Cx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:s_,values:[s_,VD,XD]},{name:"as",type:"string",array:!0,length:2,default:YD}]};G(Cx,D,{transform(e,t){var n=e.as||YD,i=n[0],r=n[1],s=ea(e.sort),o=e.field||Cu,a=e.offset===VD?Qj:e.offset===XD?Zj:eq,u,l,c,f;for(u=tq(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,o,i,r);return t.reflow(e.modified()).modifies(n)}});function Qj(e,t,n,i,r){for(var s=(t-e.sum)/2,o=e.length,a=0,u;a<o;++a)u=e[a],u[i]=s,u[r]=s+=Math.abs(n(u))}function Zj(e,t,n,i,r){for(var s=1/e.sum,o=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=o,c[r]=o=s*(l+=Math.abs(n(c)))}function eq(e,t,n,i,r){for(var s=0,o=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=o,c[r]=o+=l):(c[i]=s,c[r]=s+=l)}function tq(e,t,n,i){var r=[],s=g=>g(c),o,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(s),d=o[f],d||(o[f]=d=[],r.push(d)),d.push(c);for(f=0,p=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return r.max=p,r}const nq=Object.freeze(Object.defineProperty({__proto__:null,axisticks:LD,datajoin:PD,encode:zD,legendentries:ID,linkpath:Ax,pie:kx,scale:WD,sortitems:GD,stack:Cx},Symbol.toStringTag,{value:"Module"}));var oe=1e-6,gh=1e-12,me=Math.PI,Ye=me/2,mh=me/4,sn=me*2,Qe=180/me,pe=me/180,ve=Math.abs,Iu=Math.atan,Qn=Math.atan2,ae=Math.cos,Pf=Math.ceil,KD=Math.exp,C1=Math.hypot,yh=Math.log,Wm=Math.pow,se=Math.sin,Wn=Math.sign||function(e){return e>0?1:e<0?-1:0},on=Math.sqrt,Fx=Math.tan;function JD(e){return e>1?0:e<-1?me:Math.acos(e)}function bn(e){return e>1?Ye:e<-1?-Ye:Math.asin(e)}function _t(){}function bh(e,t){e&&a_.hasOwnProperty(e.type)&&a_[e.type](e,t)}var o_={Feature:function(e,t){bh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)bh(n[i].geometry,t)}},a_={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,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){F1(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)F1(n[i],t,0)},Polygon:function(e,t){u_(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)u_(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)bh(n[i],t)}};function F1(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function u_(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)F1(e[n],t,1);t.polygonEnd()}function $r(e,t){e&&o_.hasOwnProperty(e.type)?o_[e.type](e,t):bh(e,t)}var vh=new nn,xh=new nn,QD,ZD,T1,M1,D1,tr={point:_t,lineStart:_t,lineEnd:_t,polygonStart:function(){vh=new nn,tr.lineStart=iq,tr.lineEnd=rq},polygonEnd:function(){var e=+vh;xh.add(e<0?sn+e:e),this.lineStart=this.lineEnd=this.point=_t},sphere:function(){xh.add(sn)}};function iq(){tr.point=sq}function rq(){e3(QD,ZD)}function sq(e,t){tr.point=e3,QD=e,ZD=t,e*=pe,t*=pe,T1=e,M1=ae(t=t/2+mh),D1=se(t)}function e3(e,t){e*=pe,t*=pe,t=t/2+mh;var n=e-T1,i=n>=0?1:-1,r=i*n,s=ae(t),o=se(t),a=D1*o,u=M1*s+a*ae(r),l=a*i*se(r);vh.add(Qn(l,u)),T1=e,M1=s,D1=o}function oq(e){return xh=new nn,$r(e,tr),xh*2}function wh(e){return[Qn(e[1],e[0]),bn(e[2])]}function Po(e){var t=e[0],n=e[1],i=ae(n);return[i*ae(t),i*se(t),se(n)]}function zf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function au(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 Hm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function If(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Eh(e){var t=on(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,dn,Ve,An,go,t3,n3,Ba,Xl,as,jr,Sr={point:O1,lineStart:l_,lineEnd:c_,polygonStart:function(){Sr.point=r3,Sr.lineStart=aq,Sr.lineEnd=uq,Xl=new nn,tr.polygonStart()},polygonEnd:function(){tr.polygonEnd(),Sr.point=O1,Sr.lineStart=l_,Sr.lineEnd=c_,vh<0?(He=-(Ve=180),dn=-(An=90)):Xl>oe?An=90:Xl<-oe&&(dn=-90),jr[0]=He,jr[1]=Ve},sphere:function(){He=-(Ve=180),dn=-(An=90)}};function O1(e,t){as.push(jr=[He=e,Ve=e]),t<dn&&(dn=t),t>An&&(An=t)}function i3(e,t){var n=Po([e*pe,t*pe]);if(Ba){var i=au(Ba,n),r=[i[1],-i[0],0],s=au(r,i);Eh(s),s=wh(s);var o=e-go,a=o>0?1:-1,u=s[0]*Qe*a,l,c=ve(o)>180;c^(a*go<u&&u<a*e)?(l=s[1]*Qe,l>An&&(An=l)):(u=(u+360)%360-180,c^(a*go<u&&u<a*e)?(l=-s[1]*Qe,l<dn&&(dn=l)):(t<dn&&(dn=t),t>An&&(An=t))),c?e<go?$n(He,e)>$n(He,Ve)&&(Ve=e):$n(e,Ve)>$n(He,Ve)&&(He=e):Ve>=He?(e<He&&(He=e),e>Ve&&(Ve=e)):e>go?$n(He,e)>$n(He,Ve)&&(Ve=e):$n(e,Ve)>$n(He,Ve)&&(He=e)}else as.push(jr=[He=e,Ve=e]);t<dn&&(dn=t),t>An&&(An=t),Ba=n,go=e}function l_(){Sr.point=i3}function c_(){jr[0]=He,jr[1]=Ve,Sr.point=O1,Ba=null}function r3(e,t){if(Ba){var n=e-go;Xl.add(ve(n)>180?n+(n>0?360:-360):n)}else t3=e,n3=t;tr.point(e,t),i3(e,t)}function aq(){tr.lineStart()}function uq(){r3(t3,n3),tr.lineEnd(),ve(Xl)>oe&&(He=-(Ve=180)),jr[0]=He,jr[1]=Ve,Ba=null}function $n(e,t){return(t-=e)<0?t+360:t}function lq(e,t){return e[0]-t[0]}function f_(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function cq(e){var t,n,i,r,s,o,a;if(An=Ve=-(He=dn=1/0),as=[],$r(e,Sr),n=as.length){for(as.sort(lq),t=1,i=as[0],s=[i];t<n;++t)r=as[t],f_(i,r[0])||f_(i,r[1])?($n(i[0],r[1])>$n(i[0],i[1])&&(i[1]=r[1]),$n(r[0],i[1])>$n(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=$n(i[1],r[0]))>o&&(o=a,He=r[0],Ve=i[1])}return as=jr=null,He===1/0||dn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,dn],[Ve,An]]}var Dl,Sh,_h,$h,Ah,kh,Ch,Fh,R1,N1,L1,s3,o3,Kt,Jt,Qt,di={sphere:_t,point:Tx,lineStart:d_,lineEnd:h_,polygonStart:function(){di.lineStart=hq,di.lineEnd=pq},polygonEnd:function(){di.lineStart=d_,di.lineEnd=h_}};function Tx(e,t){e*=pe,t*=pe;var n=ae(t);ef(n*ae(e),n*se(e),se(t))}function ef(e,t,n){++Dl,_h+=(e-_h)/Dl,$h+=(t-$h)/Dl,Ah+=(n-Ah)/Dl}function d_(){di.point=fq}function fq(e,t){e*=pe,t*=pe;var n=ae(t);Kt=n*ae(e),Jt=n*se(e),Qt=se(t),di.point=dq,ef(Kt,Jt,Qt)}function dq(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Qn(on((o=Jt*s-Qt*r)*o+(o=Qt*i-Kt*s)*o+(o=Kt*r-Jt*i)*o),Kt*i+Jt*r+Qt*s);Sh+=o,kh+=o*(Kt+(Kt=i)),Ch+=o*(Jt+(Jt=r)),Fh+=o*(Qt+(Qt=s)),ef(Kt,Jt,Qt)}function h_(){di.point=Tx}function hq(){di.point=gq}function pq(){a3(s3,o3),di.point=Tx}function gq(e,t){s3=e,o3=t,e*=pe,t*=pe,di.point=a3;var n=ae(t);Kt=n*ae(e),Jt=n*se(e),Qt=se(t),ef(Kt,Jt,Qt)}function a3(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Jt*s-Qt*r,a=Qt*i-Kt*s,u=Kt*r-Jt*i,l=C1(o,a,u),c=bn(l),f=l&&-c/l;R1.add(f*o),N1.add(f*a),L1.add(f*u),Sh+=c,kh+=c*(Kt+(Kt=i)),Ch+=c*(Jt+(Jt=r)),Fh+=c*(Qt+(Qt=s)),ef(Kt,Jt,Qt)}function mq(e){Dl=Sh=_h=$h=Ah=kh=Ch=Fh=0,R1=new nn,N1=new nn,L1=new nn,$r(e,di);var t=+R1,n=+N1,i=+L1,r=C1(t,n,i);return r<gh&&(t=kh,n=Ch,i=Fh,Sh<oe&&(t=_h,n=$h,i=Ah),r=C1(t,n,i),r<gh)?[NaN,NaN]:[Qn(n,t)*Qe,bn(i/r)*Qe]}function P1(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function z1(e,t){return ve(e)>me&&(e-=Math.round(e/sn)*sn),[e,t]}z1.invert=z1;function u3(e,t,n){return(e%=sn)?t||n?P1(g_(e),m_(t,n)):g_(e):t||n?m_(t,n):z1}function p_(e){return function(t,n){return t+=e,ve(t)>me&&(t-=Math.round(t/sn)*sn),[t,n]}}function g_(e){var t=p_(e);return t.invert=p_(-e),t}function m_(e,t){var n=ae(e),i=se(e),r=ae(t),s=se(t);function o(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*n+c*i;return[Qn(f*r-h*s,c*n-d*i),bn(h*r+f*s)]}return o.invert=function(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*r-f*s;return[Qn(f*r+d*s,c*n+h*i),bn(h*n-c*i)]},o}function yq(e){e=u3(e[0]*pe,e[1]*pe,e.length>2?e[2]*pe:0);function t(n){return n=e(n[0]*pe,n[1]*pe),n[0]*=Qe,n[1]*=Qe,n}return t.invert=function(n){return n=e.invert(n[0]*pe,n[1]*pe),n[0]*=Qe,n[1]*=Qe,n},t}function bq(e,t,n,i,r,s){if(n){var o=ae(t),a=se(t),u=i*n;r==null?(r=t+i*sn,s=t-u/2):(r=y_(o,r),s=y_(o,s),(i>0?r<s:r>s)&&(r+=i*sn));for(var l,c=r;i>0?c>s:c<s;c-=u)l=wh([o,-a*ae(c),-a*se(c)]),e.point(l[0],l[1])}}function y_(e,t){t=Po(t),t[0]-=e,Eh(t);var n=JD(-t[1]);return((-t[2]<0?-n:n)+sn-oe)%sn}function l3(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:_t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function _d(e,t){return ve(e[0]-t[0])<oe&&ve(e[1]-t[1])<oe}function Bf(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function c3(e,t,n,i,r){var s=[],o=[],a,u;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(_d(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<g;++a)r.point((m=p[a])[0],m[1]);r.lineEnd();return}y[0]+=2*oe}s.push(b=new Bf(m,p,null,!0)),o.push(b.o=new Bf(m,null,b,!1)),s.push(b=new Bf(y,p,null,!1)),o.push(b.o=new Bf(y,null,b,!0))}}),!!s.length){for(o.sort(t),b_(s),b_(o),a=0,u=o.length;a<u;++a)o[a].e=n=!n;for(var l=s[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function b_(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Gm(e){return ve(e[0])<=me?e[0]:Wn(e[0])*((ve(e[0])+me)%sn-me)}function vq(e,t){var n=Gm(t),i=t[1],r=se(i),s=[se(n),-ae(n),0],o=0,a=0,u=new nn;r===1?i=Ye+oe:r===-1&&(i=-Ye-oe);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=Gm(h),g=h[1]/2+mh,m=se(g),y=ae(g),b=0;b<d;++b,p=x,m=S,y=w,h=v){var v=f[b],x=Gm(v),E=v[1]/2+mh,S=se(E),w=ae(E),_=x-p,$=_>=0?1:-1,C=$*_,T=C>me,O=m*S;if(u.add(Qn(O*$*se(C),y*w+O*ae(C))),o+=T?_+$*sn:_,T^p>=n^x>=n){var k=au(Po(h),Po(v));Eh(k);var F=au(s,k);Eh(F);var A=(T^_>=0?-1:1)*bn(F[2]);(i>A||i===A&&(k[0]||k[1]))&&(a+=T^_>=0?1:-1)}}return(o<-oe||o<oe&&u<-gh)^a&1}function f3(e,t,n,i){return function(r){var s=t(r),o=l3(),a=t(o),u=!1,l,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=SC(c);var x=vq(l,i);c.length?(u||(r.polygonStart(),u=!0),c3(c,wq,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,E){e(x,E)&&r.point(x,E)}function p(x,E){s.point(x,E)}function g(){d.point=p,s.lineStart()}function m(){d.point=h,s.lineEnd()}function y(x,E){f.push([x,E]),a.point(x,E)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),E=o.result(),S,w=E.length,_,$,C;if(f.pop(),l.push(f),f=null,!!w){if(x&1){if($=E[0],(_=$.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),S=0;S<_;++S)r.point((C=$[S])[0],C[1]);r.lineEnd()}return}w>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter(xq))}}return d}}function xq(e){return e.length>1}function wq(e,t){return((e=e.x)[0]<0?e[1]-Ye-oe:Ye-e[1])-((t=t.x)[0]<0?t[1]-Ye-oe:Ye-t[1])}const v_=f3(function(){return!0},Eq,_q,[-me,-Ye]);function Eq(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?me:-me,u=ve(s-t);ve(u-me)<oe?(e.point(t,n=(n+o)/2>0?Ye:-Ye),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=me&&(ve(t-i)<oe&&(t-=i*oe),ve(s-a)<oe&&(s-=a*oe),n=Sq(t,n,s,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=s,n=o),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Sq(e,t,n,i){var r,s,o=se(e-n);return ve(o)>oe?Iu((se(t)*(s=ae(i))*se(n)-se(i)*(r=ae(t))*se(e))/(r*s*o)):(t+i)/2}function _q(e,t,n,i){var r;if(e==null)r=n*Ye,i.point(-me,r),i.point(0,r),i.point(me,r),i.point(me,0),i.point(me,-r),i.point(0,-r),i.point(-me,-r),i.point(-me,0),i.point(-me,r);else if(ve(e[0]-t[0])>oe){var s=e[0]<t[0]?me:-me;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function $q(e){var t=ae(e),n=2*pe,i=t>0,r=ve(t)>oe;function s(c,f,d,h){bq(h,e,n,d,c,f)}function o(c,f){return ae(c)*ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),E=i?x?0:l(m,y):x?l(m+(m<0?me:-me),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||_d(f,v)||_d(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var S;!(E&d)&&(S=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!f||!_d(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Po(c),p=Po(f),g=[1,0,0],m=au(h,p),y=zf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,S=au(g,m),w=If(g,x),_=If(m,E);Hm(w,_);var $=S,C=zf(w,$),T=zf($,$),O=C*C-T*(zf(w,w)-1);if(!(O<0)){var k=on(O),F=If($,(-C-k)/T);if(Hm(F,w),F=wh(F),!d)return F;var A=c[0],M=f[0],P=c[1],z=f[1],U;M<A&&(U=A,A=M,M=U);var te=M-A,ne=ve(te-me)<oe,de=ne||te<oe;if(!ne&&z<P&&(U=P,P=z,z=U),de?ne?P+z>0^F[1]<(ve(F[0]-A)<oe?P:z):P<=F[1]&&F[1]<=z:te>me^(A<=F[0]&&F[0]<=M)){var Se=If($,(-C+k)/T);return Hm(Se,w),[F,wh(Se)]}}}function l(c,f){var d=i?e:me-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return f3(o,a,s,i?[0,-e]:[-me,e-me])}function Aq(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=i-a,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var Ol=1e9,Uf=-Ol;function d3(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(l,c){return ve(l[0]-e)<oe?c>0?0:3:ve(l[0]-n)<oe?c>0?2:1:ve(l[1]-t)<oe?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=l3(),d,h,p,g,m,y,b,v,x,E,S,w={point:_,lineStart:O,lineEnd:k,polygonStart:C,polygonEnd:T};function _(A,M){r(A,M)&&c.point(A,M)}function $(){for(var A=0,M=0,P=h.length;M<P;++M)for(var z=h[M],U=1,te=z.length,ne=z[0],de,Se,we=ne[0],Pe=ne[1];U<te;++U)de=we,Se=Pe,ne=z[U],we=ne[0],Pe=ne[1],Se<=i?Pe>i&&(we-de)*(i-Se)>(Pe-Se)*(e-de)&&++A:Pe<=i&&(we-de)*(i-Se)<(Pe-Se)*(e-de)&&--A;return A}function C(){c=f,d=[],h=[],S=!0}function T(){var A=$(),M=S&&A,P=(d=SC(d)).length;(M||P)&&(l.polygonStart(),M&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),P&&c3(d,a,A,s,l),l.polygonEnd()),c=l,d=h=p=null}function O(){w.point=F,h&&h.push(p=[]),E=!0,x=!1,b=v=NaN}function k(){d&&(F(g,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=_,x&&c.lineEnd()}function F(A,M){var P=r(A,M);if(h&&p.push([A,M]),E)g=A,m=M,y=P,E=!1,P&&(c.lineStart(),c.point(A,M));else if(P&&x)c.point(A,M);else{var z=[b=Math.max(Uf,Math.min(Ol,b)),v=Math.max(Uf,Math.min(Ol,v))],U=[A=Math.max(Uf,Math.min(Ol,A)),M=Math.max(Uf,Math.min(Ol,M))];Aq(z,U,e,t,n,i)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(U[0],U[1]),P||c.lineEnd(),S=!1):P&&(c.lineStart(),c.point(A,M),S=!1)}b=A,v=M,x=P}return w}}function x_(e,t,n){var i=Fn(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function w_(e,t,n){var i=Fn(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function kq(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Fn(Pf(i/c)*c,n,c).map(p).concat(Fn(Pf(a/f)*f,o,f).map(g)).concat(Fn(Pf(t/u)*u,e,u).filter(function(v){return ve(v%c)>oe}).map(d)).concat(Fn(Pf(s/l)*l,r,l).filter(function(v){return ve(v%f)>oe}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=x_(s,r,90),h=w_(t,e,m),p=x_(a,o,90),g=w_(i,n,m),y):m},y.extentMajor([[-180,-90+oe],[180,90-oe]]).extentMinor([[-180,-80-oe],[180,80+oe]])}const yc=e=>e;var Vm=new nn,I1=new nn,h3,p3,B1,U1,Ar={point:_t,lineStart:_t,lineEnd:_t,polygonStart:function(){Ar.lineStart=Cq,Ar.lineEnd=Tq},polygonEnd:function(){Ar.lineStart=Ar.lineEnd=Ar.point=_t,Vm.add(ve(I1)),I1=new nn},result:function(){var e=Vm/2;return Vm=new nn,e}};function Cq(){Ar.point=Fq}function Fq(e,t){Ar.point=g3,h3=B1=e,p3=U1=t}function g3(e,t){I1.add(U1*e-B1*t),B1=e,U1=t}function Tq(){g3(h3,p3)}var uu=1/0,Th=uu,bc=-uu,Mh=bc,Dh={point:Mq,lineStart:_t,lineEnd:_t,polygonStart:_t,polygonEnd:_t,result:function(){var e=[[uu,Th],[bc,Mh]];return bc=Mh=-(Th=uu=1/0),e}};function Mq(e,t){e<uu&&(uu=e),e>bc&&(bc=e),t<Th&&(Th=t),t>Mh&&(Mh=t)}var j1=0,q1=0,Rl=0,Oh=0,Rh=0,Na=0,W1=0,H1=0,Nl=0,m3,y3,qi,Wi,jn={point:zo,lineStart:E_,lineEnd:S_,polygonStart:function(){jn.lineStart=Rq,jn.lineEnd=Nq},polygonEnd:function(){jn.point=zo,jn.lineStart=E_,jn.lineEnd=S_},result:function(){var e=Nl?[W1/Nl,H1/Nl]:Na?[Oh/Na,Rh/Na]:Rl?[j1/Rl,q1/Rl]:[NaN,NaN];return j1=q1=Rl=Oh=Rh=Na=W1=H1=Nl=0,e}};function zo(e,t){j1+=e,q1+=t,++Rl}function E_(){jn.point=Dq}function Dq(e,t){jn.point=Oq,zo(qi=e,Wi=t)}function Oq(e,t){var n=e-qi,i=t-Wi,r=on(n*n+i*i);Oh+=r*(qi+e)/2,Rh+=r*(Wi+t)/2,Na+=r,zo(qi=e,Wi=t)}function S_(){jn.point=zo}function Rq(){jn.point=Lq}function Nq(){b3(m3,y3)}function Lq(e,t){jn.point=b3,zo(m3=qi=e,y3=Wi=t)}function b3(e,t){var n=e-qi,i=t-Wi,r=on(n*n+i*i);Oh+=r*(qi+e)/2,Rh+=r*(Wi+t)/2,Na+=r,r=Wi*e-qi*t,W1+=r*(qi+e),H1+=r*(Wi+t),Nl+=r*3,zo(qi=e,Wi=t)}function v3(e){this._context=e}v3.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,sn);break}}},result:_t};var G1=new nn,Xm,x3,w3,Ll,Pl,vc={point:_t,lineStart:function(){vc.point=Pq},lineEnd:function(){Xm&&E3(x3,w3),vc.point=_t},polygonStart:function(){Xm=!0},polygonEnd:function(){Xm=null},result:function(){var e=+G1;return G1=new nn,e}};function Pq(e,t){vc.point=E3,x3=Ll=e,w3=Pl=t}function E3(e,t){Ll-=e,Pl-=t,G1.add(on(Ll*Ll+Pl*Pl)),Ll=e,Pl=t}let __,Nh,$_,A_;class k_{constructor(t){this._append=t==null?S3:zq(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!==$_||this._append!==Nh){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,$_=i,Nh=this._append,A_=this._,this._=r}this._+=A_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function S3(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zq(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return S3;if(t!==__){const n=10**t;__=t,Nh=function(r){let s=1;this._+=r[0];for(const o=r.length;s<o;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return Nh}function _3(e,t){let n=3,i=4.5,r,s;function o(a){return a&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),$r(a,r(s))),s.result()}return o.area=function(a){return $r(a,r(Ar)),Ar.result()},o.measure=function(a){return $r(a,r(vc)),vc.result()},o.bounds=function(a){return $r(a,r(Dh)),Dh.result()},o.centroid=function(a){return $r(a,r(jn)),jn.result()},o.projection=function(a){return arguments.length?(r=a==null?(e=null,yc):(e=a).stream,o):e},o.context=function(a){return arguments.length?(s=a==null?(t=null,new k_(n)):new v3(t=a),typeof i!="function"&&s.pointRadius(i),o):t},o.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(s.pointRadius(+a),+a),o):i},o.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new k_(n)),o},o.projection(e).digits(n).context(t)}function og(e){return function(t){var n=new V1;for(var i in e)n[i]=e[i];return n.stream=t,n}}function V1(){}V1.prototype={constructor:V1,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 Mx(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),$r(n,e.stream(Dh)),t(Dh.result()),i!=null&&e.clipExtent(i),e}function ag(e,t,n){return Mx(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function Dx(e,t,n){return ag(e,[[0,0],t],n)}function Ox(e,t,n){return Mx(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Rx(e,t,n){return Mx(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var C_=16,Iq=ae(30*pe);function F_(e,t){return+t?Uq(e,t):Bq(e)}function Bq(e){return og({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Uq(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,E=a+h,S=u+p,w=on(x*x+E*E+S*S),_=bn(S/=w),$=ve(ve(S)-1)<oe||ve(s-f)<oe?(s+f)/2:Qn(E,x),C=e($,_),T=C[0],O=C[1],k=T-i,F=O-r,A=b*k-y*F;(A*A/v>t||ve((y*k+b*F)/v-.5)>.3||o*d+a*h+u*p<Iq)&&(n(i,r,s,o,a,u,T,O,$,x/=w,E/=w,S,g,m),m.point(T,O),n(T,O,$,x,E,S,l,c,f,d,h,p,g,m))}}return function(i){var r,s,o,a,u,l,c,f,d,h,p,g,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=E},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(_,$){_=e(_,$),i.point(_[0],_[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(_,$){var C=Po([_,$]),T=e(_,$);n(f,d,c,h,p,g,f=T[0],d=T[1],c=_,h=C[0],p=C[1],g=C[2],C_,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=S,m.lineEnd=w}function S(_,$){v(r=_,$),s=f,o=d,a=h,u=p,l=g,m.point=v}function w(){n(f,d,c,h,p,g,s,o,r,a,u,l,C_,i),m.lineEnd=x,x()}return m}}var jq=og({point:function(e,t){this.stream.point(e*pe,t*pe)}});function qq(e){return og({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Wq(e,t,n,i,r){function s(o,a){return o*=i,a*=r,[t+e*o,n-e*a]}return s.invert=function(o,a){return[(o-t)/e*i,(n-a)/e*r]},s}function T_(e,t,n,i,r,s){if(!s)return Wq(e,t,n,i,r);var o=ae(s),a=se(s),u=o*e,l=a*e,c=o/e,f=a/e,d=(a*n-o*t)/e,h=(a*t+o*n)/e;function p(g,m){return g*=i,m*=r,[u*g-l*m+t,n-l*g-u*m]}return p.invert=function(g,m){return[i*(c*g-f*m+d),r*(h-f*g-c*m)]},p}function lr(e){return $3(function(){return e})()}function $3(e){var t,n=150,i=480,r=250,s=0,o=0,a=0,u=0,l=0,c,f=0,d=1,h=1,p=null,g=v_,m=null,y,b,v,x=yc,E=.5,S,w,_,$,C;function T(A){return _(A[0]*pe,A[1]*pe)}function O(A){return A=_.invert(A[0],A[1]),A&&[A[0]*Qe,A[1]*Qe]}T.stream=function(A){return $&&C===A?$:$=jq(qq(c)(g(S(x(C=A)))))},T.preclip=function(A){return arguments.length?(g=A,p=void 0,F()):g},T.postclip=function(A){return arguments.length?(x=A,m=y=b=v=null,F()):x},T.clipAngle=function(A){return arguments.length?(g=+A?$q(p=A*pe):(p=null,v_),F()):p*Qe},T.clipExtent=function(A){return arguments.length?(x=A==null?(m=y=b=v=null,yc):d3(m=+A[0][0],y=+A[0][1],b=+A[1][0],v=+A[1][1]),F()):m==null?null:[[m,y],[b,v]]},T.scale=function(A){return arguments.length?(n=+A,k()):n},T.translate=function(A){return arguments.length?(i=+A[0],r=+A[1],k()):[i,r]},T.center=function(A){return arguments.length?(s=A[0]%360*pe,o=A[1]%360*pe,k()):[s*Qe,o*Qe]},T.rotate=function(A){return arguments.length?(a=A[0]%360*pe,u=A[1]%360*pe,l=A.length>2?A[2]%360*pe:0,k()):[a*Qe,u*Qe,l*Qe]},T.angle=function(A){return arguments.length?(f=A%360*pe,k()):f*Qe},T.reflectX=function(A){return arguments.length?(d=A?-1:1,k()):d<0},T.reflectY=function(A){return arguments.length?(h=A?-1:1,k()):h<0},T.precision=function(A){return arguments.length?(S=F_(w,E=A*A),F()):on(E)},T.fitExtent=function(A,M){return ag(T,A,M)},T.fitSize=function(A,M){return Dx(T,A,M)},T.fitWidth=function(A,M){return Ox(T,A,M)},T.fitHeight=function(A,M){return Rx(T,A,M)};function k(){var A=T_(n,0,0,d,h,f).apply(null,t(s,o)),M=T_(n,i-A[0],r-A[1],d,h,f);return c=u3(a,u,l),w=P1(t,M),_=P1(c,w),S=F_(w,E),F()}function F(){return $=C=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&O,k()}}function Nx(e){var t=0,n=me/3,i=$3(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*pe,n=s[1]*pe):[t*Qe,n*Qe]},r}function Hq(e){var t=ae(e);function n(i,r){return[i*t,se(r)/t]}return n.invert=function(i,r){return[i/t,bn(r*t)]},n}function Gq(e,t){var n=se(e),i=(n+se(t))/2;if(ve(i)<oe)return Hq(e);var r=1+n*(2*i-n),s=on(r)/i;function o(a,u){var l=on(r-2*i*se(u))/i;return[l*se(a*=i),s-l*ae(a)]}return o.invert=function(a,u){var l=s-u,c=Qn(a,ve(l))*Wn(l);return l*i<0&&(c-=me*Wn(a)*Wn(l)),[c/i,bn((r-(a*a+l*l)*i*i)/(2*i))]},o}function Lh(){return Nx(Gq).scale(155.424).center([0,33.6442])}function A3(){return Lh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Vq(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},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 Xq(){var e,t,n=A3(),i,r=Lh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s,o=Lh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,i.point(h,p),u||(s.point(h,p),u)||(a.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Vq([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+oe,g+.12*h+oe],[p-.214*h-oe,g+.234*h-oe]]).stream(l),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+oe,g+.166*h+oe],[p-.115*h-oe,g+.234*h-oe]]).stream(l),f()},c.fitExtent=function(d,h){return ag(c,d,h)},c.fitSize=function(d,h){return Dx(c,d,h)},c.fitWidth=function(d,h){return Ox(c,d,h)},c.fitHeight=function(d,h){return Rx(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function k3(e){return function(t,n){var i=ae(t),r=ae(n),s=e(i*r);return s===1/0?[2,0]:[s*r*se(t),s*se(n)]}}function tf(e){return function(t,n){var i=on(t*t+n*n),r=e(i),s=se(r),o=ae(r);return[Qn(t*s,i*o),bn(i&&n*s/i)]}}var C3=k3(function(e){return on(2/(1+e))});C3.invert=tf(function(e){return 2*bn(e/2)});function Yq(){return lr(C3).scale(124.75).clipAngle(180-.001)}var F3=k3(function(e){return(e=JD(e))&&e/se(e)});F3.invert=tf(function(e){return e});function Kq(){return lr(F3).scale(79.4188).clipAngle(180-.001)}function ug(e,t){return[e,yh(Fx((Ye+t)/2))]}ug.invert=function(e,t){return[e,2*Iu(KD(t))-Ye]};function Jq(){return T3(ug).scale(961/sn)}function T3(e){var t=lr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=me*i(),d=t(yq(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===ug?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function jf(e){return Fx((Ye+e)/2)}function Qq(e,t){var n=ae(e),i=e===t?se(e):yh(n/ae(t))/yh(jf(t)/jf(e)),r=n*Wm(jf(e),i)/i;if(!i)return ug;function s(o,a){r>0?a<-Ye+oe&&(a=-Ye+oe):a>Ye-oe&&(a=Ye-oe);var u=r/Wm(jf(a),i);return[u*se(i*o),r-u*ae(i*o)]}return s.invert=function(o,a){var u=r-a,l=Wn(i)*on(o*o+u*u),c=Qn(o,ve(u))*Wn(u);return u*i<0&&(c-=me*Wn(o)*Wn(u)),[c/i,2*Iu(Wm(r/l,1/i))-Ye]},s}function Zq(){return Nx(Qq).scale(109.5).parallels([30,30])}function Ph(e,t){return[e,t]}Ph.invert=Ph;function eW(){return lr(Ph).scale(152.63)}function tW(e,t){var n=ae(e),i=e===t?se(e):(n-ae(t))/(t-e),r=n/i+e;if(ve(i)<oe)return Ph;function s(o,a){var u=r-a,l=i*o;return[u*se(l),r-u*ae(l)]}return s.invert=function(o,a){var u=r-a,l=Qn(o,ve(u))*Wn(u);return u*i<0&&(l-=me*Wn(o)*Wn(u)),[l/i,r-Wn(i)*on(o*o+u*u)]},s}function nW(){return Nx(tW).scale(131.154).center([0,13.9389])}var Yl=1.340264,Kl=-.081106,Jl=893e-6,Ql=.003796,zh=on(3)/2,iW=12;function M3(e,t){var n=bn(zh*se(t)),i=n*n,r=i*i*i;return[e*ae(n)/(zh*(Yl+3*Kl*i+r*(7*Jl+9*Ql*i))),n*(Yl+Kl*i+r*(Jl+Ql*i))]}M3.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,o,a,u;s<iW&&(a=n*(Yl+Kl*i+r*(Jl+Ql*i))-t,u=Yl+3*Kl*i+r*(7*Jl+9*Ql*i),n-=o=a/u,i=n*n,r=i*i*i,!(ve(o)<gh));++s);return[zh*e*(Yl+3*Kl*i+r*(7*Jl+9*Ql*i))/ae(n),bn(se(n)/zh)]};function rW(){return lr(M3).scale(177.158)}function D3(e,t){var n=ae(t),i=ae(e)*n;return[n*se(e)/i,se(t)/i]}D3.invert=tf(Iu);function sW(){return lr(D3).scale(144.049).clipAngle(60)}function oW(){var e=1,t=0,n=0,i=1,r=1,s=0,o,a,u=null,l,c,f,d=1,h=1,p=og({point:function(x,E){var S=v([x,E]);this.stream.point(S[0],S[1])}}),g=yc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,S=x[1]*h;if(s){var w=S*o-E*a;E=E*o+S*a,S=w}return[E+t,S+n]}return v.invert=function(x){var E=x[0]-t,S=x[1]-n;if(s){var w=S*o+E*a;E=E*o-S*a,S=w}return[E/d,S/h]},v.stream=function(x){return m&&y===x?m:m=p(g(y=x))},v.postclip=function(x){return arguments.length?(g=x,u=l=c=f=null,b()):g},v.clipExtent=function(x){return arguments.length?(g=x==null?(u=l=c=f=null,yc):d3(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(s=x%360*pe,a=se(s),o=ae(s),b()):s*Qe},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return ag(v,x,E)},v.fitSize=function(x,E){return Dx(v,x,E)},v.fitWidth=function(x,E){return Ox(v,x,E)},v.fitHeight=function(x,E){return Rx(v,x,E)},v}function O3(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}O3.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,o=s*s;n-=r=(n*(1.007226+s*(.015085+o*(-.044475+.028874*s-.005916*o)))-t)/(1.007226+s*(.015085*3+o*(-.044475*7+.028874*9*s-.005916*11*o)))}while(ve(r)>oe&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function aW(){return lr(O3).scale(175.295)}function R3(e,t){return[ae(t)*se(e),se(t)]}R3.invert=tf(bn);function uW(){return lr(R3).scale(249.5).clipAngle(90+oe)}function N3(e,t){var n=ae(t),i=1+ae(e)*n;return[n*se(e)/i,se(t)/i]}N3.invert=tf(function(e){return 2*Iu(e)});function lW(){return lr(N3).scale(250).clipAngle(142)}function L3(e,t){return[yh(Fx((Ye+t)/2)),-e]}L3.invert=function(e,t){return[-t,2*Iu(KD(e))-Ye]};function cW(){var e=T3(L3),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var fW=Math.abs,X1=Math.cos,Ih=Math.sin,dW=1e-6,P3=Math.PI,Y1=P3/2,M_=hW(2);function D_(e){return e>1?Y1:e<-1?-Y1:Math.asin(e)}function hW(e){return e>0?Math.sqrt(e):0}function pW(e,t){var n=e*Ih(t),i=30,r;do t-=r=(t+Ih(t)-n)/(1+X1(t));while(fW(r)>dW&&--i>0);return t/2}function gW(e,t,n){function i(r,s){return[e*r*X1(s=pW(n,s)),t*Ih(s)]}return i.invert=function(r,s){return s=D_(s/t),[r/(e*X1(s)),D_((2*s+Ih(2*s))/n)]},i}var mW=gW(M_/Y1,M_,P3);function yW(){return lr(mW).scale(169.529)}const bW=_3(),K1=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function vW(e,t){return function n(){const i=t();return i.type=e,i.path=_3().projection(i),i.copy=i.copy||function(){const r=n();return K1.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},QT(i)}}function Lx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Bh[e]=vW(e,t),this):Bh[e]||null}function z3(e){return e&&e.path||bW}const Bh={albers:A3,albersusa:Xq,azimuthalequalarea:Yq,azimuthalequidistant:Kq,conicconformal:Zq,conicequalarea:Lh,conicequidistant:nW,equalEarth:rW,equirectangular:eW,gnomonic:sW,identity:oW,mercator:Jq,mollweide:yW,naturalEarth1:aW,orthographic:uW,stereographic:lW,transversemercator:cW};for(const e in Bh)Lx(e,Bh[e]);function xW(){}const vr=[[],[[[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 I3(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),wW(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h<p;++h)if(EW((g=c[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=[],d=[],h,p,g,m,y,b;for(h=p=-1,m=u[0]>=l,vr[m<<1].forEach(v);++h<e-1;)g=m,m=u[h+1]>=l,vr[g|m<<1].forEach(v);for(vr[m<<0].forEach(v);++p<t-1;){for(h=-1,m=u[p*e+e]>=l,y=u[p*e]>=l,vr[m<<1|y<<2].forEach(v);++h<e-1;)g=m,m=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,vr[g|m<<1|y<<2|b<<3].forEach(v);vr[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,vr[y<<2].forEach(v);++h<e-1;)b=y,y=u[p*e+h+1]>=l,vr[y<<2|b<<3].forEach(v);vr[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+p],S=[x[1][0]+h,x[1][1]+p],w=o(E),_=o(S),$,C;($=d[w])?(C=f[_])?(delete d[$.end],delete f[C.start],$===C?($.ring.push(S),c($.ring)):f[$.start]=d[C.end]={start:$.start,end:C.end,ring:$.ring.concat(C.ring)}):(delete d[$.end],$.ring.push(S),d[$.end=_]=$):($=f[_])?(C=d[w])?(delete f[$.start],delete d[C.end],$===C?($.ring.push(S),c($.ring)):f[C.start]=d[$.end]={start:C.start,end:$.end,ring:C.ring.concat($.ring)}):(delete f[$.start],$.ring.unshift(E),f[$.start=w]=$):f[w]=d[_]={start:w,end:_,ring:[E,S]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d<e&&p===d&&(m=l[g*e+p-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&g===h&&(m=l[(g-1)*e+p],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||N("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:xW,i):n===a},i}function wW(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function EW(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=SW(e,t[n]))return r;return 0}function SW(e,t){for(var n=t[0],i=t[1],r=-1,s=0,o=e.length,a=o-1;s<o;a=s++){var u=e[s],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(_W(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function _W(e,t,n){var i;return $W(e,t,n)&&AW(e[i=+(e[0]===t[0])],n[i],t[i])}function $W(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function AW(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function B3(e,t,n){return function(i){var r=Ji(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Oo(s,o,e):a/(e+1);return Fn(s+u,o,u)}}function Px(e){D.call(this,null,e)}Px.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};G(Px,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Wt,s=I3().smooth(e.smooth!==!1),o=e.thresholds||kW(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,L(o)?o:o(c.values));CW(f,c,l,e),f.forEach(d=>{u.push(Cp(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function kW(e,t,n){const i=B3(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>$o(t(r).values)))}function CW(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(fe(r)&&(r=r(n,i)),fe(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=($e(r)?r:r[0])||1,a=($e(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(U3(t,o,a,u,l))}function U3(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function O_(e,t,n){const i=e>=0?e:Mb(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Ym(e){return fe(e)?e:Ht(+e)}function j3(){var e=u=>u[0],t=u=>u[1],n=Cu,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=O_(i[0],u,e)>>o,f=O_(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const E=d+(+e(x)>>o),S=h+(+t(x)>>o);E>=0&&E<p&&S>=0&&S<g&&(m[E+S*p]+=+n(x))}),c>0&&f>0?(xa(p,g,m,y,c),wa(p,g,y,m,f),xa(p,g,m,y,c),wa(p,g,y,m,f),xa(p,g,m,y,c),wa(p,g,y,m,f)):c>0?(xa(p,g,m,y,c),xa(p,g,y,m,c),xa(p,g,m,y,c),b=y):f>0&&(wa(p,g,m,y,f),wa(p,g,y,m,f),wa(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/_C(b);for(let x=0,E=p*g;x<E;++x)b[x]*=v;return{values:b,scale:1<<o,width:p,height:g,x1:d,y1:h,x2:d+(r>>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=Ym(u),a):e},a.y=function(u){return arguments.length?(t=Ym(u),a):t},a.weight=function(u){return arguments.length?(n=Ym(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||N("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||N("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<<o},a.bandwidth=function(u){return arguments.length?(u=Y(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&N("invalid bandwidth"),i=u,a):i},a}function xa(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<t;++o)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+o*e]),a>=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function wa(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<e;++o)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[o+a*e]),a>=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function zx(e){D.call(this,null,e)}zx.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const FW=["x","y","weight","size","cellSize","bandwidth"];function q3(e,t){return FW.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(zx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=TW(i,e.groupby),s=(e.groupby||[]).map(Je),o=q3(j3(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<s.length;++d)c[s[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function TW(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Ix(e){D.call(this,null,e)}Ix.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};G(Ix,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=I3().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||B3(e.count||10,e.nice,!!r),o=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=q3(j3(),e)(r,!0),u=U3(a,a.scale||1,a.scale||1,0,0),o=[a.width,a.height],r=a.values),s=L(s)?s:s(r),r=i.size(o)(r,s),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const J1="Feature",Bx="FeatureCollection",MW="MultiPoint";function Ux(e){D.call(this,null,e)}Ux.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(Ux,D,{transform(e,t){var n=this._features,i=this._points,r=e.fields,s=r&&r[0],o=r&&r[1],a=e.geojson||!r&&Wt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(Bt(a))||s&&t.modified(Bt(s))||o&&t.modified(Bt(o)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:J1,geometry:{type:MW,coordinates:i}})),this.value={type:Bx,features:n}}});function jx(e){D.call(this,null,e)}jx.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};G(jx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Wt,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=z3(e.projection),n.materialize().reflow()):o=r===Wt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=DW(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function DW(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function qx(e){D.call(this,null,e)}qx.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};G(qx,D,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function Wx(e){D.call(this,null,e)}Wx.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};G(Wx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=OW(z3(e.projection),e.field||Yn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function OW(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function Hx(e){D.call(this,[],e),this.generator=kq()}Hx.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};G(Hx,D,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)fe(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(pF(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function Gx(e){D.call(this,null,e)}Gx.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};G(Gx,D,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Wt,s=NW(e.opacity,e),o=RW(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?$o(n.map(l=>$o(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=ce({},l,u);i||(f.$max=$o(c.values||[])),l[a]=LW(c,f,o.dep?o:Ht(o(f)),s.dep?s:Ht(s(f)))}),t.reflow(!0).modifies(a)}});function RW(e,t){let n;return fe(e)?(n=i=>zd(e(i,t)),n.dep=W3(e)):n=Ht(zd(e||"#888")),n}function NW(e,t){let n;return fe(e)?(n=i=>e(i,t),n.dep=W3(e)):e?n=Ht(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function W3(e){if(!fe(e))return!1;const t=yi(Bt(e));return t.$x||t.$y||t.$value||t.$max}function LW(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:cs,d=_s(u-o,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-o,l-a),g=p.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=o,v=m*r;b<u;++b,y+=4){t.$x=b-o,t.$value=f(b+v);const x=n(t);g[y+0]=x.r,g[y+1]=x.g,g[y+2]=x.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}function H3(e){D.call(this,null,e),this.modified(!0)}G(H3,D,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=zW(e.type),K1.forEach(i=>{e[i]!=null&&R_(n,i,e[i])})):K1.forEach(i=>{e.modified(i)&&R_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&PW(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function PW(e,t){const n=IW(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function zW(e){const t=Lx((e||"mercator").toLowerCase());return t||N("Unrecognized projection type: "+e),t()}function R_(e,t,n){fe(e[t])&&e[t](n)}function IW(e){return e=Y(e),e.length===1?e[0]:{type:Bx,features:e.reduce((t,n)=>t.concat(BW(n)),[])}}function BW(e){return e.type===Bx?e.features:Y(e).filter(t=>t!=null).map(t=>t.type===J1?t:{type:J1,geometry:t})}const UW=Object.freeze(Object.defineProperty({__proto__:null,contour:Ix,geojson:Ux,geopath:jx,geopoint:qx,geoshape:Wx,graticule:Hx,heatmap:Gx,isocontour:Px,kde2d:zx,projection:H3},Symbol.toStringTag,{value:"Module"}));function jW(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s<o;++s)a=n[s],u+=a.x,l+=a.y;for(u=(u/o-e)*i,l=(l/o-t)*i,s=0;s<o;++s)a=n[s],a.x-=u,a.y-=l}return r.initialize=function(s){n=s},r.x=function(s){return arguments.length?(e=+s,r):e},r.y=function(s){return arguments.length?(t=+s,r):t},r.strength=function(s){return arguments.length?(i=+s,r):i},r}function qW(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return G3(this.cover(t,n),t,n,e)}function G3(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,s=e._root,o={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,g,m,y,b;if(!s)return e._root=o,e;for(;s.length;)if((g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function WW(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(s=+this._y.call(null,t))||(o[n]=r,a[n]=s,r<u&&(u=r),r>c&&(c=r),s<l&&(l=s),s>f&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)G3(this,o[n],a[n],e[n]);return this}function HW(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,s=(i=Math.floor(t))+1;else{for(var o=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=s;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,o*=2,l){case 0:r=n+o,s=i+o;break;case 1:n=r-o,s=i+o;break;case 2:r=n+o,i=s-o;break;case 3:n=r-o,i=s-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function GW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function VW(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Zt(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function XW(e,t,n){var i,r=this._x0,s=this._y0,o,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new Zt(h,r,s,c,f)),n==null?n=1/0:(r=e-n,s=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(o=p.x0)>c||(a=p.y0)>f||(u=p.x1)<r||(l=p.y1)<s))if(h.length){var m=(o+u)/2,y=(a+l)/2;d.push(new Zt(h[3],m,y,u,l),new Zt(h[2],o,y,m,l),new Zt(h[1],m,a,u,y),new Zt(h[0],o,a,m,y)),(g=(t>=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,s=t-E,c=e+E,f=t+E,i=h.data}}return i}function YW(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,s,o=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,g,m,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(o+u)/2))?o=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function KW(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function JW(){return this._root}function QW(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function ZW(e){var t=[],n,i=this._root,r,s,o,a,u;for(i&&t.push(new Zt(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,s=n.x0,o=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(s+a)/2,c=(o+u)/2;(r=i[3])&&t.push(new Zt(r,l,c,a,u)),(r=i[2])&&t.push(new Zt(r,s,c,l,u)),(r=i[1])&&t.push(new Zt(r,l,o,a,c)),(r=i[0])&&t.push(new Zt(r,s,o,l,c))}return this}function eH(e){var t=[],n=[],i;for(this._root&&t.push(new Zt(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var s,o=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(o+u)/2,f=(a+l)/2;(s=r[0])&&t.push(new Zt(s,o,a,c,f)),(s=r[1])&&t.push(new Zt(s,c,a,u,f)),(s=r[2])&&t.push(new Zt(s,o,f,c,l)),(s=r[3])&&t.push(new Zt(s,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function tH(e){return e[0]}function nH(e){return arguments.length?(this._x=e,this):this._x}function iH(e){return e[1]}function rH(e){return arguments.length?(this._y=e,this):this._y}function Vx(e,t,n){var i=new Xx(t??tH,n??iH,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Xx(e,t,n,i,r,s){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function N_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var un=Vx.prototype=Xx.prototype;un.copy=function(){var e=new Xx(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=N_(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=N_(i));return e};un.add=qW;un.addAll=WW;un.cover=HW;un.data=GW;un.extent=VW;un.find=XW;un.remove=YW;un.removeAll=KW;un.root=JW;un.size=QW;un.visit=ZW;un.visitAfter=eH;un.x=nH;un.y=rH;function en(e){return function(){return e}}function bs(e){return(e()-.5)*1e-6}function sH(e){return e.x+e.vx}function oH(e){return e.y+e.vy}function aH(e){var t,n,i,r=1,s=1;typeof e!="function"&&(e=en(e==null?1:+e));function o(){for(var l,c=t.length,f,d,h,p,g,m,y=0;y<s;++y)for(f=Vx(t,sH,oH).visitAfter(a),l=0;l<c;++l)d=t[l],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(v,x,E,S,w){var _=v.data,$=v.r,C=g+$;if(_){if(_.index>d.index){var T=h-_.x-_.vx,O=p-_.y-_.vy,k=T*T+O*O;k<C*C&&(T===0&&(T=bs(i),k+=T*T),O===0&&(O=bs(i),k+=O*O),k=(C-(k=Math.sqrt(k)))/k*r,d.vx+=(T*=k)*(C=($*=$)/(m+$)),d.vy+=(O*=k)*C,_.vx-=T*(C=1-C),_.vy-=O*C)}return}return x>h+C||S<h-C||E>p+C||w<p-C}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return o.initialize=function(l,c){t=l,i=c,u()},o.iterations=function(l){return arguments.length?(s=+l,o):s},o.strength=function(l){return arguments.length?(r=+l,o):r},o.radius=function(l){return arguments.length?(e=typeof l=="function"?l:en(+l),u(),o):e},o}function uH(e){return e.index}function L_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function lH(e){var t=uH,n=f,i,r=en(30),s,o,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,S,w,_,$,C;v<b;++v)x=e[v],E=x.source,S=x.target,w=S.x+S.vx-E.x-E.vx||bs(l),_=S.y+S.vy-E.y-E.vy||bs(l),$=Math.sqrt(w*w+_*_),$=($-s[v])/$*m*i[v],w*=$,_*=$,S.vx-=w*(C=u[v]),S.vy-=_*C,E.vx+=w*(C=1-C),E.vy+=_*C}function h(){if(o){var m,y=o.length,b=e.length,v=new Map(o.map((E,S)=>[t(E,S,o),E])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=L_(v,x.source)),typeof x.target!="object"&&(x.target=L_(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),p(),s=new Array(b),g()}}function p(){if(o)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function g(){if(o)for(var m=0,y=e.length;m<y;++m)s[m]=+r(e[m],m,e)}return d.initialize=function(m,y){o=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:en(+m),p(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:en(+m),g(),d):r},d}var cH={value:()=>{}};function V3(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new $d(n)}function $d(e){this._=e}function fH(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}$d.prototype=V3.prototype={constructor:$d,on:function(e,t){var n=this._,i=fH(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s<o;)if((r=(e=i[s]).type)&&(r=dH(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(r=(e=i[s]).type)n[r]=P_(n[r],e.name,t);else if(t==null)for(r in n)n[r]=P_(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new $d(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function dH(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function P_(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=cH,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}function hH(e,t,n){var i=new qL,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?jL():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const pH=1664525,gH=1013904223,z_=4294967296;function mH(){let e=1;return()=>(e=(pH*e+gH)%z_)/z_}function yH(e){return e.x}function bH(e){return e.y}var vH=10,xH=Math.PI*(3-Math.sqrt(5));function wH(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=WL(f),l=V3("tick","end"),c=mH();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(g){var m,y=e.length,b;g===void 0&&(g=1);for(var v=0;v<g;++v)for(n+=(s-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=o:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=o:(b.y=b.fy,b.vy=0);return t}function h(){for(var g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=vH*Math.sqrt(.5+g),v=g*xH;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,c),g}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(i=+g,t):i},alphaDecay:function(g){return arguments.length?(r=+g,t):+r},alphaTarget:function(g){return arguments.length?(s=+g,t):s},velocityDecay:function(g){return arguments.length?(o=1-g,t):1-o},randomSource:function(g){return arguments.length?(c=g,a.forEach(p),t):c},force:function(g,m){return arguments.length>1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,E,S,w,_;for(y==null?y=1/0:y*=y,b=0;b<v;++b)w=e[b],x=g-w.x,E=m-w.y,S=x*x+E*E,S<y&&(_=w,y=S);return _},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function EH(){var e,t,n,i,r=en(-30),s,o=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=Vx(e,yH,bH).visitAfter(f);for(i=h,p=0;p<g;++p)t=e[p],m.visit(d)}function c(){if(e){var h,p=e.length,g;for(s=new Array(p),h=0;h<p;++h)g=e[h],s[g.index]=+r(g,h,e)}}function f(h){var p=0,g,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(g=h[x])&&(m=Math.abs(g.value))&&(p+=g.value,y+=m,b+=m*g.x,v+=m*g.y);h.x=b/y,h.y=v/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=s[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-p,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=bs(n),x+=y*y),b===0&&(b=bs(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=bs(n),x+=y*y),b===0&&(b=bs(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)));do h.data!==t&&(v=s[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:en(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function SH(e){var t=en(.1),n,i,r;typeof e!="function"&&(e=en(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:en(+a),o(),s):t},s.x=function(a){return arguments.length?(e=typeof a=="function"?a:en(+a),o(),s):e},s}function _H(e){var t=en(.1),n,i,r;typeof e!="function"&&(e=en(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:en(+a),o(),s):t},s.y=function(a){return arguments.length?(e=typeof a=="function"?a:en(+a),o(),s):e},s}const I_={center:jW,collide:aH,nbody:EH,link:lH,x:SH,y:_H},zl="forces",Q1=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],$H=["static","iterations"],X3=["x","y","vx","vy"];function Yx(e){D.call(this,null,e)}Yx.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:X3}]};G(Yx,D,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(Q1),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&Y3(n,e,0,t)):(this.value=n=kH(t.source,e),n.on("tick",AH(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified($H)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==zl||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,s=i.length,o;r<s;++r)if(i[r].name==="links"&&(o=i[r].op.source)){n.pulse(o,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(X3)}});function AH(e,t){return()=>e.touch(t).run()}function kH(e,t){const n=wH(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),Y3(n,t,!0).on("end",()=>s=!0)}function Y3(e,t,n,i){var r=Y(t.forces),s,o,a,u;for(s=0,o=Q1.length;s<o;++s)a=Q1[s],a!==zl&&t.modified(a)&&e[a](t[a]);for(s=0,o=r.length;s<o;++s)u=zl+s,a=n||t.modified(zl,s)?FH(r[s]):i&&CH(r[s],i)?e.force(u):null,a&&e.force(u,a);for(o=e.numForces||0;s<o;++s)e.force(zl+s,null);return e.numForces=r.length,e}function CH(e,t){var n,i;for(n in e)if(fe(i=e[n])&&t.modified(Bt(i)))return 1;return 0}function FH(e){var t,n;J(I_,e.force)||N("Unrecognized force: "+e.force),t=I_[e.force]();for(n in e)fe(t[n])&&TH(t[n],e[n],e);return t}function TH(e,t,n){e(fe(t)?i=>t(i,n):t)}const MH=Object.freeze(Object.defineProperty({__proto__:null,force:Yx},Symbol.toStringTag,{value:"Module"}));function DH(e,t){return e.parent===t.parent?1:2}function OH(e){return e.reduce(RH,0)/e.length}function RH(e,t){return e+t.x}function NH(e){return 1+e.reduce(LH,0)}function LH(e,t){return Math.max(e,t.y)}function PH(e){for(var t;t=e.children;)e=t[0];return e}function zH(e){for(var t;t=e.children;)e=t[t.length-1];return e}function IH(){var e=DH,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=OH(h),d.y=NH(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=PH(s),l=zH(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function BH(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function UH(){return this.eachAfter(BH)}function jH(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function qH(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function WH(e,t){for(var n=this,i=[n],r=[],s,o,a,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o<a;++o)i.push(s[o]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function HH(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function GH(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function VH(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function XH(e){for(var t=this,n=YH(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function YH(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function KH(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function JH(){return Array.from(this)}function QH(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function ZH(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*eG(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Kx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=iG)):t===void 0&&(t=nG);for(var n=new lu(e),i,r=[n],s,o,a,u;i=r.pop();)if((o=t(i.data))&&(u=(o=Array.from(o)).length))for(i.children=o,a=u-1;a>=0;--a)r.push(s=o[a]=new lu(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(K3)}function tG(){return Kx(this).eachBefore(rG)}function nG(e){return e.children}function iG(e){return Array.isArray(e)?e[1]:null}function rG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function K3(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function lu(e){this.data=e,this.depth=this.height=0,this.parent=null}lu.prototype=Kx.prototype={constructor:lu,count:UH,each:jH,eachAfter:WH,eachBefore:qH,find:HH,sum:GH,sort:VH,path:XH,ancestors:KH,descendants:JH,leaves:QH,links:ZH,copy:tG,[Symbol.iterator]:eG};function Ad(e){return e==null?null:J3(e)}function J3(e){if(typeof e!="function")throw new Error;return e}function xo(){return 0}function Fa(e){return function(){return e}}const sG=1664525,oG=1013904223,B_=4294967296;function aG(){let e=1;return()=>(e=(sG*e+oG)%B_)/B_}function uG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lG(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function cG(e,t){for(var n=0,i=(e=lG(Array.from(e),t)).length,r=[],s,o;n<i;)s=e[n],o&&Q3(o,s)?++n:(o=dG(r=fG(r,s)),n=0);return o}function fG(e,t){var n,i;if(Km(t,e))return[t];for(n=0;n<e.length;++n)if(qf(t,e[n])&&Km(Il(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(qf(Il(e[n],e[i]),t)&&qf(Il(e[n],t),e[i])&&qf(Il(e[i],t),e[n])&&Km(Z3(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function qf(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Q3(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Km(e,t){for(var n=0;n<t.length;++n)if(!Q3(e,t[n]))return!1;return!0}function dG(e){switch(e.length){case 1:return hG(e[0]);case 2:return Il(e[0],e[1]);case 3:return Z3(e[0],e[1],e[2])}}function hG(e){return{x:e.x,y:e.y,r:e.r}}function Il(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,o=t.y,a=t.r,u=s-n,l=o-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+s+u/f*c)/2,y:(i+o+l/f*c)/2,r:(f+r+a)/2}}function Z3(e,t,n){var i=e.x,r=e.y,s=e.r,o=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-o,h=i-l,p=r-a,g=r-c,m=u-s,y=f-s,b=i*i+r*r-s*s,v=b-o*o-a*a+u*u,x=b-l*l-c*c+f*f,E=h*p-d*g,S=(p*x-g*v)/(E*2)-i,w=(g*m-p*y)/E,_=(h*v-d*x)/(E*2)-r,$=(d*y-h*m)/E,C=w*w+$*$-1,T=2*(s+S*w+_*$),O=S*S+_*_-s*s,k=-(Math.abs(C)>1e-6?(T+Math.sqrt(T*T-4*C*O))/(2*C):O/T);return{x:i+S+w*k,y:r+_+$*k,r:k}}function U_(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function j_(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function q_(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Wf(e){this._=e,this.next=null,this.previous=null}function pG(e,t){if(!(s=(e=uG(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;U_(i,n,r=e[2]),n=new Wf(n),i=new Wf(i),r=new Wf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<s;++u){U_(n._,i._,r=e[u]),r=new Wf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(j_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(j_(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,o=q_(n);(r=r.next)!==i;)(a=q_(r))<o&&(n=r,o=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=cG(n,t),u=0;u<s;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function gG(e){return Math.sqrt(e.value)}function mG(){var e=null,t=1,n=1,i=xo;function r(s){const o=aG();return s.x=t/2,s.y=n/2,e?s.eachBefore(W_(e)).eachAfter(Jm(i,.5,o)).eachBefore(H_(1)):s.eachBefore(W_(gG)).eachAfter(Jm(xo,1,o)).eachAfter(Jm(i,s.r/Math.min(t,n),o)).eachBefore(H_(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=Ad(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:Fa(+s),r):i},r}function W_(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Jm(e,t,n){return function(i){if(r=i.children){var r,s,o=r.length,a=e(i)*t||0,u;if(a)for(s=0;s<o;++s)r[s].r+=a;if(u=pG(r,n),a)for(s=0;s<o;++s)r[s].r-=a;i.r=u+a}}}function H_(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function eO(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function nf(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(i-t)/e.value;++a<u;)o=s[a],o.y0=n,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function yG(){var e=1,t=1,n=0,i=!1;function r(o){var a=o.height+1;return o.x0=o.y0=n,o.x1=e,o.y1=t/a,o.eachBefore(s(t,a)),i&&o.eachBefore(eO),o}function s(o,a){return function(u){u.children&&nf(u,u.x0,o*(u.depth+1)/a,u.x1,o*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(o){return arguments.length?(i=!!o,r):i},r.size=function(o){return arguments.length?(e=+o[0],t=+o[1],r):[e,t]},r.padding=function(o){return arguments.length?(n=+o,r):n},r}var bG={depth:-1},G_={},Qm={};function vG(e){return e.id}function xG(e){return e.parentId}function V_(){var e=vG,t=xG,n;function i(r){var s=Array.from(r),o=e,a=t,u,l,c,f,d,h,p,g,m=new Map;if(n!=null){const y=s.map((x,E)=>wG(n(x,E,r))),b=y.map(X_),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(X_(x)),s.push(Qm));o=(x,E)=>y[E],a=(x,E)=>b[E]}for(c=0,u=s.length;c<u;++c)l=s[c],h=s[c]=new lu(l),(p=o(l,c,r))!=null&&(p+="")&&(g=h.id=p,m.set(g,m.has(g)?G_:h)),(p=a(l,c,r))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=s[c],p=h.parent){if(d=m.get(p),!d)throw new Error("missing: "+p);if(d===G_)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Qm&&f.children.length===1;)f=f.children[0],--u;for(let y=s.length-1;y>=0&&(h=s[y],h.data===Qm);--y)h.data=null}if(f.parent=bG,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(K3),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Ad(r),i):e},i.parentId=function(r){return arguments.length?(t=Ad(r),i):t},i.path=function(r){return arguments.length?(n=Ad(r),i):n},i}function wG(e){e=`${e}`;let t=e.length;return Z1(e,t-1)&&!Z1(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function X_(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Z1(e,t););return e.slice(0,t)}function Z1(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function EG(e,t){return e.parent===t.parent?1:2}function Zm(e){var t=e.children;return t?t[0]:e.t}function e0(e){var t=e.children;return t?t[t.length-1]:e.t}function SG(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function _G(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function $G(e,t,n){return e.a.parent===t.parent?e.a:n}function kd(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}kd.prototype=Object.create(lu.prototype);function AG(e){for(var t=new kd(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new kd(s[o],o)),r.parent=n;return(t.parent=new kd(null,0)).children=[t],t}function kG(){var e=EG,t=1,n=1,i=null;function r(l){var c=AG(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){_G(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=e0(p),d=Zm(d),p&&d;)g=Zm(g),h=e0(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(SG($G(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!e0(h)&&(h.t=p,h.m+=b-y),d&&!Zm(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function lg(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(r-n)/e.value;++a<u;)o=s[a],o.x0=t,o.x1=i,o.y0=n,o.y1=n+=o.value*l}var tO=(1+Math.sqrt(5))/2;function nO(e,t,n,i,r,s){for(var o=[],a=t.children,u,l,c=0,f=0,d=a.length,h,p,g=t.value,m,y,b,v,x,E,S;c<d;){h=r-n,p=s-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,E=Math.max(p/h,h/p)/(g*e),S=m*m*E,x=Math.max(b/S,S/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),S=m*m*E,v=Math.max(b/S,S/y),v>x){m-=l;break}x=v}o.push(u={value:m,dice:h<p,children:a.slice(c,f)}),u.dice?nf(u,n,i,r,g?i+=p*m/g:s):lg(u,n,i,g?n+=h*m/g:r,s),g-=m,c=f}return o}const iO=function e(t){function n(i,r,s,o,a){nO(t,i,r,s,o,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(tO);function CG(){var e=iO,t=!1,n=1,i=1,r=[0],s=xo,o=xo,a=xo,u=xo,l=xo;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(eO),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),d.x0=p,d.y0=g,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=s(d)/2,p+=l(d)-h,g+=o(d)-h,m-=a(d)-h,y-=u(d)-h,m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),e(d,p,g,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=J3(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:Fa(+d),c):s},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:Fa(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Fa(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Fa(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Fa(+d),c):l},c}function FG(e,t,n,i,r){var s=e.children,o,a=s.length,u,l=new Array(a+1);for(l[0]=u=o=0;o<a;++o)l[o+1]=u+=s[o].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,p,g,m,y){if(f>=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,S=d-1;E<S;){var w=E+S>>>1;l[w]<x?E=w+1:S=w}x-l[E-1]<l[E]-x&&f+1<E&&--E;var _=l[E]-v,$=h-_;if(m-p>y-g){var C=h?(p*$+m*_)/h:m;c(f,E,_,p,g,C,y),c(E,d,$,C,g,m,y)}else{var T=h?(g*$+y*_)/h:y;c(f,E,_,p,g,m,T),c(E,d,$,p,T,m,y)}}}function TG(e,t,n,i,r){(e.depth&1?lg:nf)(e,t,n,i,r)}const MG=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?nf(l,r,s,o,g?s+=(a-s)*l.value/g:a):lg(l,r,s,g?r+=(o-r)*l.value/g:o,a),g-=l.value}else i._squarify=u=nO(t,i,r,s,o,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(tO);function ey(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function Jx(e){D.call(this,null,e)}Jx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const DG=e=>e.values;G(Jx,D,{transform(e,t){t.source||N("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&kp(o.data)&&r.rem.push(o.data)}),this.value=s=Kx({values:Y(e.keys).reduce((o,a)=>(o.key(a),o),OG()).entries(r.source)},DG),n&&s.each(o=>{o.children&&(o=Ce(o.data),r.add.push(o),r.source.push(o))}),ey(s,re,re)),r.source.root=s,r}});function OG(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++c<o;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],s);return l}function i(r,s){if(++s>e.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Gr(e){D.call(this,null,e)}const RG=(e,t)=>e.parent===t.parent?1:2;G(Gr,D,{transform(e,t){(!t.source||!t.source.root)&&N(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ea(e.sort,o=>o.data)),NG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?RG:Cu);try{this.value=n(r)}catch(o){N(o)}return r.each(o=>LG(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function NG(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}function LG(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}const ty=["x","y","r","depth","children"];function Qx(e){Gr.call(this,e)}Qx.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ty.length,default:ty}]};G(Qx,Gr,{layout:mG,params:["radius","size","padding"],fields:ty});const ny=["x0","y0","x1","y1","depth","children"];function Zx(e){Gr.call(this,e)}Zx.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ny.length,default:ny}]};G(Zx,Gr,{layout:yG,params:["size","round","padding"],fields:ny});function e2(e){D.call(this,null,e)}e2.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(e2,D,{transform(e,t){t.source||N("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?ey(V_().id(e.key).parentId(e.parentKey)(r.source),e.key,Rn):ey(V_()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const Y_={tidy:kG,cluster:IH},iy=["x","y","depth","children"];function t2(e){Gr.call(this,e)}t2.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:iy.length,default:iy}]};G(t2,Gr,{layout(e){const t=e||"tidy";if(J(Y_,t))return Y_[t]();N("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:iy});function n2(e){D.call(this,[],e)}n2.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(n2,D,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||N("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,o=>s[re(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[re(a)]&&s[re(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[re(o)]=1),n.forEach(o=>{(s[re(o.source)]||s[re(o.target)])&&r.mod.push(o)})),r}});const K_={binary:FG,dice:nf,slice:lg,slicedice:TG,squarify:iO,resquarify:MG},ry=["x0","y0","x1","y1","depth","children"];function i2(e){Gr.call(this,e)}i2.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ry.length,default:ry}]};G(i2,Gr,{layout(){const e=CG();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{J(K_,t)?e.tile(K_[t]):N("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:ry});const PG=Object.freeze(Object.defineProperty({__proto__:null,nest:Jx,pack:Qx,partition:Zx,stratify:e2,tree:t2,treelinks:n2,treemap:i2},Symbol.toStringTag,{value:"Module"})),t0=4278190080;function zG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function IG(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=_s(s,o).getContext("2d"),l=_s(s,o).getContext("2d"),c=a&&_s(s,o).getContext("2d");n.forEach(_=>Cd(u,_,!1)),Cd(l,t,!1),a&&Cd(c,t,!0);const f=n0(u,s,o),d=n0(l,s,o),h=a&&n0(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,E,S,w;for(y=0;y<o;++y)for(m=0;m<s;++m)x=y*s+m,E=f[x]&t0,w=d[x]&t0,S=a&&h[x]&t0,(E||S||w)&&(b=e(m),v=e(y),!r&&(E||w)&&p.set(b,v),a&&(E||S)&&g.set(b,v));return[p,g]}function n0(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function Cd(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>Cd(e,s.items,n))}):Pn[i].draw(e,{items:n?t.map(BG):t})}function BG(e){const t=Cp(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const xr=5,Gt=31,xc=32,us=new Uint32Array(xc+1),li=new Uint32Array(xc+1);li[0]=0;us[0]=~li[0];for(let e=1;e<=xc;++e)li[e]=li[e-1]<<1|1,us[e]=~li[e];function UG(e,t){const n=new Uint32Array(~~((e*t+xc)/xc));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>xr]&1<<(a&Gt)},set:(s,o)=>{const a=o*e+s;i(a>>>xr,1<<(a&Gt))},clear:(s,o)=>{const a=o*e+s;r(a>>>xr,~(1<<(a&Gt)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>xr,h=f>>>xr,d===h){if(n[d]&us[c&Gt]&li[(f&Gt)+1])return!0}else{if(n[d]&us[c&Gt]||n[h]&li[(f&Gt)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>xr,d=c>>>xr,f===d)i(f,us[l&Gt]&li[(c&Gt)+1]);else for(i(f,us[l&Gt]),i(d,li[(c&Gt)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>xr,d=c>>>xr,f===d)r(f,li[l&Gt]|us[(c&Gt)+1]);else for(r(f,li[l&Gt]),r(d,us[(c&Gt)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(s,o,a,u)=>s<0||o<0||u>=t||a>=e}}function jG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>UG(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function qG(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Mn.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v<u;++v)d=a[v].x,p=a[v].y,h=a[v].x2===void 0?d:a[v].x2,g=a[v].y2===void 0?p:a[v].y2,m=(d+h)/2,y=(p+g)/2,b=Math.abs(h-d+g-p),b>=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&r<h&&(o.align="right"),o.baseline="middle",p<0&&g<=s?o.baseline="top":0<=p&&s<g&&(o.baseline="bottom"),!0}}function Uh(e,t,n,i,r,s){let o=n/2;return e-o<0||e+o>r||t-(o=i/2)<0||t+o>s}function vs(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function WG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Uh(p,g,d,h,r,s)&&!vs(e,p,g,h,d,m,o,a)&&!vs(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,vs(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Mn.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,E,S,w,_,$,C,T,O,k,F,A,M,P,z;for(let U=0;U<f;++U){for(b=c[U].x,x=c[U].y,v=c[U].x2===void 0?b:c[U].x2,E=c[U].y2===void 0?x:c[U].y2,b>v&&(z=b,b=v,v=z),x>E&&(z=x,x=E,E=z),C=e(b),O=e(v),T=~~((C+O)/2),k=e(x),A=e(E),F=~~((k+A)/2),_=T;_>=C;--_)for($=F;$>=k;--$)P=u(_,$,p,h,d),P&&([l.x,l.y,p,g]=P);for(_=T;_<=O;++_)for($=F;$<=A;++$)P=u(_,$,p,h,d),P&&([l.x,l.y,p,g]=P);!g&&!n&&(M=Math.abs(v-b+E-x),S=(b+v)/2,w=(x+E)/2,M>=y&&!Uh(S,w,h,d,r,s)&&!vs(e,S,w,d,h,d,o,null)&&(y=M,l.x=S,l.y=w,m=!0))}return g||m?(S=h/2,w=d/2,o.setRange(e(l.x-S),e(l.y-w),e(l.x+S),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const HG=[-1,-1,1,1],GG=[-1,1,-1,1];function VG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Mn.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,E,S,w,_,$,C,T,O,k,F;for(let A=0;A<f;++A){for(v=c[A].x,E=c[A].y,x=c[A].x2===void 0?v:c[A].x2,S=c[A].y2===void 0?E:c[A].y2,p.push([e((v+x)/2),e((E+S)/2)]);p.length;)if([$,C]=p.pop(),!(o.get($,C)||a.get($,C)||u.get($,C))){u.set($,C);for(let M=0;M<4;++M)w=$+HG[M],_=C+GG[M],u.outOfBounds(w,_,w,_)||p.push([w,_]);if(w=e.invert($),_=e.invert(C),T=g,O=s,!Uh(w,_,h,d,r,s)&&!vs(e,w,_,d,h,T,o,a)&&!vs(e,w,_,d,h,d,o,null)){for(;O-T>=1;)k=(T+O)/2,vs(e,w,_,d,h,k,o,a)?O=k:T=k;T>g&&(l.x=w,l.y=_,g=T,m=!0)}}!m&&!n&&(F=Math.abs(x-v+S-E),w=(v+x)/2,_=(E+S)/2,F>=b&&!Uh(w,_,h,d,r,s)&&!vs(e,w,_,d,h,d,o,null)&&(b=F,l.x=w,l.y=_,y=!0))}return m||y?(w=h/2,_=d/2,o.setRange(e(l.x-w),e(l.y-_),e(l.x+w),e(l.y+_)),l.align="center",l.baseline="middle",!0):!1}}const XG=["right","center","left"],YG=["bottom","middle","top"];function KG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,E,S,w,_,$,C,T;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,p=(n[O]>>>2&3)-1,g=h===0&&p===0||i[O]<0,m=h&&p?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+p]+y*f*p/2+i[O]*p*m,x=w-f/2,E=w+f/2,_=e(b),C=e(x),T=e(E),!d)if(J_(_,_,C,T,o,a,b,b,x,E,c,g))d=Mn.width(l.datum,l.datum.text);else continue;if(S=b+y*d*h/2,b=S-d/2,v=S+d/2,_=e(b),$=e(v),J_(_,$,C,T,o,a,b,v,x,E,c,g))return l.x=h?h*y<0?v:b:S,l.y=p?p*y<0?E:x:w,l.align=XG[h*y+1],l.baseline=YG[p*y+1],o.setRange(_,C,$,T),!0}return!1}}function J_(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const i0=0,r0=4,s0=8,o0=0,a0=1,u0=2,JG={"top-left":i0+o0,top:i0+a0,"top-right":i0+u0,left:r0+o0,middle:r0+a0,right:r0+u0,"bottom-left":s0+o0,bottom:s0+a0,"bottom-right":s0+u0},QG={naive:qG,"reduced-search":WG,floodfill:VG};function ZG(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=eV(i,f),h=tV(r,f),p=nV(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=iV(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const S=e.map(C=>{const T=b?Mn.width(C,C.text):void 0;return x=Math.max(x,T),E=Math.max(E,C.fontSize),{datum:C,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(C),textWidth:T}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=jG(t[0],t[1],l);let _;if(!v){n&&S.sort((O,k)=>n(O.datum,k.datum));let C=!1;for(let O=0;O<h.length&&!C;++O)C=h[O]===5||d[O]<0;const T=(p&&o||m)&&e.map(O=>O.datum);_=s.length||T?IG(w,T||[],s,C,m):zG(w,o&&S)}const $=m?QG[c](w,_,o,u):KG(w,_,h,d);return S.forEach(C=>C.opacity=+$(C)),S}function eV(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function tV(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=JG[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function nV(e){return e&&e.mark&&e.mark.marktype}function iV(e,t,n,i){const r=s=>[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const sy=["x","y","opacity","align","baseline"],rO=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function r2(e){D.call(this,null,e)}r2.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:rO},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:sy.length,default:sy}]};G(r2,D,{transform(e,t){function n(s){const o=e[s];return fe(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&N("Size parameter should be specified as a [width, height] array.");const r=e.as||sy;return ZG(t.materialize(t.SOURCE).source||[],e.size,e.sort,Y(e.offset==null?1:e.offset),Y(e.anchor||rO),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const rV=Object.freeze(Object.defineProperty({__proto__:null,label:r2},Symbol.toStringTag,{value:"Module"}));function sO(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function s2(e){D.call(this,null,e)}s2.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};G(s2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=sO(i,e.groupby),s=(e.groupby||[]).map(Je),o=s.length,a=e.as||[Je(e.x),Je(e.y)],u=[];r.forEach(l=>{DF(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<o;++d)f[s[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const oy={constant:qb,linear:Wb,log:CF,exp:FF,pow:TF,quad:Hb,poly:MF},sV=(e,t)=>e==="poly"?t:e==="quad"?2:1;function o2(e){D.call(this,null,e)}o2.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(oy)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};G(o2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=sO(i,e.groupby),s=(e.groupby||[]).map(Je),o=e.method||"linear",a=e.order==null?3:e.order,u=sV(o,a),l=e.as||[Je(e.x),Je(e.y)],c=oy[o],f=[];let d=e.extent;J(oy,o)||N("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Ji(h,e.x),y=b=>{const v={};for(let x=0;x<s.length;++x)v[s[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};o==="linear"||o==="constant"?m.forEach(b=>y([b,g.predict(b)])):Np(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const oV=Object.freeze(Object.defineProperty({__proto__:null,loess:s2,regression:o2},Symbol.toStringTag,{value:"Module"})),Rr=11102230246251565e-32,Dt=134217729,aV=(3+8*Rr)*Rr;function l0(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f<e;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f],s=o,a!==0&&(r[h++]=a);for(;d<n;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d],s=o,a!==0&&(r[h++]=a);return(s!==0||h===0)&&(r[h++]=s),h}function uV(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function rf(e){return new Float64Array(e)}const lV=(3+16*Rr)*Rr,cV=(2+12*Rr)*Rr,fV=(9+64*Rr)*Rr*Rr,Ea=rf(4),Q_=rf(8),Z_=rf(12),e$=rf(16),Vt=rf(4);function dV(e,t,n,i,r,s,o){let a,u,l,c,f,d,h,p,g,m,y,b,v,x,E,S,w,_;const $=e-r,C=n-r,T=t-s,O=i-s;x=$*O,d=Dt*$,h=d-(d-$),p=$-h,d=Dt*O,g=d-(d-O),m=O-g,E=p*m-(x-h*g-p*g-h*m),S=T*C,d=Dt*T,h=d-(d-T),p=T-h,d=Dt*C,g=d-(d-C),m=C-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Ea[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Ea[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Ea[2]=b-(_-f)+(y-f),Ea[3]=_;let k=uV(4,Ea),F=cV*o;if(k>=F||-k>=F||(f=e-$,a=e-($+f)+(f-r),f=n-C,l=n-(C+f)+(f-r),f=t-T,u=t-(T+f)+(f-s),f=i-O,c=i-(O+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(F=fV*o+aV*Math.abs(k),k+=$*c+O*a-(T*l+C*u),k>=F||-k>=F))return k;x=a*O,d=Dt*a,h=d-(d-a),p=a-h,d=Dt*O,g=d-(d-O),m=O-g,E=p*m-(x-h*g-p*g-h*m),S=u*C,d=Dt*u,h=d-(d-u),p=u-h,d=Dt*C,g=d-(d-C),m=C-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const A=l0(4,Ea,4,Vt,Q_);x=$*c,d=Dt*$,h=d-(d-$),p=$-h,d=Dt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),S=T*l,d=Dt*T,h=d-(d-T),p=T-h,d=Dt*l,g=d-(d-l),m=l-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const M=l0(A,Q_,4,Vt,Z_);x=a*c,d=Dt*a,h=d-(d-a),p=a-h,d=Dt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),S=u*l,d=Dt*u,h=d-(d-u),p=u-h,d=Dt*l,g=d-(d-l),m=l-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const P=l0(M,Z_,4,Vt,e$);return e$[P-1]}function Hf(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=lV*l?u:-dV(e,t,n,i,r,s,l)}const t$=Math.pow(2,-52),Gf=new Uint32Array(512);class jh{static from(t,n=yV,i=bV){const r=t.length,s=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];s[2*o]=n(a),s[2*o+1]=i(a)}return new jh(s)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*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(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let $=0;$<o;$++){const C=t[2*$],T=t[2*$+1];C<a&&(a=C),T<u&&(u=T),C>l&&(l=C),T>c&&(c=T),this._ids[$]=$}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let $=0,C=1/0;$<o;$++){const T=c0(f,d,t[2*$],t[2*$+1]);T<C&&(h=$,C=T)}const m=t[2*h],y=t[2*h+1];for(let $=0,C=1/0;$<o;$++){if($===h)continue;const T=c0(m,y,t[2*$],t[2*$+1]);T<C&&T>0&&(p=$,C=T)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let $=0;$<o;$++){if($===h||$===p)continue;const C=gV(m,y,b,v,t[2*$],t[2*$+1]);C<x&&(g=$,x=C)}let E=t[2*g],S=t[2*g+1];if(x===1/0){for(let T=0;T<o;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];La(this._ids,this._dists,0,o-1);const $=new Uint32Array(o);let C=0;for(let T=0,O=-1/0;T<o;T++){const k=this._ids[T],F=this._dists[k];F>O&&($[C++]=k,O=F)}this.hull=$.subarray(0,C),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Hf(m,y,b,v,E,S)<0){const $=p,C=b,T=v;p=g,b=E,v=S,g=$,E=C,S=T}const w=mV(m,y,b,v,E,S);this._cx=w.x,this._cy=w.y;for(let $=0;$<o;$++)this._dists[$]=c0(t[2*$],t[2*$+1],w.x,w.y);La(this._ids,this._dists,0,o-1),this._hullStart=h;let _=3;i[h]=n[g]=p,i[p]=n[h]=g,i[g]=n[p]=h,r[h]=0,r[p]=1,r[g]=2,s.fill(-1),s[this._hashKey(m,y)]=h,s[this._hashKey(b,v)]=p,s[this._hashKey(E,S)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(let $=0,C,T;$<this._ids.length;$++){const O=this._ids[$],k=t[2*O],F=t[2*O+1];if($>0&&Math.abs(k-C)<=t$&&Math.abs(F-T)<=t$||(C=k,T=F,O===h||O===p||O===g))continue;let A=0;for(let te=0,ne=this._hashKey(k,F);te<this._hashSize&&(A=s[(ne+te)%this._hashSize],!(A!==-1&&A!==i[A]));te++);A=n[A];let M=A,P;for(;P=i[M],Hf(k,F,t[2*M],t[2*M+1],t[2*P],t[2*P+1])>=0;)if(M=P,M===A){M=-1;break}if(M===-1)continue;let z=this._addTriangle(M,O,i[M],-1,-1,r[M]);r[O]=this._legalize(z+2),r[M]=z,_++;let U=i[M];for(;P=i[U],Hf(k,F,t[2*U],t[2*U+1],t[2*P],t[2*P+1])<0;)z=this._addTriangle(U,O,P,r[O],-1,r[U]),r[O]=this._legalize(z+2),i[U]=U,_--,U=P;if(M===A)for(;P=n[M],Hf(k,F,t[2*P],t[2*P+1],t[2*M],t[2*M+1])<0;)z=this._addTriangle(P,O,M,-1,r[M],r[P]),this._legalize(z+2),r[P]=z,i[M]=M,_--,M=P;this._hullStart=n[O]=M,i[M]=n[U]=O,i[O]=U,s[this._hashKey(k,F)]=O,s[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(_);for(let $=0,C=this._hullStart;$<_;$++)this.hull[$]=C,C=i[C];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(hV(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let s=0,o=0;for(;;){const a=i[t],u=t-t%3;if(o=u+(t+2)%3,a===-1){if(s===0)break;t=Gf[--s];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[o],h=n[t],p=n[c],g=n[f];if(pV(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*g],r[2*g+1])){n[t]=g,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[o]),this._link(o,f);const b=l+(a+1)%3;s<Gf.length&&(Gf[s++]=b)}else{if(s===0)break;t=Gf[--s]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,s,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,s),this._link(a+2,o),this.trianglesLen+=3,a}}function hV(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function c0(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function pV(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function gV(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function mV(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,p=t+(o*f-u*c)*d;return{x:h,y:p}}function La(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;fl(e,r,s),t[e[n]]>t[e[i]]&&fl(e,n,i),t[e[s]]>t[e[i]]&&fl(e,s,i),t[e[n]]>t[e[s]]&&fl(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]<u);do o--;while(t[e[o]]>u);if(o<s)break;fl(e,s,o)}e[n+1]=e[o],e[o]=a,i-s+1>=o-n?(La(e,t,s,i),La(e,t,n,o-1)):(La(e,t,n,o-1),La(e,t,s,i))}}function fl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function yV(e){return e[0]}function bV(e){return e[1]}const n$=1e-6;class So{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,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>n$||Math.abs(this._y1-s)>n$)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class ay{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}}let vV=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))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=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g<y;g+=3,m+=2){const x=i[g]*2,E=i[g+1]*2,S=i[g+2]*2,w=t[x],_=t[x+1],$=t[E],C=t[E+1],T=t[S],O=t[S+1],k=$-w,F=C-_,A=T-w,M=O-_,P=(k*M-F*A)*2;if(Math.abs(P)<1e-9){if(s===void 0){s=o=0;for(const U of n)s+=t[U*2],o+=t[U*2+1];s/=n.length,o/=n.length}const z=1e9*Math.sign((s-w)*M-(o-_)*A);b=(w+T)/2-z*M,v=(_+O)/2+z*A}else{const z=1/P,U=k*k+F*F,te=A*A+M*M;b=w+(M*U-F*te)*z,v=_+(k*te-A*U)*z}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];r.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],r[l+2]=r[c]=h-p,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new So:void 0,{delaunay:{halfedges:i,inedges:r,hull:s},circumcenters:o,vectors:a}=this;if(s.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,g=o[h],m=o[h+1],y=o[p],b=o[p+1];this._renderSegment(g,m,y,b,t)}let u,l=s[s.length-1];for(let c=0;c<s.length;++c){u=l,l=s[c];const f=Math.floor(r[l]/3)*2,d=o[f],h=o[f+1],p=u*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new So:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new So:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let s=r.length;for(;r[0]===r[s-2]&&r[1]===r[s-1]&&s>1;)s-=2;for(let o=2;o<s;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&n.lineTo(r[o],r[o+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new ay;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,s){let o;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(s.moveTo(t,n),s.lineTo(i,r)):(o=this._clipSegment(t,n,i,r,a,u))&&(s.moveTo(o[0],o[1]),s.lineTo(o[2],o[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let s=0,o=n.length;s<o;s+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[s]===r[a]&&n[s+1]===r[a+1]&&n[(s+2)%o]===r[(a+u-2)%u]&&n[(s+3)%o]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:s}}=this,o=i[t];if(o===-1)return null;const a=[];let u=o;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,s[u]!==t)break;u=r[u]}while(u!==o&&u!==-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];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,s,o,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(s=a,o=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let p,g,m,y,b;if(l===0){if((p=this._clipSegment(s,o,a,u,l,c))===null)continue;[g,m,y,b]=p}else{if((p=this._clipSegment(a,u,s,o,c,l))===null)continue;[y,b,g,m]=p,f=d,d=this._edgecode(g,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(g,m):r=[g,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.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 r}_clipSegment(t,n,i,r,s,o){const a=s<o;for(a&&([t,n,i,r,s,o]=[i,r,t,n,o,s]);;){if(s===0&&o===0)return a?[i,r,t,n]:[t,n,i,r];if(s&o)return null;let u,l,c=s||o;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),s?(t=u,n=l,s=this._regioncode(t,n)):(i=u,r=l,o=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,s,o){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],s,o))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=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,i,r,s){for(;n!==i;){let o,a;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,a=this.ymin;break}(r[s]!==o||r[s+1]!==a)&&this.contains(t,o,a)&&(r.splice(s,0,o,a),s+=2)}return s}_project(t,n,i,r){let s=1/0,o,a,u;if(r<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/r)<s&&(u=this.ymin,a=t+(s=o)*i)}else if(r>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)<s&&(u=this.ymax,a=t+(s=o)*i)}if(i>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)<s&&(a=this.xmax,u=n+(s=o)*r)}else if(i<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/i)<s&&(a=this.xmin,u=n+(s=o)*r)}return[a,u]}_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){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const xV=2*Math.PI,Sa=Math.pow;function wV(e){return e[0]}function EV(e){return e[1]}function SV(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],s=2*t[i+1],o=2*t[i+2];if((n[o]-n[r])*(n[s+1]-n[r+1])-(n[s]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}function _V(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class a2{static from(t,n=wV,i=EV,r){return new a2("length"in t?$V(t,n,i,r):Float64Array.from(AV(t,n,i,r)))}constructor(t){this._delaunator=new jh(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(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&SV(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const p=_V(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new jh(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=s[u%3===2?u-2:u+1];(i[u]===-1||o[c]===-1)&&(o[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new vV(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=s[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let s;for(;(s=this._step(i,t,n))>=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Sa(n-l[t*2],2)+Sa(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=Sa(n-l[p*2],2)+Sa(i-l[p*2+1],2);if(g<f&&(f=g,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=s[(o[t]+1)%s.length],h!==p&&Sa(n-l[h*2],2)+Sa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new So:void 0,{points:i,halfedges:r,triangles:s}=this;for(let o=0,a=r.length;o<a;++o){const u=r[o];if(u<o)continue;const l=s[o]*2,c=s[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+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;const i=t==null?t=new So:void 0,{points:r}=this;for(let s=0,o=r.length;s<o;s+=2){const a=r[s],u=r[s+1];t.moveTo(a+n,u),t.arc(a,u,n,0,xV)}return i&&i.value()}renderHull(t){const n=t==null?t=new So:void 0,{hull:i,points:r}=this,s=i[0]*2,o=i.length;t.moveTo(r[s],r[s+1]);for(let a=1;a<o;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new ay;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new So:void 0,{points:r,triangles:s}=this,o=s[t*=3]*2,a=s[t+1]*2,u=s[t+2]*2;return n.moveTo(r[o],r[o+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new ay;return this.renderTriangle(t,n),n.value()}}function $V(e,t,n,i){const r=e.length,s=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];s[o*2]=t.call(i,a,o,e),s[o*2+1]=n.call(i,a,o,e)}return s}function*AV(e,t,n,i){let r=0;for(const s of e)yield t.call(i,s,r,e),yield n.call(i,s,r,e),++r}function u2(e){D.call(this,null,e)}u2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const kV=[-1e5,-1e5,1e5,1e5];G(u2,D,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:kV;const s=this.value=a2.from(i,e.x,e.y).voronoi(r);for(let o=0,a=i.length;o<a;++o){const u=s.cellPolygon(o);i[o][n]=u&&!FV(u)?CV(u):null}return t.reflow(e.modified()).modifies(n)}});function CV(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function FV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const TV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:u2},Symbol.toStringTag,{value:"Module"}));var f0=Math.PI/180,Bl=64,Fd=2048;function MV(){var e=[256,256],t,n,i,r,s,o,a,u=oO,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(_s()),g=PV((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(S=>({text:t(S),font:n(S),style:r(S),weight:s(S),rotate:o(S),size:~~(i(S)+1e-14),padding:a(S),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:S})).sort((S,w)=>w.size-S.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,DV(p,E,x,b),E.hasText&&h(g,E,m)&&(v.push(E),m?RV(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(Bl<<5)/g,p.height=Fd/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,S=-E,w,_,$;(w=x(S+=E))&&(_=~~w[0],$=~~w[1],!(Math.min(Math.abs(_),Math.abs($))>=v));)if(g.x=y+_,g.y=b+$,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!OV(g,p,e[0]))&&(!m||NV(g,m))){for(var C=g.sprite,T=g.width>>5,O=e[0]>>5,k=g.x-(T<<4),F=k&127,A=32-F,M=g.y1-g.y0,P=(g.y+g.y0)*O+(k>>5),z,U=0;U<M;U++){z=0;for(var te=0;te<=T;te++)p[P+te]|=z<<A|(te<T?(z=C[U*T+te])>>>F:0);P+=O}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=no(p),f):n},f.fontStyle=function(p){return arguments.length?(r=no(p),f):r},f.fontWeight=function(p){return arguments.length?(s=no(p),f):s},f.rotate=function(p){return arguments.length?(o=no(p),f):o},f.text=function(p){return arguments.length?(t=no(p),f):t},f.spiral=function(p){return arguments.length?(u=zV[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=no(p),f):i},f.padding=function(p){return arguments.length?(a=no(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function DV(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Bl<<5)/s,Fd/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,c=r.measureText(t.text+"m").width*s,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*f0),m=Math.cos(t.rotate*f0),y=c*m,b=c*g,v=d*m,x=d*g;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=Bl<<5&&(o=0,a+=u,u=0),a+d>=Fd)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*f0),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var E=r.getImageData(0,0,(Bl<<5)/s,Fd/s).data,S=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)S[h]=0;if(o=t.xoff,o==null)return;a=t.yoff;var w=0,_=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var $=f*p+(h>>5),C=E[(a+p)*(Bl<<5)+(o+h)<<2]?1<<31-h%32:0;S[$]|=C,w|=C}w?_=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+_,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function OV(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>o:0))&t[l+d])return!0;l+=n}return!1}function RV(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function NV(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function oO(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function LV(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var o=s<0?-1:1;switch(Math.sqrt(1+4*o*s)-o&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function PV(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function no(e){return typeof e=="function"?e:function(){return e}}var zV={archimedean:oO,rectangular:LV};const aO=["x","y","font","fontSize","fontStyle","fontWeight","angle"],IV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function l2(e){D.call(this,MV(),e)}l2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:aO}]};G(l2,D,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&N("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return fe(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||IV.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,o=e.as||aO;let a=e.fontSize||14,u;if(fe(a)?u=e.fontSizeRange:a=Ht(a),u){const p=a,g=ke("sqrt")().domain(Ji(r,p)).range(u);a=m=>g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Jn).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;p<h;++p)g=l[p],m=g.datum,m[o[0]]=g.x+f,m[o[1]]=g.y+d,m[o[2]]=g.font,m[o[3]]=g.size,m[o[4]]=g.style,m[o[5]]=g.weight,m[o[6]]=g.rotate;return t.reflow(i).modifies(o)}});const BV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:l2},Symbol.toStringTag,{value:"Module"})),UV=e=>new Uint8Array(e),jV=e=>new Uint16Array(e),Zl=e=>new Uint32Array(e);function qV(){let e=8,t=[],n=Zl(0),i=Vf(0,e),r=Vf(0,e);return{data:()=>t,seen:()=>n=WV(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;o<u;++o)l=s[o],l._index=a++,t.push(l)},remove(s,o){const a=t.length,u=Array(a-s),l=t;let c,f,d;for(f=0;!o[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],o[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=Vf(s,e,i),r=Vf(s,e))}}}function WV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Vf(e,t,n){const i=(t<257?UV:t<65537?jV:Zl)(e);return n&&i.set(n),i}function i$(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,s){const o=this,a=o.bisect(o.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)s[u[d]]|=i;for(d=c;d<f;++d)s[u[d]]|=i;return o}}}function r$(){let e=Zl(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Zl(f);let h=Array(f),p,g,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=HV(h,d),c)p=t,g=e,t=Array(c+f),e=Zl(c+f),GV(l,p,g,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function s(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function o(a,u){let l;return u?l=u.length:(u=t,l=n),[DL(u,a[0],0,l),Va(u,a[1],0,l)]}return{insert:i,remove:r,bisect:o,reindex:s,index:()=>e,size:()=>n}}function HV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return r<s?-1:r>s?1:0}),zP(e,t)}function GV(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;l<i&&c<o;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=s[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<o;++c,++f)a[f]=r[c],u[f]=s[c]+e}function c2(e){D.call(this,qV(),e),this._indices=null,this._dims=null}c2.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};G(c2,D,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a<o;++a)u=n[a].fname,l=r[u]||(r[u]=r$()),s.push(i$(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,o=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,b,v,x,E,S,w;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,S=b.length;E<S;++E)x[b[E]._index]=1;for(E=0;E<h;++E)w=i[E],(!o[E]||e.modified("fields",E)||t.modified(w.fields))&&(y=w.fname,(g=p[y])||(s[y]=m=r$(),p[y]=g=m.insert(w,t.source,0)),o[E]=i$(m,E,r[E]).onAdd(g,u));for(E=0,S=a.data().length;E<S;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,s=this._dims,o=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=s.length;let d=r.size(),h,p,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)p=a[h].fname,g=u[p]||(u[p]=o[p].insert(a[h],i,d)),s[h].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),s=i.all(),o=e.mod;let a,u,l;for(a=0,u=o.length;a<u;++a)l=o[a]._index,r[l]!==s&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),o=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,o[h]=p=s[h],s[h]=a,p!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;l<o;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<o;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),o=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,s=r.curr(),o=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let p,g,m;if(l<f)for(p=l,g=Math.min(f,c);p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(l>f)for(p=f,g=Math.min(l,d);p<g;++p)m=o[p],s[m]^=h,i.push(m);if(c>d)for(p=Math.max(l,d),g=c;p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(c<d)for(p=Math.max(f,c),g=d;p<g;++p)m=o[p],s[m]^=h,i.push(m);e.range=t.slice()}});function f2(e){D.call(this,null,e)}f2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};G(f2,D,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const s=t.fork(t.ALL),o=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const VV=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:c2,resolvefilter:f2},Symbol.toStringTag,{value:"Module"})),XV="RawCode",Io="Literal",YV="Property",KV="Identifier",JV="ArrayExpression",QV="BinaryExpression",uO="CallExpression",ZV="ConditionalExpression",eX="LogicalExpression",tX="MemberExpression",nX="ObjectExpression",iX="UnaryExpression";function _i(e){this.type=e}_i.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=rX(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function rX(e){switch(e.type){case JV:return e.elements;case QV:case eX:return[e.left,e.right];case uO:return[e.callee].concat(e.arguments);case ZV:return[e.test,e.consequent,e.alternate];case tX:return[e.object,e.property];case nX:return e.properties;case YV:return[e.key,e.value];case iX:return[e.argument];case KV:case Io:case XV:default:return[]}}var cr,Z,R,jt,Me,cg=1,sf=2,Bo=3,Ws=4,fg=5,ia=6,fn=7,of=8,sX=9;cr={};cr[cg]="Boolean";cr[sf]="<end>";cr[Bo]="Identifier";cr[Ws]="Keyword";cr[fg]="Null";cr[ia]="Numeric";cr[fn]="Punctuator";cr[of]="String";cr[sX]="RegularExpression";var oX="ArrayExpression",aX="BinaryExpression",uX="CallExpression",lX="ConditionalExpression",lO="Identifier",cX="Literal",fX="LogicalExpression",dX="MemberExpression",hX="ObjectExpression",pX="Property",gX="UnaryExpression",dt="Unexpected token %0",mX="Unexpected number",yX="Unexpected string",bX="Unexpected identifier",vX="Unexpected reserved word",xX="Unexpected end of input",uy="Invalid regular expression",d0="Invalid regular expression: missing /",cO="Octal literals are not allowed in strict mode.",wX="Duplicate data property in object literal not allowed in strict mode",$t="ILLEGAL",wc="Disabled.",EX=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),SX=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function dg(e,t){if(!e)throw new Error("ASSERT: "+t)}function _r(e){return e>=48&&e<=57}function d2(e){return"0123456789abcdefABCDEF".includes(e)}function ec(e){return"01234567".includes(e)}function _X(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Ec(e){return e===10||e===13||e===8232||e===8233}function af(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&EX.test(String.fromCharCode(e))}function qh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&SX.test(String.fromCharCode(e))}const $X={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function fO(){for(;R<jt;){const e=Z.charCodeAt(R);if(_X(e)||Ec(e))++R;else break}}function ly(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<jt&&d2(Z[R])?(i=Z[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):_e({},dt,$t);return String.fromCharCode(r)}function AX(){var e,t,n,i;for(e=Z[R],t=0,e==="}"&&_e({},dt,$t);R<jt&&(e=Z[R++],!!d2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&_e({},dt,$t),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function dO(){var e,t;for(e=Z.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(Z.charCodeAt(R)!==117&&_e({},dt,$t),++R,e=ly("u"),(!e||e==="\\"||!af(e.charCodeAt(0)))&&_e({},dt,$t),t=e);R<jt&&(e=Z.charCodeAt(R),!!qh(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Z.charCodeAt(R)!==117&&_e({},dt,$t),++R,e=ly("u"),(!e||e==="\\"||!qh(e.charCodeAt(0)))&&_e({},dt,$t),t+=e);return t}function kX(){var e,t;for(e=R++;R<jt;){if(t=Z.charCodeAt(R),t===92)return R=e,dO();if(qh(t))++R;else break}return Z.slice(e,R)}function CX(){var e,t,n;return e=R,t=Z.charCodeAt(R)===92?dO():kX(),t.length===1?n=Bo:$X.hasOwnProperty(t)?n=Ws:t==="null"?n=fg:t==="true"||t==="false"?n=cg:n=Bo,{type:n,value:t,start:e,end:R}}function h0(){var e=R,t=Z.charCodeAt(R),n,i=Z[R],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:fn,value:String.fromCharCode(t),start:e,end:R};default:if(n=Z.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:fn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,Z.charCodeAt(R)===61&&++R,{type:fn,value:Z.slice(e,R),start:e,end:R}}}if(o=Z.substr(R,4),o===">>>=")return R+=4,{type:fn,value:o,start:e,end:R};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return R+=3,{type:fn,value:s,start:e,end:R};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:fn,value:r,start:e,end:R};if(r==="//"&&_e({},dt,$t),"<>=!+-*%&|^/".includes(i))return++R,{type:fn,value:i,start:e,end:R};_e({},dt,$t)}function FX(e){let t="";for(;R<jt&&d2(Z[R]);)t+=Z[R++];return t.length===0&&_e({},dt,$t),af(Z.charCodeAt(R))&&_e({},dt,$t),{type:ia,value:parseInt("0x"+t,16),start:e,end:R}}function TX(e){let t="0"+Z[R++];for(;R<jt&&ec(Z[R]);)t+=Z[R++];return(af(Z.charCodeAt(R))||_r(Z.charCodeAt(R)))&&_e({},dt,$t),{type:ia,value:parseInt(t,8),octal:!0,start:e,end:R}}function s$(){var e,t,n;if(n=Z[R],dg(_r(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=Z[R++],n=Z[R],e==="0"){if(n==="x"||n==="X")return++R,FX(t);if(ec(n))return TX(t);n&&_r(n.charCodeAt(0))&&_e({},dt,$t)}for(;_r(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="."){for(e+=Z[R++];_r(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="e"||n==="E")if(e+=Z[R++],n=Z[R],(n==="+"||n==="-")&&(e+=Z[R++]),_r(Z.charCodeAt(R)))for(;_r(Z.charCodeAt(R));)e+=Z[R++];else _e({},dt,$t);return af(Z.charCodeAt(R))&&_e({},dt,$t),{type:ia,value:parseFloat(e),start:t,end:R}}function MX(){var e="",t,n,i,r,s=!1;for(t=Z[R],dg(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<jt;)if(i=Z[R++],i===t){t="";break}else if(i==="\\")if(i=Z[R++],!i||!Ec(i.charCodeAt(0)))switch(i){case"u":case"x":Z[R]==="{"?(++R,e+=AX()):e+=ly(i);break;case"n":e+=`
|
17
|
+
`+e),kP(t.delimiter).parse(e+"")}Sb.responseType="text";function RI(e){return typeof Buffer=="function"&&fe(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function _b(e,t){const n=t&&t.property?Yn(t.property):Wt;return X(e)&&!RI(e)?NI(n(e),t):n(JSON.parse(e))}_b.responseType="json";function NI(e,t){return!L(e)&&aC(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const LI={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function lF(e,t){let n,i,r,s;return e=_b(e,t),t&&t.feature?(n=MP,r=t.feature):t&&t.mesh?(n=OP,r=t.mesh,s=LI[t.filter]):N("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):N("Invalid TopoJSON object: "+r),i&&i.features||[i]}lF.responseType="json";const dd={dsv:Sb,csv:XE(","),tsv:XE(" "),json:_b,topojson:lF};function $b(e,t){return arguments.length>1?(dd[e]=t,this):J(dd,e)?dd[e]:null}function cF(e){const t=$b(e);return t&&t.responseType||"text"}function fF(e,t,n,i){t=t||{};const r=$b(t.type||"json");return r||N("Unknown data format type: "+t.type),e=r(e,t),t.parse&&PI(e,t.parse,n,i),J(e,"columns")&&delete e.columns,e}function PI(e,t,n,i){if(!e.length)return;const r=cc();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=uF(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!o1[p])throw Error("Illegal format pattern: "+h+":"+p);return o1[p]});for(u=0,c=e.length,f=s.length;u<c;++u)for(o=e[u],l=0;l<f;++l)a=s[l],o[a]=d[l](o[a])}const $p=EI(typeof fetch<"u"&&fetch,null);function Ap(e){const t=e||Wt,n=[],i={};return n.add=r=>{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function hd(e,t){try{await t(e)}catch(n){e.error(n)}}const dF=Symbol("vega_id");let zI=1;function kp(e){return!!(e&&re(e))}function re(e){return e[dF]}function hF(e,t){return e[dF]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return re(t)?t:hF(t,zI++)}function Ab(e){return Cp(e,Ce({}))}function Cp(e,t){for(const n in e)t[n]=e[n];return t}function pF(e,t){return hF(t,re(e))}function ea(e,t){return e?t?(n,i)=>e(n,i)||re(t(n))-re(t(i)):(n,i)=>e(n,i)||re(n)-re(i):null}function gF(e){return e&&e.constructor===ta}function ta(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:ta,insert(a){const u=Y(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=fe(a)?i:t,l=Y(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Ht(l)};return fe(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return fe(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return s=a,this},reflow(){return o=!0,this},pulse(a,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[re(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[re(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],u.forEach(b=>{p(b)&&(l[re(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=re(g),l[m]?l[m]=1:a.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[re(g)]<0&&a.rem.push(g);function y(b,v,x){x?b[v]=x(b):a.encode=v,o||(c[re(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[re(g)],m>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,u.forEach(b=>{p(b)&&l[re(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[re(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const pd="_:mod:_";function Fp(){Object.defineProperty(this,pd,{writable:!0,value:{}})}Fp.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[pd];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=L(n)?1+n.length:-1),r},modified(e,t){const n=this[pd];if(arguments.length){if(L(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[pd]={},this}};let II=0;const BI="pulse",UI=new Fp,jI=1,qI=2;function ze(e,t,n,i){this.id=++II,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function YE(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}ze.prototype={targets(){return this._targets||(this._targets=Ap(Lc))},set(e){return this.value!==e?(this.value=e,1):0},skip:YE(jI),modified:YE(qI),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Fp,r=this._argops=this._argops||[],s=[];let o,a,u,l;const c=(f,d,h)=>{h instanceof ze?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===BI)Y(a).forEach(f=>{f instanceof ze?f!==this&&(f.targets().add(this),s.push(f)):N("Pulse parameters must be operator instances.")}),this.source=a;else if(L(a))for(i.set(o,-1,Array(u=a.length)),l=0;l<u;++l)c(o,l,a[l]);else c(o,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||UI,n=this._argops;let i,r,s,o;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],s=i.op,o=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,o);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function WI(e,t,n,i){let r=1,s;return e instanceof ze?s=e:e&&e.prototype instanceof ze?s=new e:fe(e)?s=new ze(null,e):(r=0,s=new ze(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function HI(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let GI=0;function Tp(e,t,n){this.id=++GI,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function is(e,t,n){return new Tp(e,t,n)}Tp.prototype={_filter:Rn,_apply:Wt,targets(){return this._targets||(this._targets=Ap(Lc))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=is(e);return this.targets().add(t),t},apply(e){const t=is(null,e);return this.targets().add(t),t},merge(){const e=is();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=is();return this.targets().add(is(null,null,fb(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(is(null,null,()=>n=!0)),t.targets().add(is(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Rn,this._targets=null}};function VI(e,t,n,i){const r=this,s=is(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=Y(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,o);return s}function XI(e,t){const n=this.locale();return fF(e,t,n.timeParse,n.utcParse)}function YI(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function KI(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:cF(t&&t.type)});try{r=n.parse(r,t)}catch(s){i=-2,n.warn("Data ingestion failed",e,s)}}catch(s){i=-1,n.warn("Loading failed",e,s)}return{data:r,status:i}}async function JI(e,t,n){const i=this,r=i._pending||QI(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(Rn).insert(s.data||[])),r.done(),s}function QI(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const ZI={skip:!0};function e4(e,t,n,i,r){return(e instanceof ze?n4:t4)(this,e,t,n,i,r),this}function t4(e,t,n,i,r,s){const o=ce({},s,ZI);let a,u;fe(n)||(n=Ht(n)),i===void 0?a=l=>e.touch(n(l)):fe(i)?(u=new ze(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;gF(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function n4(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new ze(null,i4(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function i4(e,t){return t=fe(t)?t:Ht(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function r4(e){e.rank=++this._rank}function s4(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&N("Cycle detected in dataflow graph.")}const Vd={},Ii=1,os=2,Er=4,o4=Ii|os,KE=Ii|Er,ya=Ii|os|Er,JE=8,sl=16,QE=32,ZE=64;function Ss(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Cm(e,t){const n=[];return ss(e,t,i=>n.push(i)),n}function eS(e,t){const n={};return e.visit(t,i=>{n[re(i)]=1}),i=>n[re(i)]?null:i}function Ff(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ss.prototype={StopPropagation:Vd,ADD:Ii,REM:os,MOD:Er,ADD_REM:o4,ADD_MOD:KE,ALL:ya,REFLOW:JE,SOURCE:sl,NO_SOURCE:QE,NO_FIELDS:ZE,fork(e){return new Ss(this.dataflow).init(this,e)},clone(){const e=this.fork(ya);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(ya|sl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ss(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&ZE)&&(n.fields=e.fields),t&Ii?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&os?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Er?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&QE?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||ya;return t&Ii&&this.add.length||t&os&&this.rem.length||t&Er&&this.mod.length},reflow(e){if(e)return this.fork(ya).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Er,eS(this,Ii))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return L(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?L(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Ii&&(n.addF=Ff(n.addF,t)),e&os&&(n.remF=Ff(n.remF,t)),e&Er&&(n.modF=Ff(n.modF,t)),e&sl&&(n.srcF=Ff(n.srcF,t)),n},materialize(e){e=e||ya;const t=this;return e&Ii&&t.addF&&(t.add=Cm(t.add,t.addF),t.addF=null),e&os&&t.remF&&(t.rem=Cm(t.rem,t.remF),t.remF=null),e&Er&&t.modF&&(t.mod=Cm(t.mod,t.modF),t.modF=null),e&sl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&sl)return ss(n.source,n.srcF,i),n;e&Ii&&ss(n.add,n.addF,i),e&os&&ss(n.rem,n.remF,i),e&Er&&ss(n.mod,n.modF,i);const r=n.source;if(e&JE&&r){const s=n.add.length+n.mod.length;s===r.length||(s?ss(r,eS(n,KE),i):ss(r,n.srcF,i))}return n}};function kb(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}G(kb,Ss,{fork(e){const t=new Ss(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?L(e)?e.some(i=>n[i]):n[e]:0},filter(){N("MultiPulse does not support filtering.")},materialize(){N("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});async function a4(e,t,n){const i=this,r=[];if(i._pulse)return mF(i);if(i._pending&&await i._pending,t&&await hd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new Ss(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Ap(Lc);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Vd),u!==Vd&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await hd(i,c[f].callback)}return n&&await hd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function u4(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function l4(e,t,n){return this._pulse?mF(this):(this.evaluate(e,t,n),this)}function c4(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function mF(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function f4(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function d4(e,t){const n=e.source,i=this._clock;return n&&L(n)?new kb(this,i,n.map(r=>r.pulse),t):this._input[e.id]||h4(this._pulse,n&&n.pulse)}function h4(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Vd&&(e.source=t.source),e)}const Cb={skip:!1,force:!1};function p4(e,t){const n=t||Cb;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function g4(e,t,n){const i=n||Cb;return(e.set(t)||i.force)&&this.touch(e,i),this}function m4(e,t,n){this.touch(e,n||Cb);const i=new Ss(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function y4(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),yF(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,b4(t,0,e)):i=n,i}}}function yF(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function b4(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o<r;)a=o+1,a<r&&n(e[o],e[a])>=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,yF(e,i,t,n)}function za(){this.logger(ob()),this.logLevel(rb),this._clock=0,this._rank=0,this._locale=Eb();try{this._loader=$p()}catch{}this._touched=Ap(Lc),this._input={},this._pulse=null,this._heap=y4((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ol(e){return function(){return this._log[e].apply(this,arguments)}}za.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:ol("error"),warn:ol("warn"),info:ol("info"),debug:ol("debug"),logLevel:ol("level"),cleanThreshold:1e4,add:WI,connect:HI,rank:r4,rerank:s4,pulse:m4,touch:p4,update:g4,changeset:ta,ingest:YI,parse:XI,preload:JI,request:KI,events:VI,on:e4,evaluate:a4,run:l4,runAsync:u4,runAfter:c4,_enqueue:f4,_getPulse:d4};function D(e,t){ze.call(this,e,null,t)}G(D,ze,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Qa={};function bF(e){const t=vF(e);return t&&t.Definition||null}function vF(e){return e=e&&e.toLowerCase(),J(Qa,e)?Qa[e]:null}function*xF(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Fb(e,t,n){const i=Float64Array.from(xF(e,n));return i.sort(oc),t.map(r=>wC(i,r))}function Tb(e,t){return Fb(e,[.25,.5,.75],t)}function Mb(e,t){const n=e.length,i=PP(e,t),r=Tb(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function wF(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=s<c?c-a:c,o=Math.ceil(o/a)*a),{start:s,stop:o===s?s+a:o,step:a}}var Jn=Math.random;function v4(e){Jn=e}function EF(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(xF(e,i)),s=r.length,o=t;let a,u,l,c;for(l=0,c=Array(o);l<o;++l){for(a=0,u=0;u<s;++u)a+=r[~~(Jn()*s)];c[l]=a/s}return c.sort(oc),[J0(c,n/2),J0(c,1-n/2)]}function SF(e,t,n,i){i=i||(d=>d);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;o<a;++o)s[o]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;o<a;++o)s[o]=l;return n?x4(s,t+t/4):s}function x4(e,t){const n=e.length;let i=0,r=1,s,o;for(;e[i]===e[r];)++r;for(;r<n;){for(s=r+1;e[r]===e[s];)++s;if(e[r]-e[r-1]<t){for(o=r+(i+s-r-r>>1);o<r;)e[o++]=e[r];for(;o>r;)e[o--]=e[i]}i=r,r=s}return e}function w4(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function E4(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Jn())},pdf(o){return o===Math.floor(o)&&o>=n&&o<i?1/r:0},cdf(o){const a=Math.floor(o);return a<n?0:a>=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const _F=Math.sqrt(2*Math.PI),S4=Math.SQRT2;let al=NaN;function Mp(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(al===al)n=al,al=NaN;else{do n=Jn()*2-1,i=Jn()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,al=i*s}return e+n*t}function Db(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*_F)}function Dp(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function Op(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*S4*_4(2*e-1)}function _4(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}function Ob(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Mp(n,i),pdf:s=>Db(s,n,i),cdf:s=>Dp(s,n,i),icdf:s=>Op(s,n,i)};return r.mean(e).stdev(t)}function Rb(e,t){const n=Ob();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=Mb(e)),r):t},sample(){return e[~~(Jn()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;a<i;++a)o+=n.pdf((s-e[a])/t);return o/t/i},cdf(s){let o=0,a=0;for(;a<i;++a)o+=n.cdf((s-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Nb(e,t){return e=e||0,t=t??1,Math.exp(e+Mp()*t)}function Lb(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*_F*e)}function Pb(e,t,n){return Dp(Math.log(e),t,n)}function zb(e,t,n){return Math.exp(Op(e,t,n))}function $F(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Nb(n,i),pdf:s=>Lb(s,n,i),cdf:s=>Pb(s,n,i),icdf:s=>zb(s,n,i)};return r.mean(e).stdev(t)}function AF(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=o[l]==null?1:+o[l];for(l=0;l<n;++l)a[l]/=u;return a}const s={weights(o){return arguments.length?(i=r(t=o||[]),s):t},distributions(o){return arguments.length?(o?(n=o.length,e=o):(n=0,e=[]),s.weights(t)):e},sample(){const o=Jn();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(o<u){a=e[l];break}return a.sample()},pdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(o);return a},cdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(o);return a},icdf(){throw Error("Mixture icdf not supported.")}};return s.distributions(e).weights(t)}function Ib(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Jn()}function Bb(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Ub(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function jb(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function kF(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Ib(n,i),pdf:s=>Bb(s,n,i),cdf:s=>Ub(s,n,i),icdf:s=>jb(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function qb(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function zc(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Rp(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)s[a]-=u,o[a]-=l;return[s,o,u,l]}function Ic(e,t,n,i){let r=-1,s,o;for(const a of e)s=t(a),o=n(a),s!=null&&(s=+s)>=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function Lu(e,t,n,i,r){let s=0,o=0;return Ic(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function Wb(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ic(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=zc(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function CF(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ic(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=zc(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function FF(e,t,n){const[i,r,s,o]=Rp(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;Ic(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=zc(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:Lu(e,t,n,o,y)}}function TF(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;Ic(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,s+=(h*p-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=zc(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Lu(e,t,n,a,c)}}function Hb(e,t,n){const[i,r,s,o]=Rp(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h<a;)p=i[h],g=r[h++],m=p*p,u+=(m-u)/h,l+=(m*p-l)/h,c+=(m*m-c)/h,f+=(p*g-f)/h,d+=(m*g-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,E=-v*u,S=w=>(w=w-s,v*w*w+x*w+E+o);return{coef:[E-x*s+v*s*s+o,x-2*v*s,v],predict:S,rSquared:Lu(e,t,n,o,S)}}function MF(e,t,n,i){if(i===0)return qb(e,t,n);if(i===1)return Wb(e,t,n);if(i===2)return Hb(e,t,n);const[r,s,o,a]=Rp(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d)*s[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d+h);m[h]=g}c.push(m)}c.push(l);const y=A4(c),b=v=>{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:$4(f,y,-o,a),predict:b,rSquared:Lu(e,t,n,a,b)}}function $4(e,t,n,i){const r=Array(e);let s,o,a,u;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function A4(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;i<t;++i){for(o=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][o])&&(o=r);for(s=i;s<t+1;++s)a=e[s][i],e[s][i]=e[s][o],e[s][o]=a;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;s<t;++s)a+=e[s][r]*n[s];n[r]=(e[t][r]-a)/e[r][r]}return n}const tS=2,nS=1e-12;function DF(e,t,n,i){const[r,s,o,a]=Rp(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=tS;){const p=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=p[0],v=p[1],x=y-r[b]>r[v]-y?b:v;let E=0,S=0,w=0,_=0,$=0;const C=1/Math.abs(r[x]-y||1);for(let k=b;k<=v;++k){const F=r[k],A=s[k],M=k4(Math.abs(y-F)*C)*d[k],P=F*M;E+=M,S+=P,w+=A*M,_+=A*P,$+=F*P}const[T,O]=zc(S/E,w/E,_/E,$/E);c[m]=T+O*y,f[m]=Math.abs(s[m]-c[m]),C4(r,m+1,p)}if(h===tS)break;const g=EC(f);if(Math.abs(g)<nS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?nS:(b=1-y*y)*b}return F4(r,c,o,a)}function k4(e){return(e=1-e*e*e)*e*e}function C4(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function F4(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o<r;++o)l=e[o]+n,u[0]===l?u[1]+=(t[o]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[o]],s.push(u));return u[1]+=i,s}const T4=.5*Math.PI/180;function Np(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(s+g/n*a));return l.push(r(o)),l}else{c.push(r(o));for(let g=n;--g>0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=M4(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&D4(f,g,d,h,p)>T4?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function M4(e,t){let n=e,i=e;const r=t.length;for(let s=0;s<r;++s){const o=t[s][1];o<n&&(n=o),o>i&&(i=o)}return 1/(i-n)}function D4(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function O4(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function a1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:O4(e)}function OF(e,t,n){return n||e+(t?"_"+t:"")}const Fm=()=>{},R4={init:Fm,add:Fm,rem:Fm,idx:0},fc={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Bc=Object.keys(fc).filter(e=>e!=="__count__");function N4(e,t){return(n,i)=>ce({name:e,aggregate_param:i,out:n||e},R4,t)}[...Bc,"__count__"].forEach(e=>{fc[e]=N4(e,fc[e])});function RF(e,t,n){return fc[e](n,t)}function NF(e,t){return e.idx-t.idx}function L4(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=fc[r]())})};return e.forEach(n),Object.values(t).sort(NF)}function P4(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function z4(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function I4(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function B4(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function LF(e,t){const n=t||Wt,i=L4(e),r=e.slice().sort(NF);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=P4,s.prototype.add=z4,s.prototype.rem=I4,s.prototype.set=B4,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function Gb(e){this._key=e?Yn(e):re,this.reset()}const Ft=Gb.prototype;Ft.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Ft.add=function(e){this._add.push(e)};Ft.rem=function(e){this._rem.push(e)};Ft.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a<r;++a)o[n(t[a])]=1;for(a=0,u=0;a<i;++a)o[n(l=e[a])]?o[n(l)]=0:s[u++]=l;return this._rem=[],this._add=s};Ft.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",J(n,s)||(n[s]=1,++r);return r};Ft.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=sC(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Ft.argmin=function(e){return this.extent(e)[0]||{}};Ft.argmax=function(e){return this.extent(e)[1]||{}};Ft.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Ft.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Ft.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=Tb(this.values(),e),this._get=e),this._q};Ft.q1=function(e){return this.quartile(e)[0]};Ft.q2=function(e){return this.quartile(e)[1]};Ft.q3=function(e){return this.quartile(e)[2]};Ft.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=EF(this.values(),1e3,.05,e),this._get=e),this._ci};Ft.ci0=function(e){return this.ci(e)[0]};Ft.ci1=function(e){return this.ci(e)[1]};function ks(e){D.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ks.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Bc},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};G(ks,D,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}s(e._prev),s(t);function o(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?o(h,u,l):t[h]||e.cell(h,u)}}o("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=Y(Bt(b)),x=v.length;let E=0,S;for(;E<x;++E)i[S=v[E]]||(i[S]=1,t.push(S))}this._dims=Y(e.groupby),this._dnames=this._dims.map(b=>{const v=Je(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:a1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,h,p,g,m,y;for(l!==o.length&&N("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=s[y],d=o[y],h=a[y]||null,f==null&&d!=="count"&&N("Null aggregate field specified."),g=Je(f),m=OF(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(RF(d,h,m))}return this._measures=this._measures.map(b=>LF(b,b.field)),Object.create(null)},cellkey:a1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let s=0;s<r;++s)n.agg[s]=new i[s](n)}return n.store&&(n.data=new Gb),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let o=0;o<r;++o)s[n[o]]=i[o](e);return t?pF(t.tuple,s):Ce(s)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,s=i.length;r<s;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,o=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&o.push(u.tuple);for(c=0,f=this._alen;c<f;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?o:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const U4=1e-14;function Vb(e){D.call(this,null,e)}Vb.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};G(Vb,D,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,s=i.step,o=e.as||["bin0","bin1"],a=o[0],u=o[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Bt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=wF(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=zt(t(l));return c==null?null:c<r?-1/0:c>s?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(U4+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=En(u,Bt(t),e.name||"bin_"+Je(t))}});function PF(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?fC(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Xb(e){D.call(this,[],e)}Xb.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(Xb,D,{transform(e,t){const n=t.fork(t.ALL),i=PF(re,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(ea(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function zF(e){ze.call(this,null,j4,e)}G(zF,ze);function j4(e){return this.value&&!e.modified()?this.value:cb(e.fields,e.orders)}function Yb(e){D.call(this,null,e)}Yb.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function q4(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(Yb,D,{transform(e,t){const n=f=>d=>{for(var h=q4(a(d),e.case,s)||[],p,g=0,m=h.length;g<m;++g)o.test(p=h[g])||f(p)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,o=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Ce({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function Kb(e){D.call(this,null,e)}Kb.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(Kb,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=W4(a,r,s,e.filter||Rn)):n.mod=a,n.source=this.value,n.modifies(i)}});function W4(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;a<o;++a)for(s[t]=l=e[a],u=0;u<o;++u)s[n]=e[u],i(s)&&(r.push(Ce(s)),s={},s[t]=l);return r}const iS={kde:Rb,mixture:AF,normal:Ob,lognormal:$F,uniform:kF},H4="distributions",rS="function",G4="field";function IF(e,t){const n=e[rS];J(iS,n)||N("Unknown distribution function: "+n);const i=iS[n]();for(const r in e)r===G4?i.data((e.from||t()).map(e[r])):r===H4?i[r](e[r].map(s=>IF(s,t))):typeof i[r]===rS&&i[r](e[r]);return i}function Jb(e){D.call(this,null,e)}const BF=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],V4={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:BF},{name:"weights",type:"number",array:!0}]};Jb.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:BF.concat(V4)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(Jb,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=IF(e.distribution,X4(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&N("Invalid density method: "+o),!e.extent&&!i.data&&N("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||Ji(i.data()),l=Np(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function X4(e){return()=>e.materialize(e.SOURCE).source}function UF(e,t){return e?e.map((n,i)=>t[i]||Je(n)):null}function Qb(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;o<a;++o)u=e[o],l=t.map(r),c=s[l],c||(s[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const jF="bin";function Zb(e){D.call(this,null,e)}Zb.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:jF}]};const Y4=(e,t)=>Pc(Ji(e,t))/30;G(Zb,D,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Qb(t.source,e.groupby,Wt),r=e.smooth||!1,s=e.field,o=e.step||Y4(n,s),a=ea((p,g)=>s(p)-s(g)),u=e.as||jF,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const p=i[d].sort(a);h=-1;for(const g of SF(p,o,r,s))g<c&&(c=g),g>f&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function qF(e){ze.call(this,null,K4,e),this.modified(!0)}G(qF,ze);function K4(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:En(n=>t(n,e),Bt(t),Je(t))}function ev(e){D.call(this,[void 0,void 0],e)}ev.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(ev,D,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=zt(i(a));u!=null&&(u<s&&(s=u),u>o&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Je(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function tv(e,t){ze.call(this,e),this.parent=t,this.count=0}G(tv,ze,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function Lp(e){D.call(this,{},e),this._keys=Mu();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(Lp,D,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=J(r,e)&&r[e],o,a;return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new tv(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,s=this._keys,o=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=re(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(re(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=re(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(re(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=re(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function WF(e){ze.call(this,null,J4,e)}G(WF,ze);function J4(e){return this.value&&!e.modified()?this.value:L(e.name)?Y(e.name).map(t=>Yn(t)):Yn(e.name,e.as)}function nv(e){D.call(this,Mu(),e)}nv.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G(nv,D,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=re(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(re(f),1)});function c(f){const d=re(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function iv(e){D.call(this,[],e)}iv.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};G(iv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=UF(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=Ab(a),f=0;f<o;++f)d[r[f]]=(h=u[f][c])==null?null:h;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function rv(e){D.call(this,[],e)}rv.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};G(rv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Je),s=e.as||["key","value"],o=s[0],a=s[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Ab(l),f[o]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function sv(e){D.call(this,null,e)}sv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(sv,D,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(s,o=>o[i]=n(o,e))}});function HF(e){D.call(this,[],e)}G(HF,D,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=Ce(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const Tf={value:"value",median:EC,mean:BP,min:K0,max:$o},Q4=[];function ov(e){D.call(this,[],e)}ov.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function Z4(e){var t=e.method||Tf.value,n;if(Tf[t]==null)N("Unrecognized imputation method: "+t);else return t===Tf.value?(n=e.value!==void 0?e.value:0,()=>n):Tf[t]}function e9(e){const t=e.field;return n=>n?t(n):NaN}G(ov,D,{transform(e,t){var n=t.fork(t.ALL),i=Z4(e),r=e9(e),s=Je(e.field),o=Je(e.key),a=(e.groupby||[]).map(Je),u=t9(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],E={_impute:!0},y=0,x=p.length;y<x;++y)E[a[y]]=p[y];E[o]=g,E[s]=Number.isNaN(h)?h=i(d,r):h,l.push(Ce(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function t9(e,t,n,i){var r=y=>y(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],p=n(m),h=a[p]||(a[p]=o.push(p)),c=(l=t?t.map(r):Q4)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[h-1]=m;return s.domain=o,s}function av(e){ks.call(this,e)}av.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Bc},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(av,ks,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,s=>n.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{ce(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function uv(e){D.call(this,null,e)}uv.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(uv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Qb(i,e.groupby,e.field),s=(e.groupby||[]).map(Je),o=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&N("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Ji(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const p=Rb(h,o)[a],g=e.counts?h.length:1,m=c||Ji(h);Np(p,m,f,d).forEach(y=>{const b={};for(let v=0;v<s.length;++v)b[s[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function GF(e){ze.call(this,null,n9,e)}G(GF,ze);function n9(e){return this.value&&!e.modified()?this.value:db(e.fields,e.flat)}function VF(e){D.call(this,[],e),this._pending=null}G(VF,D,{transform(e,t){const n=t.dataflow;return this._pending?Tm(this,t,this._pending):i9(e)?t.StopPropagation:e.values?Tm(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=Y(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Tm(this,t,Y(i.data)))}});function i9(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Tm(e,t,n){n.forEach(Ce);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function lv(e){D.call(this,{},e)}lv.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};G(lv,D,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&N('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&N('The "as" parameter has too few output field names.'),c=c||r.map(Je),f=function(p){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](p)),b==null)for(y=0;y<d;++y,++m)p[c[m]]=s;else for(y=0;y<d;++y,++m)p[c[m]]=r[y](b)}):(c||N("Missing output field names."),f=function(p){for(var g=0,m;g<a;++g)m=i.get(n[g](p)),p[c[g]]=m??s}),o?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function XF(e){ze.call(this,null,r9,e)}G(XF,ze);function r9(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;s<n;++s)o=t[s],o[0]<i&&(i=o[0]),o[1]>r&&(r=o[1]);return[i,r]}function YF(e){ze.call(this,null,s9,e)}G(YF,ze);function s9(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function KF(e){D.call(this,null,e)}G(KF,D,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function cv(e){ks.call(this,e)}cv.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Bc,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(cv,ks,{_transform:ks.prototype.transform,transform(e,t){return this._transform(o9(e,t),t)}});function o9(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=Bt(n).concat(Bt(i)),o=u9(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>a9(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function a9(e,t,n,i){return En(r=>t(r)===e?n(r):NaN,i,e+"")}function u9(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(vp),t?r.slice(0,t):r}function JF(e){Lp.call(this,e)}G(JF,Lp,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(re(s),n,t,s);return(e.modified("field")||i&&t.modified(Bt(i)))&&N("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(Ce(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function fv(e){D.call(this,null,e)}fv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(fv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=UF(e.fields,e.as||[]),s=i?(a,u)=>l9(a,u,i,r):Cp;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=re(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,Ce({}));o[re(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[re(a)]))}),n}});function l9(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function QF(e){D.call(this,null,e)}G(QF,D,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function dv(e){D.call(this,null,e)}dv.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const c9=1e-14;G(dv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,s=Qb(r,e.groupby,e.field),o=(e.groupby||[]).map(Je),a=[],u=e.step||.01,l=e.probs||Fn(u/2,1-c9,u),c=l.length;return s.forEach(f=>{const d=Fb(f,l);for(let h=0;h<c;++h){const p={};for(let g=0;g<o.length;++g)p[o[g]]=f.dims[g];p[i[0]]=l[h],p[i[1]]=d[h],a.push(Ce(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function ZF(e){D.call(this,null,e)}G(ZF,D,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const s=re(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=Ab(r);i[re(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[re(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function hv(e){D.call(this,[],e),this.count=0}hv.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(hv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[re(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length<r?o.push(c):(d=~~((a+1)*Jn()),d<o.length&&d>=u&&(f=o[d],s[re(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=re(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[re(c)]!==-1)),(t.rem.length||i)&&o.length<r&&t.source&&(u=a=o.length,t.visit(t.SOURCE,c=>{s[re(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f<c;++f)s[re(o[f])]=-1,n.rem.push(o[f]);o=o.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[re(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[re(c)])),this.count=a,this.value=n.source=o,n}});function pv(e){D.call(this,null,e)}pv.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};G(pv,D,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Fn(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,Ce(s)}),n.add=t.add.concat(this.value),n}});function eT(e){D.call(this,null,e),this.modified(!0)}G(eT,D,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function gv(e){D.call(this,null,e)}const tT=["unit0","unit1"];gv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:yb,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:tT}]};G(gv,D,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?Nu:Ru)(s.unit).offset,a=e.as||tT,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Bt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=s(g),i&&(p[l]=y=o(m,c)),m<f&&(f=m),y>d&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:HC({extent:e.extent||Ji(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=bb(i),o=this.value||{},a=(n?LC:NC)(s,r);return a.unit=xe(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function nT(e){D.call(this,Mu(),e)}G(nT,D,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function iT(e){D.call(this,null,e)}G(iT,D,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ea(e.sort)):t.source).map(e.field))}});function f9(e,t,n,i){const r=dc[e](t,n);return{init:r.init||cs,update:function(s,o){o[i]=r.next(s)}}}const dc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=dc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||N("ntile num must be greater than zero.");const n=dc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||N("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=d9(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function d9(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const h9=Object.keys(dc);function rT(e){const t=Y(e.ops),n=Y(e.fields),i=Y(e.params),r=Y(e.aggregate_params),s=Y(e.as),o=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(p){Y(Bt(p)).forEach(g=>u[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Je(m),x=OF(p,v,s[g]);if(h(m),o.push(x),J(dc,p))a.push(f9(p,m,y,x));else{if(m==null&&p!=="count"&&N("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(RF(p,b,x))}}),(c.length||f.length)&&(this.cell=p9(f,c,d)),this.inputs=Object.keys(u)}const sT=rT.prototype;sT.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};sT.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o<e.i0;++o)n.rem(r[o]);for(o=e.p1;o<e.i1;++o)n.add(r[o]);n.set(t)}for(o=0;o<s;++o)i[o].update(e,t)};function p9(e,t,n){e=e.map(u=>LF(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;o<r;++o)s[o]=new e[o](i);if(i.store)var a=i.data=new Gb;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)s[l].add(s[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)s[l].rem(s[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=s.length;l<c;++l)s[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)s[u].init()},i}function mv(e){D.call(this,{},e),this._mlen=0,this._mods=[]}mv.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:h9.concat(Bc)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};G(mv,D,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ea(e.sort),r=a1(e.groupby),s=a=>this.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new rT(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)g9(this._mods[a],o,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(o.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=PF(re),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function g9(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,o=i.frame||[null,0],a=e.data(n),u=a.length,l=s?fp(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Ht(-1)};t.init();for(let f=0;f<u;++f)m9(c,o,f,u),s&&y9(c,l),t.update(c,a[f])}function m9(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function y9(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,o=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<o&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}const b9=Object.freeze(Object.defineProperty({__proto__:null,aggregate:ks,bin:Vb,collect:Xb,compare:zF,countpattern:Yb,cross:Kb,density:Jb,dotbin:Zb,expression:qF,extent:ev,facet:Lp,field:WF,filter:nv,flatten:iv,fold:rv,formula:sv,generate:HF,impute:ov,joinaggregate:av,kde:uv,key:GF,load:VF,lookup:lv,multiextent:XF,multivalues:YF,params:KF,pivot:cv,prefacet:JF,project:fv,proxy:QF,quantile:dv,relay:ZF,sample:hv,sequence:pv,sieve:eT,subflow:tv,timeunit:gv,tupleindex:nT,values:iT,window:mv},Symbol.toStringTag,{value:"Module"}));function Fe(e){return function(){return e}}const sS=Math.abs,Mt=Math.atan2,to=Math.cos,v9=Math.max,Mm=Math.min,Ri=Math.sin,wo=Math.sqrt,Ot=1e-12,Za=Math.PI,Xd=Za/2,oT=2*Za;function x9(e){return e>1?0:e<-1?Za:Math.acos(e)}function oS(e){return e>=1?Xd:e<=-1?-Xd:Math.asin(e)}const u1=Math.PI,l1=2*u1,po=1e-6,w9=l1-po;function aT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function E9(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return aT;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let yv=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?aT:E9(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,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,o){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,u=i-t,l=r-n,c=o-t,f=a-n,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>po)if(!(Math.abs(f*u-l*c)>po)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((u1-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,E=v/y;Math.abs(x-1)>po&&this._append`L${t+x*c},${n+x*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+E*u},${this._y1=n+E*l}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>po||Math.abs(this._y1-c)>po)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%l1+l1),d>w9?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>po&&this._append`A${i},${i},0,${+(d>=u1)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function Pp(){return new yv}Pp.prototype=yv.prototype;function zp(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new yv(t)}function S9(e){return e.innerRadius}function _9(e){return e.outerRadius}function $9(e){return e.startAngle}function A9(e){return e.endAngle}function k9(e){return e&&e.padAngle}function C9(e,t,n,i,r,s,o,a){var u=n-e,l=i-t,c=o-r,f=a-s,d=f*u-c*l;if(!(d*d<Ot))return d=(c*(t-s)-f*(e-r))/d,[e+d*u,t+d*l]}function Mf(e,t,n,i,r,s,o){var a=e-n,u=t-i,l=(o?s:-s)/wo(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,p=n+c,g=i+f,m=(d+p)/2,y=(h+g)/2,b=p-d,v=g-h,x=b*b+v*v,E=r-s,S=d*g-p*h,w=(v<0?-1:1)*wo(v9(0,E*E*x-S*S)),_=(S*v-b*w)/x,$=(-S*b-v*w)/x,C=(S*v+b*w)/x,T=(-S*b+v*w)/x,O=_-m,k=$-y,F=C-m,A=T-y;return O*O+k*k>F*F+A*A&&(_=C,$=T),{cx:_,cy:$,x01:-c,y01:-f,x11:_*(r/E-1),y11:$*(r/E-1)}}function F9(){var e=S9,t=_9,n=Fe(0),i=null,r=$9,s=A9,o=k9,a=null,u=zp(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-Xd,g=s.apply(this,arguments)-Xd,m=sS(g-p),y=g>p;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Ot))a.moveTo(0,0);else if(m>oT-Ot)a.moveTo(h*to(p),h*Ri(p)),a.arc(0,0,h,p,g,!y),d>Ot&&(a.moveTo(d*to(g),d*Ri(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,E=g,S=m,w=m,_=o.apply(this,arguments)/2,$=_>Ot&&(i?+i.apply(this,arguments):wo(d*d+h*h)),C=Mm(sS(h-d)/2,+n.apply(this,arguments)),T=C,O=C,k,F;if($>Ot){var A=oS($/d*Ri(_)),M=oS($/h*Ri(_));(S-=A*2)>Ot?(A*=y?1:-1,x+=A,E-=A):(S=0,x=E=(p+g)/2),(w-=M*2)>Ot?(M*=y?1:-1,b+=M,v-=M):(w=0,b=v=(p+g)/2)}var P=h*to(b),z=h*Ri(b),U=d*to(E),te=d*Ri(E);if(C>Ot){var ne=h*to(v),de=h*Ri(v),Se=d*to(x),we=d*Ri(x),Pe;if(m<Za)if(Pe=C9(P,z,Se,we,ne,de,U,te)){var Di=P-Pe[0],Zs=z-Pe[1],es=ne-Pe[0],Q=de-Pe[1],he=1/Ri(x9((Di*es+Zs*Q)/(wo(Di*Di+Zs*Zs)*wo(es*es+Q*Q)))/2),ge=wo(Pe[0]*Pe[0]+Pe[1]*Pe[1]);T=Mm(C,(d-ge)/(he-1)),O=Mm(C,(h-ge)/(he+1))}else T=O=0}w>Ot?O>Ot?(k=Mf(Se,we,P,z,h,O,y),F=Mf(ne,de,U,te,h,O,y),a.moveTo(k.cx+k.x01,k.cy+k.y01),O<C?a.arc(k.cx,k.cy,O,Mt(k.y01,k.x01),Mt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,O,Mt(k.y01,k.x01),Mt(k.y11,k.x11),!y),a.arc(0,0,h,Mt(k.cy+k.y11,k.cx+k.x11),Mt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,O,Mt(F.y11,F.x11),Mt(F.y01,F.x01),!y))):(a.moveTo(P,z),a.arc(0,0,h,b,v,!y)):a.moveTo(P,z),!(d>Ot)||!(S>Ot)?a.lineTo(U,te):T>Ot?(k=Mf(U,te,ne,de,d,-T,y),F=Mf(P,z,Se,we,d,-T,y),a.lineTo(k.cx+k.x01,k.cy+k.y01),T<C?a.arc(k.cx,k.cy,T,Mt(k.y01,k.x01),Mt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,T,Mt(k.y01,k.x01),Mt(k.y11,k.x11),!y),a.arc(0,0,d,Mt(k.cy+k.y11,k.cx+k.x11),Mt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,T,Mt(F.y11,F.x11),Mt(F.y01,F.x01),!y))):a.arc(0,0,d,E,x,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Za/2;return[to(f)*c,Ri(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Fe(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Fe(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Fe(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Fe(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Fe(+c),l):r},l.endAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Fe(+c),l):s},l.padAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Fe(+c),l):o},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function uT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lT(e){this._context=e}lT.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 bv(e){return new lT(e)}function cT(e){return e[0]}function fT(e){return e[1]}function dT(e,t){var n=Fe(!0),i=null,r=bv,s=null,o=zp(a);e=typeof e=="function"?e:e===void 0?cT:Fe(e),t=typeof t=="function"?t:t===void 0?fT:Fe(t);function a(u){var l,c=(u=uT(u)).length,f,d=!1,h;for(i==null&&(s=r(h=o())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(f,l,u),+t(f,l,u));if(h)return s=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Fe(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Fe(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Fe(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(s=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=s=null:s=r(i=u),a):i},a}function hT(e,t,n){var i=null,r=Fe(!0),s=null,o=bv,a=null,u=zp(l);e=typeof e=="function"?e:e===void 0?cT:Fe(+e),t=typeof t=="function"?t:Fe(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?fT:Fe(+n);function l(f){var d,h,p,g=(f=uT(f)).length,m,y=!1,b,v=new Array(g),x=new Array(g);for(s==null&&(a=o(b=u())),d=0;d<=g;++d){if(!(d<g&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return dT().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Fe(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Fe(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Fe(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const T9={draw(e,t){const n=wo(t/Za);e.moveTo(n,0),e.arc(0,0,n,0,oT)}};function M9(e,t){let n=null,i=zp(r);e=typeof e=="function"?e:Fe(e||T9),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:Fe(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:Fe(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function Cs(){}function Yd(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 Ip(e){this._context=e}Ip.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:Yd(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:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function D9(e){return new Ip(e)}function pT(e){this._context=e}pT.prototype={areaStart:Cs,areaEnd:Cs,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:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function O9(e){return new pT(e)}function gT(e){this._context=e}gT.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,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function R9(e){return new gT(e)}function mT(e,t){this._basis=new Ip(e),this._beta=t}mT.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 i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*s),this._beta*t[a]+(1-this._beta)*(r+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const N9=function e(t){function n(i){return t===1?new Ip(i):new mT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Kd(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 vv(e,t){this._context=e,this._k=(1-t)/6}vv.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:Kd(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:Kd(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}};const L9=function e(t){function n(i){return new vv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function xv(e,t){this._context=e,this._k=(1-t)/6}xv.prototype={areaStart:Cs,areaEnd:Cs,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:Kd(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}};const P9=function e(t){function n(i){return new xv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function wv(e,t){this._context=e,this._k=(1-t)/6}wv.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:Kd(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}};const z9=function e(t){function n(i){return new wv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Ev(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>Ot){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Ot){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function yT(e,t){this._context=e,this._alpha=t}yT.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ev(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}};const I9=function e(t){function n(i){return t?new yT(i,t):new vv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bT(e,t){this._context=e,this._alpha=t}bT.prototype={areaStart:Cs,areaEnd:Cs,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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ev(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}};const B9=function e(t){function n(i){return t?new bT(i,t):new xv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function vT(e,t){this._context=e,this._alpha=t}vT.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ev(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}};const U9=function e(t){function n(i){return t?new vT(i,t):new wv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function xT(e){this._context=e}xT.prototype={areaStart:Cs,areaEnd:Cs,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 j9(e){return new xT(e)}function aS(e){return e<0?-1:1}function uS(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(aS(s)+aS(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function lS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Dm(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function Jd(e){this._context=e}Jd.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:Dm(this,this._t0,lS(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,Dm(this,lS(this,n=uS(this,e,t)),n);break;default:Dm(this,this._t0,n=uS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function wT(e){this._context=new ET(e)}(wT.prototype=Object.create(Jd.prototype)).point=function(e,t){Jd.prototype.point.call(this,t,e)};function ET(e){this._context=e}ET.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,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function q9(e){return new Jd(e)}function W9(e){return new wT(e)}function ST(e){this._context=e}ST.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 i=cS(e),r=cS(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[o],t[o]);(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 cS(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),o=new Array(n);for(r[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,o[t]-=i*o[t-1];for(r[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function H9(e){return new ST(e)}function Bp(e,t){this._context=e,this._t=t}Bp.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 G9(e){return new Bp(e,.5)}function V9(e){return new Bp(e,0)}function X9(e){return new Bp(e,1)}function _s(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const Y9=()=>typeof Image<"u"?Image:null,c1=Symbol("implicit");function Sv(){var e=new DE,t=[],n=[],i=c1;function r(s){let o=e.get(s);if(o===void 0){if(i!==c1)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new DE;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return Sv(t,n).unknown(i)},Bs.apply(r,arguments),r}const _T=Math.PI/180,$T=180/Math.PI,Qd=18,AT=.96422,kT=1,CT=.82521,FT=4/29,Ia=6/29,TT=3*Ia*Ia,K9=Ia*Ia*Ia;function MT(e){if(e instanceof Vi)return new Vi(e.l,e.a,e.b,e.opacity);if(e instanceof Tr)return DT(e);e instanceof pp||(e=Bk(e));var t=Lm(e.r),n=Lm(e.g),i=Lm(e.b),r=Om((.2225045*t+.7168786*n+.0606169*i)/kT),s,o;return t===n&&n===i?s=o=r:(s=Om((.4360747*t+.3850649*n+.1430804*i)/AT),o=Om((.0139322*t+.0971045*n+.7141733*i)/CT)),new Vi(116*r-16,500*(s-r),200*(r-o),e.opacity)}function Zd(e,t,n,i){return arguments.length===1?MT(e):new Vi(e,t,n,i??1)}function Vi(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}Zy(Vi,Zd,eb(tb,{brighter(e){return new Vi(this.l+Qd*(e??1),this.a,this.b,this.opacity)},darker(e){return new Vi(this.l-Qd*(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=AT*Rm(t),e=kT*Rm(e),n=CT*Rm(n),new pp(Nm(3.1338561*t-1.6168667*e-.4906146*n),Nm(-.9787684*t+1.9161415*e+.033454*n),Nm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Om(e){return e>K9?Math.pow(e,1/3):e/TT+FT}function Rm(e){return e>Ia?e*e*e:TT*(e-FT)}function Nm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Lm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function J9(e){if(e instanceof Tr)return new Tr(e.h,e.c,e.l,e.opacity);if(e instanceof Vi||(e=MT(e)),e.a===0&&e.b===0)return new Tr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*$T;return new Tr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function eh(e,t,n,i){return arguments.length===1?J9(e):new Tr(e,t,n,i??1)}function Tr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function DT(e){if(isNaN(e.h))return new Vi(e.l,0,0,e.opacity);var t=e.h*_T;return new Vi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Zy(Tr,eh,eb(tb,{brighter(e){return new Tr(this.h,this.c,this.l+Qd*(e??1),this.opacity)},darker(e){return new Tr(this.h,this.c,this.l-Qd*(e??1),this.opacity)},rgb(){return DT(this).rgb()}}));var OT=-.14861,_v=1.78277,$v=-.29227,Up=-.90649,hc=1.97294,fS=hc*Up,dS=hc*_v,hS=_v*$v-Up*OT;function Q9(e){if(e instanceof Ao)return new Ao(e.h,e.s,e.l,e.opacity);e instanceof pp||(e=Bk(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(hS*i+fS*t-dS*n)/(hS+fS-dS),s=i-r,o=(hc*(n-r)-$v*s)/Up,a=Math.sqrt(o*o+s*s)/(hc*r*(1-r)),u=a?Math.atan2(o,s)*$T-120:NaN;return new Ao(u<0?u+360:u,a,r,e.opacity)}function f1(e,t,n,i){return arguments.length===1?Q9(e):new Ao(e,t,n,i??1)}function Ao(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Zy(Ao,f1,eb(tb,{brighter(e){return e=e==null?_E:Math.pow(_E,e),new Ao(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$E:Math.pow($E,e),new Ao(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*_T,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new pp(255*(t+n*(OT*i+_v*r)),255*(t+n*($v*i+Up*r)),255*(t+n*(hc*i)),this.opacity)}}));function Z9(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function e8(e,t){var n=gp(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}var t8=1e-12;function pS(e){return((e=Math.exp(e))+1/e)/2}function n8(e){return((e=Math.exp(e))-1/e)/2}function i8(e){return((e=Math.exp(2*e))-1)/(e+1)}const r8=function e(t,n,i){function r(s,o){var a=s[0],u=s[1],l=s[2],c=o[0],f=o[1],d=o[2],h=c-a,p=f-u,g=h*h+p*p,m,y;if(g<t8)y=Math.log(d/l)/t,m=function(w){return[a+w*h,u+w*p,l*Math.exp(t*w*y)]};else{var b=Math.sqrt(g),v=(d*d-l*l+i*g)/(2*l*n*b),x=(d*d-l*l-i*g)/(2*d*n*b),E=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(x*x+1)-x);y=(S-E)/t,m=function(w){var _=w*y,$=pS(E),C=l/(n*b)*($*i8(t*_+E)-n8(E));return[a+C*h,u+C*p,l*$/pS(t*_+E)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(s){var o=Math.max(.001,+s),a=o*o,u=a*a;return e(o,a,u)},r}(Math.SQRT2,2,4);function RT(e){return function(t,n){var i=e((t=q0(t)).h,(n=q0(n)).h),r=Pt(t.s,n.s),s=Pt(t.l,n.l),o=Pt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const s8=RT(gp);var o8=RT(Pt);function a8(e,t){var n=Pt((e=Zd(e)).l,(t=Zd(t)).l),i=Pt(e.a,t.a),r=Pt(e.b,t.b),s=Pt(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=i(o),e.b=r(o),e.opacity=s(o),e+""}}function NT(e){return function(t,n){var i=e((t=eh(t)).h,(n=eh(n)).h),r=Pt(t.c,n.c),s=Pt(t.l,n.l),o=Pt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const u8=NT(gp);var l8=NT(Pt);function LT(e){return function t(n){n=+n;function i(r,s){var o=e((r=f1(r)).h,(s=f1(s)).h),a=Pt(r.s,s.s),u=Pt(r.l,s.l),l=Pt(r.opacity,s.opacity);return function(c){return r.h=o(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const c8=LT(gp);var f8=LT(Pt);function Av(e,t){t===void 0&&(t=e,e=Nc);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(o){var a=Math.max(0,Math.min(i-1,Math.floor(o*=i)));return s[a](o-a)}}function d8(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const h8=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Nc,interpolateArray:_L,interpolateBasis:OL,interpolateBasisClosed:RL,interpolateCubehelix:c8,interpolateCubehelixLong:f8,interpolateDate:$L,interpolateDiscrete:Z9,interpolateHcl:u8,interpolateHclLong:l8,interpolateHsl:s8,interpolateHslLong:o8,interpolateHue:e8,interpolateLab:a8,interpolateNumber:NL,interpolateNumberArray:AL,interpolateObject:kL,interpolateRgb:LL,interpolateRgbBasis:PL,interpolateRgbBasisClosed:zL,interpolateRound:dp,interpolateString:IL,interpolateTransformCss:BL,interpolateTransformSvg:UL,interpolateZoom:r8,piecewise:Av,quantize:d8},Symbol.toStringTag,{value:"Module"}));function PT(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,EE),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return PT(e).unknown(t)},e=arguments.length?Array.from(e,EE):[0,1],ku(n)}function zT(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return s<r&&(o=n,n=i,i=o,o=r,r=s,s=o),e[n]=t.floor(r),e[i]=t.ceil(s),e}function gS(e){return Math.log(e)}function mS(e){return Math.exp(e)}function p8(e){return-Math.log(-e)}function g8(e){return-Math.exp(-e)}function m8(e){return isFinite(e)?+("1e"+e):e<0?0:e}function y8(e){return e===10?m8:e===Math.E?Math.exp:t=>Math.pow(e,t)}function b8(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 yS(e){return(t,n)=>-e(-t,n)}function kv(e){const t=e(gS,mS),n=t.domain;let i=10,r,s;function o(){return r=b8(i),s=y8(i),n()[0]<0?(r=yS(r),s=yS(s),e(p8,g8)):e(gS,mS),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),p,g;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<i;++p)if(g=d<0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=SE(l,c,m))}else y=SE(d,h,Math.min(h-d,m)).map(s);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=j0(u)).precision==null&&(u.trim=!0),u=Ik(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(zT(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function IT(){const e=kv(Qy()).domain([1,10]);return e.copy=()=>hp(e,IT()).base(e.base()),Bs.apply(e,arguments),e}function bS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Cv(e){var t=1,n=e(bS(t),vS(t));return n.constant=function(i){return arguments.length?e(bS(t=+i),vS(t)):t},ku(n)}function BT(){var e=Cv(Qy());return e.copy=function(){return hp(e,BT()).constant(e.constant())},Bs.apply(e,arguments)}function xS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function v8(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function x8(e){return e<0?-e*e:e*e}function Fv(e){var t=e(fs,fs),n=1;function i(){return n===1?e(fs,fs):n===.5?e(v8,x8):e(xS(n),xS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},ku(t)}function Tv(){var e=Fv(Qy());return e.copy=function(){return hp(e,Tv()).exponent(e.exponent())},Bs.apply(e,arguments),e}function w8(){return Tv.apply(null,arguments).exponent(.5)}function UT(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o<a;)n[o-1]=wC(e,o/a);return s}function s(o){return o==null||isNaN(o=+o)?i:t[Va(n,o)]}return s.invertExtent=function(o){var a=t.indexOf(o);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let a of o)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(oc),r()},s.range=function(o){return arguments.length?(t=Array.from(o),r()):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.quantiles=function(){return n.slice()},s.copy=function(){return UT().domain(e).range(t).unknown(i)},Bs.apply(s,arguments)}function jT(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function o(u){return u!=null&&u<=u?r[Va(i,u,0,n)]:s}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},o.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},o.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return jT().domain([e,t]).range(r).unknown(s)},Bs.apply(ku(o),arguments)}function E8(e){return new Date(e)}function S8(e){return e instanceof Date?+e:+new Date(+e)}function Mv(e,t,n,i,r,s,o,a,u,l){var c=CL(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function E(S){return(u(S)<S?h:a(S)<S?p:o(S)<S?g:s(S)<S?m:i(S)<S?r(S)<S?y:b:n(S)<S?v:x)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?d(Array.from(S,S8)):d().map(E8)},c.ticks=function(S){var w=d();return e(w[0],w[w.length-1],S??10)},c.tickFormat=function(S,w){return w==null?E:l(w)},c.nice=function(S){var w=d();return(!S||typeof S.range!="function")&&(S=t(w[0],w[w.length-1],S??10)),S?d(zT(w,S)):c},c.copy=function(){return hp(c,Mv(e,t,n,i,r,s,o,a,u,l))},c}function _8(){return Bs.apply(Mv(tz,nz,Qi,uc,Du,Or,Ep,xp,Fr,xb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function $8(){return Bs.apply(Mv(ZP,ez,Zi,lc,Ou,Es,Sp,wp,Fr,wb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jp(){var e=0,t=1,n,i,r,s,o=fs,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:o(r===0?.5:(f=(s(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),i=s(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(o=f,l):o};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,o=f(h,p),l):[o(0),o(1)]}}return l.range=c(Nc),l.rangeRound=c(dp),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return s=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function qs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Dv(){var e=ku(jp()(fs));return e.copy=function(){return qs(e,Dv())},Us.apply(e,arguments)}function qT(){var e=kv(jp()).domain([1,10]);return e.copy=function(){return qs(e,qT()).base(e.base())},Us.apply(e,arguments)}function WT(){var e=Cv(jp());return e.copy=function(){return qs(e,WT()).constant(e.constant())},Us.apply(e,arguments)}function Ov(){var e=Fv(jp());return e.copy=function(){return qs(e,Ov()).exponent(e.exponent())},Us.apply(e,arguments)}function A8(){return Ov.apply(null,arguments).exponent(.5)}function qp(){var e=0,t=.5,n=1,i=1,r,s,o,a,u,l=fs,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-s)*(i*g<i*s?a:u),l(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,r=c(e=+e),s=c(t=+t),o=c(n=+n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Av(g,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=p(Nc),h.rangeRound=p(dp),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,r=g(e),s=g(t),o=g(n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h}}function HT(){var e=ku(qp()(fs));return e.copy=function(){return qs(e,HT())},Us.apply(e,arguments)}function GT(){var e=kv(qp()).domain([.1,1,10]);return e.copy=function(){return qs(e,GT()).base(e.base())},Us.apply(e,arguments)}function VT(){var e=Cv(qp());return e.copy=function(){return qs(e,VT()).constant(e.constant())},Us.apply(e,arguments)}function Rv(){var e=Fv(qp());return e.copy=function(){return qs(e,Rv()).exponent(e.exponent())},Us.apply(e,arguments)}function k8(){return Rv.apply(null,arguments).exponent(.5)}function ar(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const C8=ar("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),F8=ar("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),T8=ar("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),M8=ar("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),D8=ar("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),O8=ar("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),R8=ar("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),N8=ar("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),L8=ar("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),P8=ar("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function Nv(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const z8="identity",eu="linear",Ur="log",Uc="pow",jc="sqrt",Wp="symlog",Ro="time",No="utc",Xi="sequential",Pu="diverging",tu="quantile",Hp="quantize",Gp="threshold",Lv="ordinal",d1="point",XT="band",Pv="bin-ordinal",lt="continuous",qc="discrete",Wc="discretizing",ti="interpolating",zv="temporal";function I8(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function B8(e){return function(t){const n=e.range();let i=t[0],r=t[1],s=-1,o,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Iv(){const e=Sv().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],p=Nv(f,a,u);let g=i[d-0];r=(h-g)/(p||1),o&&(r=Math.floor(r)),g+=(h-g-r*(f-a))*l,s=r*(1-a),o&&(g=Math.round(g),s=Math.round(s));const m=Fn(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],m=+f[1],y,b,v;if(!(g!==g||m!==m)&&(m<g&&(v=g,g=m,m=v),!(m<h[0]||g>i[1-d])))return y=Math.max(0,Va(h,g)-1),b=g===m?y:Va(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Iv().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function YT(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return YT(t())},e}function U8(){return YT(Iv().paddingInner(1))}var j8=Array.prototype.map;function q8(e){return j8.call(e,zt)}const W8=Array.prototype.slice;function KT(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Va(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=q8(i),n):e.slice()},n.range=function(i){return arguments.length?(t=W8.call(i),n):t.slice()},n.tickFormat=function(i,r){return ML(e[0],xe(e),i??10,r)},n.copy=function(){return KT().domain(n.domain()).range(n.range())},n}const th=new Map,JT=Symbol("vega_scale");function QT(e){return e[JT]=!0,e}function H8(e){return e&&e[JT]===!0}function G8(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?I8(s):s.invertExtent?B8(s):void 0),s.type=e,QT(s)};return i.metadata=yi(Y(n)),i}function ke(e,t,n){return arguments.length>1?(th.set(e,G8(e,t,n)),this):ZT(e)?th.get(e):void 0}ke(z8,PT);ke(eu,FL,lt);ke(Ur,IT,[lt,Ur]);ke(Uc,Tv,lt);ke(jc,w8,lt);ke(Wp,BT,lt);ke(Ro,_8,[lt,zv]);ke(No,$8,[lt,zv]);ke(Xi,Dv,[lt,ti]);ke(`${Xi}-${eu}`,Dv,[lt,ti]);ke(`${Xi}-${Ur}`,qT,[lt,ti,Ur]);ke(`${Xi}-${Uc}`,Ov,[lt,ti]);ke(`${Xi}-${jc}`,A8,[lt,ti]);ke(`${Xi}-${Wp}`,WT,[lt,ti]);ke(`${Pu}-${eu}`,HT,[lt,ti]);ke(`${Pu}-${Ur}`,GT,[lt,ti,Ur]);ke(`${Pu}-${Uc}`,Rv,[lt,ti]);ke(`${Pu}-${jc}`,k8,[lt,ti]);ke(`${Pu}-${Wp}`,VT,[lt,ti]);ke(tu,UT,[Wc,tu]);ke(Hp,jT,Wc);ke(Gp,TL,Wc);ke(Pv,KT,[qc,Wc]);ke(Lv,Sv,qc);ke(XT,Iv,qc);ke(d1,U8,qc);function ZT(e){return th.has(e)}function na(e,t){const n=th.get(e);return n&&n.metadata[t]}function Bv(e){return na(e,lt)}function nu(e){return na(e,qc)}function h1(e){return na(e,Wc)}function eM(e){return na(e,Ur)}function V8(e){return na(e,zv)}function tM(e){return na(e,ti)}function nM(e){return na(e,tu)}const X8=["clamp","base","constant","exponent"];function iM(e,t){const n=t[0],i=xe(t)-n;return function(r){return e(n+r*i)}}function Vp(e,t,n){return Av(Uv(t||"rgb",n),e)}function rM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function sM(e,t,n){const i=n-t;let r,s,o;return!i||!Number.isFinite(i)?Ht(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),o=ke(s)().domain([t,n]).range([0,1]),X8.forEach(a=>e[a]?o[a](e[a]()):0),o)}function Uv(e,t){const n=h8[Y8(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function Y8(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const K8={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},J8={accent:F8,category10:C8,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:T8,observable10:M8,paired:D8,pastel1:O8,pastel2:R8,set1:N8,set2:L8,set3:P8,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function oM(e){if(L(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function aM(e,t){for(const n in e)jv(n,t(e[n]))}const wS={};aM(J8,oM);aM(K8,e=>Vp(oM(e)));function jv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(wS[e]=t,this):wS[e]}const gd="symbol",Q8="discrete",Z8="gradient",e7=e=>L(e)?e.map(t=>String(t)):String(e),t7=(e,t)=>e[1]-t[1],n7=(e,t)=>t[1]-e[1];function qv(e,t,n){let i;return $e(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Pc(e.domain())/n||1)+1))),X(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Ro?Ru(t):e.type==No?Nu(t):N("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function uM(e,t,n){let i=e.range(),r=i[0],s=xe(i),o=t7;if(r>s&&(i=s,s=r,r=i,o=n7),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],xe(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Wv(e,t){return e.bins?uM(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function lM(e,t,n,i,r,s){const o=t.type;let a=e7;if(o===Ro||r===Ro)a=e.timeFormat(i);else if(o===No||r===No)a=e.utcFormat(i);else if(eM(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=cM(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function cM(e,t,n){const i=Wv(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r<r-.5&&(l*=r),l<=o};return n?i.filter(a):a}const p1={[tu]:"quantiles",[Hp]:"thresholds",[Gp]:"domain"},fM={[tu]:"quantiles",[Hp]:"domain"};function dM(e,t){return e.bins?s7(e.bins):e.type===Ur?cM(e,t,!0):p1[e.type]?r7(e[p1[e.type]]()):Wv(e,t)}function i7(e,t,n){const i=t[fM[t.type]](),r=i.length;let s=r>1?i[1]-i[0]:i[0],o;for(o=1;o<r;++o)s=Math.min(s,i[o]-i[o-1]);return e.formatSpan(0,s,3*10,n)}function r7(e){const t=[-1/0].concat(e);return t.max=1/0,t}function s7(e){const t=e.slice(0,-1);return t.max=xe(e),t}const o7=e=>p1[e.type]||e.bins;function hM(e,t,n,i,r,s,o){const a=fM[t.type]&&s!==Ro&&s!==No?i7(e,t,r):lM(e,t,n,r,s,o);return i===gd&&o7(t)?a7(a):i===Q8?u7(a):l7(a)}const a7=e=>(t,n,i)=>{const r=ES(i[n+1],ES(i.max,1/0)),s=SS(t,e),o=SS(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},ES=(e,t)=>e??t,u7=e=>(t,n)=>n?e(t):null,l7=e=>t=>e(t),SS=(e,t)=>Number.isFinite(e)?t(e):null;function c7(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+xe(t),s=r-i;if(e.type===Gp){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function f7(e,t,n,i){const r=i||t.type;return K(n)&&V8(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ro?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===No?e.utcFormat("%A, %d %B %Y, %X UTC"):hM(e,t,5,null,n,i,!0)}function pM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=f7(e,t,n.format,n.formatType);if(h1(t.type)){const s=dM(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(nu(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(xe(s))}`}}let gM=0;function d7(){gM=0}const nh="p_";function Hv(e){return e&&e.gradient}function mM(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?nh:"";return r||(r=e.id="gradient_"+gM++,i==="radial"?(e.x1=Ni(e.x1,.5),e.y1=Ni(e.y1,.5),e.r1=Ni(e.r1,0),e.x2=Ni(e.x2,.5),e.y2=Ni(e.y2,.5),e.r2=Ni(e.r2,.5),s=nh):(e.x1=Ni(e.x1,0),e.y1=Ni(e.y1,0),e.x2=Ni(e.x2,1),e.y2=Ni(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Ni(e,t){return e??t}function yM(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const _S={basis:{curve:D9},"basis-closed":{curve:O9},"basis-open":{curve:R9},bundle:{curve:N9,tension:"beta",value:.85},cardinal:{curve:L9,tension:"tension",value:0},"cardinal-open":{curve:z9,tension:"tension",value:0},"cardinal-closed":{curve:P9,tension:"tension",value:0},"catmull-rom":{curve:I9,tension:"alpha",value:.5},"catmull-rom-closed":{curve:B9,tension:"alpha",value:.5},"catmull-rom-open":{curve:U9,tension:"alpha",value:.5},linear:{curve:bv},"linear-closed":{curve:j9},monotone:{horizontal:W9,vertical:q9},natural:{curve:H9},step:{curve:G9},"step-after":{curve:X9},"step-before":{curve:V9}};function Gv(e,t,n){var i=J(_S,e)&&_S[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const h7={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},p7=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,g7=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,m7=/^((\s+,?\s*)|(,\s*))/,y7=/^[01]/;function iu(e){const t=[];return(e.match(p7)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=h7[s],a=b7(s,o,i.slice(1).trim()),u=a.length;if(u<o||u&&u%o!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,o)]),u!==o){s==="m"&&(r=r==="M"?"L":"l");for(let l=o;l<u;l+=o)t.push([r,...a.slice(l,l+o)])}}),t}function b7(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const o=e==="a"&&(s===3||s===4)?y7:g7,a=n.slice(r).match(o);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(m7);u!==null&&(r+=u[0].length)}return i}const Fs=Math.PI/180,v7=1e-14,yo=Math.PI/2,ji=Math.PI*2,ba=Math.sqrt(3)/2;var Pm={},zm={},bM=[].join;function x7(e,t,n,i,r,s,o,a,u){const l=bM.call(arguments);if(Pm[l])return Pm[l];const c=o*Fs,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,E=b*a+v*u,S=m*e+y*t,w=b*e+v*t;let $=1/((S-x)*(S-x)+(w-E)*(w-E))-.25;$<0&&($=0);let C=Math.sqrt($);s==r&&(C=-C);const T=.5*(x+S)-C*(w-E),O=.5*(E+w)+C*(S-x),k=Math.atan2(E-O,x-T);let A=Math.atan2(w-O,S-T)-k;A<0&&s===1?A+=ji:A>0&&s===0&&(A-=ji);const M=Math.ceil(Math.abs(A/(yo+.001))),P=[];for(let z=0;z<M;++z){const U=k+z*A/M,te=k+(z+1)*A/M;P[z]=[T,O,U,te,n,i,f,d]}return Pm[l]=P}function w7(e){const t=bM.call(e);if(zm[t])return zm[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],l=e[7];const c=l*o,f=-u*a,d=u*o,h=l*a,p=Math.cos(r),g=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),E=n+p-x*g,S=i+g+x*p,w=n+m,_=i+y,$=w+x*y,C=_-x*m;return zm[t]=[c*E+f*S,d*E+h*S,c*$+f*C,d*$+h*C,c*w+f*_,d*w+h*_]}const In=["l",0,0,0,0,0,0,0];function E7(e,t,n){const i=In[0]=e[0];if(i==="a"||i==="A")In[1]=t*e[1],In[2]=n*e[2],In[3]=e[3],In[4]=e[4],In[5]=e[5],In[6]=t*e[6],In[7]=n*e[7];else if(i==="h"||i==="H")In[1]=t*e[1];else if(i==="v"||i==="V")In[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)In[r]=(r%2==1?t:n)*e[r];return In}function pc(e,t,n,i,r,s){var o,a=null,u=0,l=0,c=0,f=0,d,h,p,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),s==null&&(s=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(o=t[b],(r!==1||s!==1)&&(o=E7(o,r,s)),o[0]){case"l":u+=o[1],l+=o[2],e.lineTo(u+n,l+i);break;case"L":u=o[1],l=o[2],e.lineTo(u+n,l+i);break;case"h":u+=o[1],e.lineTo(u+n,l+i);break;case"H":u=o[1],e.lineTo(u+n,l+i);break;case"v":l+=o[1],e.lineTo(u+n,l+i);break;case"V":l=o[1],e.lineTo(u+n,l+i);break;case"m":u+=o[1],l+=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=o[1],l=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+o[5],h=l+o[6],c=u+o[3],f=l+o[4],e.bezierCurveTo(u+o[1]+n,l+o[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=o[5],l=o[6],c=o[3],f=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+o[3],h=l+o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+o[1]+n,l+o[2]+i,d+n,h+i),c=u+o[1],f=l+o[2],u=d,l=h;break;case"S":d=o[3],h=o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"q":d=u+o[3],h=l+o[4],c=u+o[1],f=l+o[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=o[3],h=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"t":d=u+o[1],h=l+o[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-p,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+o[1],f=l+o[2];break;case"T":d=o[1],h=o[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":$S(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+u+n,o[7]+l+i]),u+=o[6],l+=o[7];break;case"A":$S(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),u=o[6],l=o[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=o}}function $S(e,t,n,i){const r=x7(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let s=0;s<r.length;++s){const o=w7(r[s]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}const AS=.5773502691896257,kS={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,ji)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*AS,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*AS;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function vM(e){return J(kS,e)?kS[e]:S7(e)}var Im={};function S7(e){if(!J(Im,e)){const t=iu(e);Im[e]={draw:function(n,i){pc(n,t,0,0,Math.sqrt(i)/2)}}}return Im[e]}const ts=.448084975506;function _7(e){return e.x}function $7(e){return e.y}function A7(e){return e.width}function k7(e){return e.height}function br(e){return typeof e=="function"?e:()=>+e}function Df(e,t,n){return Math.max(t,Math.min(e,n))}function xM(){var e=_7,t=$7,n=A7,i=k7,r=br(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Df(+r.call(this,c),0,b),x=Df(+s.call(this,c),0,b),E=Df(+o.call(this,c),0,b),S=Df(+a.call(this,c),0,b);if(u||(u=h=Pp()),v<=0&&x<=0&&E<=0&&S<=0)u.rect(p,g,m,y);else{var w=p+m,_=g+y;u.moveTo(p+v,g),u.lineTo(w-x,g),u.bezierCurveTo(w-ts*x,g,w,g+ts*x,w,g+x),u.lineTo(w,_-S),u.bezierCurveTo(w,_-ts*S,w-ts*S,_,w-S,_),u.lineTo(p+E,_),u.bezierCurveTo(p+ts*E,_,p,_-ts*E,p,_-E),u.lineTo(p,g+v),u.bezierCurveTo(p,g+ts*v,p+ts*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=br(c),l):e},l.y=function(c){return arguments.length?(t=br(c),l):t},l.width=function(c){return arguments.length?(n=br(c),l):n},l.height=function(c){return arguments.length?(i=br(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=br(c),s=f!=null?br(f):r,a=d!=null?br(d):r,o=h!=null?br(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function wM(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,ji);r.closePath()}else s=1;o=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=Pp()),d=0;d<=h;++d)!(d<h&&i(p=f[d],d,f))===g&&(g=!g)&&(s=0),g&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function Hc(e,t){return e??t}const Gc=e=>e.x||0,Vc=e=>e.y||0,C7=e=>e.width||0,F7=e=>e.height||0,T7=e=>(e.x||0)+(e.width||0),M7=e=>(e.y||0)+(e.height||0),D7=e=>e.startAngle||0,O7=e=>e.endAngle||0,R7=e=>e.padAngle||0,N7=e=>e.innerRadius||0,L7=e=>e.outerRadius||0,P7=e=>e.cornerRadius||0,z7=e=>Hc(e.cornerRadiusTopLeft,e.cornerRadius)||0,I7=e=>Hc(e.cornerRadiusTopRight,e.cornerRadius)||0,B7=e=>Hc(e.cornerRadiusBottomRight,e.cornerRadius)||0,U7=e=>Hc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,j7=e=>Hc(e.size,64),q7=e=>e.size||1,Xp=e=>e.defined!==!1,W7=e=>vM(e.shape||"circle"),H7=F9().startAngle(D7).endAngle(O7).padAngle(R7).innerRadius(N7).outerRadius(L7).cornerRadius(P7),G7=hT().x(Gc).y1(Vc).y0(M7).defined(Xp),V7=hT().y(Vc).x1(Gc).x0(T7).defined(Xp),X7=dT().x(Gc).y(Vc).defined(Xp),Y7=xM().x(Gc).y(Vc).width(C7).height(F7).cornerRadius(z7,I7,B7,U7),K7=M9().type(W7).size(j7),J7=wM().x(Gc).y(Vc).defined(Xp).size(q7);function Vv(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Q7(e,t){return H7.context(e)(t)}function Z7(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?V7:G7).curve(Gv(i,n.orient,n.tension)).context(e)(t)}function eB(e,t){const n=t[0],i=n.interpolate||"linear";return X7.curve(Gv(i,n.orient,n.tension)).context(e)(t)}function zu(e,t,n,i){return Y7.context(e)(t,n,i)}function tB(e,t){return(t.mark.shape||t.shape).context(e)(t)}function nB(e,t){return K7.context(e)(t)}function iB(e,t){return J7.context(e)(t)}var EM=1;function SM(){EM=1}function Xv(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+EM++),o=r.clipping[s]||(r.clipping[s]={id:s});return fe(i)?o.path=i(null):Vv(n)?o.path=zu(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function nt(e){this.clear(),e&&this.union(e)}nt.prototype={clone(){return new nt(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Yp(e){this.mark=e,this.bounds=this.bounds||new nt}function Kp(e){Yp.call(this,e),this.items=this.items||[]}G(Kp,Yp);class _M{constructor(t){this._pending=0,this._loader=t||$p()}pending(){return this._pending}sanitizeURL(t){const n=this;return CS(n),n._loader.sanitize(t,{context:"href"}).then(i=>(ul(n),i)).catch(()=>(ul(n),null))}loadImage(t){const n=this,i=Y9();return CS(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=J(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>ul(n),o.onerror=()=>ul(n),o.src=s,o}).catch(r=>(ul(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function CS(e){e._pending+=1}function ul(e){e._pending-=1}function Hr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?rB(t,i):0))}return e}function rB(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const sB=ji-1e-8;let Jp,md,yd,Eo,g1,bd,m1,y1;const ds=(e,t)=>Jp.add(e,t),vd=(e,t)=>ds(md=e,yd=t),FS=e=>ds(e,Jp.y1),TS=e=>ds(Jp.x1,e),bo=(e,t)=>g1*e+m1*t,vo=(e,t)=>bd*e+y1*t,Bm=(e,t)=>ds(bo(e,t),vo(e,t)),Um=(e,t)=>vd(bo(e,t),vo(e,t));function Xc(e,t){return Jp=e,t?(Eo=t*Fs,g1=y1=Math.cos(Eo),bd=Math.sin(Eo),m1=-bd):(g1=y1=1,Eo=bd=m1=0),oB}const oB={beginPath(){},closePath(){},moveTo:Um,lineTo:Um,rect(e,t,n,i){Eo?(Bm(e+n,t),Bm(e+n,t+i),Bm(e,t+i),Um(e,t)):(ds(e+n,t+i),vd(e,t))},quadraticCurveTo(e,t,n,i){const r=bo(e,t),s=vo(e,t),o=bo(n,i),a=vo(n,i);MS(md,r,o,FS),MS(yd,s,a,TS),vd(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=bo(e,t),a=vo(e,t),u=bo(n,i),l=vo(n,i),c=bo(r,s),f=vo(r,s);DS(md,o,u,c,FS),DS(yd,a,l,f,TS),vd(c,f)},arc(e,t,n,i,r,s){if(i+=Eo,r+=Eo,md=n*Math.cos(r)+e,yd=n*Math.sin(r)+t,Math.abs(r-i)>sB)ds(e-n,t-n),ds(e+n,t+n);else{const o=l=>ds(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%ji,i<0&&(i+=ji),r=r%ji,r<0&&(r+=ji),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=ji,a=i-i%yo,u=0;u<4&&a>r;++u,a-=yo)o(a);else for(a=i-i%yo+yo,u=0;u<4&&a<r;++u,a=a+yo)o(a)}}};function MS(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function DS(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(s)>v7?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0<u&&u<1&&r(OS(u,e,t,n,i)),0<l&&l<1&&r(OS(l,e,t,n,i))}function OS(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var $s=($s=_s(1,1))?$s.getContext("2d"):null;const b1=new nt;function Yv(e){return function(t,n){if(!$s)return!0;e($s,t),b1.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=b1;for(let a=r;a<=o;++a)for(let u=i;u<=s;++u)if($s.isPointInPath(u,a))return!0;return!1}}function Kv(e,t){return t.contains(e.x||0,e.y||0)}function $M(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(b1.set(n,i,n+r,i+s))}function AM(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,s=e.y2!=null?e.y2:i;return Oa(t,n,i,r,s)}function Oa(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,p,g,m;for(m=0;m<4;++m){if(m===0&&(h=-l,p=-(s-t)),m===1&&(h=l,p=a-t),m===2&&(h=-c,p=-(o-n)),m===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function ru(e,t){e.globalCompositeOperation=t.blend||"source-over"}function si(e,t){return e??t}function RS(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function aB(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+si(t.x1,.5)*i,n.y1+si(t.y1,.5)*r,Math.max(i,r)*si(t.r1,0),n.x1+si(t.x2,.5)*i,n.y1+si(t.y2,.5)*r,Math.max(i,r)*si(t.r2,.5));else{const o=si(t.x1,0),a=si(t.y1,0),u=si(t.x2,1),l=si(t.y2,0);if(o===u||a===l||i===r)s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=_s(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=RS(f.createLinearGradient(o,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return RS(s,t.stops)}function kM(e,t,n){return Hv(n)?aB(e,n,t.bounds):n}function ih(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=kM(e,t,t.fill),!0):!1}var uB=[];function su(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=kM(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||uB),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function lB(e,t){return e.zindex-t.zindex||e.index-t.index}function Jv(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r<s;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(lB)}function vi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=Jv(e);if(s&&s.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=s}for(i=0,r=n.length;i<r;++i)t(n[i])}function rh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=Jv(e);for(s&&s.length&&(n=s),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Qv(e){return function(t,n,i){vi(n,r=>{(!i||i.intersects(r.bounds))&&CM(e,t,r,r)})}}function cB(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&CM(e,t,n.items[0],n.items)}}function CM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(ru(t,n),n.fill&&ih(t,n,r)&&t.fill(),n.stroke&&su(t,n,r)&&t.stroke()))}function Qp(e){return e=e||Rn,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,rh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function Yc(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function Zv(e){return Qp(Yc(e))}function ko(e,t){return"translate("+e+","+t+")"}function ex(e){return"rotate("+e+")"}function fB(e,t){return"scale("+e+","+t+")"}function FM(e){return ko(e.x||0,e.y||0)}function dB(e){return ko(e.x||0,e.y||0)+(e.angle?" "+ex(e.angle):"")}function hB(e){return ko(e.x||0,e.y||0)+(e.angle?" "+ex(e.angle):"")+(e.scaleX||e.scaleY?" "+fB(e.scaleX||1,e.scaleY||1):"")}function tx(e,t,n){function i(o,a){o("transform",dB(a)),o("d",t(null,a))}function r(o,a){return t(Xc(o,a.angle),a),Hr(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=Fs),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Qv(s),pick:Zv(s),isect:n||Yv(s)}}var pB=tx("arc",Q7);function gB(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<s&&(s=a,o=e[r]));return o}function mB(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,s,o;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o<n))return e[i];return null}function yB(e,t){for(var n=e.length,i,r,s;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s<i*i))return e[n];return null}function nx(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Xc(u),c),Hr(u,c[0]))}function s(u,l){u.beginPath(),t(u,l)}const o=Yc(s);function a(u,l,c,f,d,h){var p=l.items,g=l.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,o(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:cB(s),pick:a,isect:Kv,tip:n}}var bB=nx("area",Z7,gB);function vB(e,t){var n=t.clip;e.save(),fe(n)?(e.beginPath(),n(e),e.clip()):TM(e,t.group)}function TM(e,t){e.beginPath(),Vv(t)?zu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function MM(e){const t=si(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function xB(e,t){e("transform",FM(t))}function DM(e,t){const n=MM(t);e("d",zu(null,t,n,n))}function wB(e,t){e("class","background"),e("aria-hidden",!0),DM(e,t)}function EB(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?DM(e,t):e("d","")}function SB(e,t,n){const i=t.clip?Xv(n,t,t):null;e("clip-path",i)}function _B(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Hr(e,t),e.translate(t.x||0,t.y||0)}function gc(e,t,n,i){const r=MM(t);e.beginPath(),zu(e,t,(n||0)+r,(i||0)+r)}const $B=Yc(gc),AB=Yc(gc,!1),kB=Yc(gc,!0);function CB(e,t,n,i){vi(t,r=>{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(gc(e,r,s,o),ru(e,r),r.fill&&ih(e,r,u)&&e.fill(),r.stroke&&!a&&su(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&TM(e,r),n&&n.translate(-s,-o),vi(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(gc(e,r,s,o),ru(e,r),su(e,r,u)&&e.stroke())})}function FB(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return rh(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(r<c||r>h||s<f||s>p))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Vv(u)&&!kB(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&AB(e,u,o,a)?(e.restore(),u):(l=rh(u,b=>TB(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&$B(e,u,o,a)&&(l=u),e.restore(),l||null)})}function TB(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var MB={type:"group",tag:"g",nested:!1,attr:xB,bound:_B,draw:CB,pick:FB,isect:$M,content:SB,background:wB,foreground:EB},mc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function ix(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function rx(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function sx(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Zp(e,t){return e==="center"?t/2:e==="right"?t:0}function eg(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function DB(e,t,n){const i=ix(t,n),r=rx(t,i),s=sx(t,i),o=(t.x||0)-Zp(t.align,r),a=(t.y||0)-eg(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,mc["xmlns:xlink"],"xlink:href"),e("transform",ko(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function OB(e,t){const n=t.image,i=rx(t,n),r=sx(t,n),s=(t.x||0)-Zp(t.align,i),o=(t.y||0)-eg(t.baseline,r);return e.set(s,o,s+i,o+r)}function RB(e,t,n){vi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=ix(i,this);let s=rx(i,r),o=sx(i,r);if(s===0||o===0)return;let a=(i.x||0)-Zp(i.align,s),u=(i.y||0)-eg(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=s/c,u+=(o-d)/2,o=d):(d=o*c,a+=(s-d)/2,s=d))),(r.complete||r.toDataURL)&&(ru(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,s,o))})}var NB={type:"image",tag:"image",nested:!1,attr:DB,bound:OB,draw:RB,pick:Qp(),isect:Rn,get:ix,xOffset:Zp,yOffset:eg},LB=nx("line",eB,mB);function PB(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",hB(t)),e("d",t.path)}function xd(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*Fs,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=iu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),pc(e,u,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):pc(e,u,i,r,s,o)}function zB(e,t){return xd(Xc(e,t.angle),t)?e.set(0,0,0,0):Hr(e,t,!0)}var IB={type:"path",tag:"path",nested:!1,attr:PB,bound:zB,draw:Qv(xd),pick:Zv(xd),isect:Yv(xd)};function BB(e,t){e("d",zu(null,t))}function UB(e,t){var n,i;return Hr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function NS(e,t){e.beginPath(),zu(e,t)}var jB={type:"rect",tag:"path",nested:!1,attr:BB,bound:UB,draw:Qv(NS),pick:Zv(NS),isect:$M};function qB(e,t){e("transform",FM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function WB(e,t){var n,i;return Hr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function OM(e,t,n){var i,r,s,o;return t.stroke&&su(e,t,n)?(i=t.x||0,r=t.y||0,s=t.x2!=null?t.x2:i,o=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0):!1}function HB(e,t,n){vi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&OM(e,i,r)&&(ru(e,i),e.stroke())}})}function GB(e,t,n,i){return e.isPointInStroke?OM(e,t,1)&&e.isPointInStroke(n,i):!1}var VB={type:"rule",tag:"line",nested:!1,attr:qB,bound:WB,draw:HB,pick:Qp(GB),isect:AM},XB=tx("shape",tB),YB=tx("symbol",nB,Kv);const LS=cC();var Mn={height:ur,measureWidth:ox,estimateWidth:sh,width:sh,canvas:RM};RM(!0);function RM(e){Mn.width=e&&$s?ox:sh}function sh(e,t){return NM(Ms(e,t),ur(e))}function NM(e,t){return~~(.8*e.length*t)}function ox(e,t){return ur(e)<=0||!(t=Ms(e,t))?0:LM(t,tg(e))}function LM(e,t){const n=`(${t}) ${e}`;let i=LS.get(n);return i===void 0&&($s.font=t,i=$s.measureText(e).width,LS.set(n,i)),i}function ur(e){return e.fontSize!=null?+e.fontSize||0:11}function Ts(e){return e.lineHeight!=null?e.lineHeight:ur(e)+2}function KB(e){return L(e)?e.length>1?e:e[0]:e}function Kc(e){return KB(e.lineBreak&&e.text&&!L(e.text)?e.text.split(e.lineBreak):e.text)}function ax(e){const t=Kc(e);return(L(t)?t.length-1:0)*Ts(e)}function Ms(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?QB(e,n):n}function JB(e){if(Mn.width===ox){const t=tg(e);return n=>LM(n,t)}else if(Mn.width===sh){const t=ur(e);return n=>NM(n,t)}else return t=>Mn.width(e,t)}function QB(e,t){var n=+e.limit,i=JB(e);if(i(t)<n)return t;var r=e.ellipsis||"…",s=e.dir==="rtl",o=0,a=t.length,u;if(n-=i(r),s){for(;o<a;)u=o+a>>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o<a;)u=1+(o+a>>>1),i(t.slice(0,u))<n?o=u:a=u-1;return t.slice(0,o)+r}}function Jc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function tg(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+ur(e)+"px "+Jc(e,t)}function ux(e){var t=e.baseline,n=ur(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Ts(e):t==="line-bottom"?.29*n-.5*Ts(e):0)}const ZB={left:"start",center:"middle",right:"end"},Hl=new nt;function ng(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-yo,t+=i*Math.cos(r),n+=i*Math.sin(r)),Hl.x1=t,Hl.y1=n,Hl}function eU(e,t){var n=t.dx||0,i=(t.dy||0)+ux(t),r=ng(t),s=r.x1,o=r.y1,a=t.angle||0,u;e("text-anchor",ZB[t.align]||"start"),a?(u=ko(s,o)+" "+ex(a),(n||i)&&(u+=" "+ko(n,i))):u=ko(s+n,o+i),e("transform",u)}function lx(e,t,n){var i=Mn.height(t),r=t.align,s=ng(t),o=s.x1,a=s.y1,u=t.dx||0,l=(t.dy||0)+ux(t)-Math.round(.8*i),c=Kc(t),f;if(L(c)?(i+=Ts(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Mn.width(t,h)),0)):f=Mn.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Fs,o,a);else if(n===2)return e.rotatedPoints(t.angle*Fs,o,a);return e}function tU(e,t,n){vi(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=tg(i),e.textAlign=i.align||"left",s=ng(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*Fs),o=a=0),o+=i.dx||0,a+=(i.dy||0)+ux(i),c=Kc(i),ru(e,i),L(c))for(l=Ts(i),u=0;u<c.length;++u)f=Ms(i,c[u]),i.fill&&ih(e,i,r)&&e.fillText(f,o,a),i.stroke&&su(e,i,r)&&e.strokeText(f,o,a),a+=l;else f=Ms(i,c),i.fill&&ih(e,i,r)&&e.fillText(f,o,a),i.stroke&&su(e,i,r)&&e.strokeText(f,o,a);i.angle&&e.restore()}})}function nU(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=ng(t),a=o.x1,u=o.y1,l=lx(Hl,t,1),c=-t.angle*Fs,f=Math.cos(c),d=Math.sin(c),h=f*r-d*s+(a-f*a+d*u),p=d*r+f*s+(u-d*a-f*u);return l.contains(h,p)}function iU(e,t){const n=lx(Hl,e,2);return Oa(t,n[0],n[1],n[2],n[3])||Oa(t,n[0],n[1],n[4],n[5])||Oa(t,n[4],n[5],n[6],n[7])||Oa(t,n[2],n[3],n[6],n[7])}var rU={type:"text",tag:"text",nested:!1,attr:eU,bound:lx,draw:tU,pick:Qp(nU),isect:iU},sU=nx("trail",iB,yB),Pn={arc:pB,area:bB,group:MB,image:NB,line:LB,path:IB,rect:jB,rule:VB,shape:XB,symbol:YB,text:rU,trail:sU};function v1(e,t,n){var i=Pn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new nt),e,n)}var PS={mark:null};function PM(e,t,n){var i=Pn[e.marktype],r=i.bound,s=e.items,o=s&&s.length,a,u,l,c;if(i.nested)return o?l=s[0]:(PS.mark=e,l=PS),c=v1(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new nt,o)for(a=0,u=s.length;a<u;++a)t.union(v1(s[a],r,n));return e.bounds=t}const oU=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function zM(e,t){return JSON.stringify(e,oU,t)}function IM(e){const t=typeof e=="string"?JSON.parse(e):e;return BM(t)}function BM(e){var t=e.marktype,n=e.items,i,r,s;if(n)for(r=0,s=n.length;r<s;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&BM(n[r]);return t&&PM(e),e}class UM{constructor(t){arguments.length?this.root=IM(t):(this.root=zS({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Kp(this.root)])}toJSON(t){return zM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=zS(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function zS(e,t){const n={bounds:new nt,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function hs(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function cx(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function rt(e,t,n,i){var r=e.childNodes[t],s;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(s=r||null,r=hs(e.ownerDocument,n,i),e.insertBefore(r,s)),r}function Un(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function jM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function ig(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function aU(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=Pn[r.marktype]).tip){for(o=ig(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let fx=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||$p(),this._tooltip=n||uU}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=hs(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=aU(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function uU(e,t,n,i){e.element().setAttribute("title",i||"")}class Qc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new _M(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const lU="keydown",cU="keypress",fU="keyup",qM="dragenter",wd="dragleave",WM="dragover",x1="pointerdown",dU="pointerup",oh="pointermove",Ed="pointerout",HM="pointerover",w1="mousedown",hU="mouseup",GM="mousemove",ah="mouseout",VM="mouseover",uh="click",pU="dblclick",gU="wheel",XM="mousewheel",lh="touchstart",ch="touchmove",fh="touchend",mU=[lU,cU,fU,qM,wd,WM,x1,dU,oh,Ed,HM,w1,hU,GM,ah,VM,uh,pU,gU,XM,lh,ch,fh],E1=oh,Gl=ah,S1=uh;class Zc extends fx{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=mU,this.pointermove=BS([oh,GM],[HM,VM],[Ed,ah]),this.dragover=BS([WM],[qM],[wd]),this.pointerout=US([Ed,ah]),this.dragleave=US([wd])}initialize(t,n,i){return this._canvas=t&&cx(t,"canvas"),[uh,w1,x1,oh,Ed,wd].forEach(r=>IS(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(XM,t)}pointerdown(t){this._down=this._active,this.fire(x1,t)}mousedown(t){this._down=this._active,this.fire(w1,t)}click(t){this._down===this._active&&(this.fire(uh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(lh,t,!0)}touchmove(t){this.fire(ch,t,!0)}touchend(t){this.fire(fh,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===S1&&r&&r.href?this.handleHref(n,r,r.href):(t===E1||t===Gl)&&this.handleTooltip(n,r,t!==Gl),s)for(let o=0,a=s.length;o<a;++o)s[o].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(IS(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&r.splice(s,1),this}pickEvent(t){const n=ig(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return Pn[t.marktype].pick.call(this,o,t,n,i,r,s)}}const yU=e=>e===lh||e===ch||e===fh?[lh,ch,fh]:[e];function IS(e,t){yU(t).forEach(n=>bU(e,n))}function bU(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Ml(e,t,n){t.forEach(i=>e.fire(i,n))}function BS(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Ml(this,e,i):((!r||!r.exit)&&Ml(this,n,i),this._active=s,Ml(this,t,i),Ml(this,e,i))}}function US(e){return function(t){Ml(this,e,t),this._active=null}}function vU(){return typeof window<"u"&&window.devicePixelRatio||1}function xU(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?vU():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class dh extends Qc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new nt,this._tempb=new nt}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:_s(1,1,this._options.type),t&&this._canvas&&(Un(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)xU(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||N("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=wU(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):EU(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=Pn[n.marktype];n.clip&&vB(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const wU=(e,t,n)=>new nt().set(0,0,t,n).translate(-e[0],-e[1]);function EU(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class YM extends fx{constructor(t,n){super(t,n);const i=this;i._hrefHandler=jm(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=jm(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Gl)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(S1,this._hrefHandler),r.removeEventListener(E1,this._tooltipHandler),r.removeEventListener(Gl,this._tooltipHandler)),this._svg=r=t&&cx(t,"svg"),r&&(r.addEventListener(S1,this._hrefHandler),r.addEventListener(E1,this._tooltipHandler),r.addEventListener(Gl,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:jm(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const jm=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},KM="aria-hidden",dx="aria-label",hx="role",px="aria-roledescription",JM="graphics-object",gx="graphics-symbol",QM=(e,t,n)=>({[hx]:e,[px]:t,[dx]:n||void 0}),SU=yi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),jS={axis:{desc:"axis",caption:AU},legend:{desc:"legend",caption:kU},"title-text":{desc:"title",caption:e=>`Title text '${WS(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${WS(e)}'`}},qS={ariaRole:hx,ariaRoleDescription:px,description:dx};function ZM(e,t){const n=t.aria===!1;if(e(KM,n||void 0),n||t.description==null)for(const i in qS)e(qS[i],void 0);else{const i=t.mark.marktype;e(dx,t.description),e(hx,t.ariaRole||(i==="group"?JM:gx)),e(px,t.ariaRoleDescription||`${i} mark`)}}function eD(e){return e.aria===!1?{[KM]:!0}:SU[e.role]?null:jS[e.role]?$U(e,jS[e.role]):_U(e)}function _U(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return QM(n?JM:gx,`${t} mark container`,e.description)}function $U(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return QM(t.role||gx,t.desc,n.description||i(n))}catch{return null}}function WS(e){return Y(e.text).join(" ")}function AU(e){const t=e.datum,n=e.orient,i=t.title?tD(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${nu(a)?"discrete":a} scale with ${pM(o,s,e)}`}function kU(e){const t=e.datum,n=t.title?tD(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return FU(i)+(n?` titled '${n}'`:"")+` for ${CU(s)} with ${pM(u,a,e)}`}function tD(e){try{return Y(xe(e.items).items[0].text).join(" ")}catch{return null}}function CU(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+xe(e)}function FU(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const nD=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),TU=e=>nD(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function mx(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${TU(l)}"`),a),a={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)o(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:o,text:u=>(n+=nD(u),a),toString:()=>e};return a}const iD=e=>rD(mx(),e)+"";function rD(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):rD(e,i)}return e.close()}const hh={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},ph={blend:"mix-blend-mode"},sD={fill:"none","stroke-miterlimit":10},ll=0,HS="http://www.w3.org/2000/xmlns/",it=mc.xmlns;class yx extends Qc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,s){return this._defs={},this._clearDefs(),t&&(this._svg=rt(t,0,"svg",it),this._svg.setAttributeNS(HS,"xmlns",it),this._svg.setAttributeNS(HS,"xmlns:xlink",mc["xmlns:xlink"]),this._svg.setAttribute("version",mc.version),this._svg.setAttribute("class","marks"),Un(t,1),this._root=rt(this._svg,ll,"g",it),ps(this._root,sD),Un(this._svg,ll+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,s)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(ps(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=rt(t,ll,"rect",it),ps(i,{width:this._width,height:this._height,fill:n}));const r=iD(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Un(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,s,o,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==s&&(s=r.marktype,o=Pn[s]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,GS(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,GS(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=Pn[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=VS(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Un(c,0),n._svg;c.setAttribute("class",jM(n));const f=eD(n);for(const g in f)Xt(c,g,f[g]);l||Xt(c,"pointer-events",u),Xt(c,"clip-path",n.clip?Xv(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=VS(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&OU(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):vi(n,p),Un(c,h),c}_update(t,n,i){Mr=n,Nt=n.__values__,ZM(Vl,i),t.attr(Vl,i,this);const r=NU[t.type];r&&r.call(this,t,n,i),Mr&&this.style(Mr,i)}style(t,n){if(n!=null){for(const i in hh){let r=i==="font"?Jc(n):n[i];if(r===Nt[i])continue;const s=hh[i];r==null?t.removeAttribute(s):(Hv(r)&&(r=mM(r,this._defs.gradient,oD())),t.setAttribute(s,r+"")),Nt[i]=r}for(const i in ph)Sd(t,ph[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=rt(t,ll+1,"defs",it)),r=MU(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=rt(t,ll+1,"defs",it)),r=DU(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Un(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function GS(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function MU(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=rt(e,n++,"pattern",it);ps(o,{id:nh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=rt(o,0,"rect",it),ps(o,{width:1,height:1,fill:`url(${oD()}#${t.id})`}),e=rt(e,n++,"radialGradient",it),ps(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=rt(e,n++,"linearGradient",it),ps(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=rt(e,i,"stop",it),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return Un(e,i),n}function DU(e,t,n){let i;return e=rt(e,n,"clipPath",it),e.setAttribute("id",t.id),t.path?(i=rt(e,0,"path",it),i.setAttribute("d",t.path)):(i=rt(e,0,"rect",it),ps(i,{x:0,y:0,width:t.width,height:t.height})),Un(e,1),n+1}function OU(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;vi(n,o=>{r=e.mark(t,o,r,i),++s}),Un(t,1+s)}function VS(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=hs(o,i,it),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=hs(o,"path",it);s.appendChild(a),a.__data__=e;const u=hs(o,"g",it);s.appendChild(u),u.__data__=e;const l=hs(o,"path",it);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||RU(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function RU(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Mr=null,Nt=null;const NU={group(e,t,n){const i=Mr=t.childNodes[2];Nt=i.__values__,e.foreground(Vl,n,this),Nt=t.__values__,Mr=t.childNodes[1],e.content(Vl,n,this);const r=Mr=t.childNodes[0];e.background(Vl,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Nt.events&&(Xt(i,"pointer-events",s),Xt(r,"pointer-events",s),Nt.events=s),n.strokeForeground&&n.stroke){const o=n.fill;Xt(i,"display",null),this.style(r,n),Xt(r,"stroke",null),o&&(n.fill=null),Nt=i.__values__,this.style(i,n),o&&(n.fill=o),Mr=null}else Xt(i,"display","none")},image(e,t,n){n.smooth===!1?(Sd(t,"image-rendering","optimizeSpeed"),Sd(t,"image-rendering","pixelated")):Sd(t,"image-rendering",null)},text(e,t,n){const i=Kc(n);let r,s,o,a;L(i)?(s=i.map(u=>Ms(n,u)),r=s.join(`
|
18
|
+
`),r!==Nt.text&&(Un(t,0),o=t.ownerDocument,a=Ts(n),s.forEach((u,l)=>{const c=hs(o,"tspan",it);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Nt.text=r)):(s=Ms(n,i),s!==Nt.text&&(t.textContent=s,Nt.text=s)),Xt(t,"font-family",Jc(n)),Xt(t,"font-size",ur(n)+"px"),Xt(t,"font-style",n.fontStyle),Xt(t,"font-variant",n.fontVariant),Xt(t,"font-weight",n.fontWeight)}};function Vl(e,t,n){t!==Nt[e]&&(n?LU(Mr,e,t,n):Xt(Mr,e,t),Nt[e]=t)}function Sd(e,t,n){n!==Nt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Nt[t]=n)}function ps(e,t){for(const n in t)Xt(e,n,t[n])}function Xt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function LU(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function oD(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class aD extends Qc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=mx();n.open("svg",ce({},mc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",sD,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Pn[n.marktype],r=i.tag,s=[ZM,i.attr];t.open("g",{class:jM(n),"clip-path":n.clip?Xv(this,n,n.group):null},eD(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Kc(a);if(L(l)){const c={x:0,dy:Ts(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Ms(a,l[f])).close()}else t.text(Ms(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),vi(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):vi(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&PU(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:nh+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const s in i){const o=i[s];t.open("clipPath",{id:s}),o.path?t.open("path",{d:o.path}).close():t.open("rect",{x:0,y:0,width:o.width,height:o.height}).close(),t.close()}t.close()}}}function PU(e,t,n,i,r){let s;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Jc(t),e["font-size"]=ur(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const o in hh){let a=t[o];const u=hh[o];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Hv(a)&&(a=mM(a,r.gradient,"")),e[u]=a)}for(const o in ph){const a=t[o];a!=null&&(s=s||[],s.push(`${ph[o]}: ${a};`))}return s&&(e.style=s.join(" ")),e}const ai={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function zU(e){ai.svgMarkTypes=e.svgMarkTypes??["text"],ai.svgOnTop=e.svgOnTop??!0,ai.debug=e.debug??!1}class _1 extends Qc{constructor(t){super(t),this._svgRenderer=new yx(t),this._canvasRenderer=new dh(t)}initialize(t,n,i,r,s){this._root_el=rt(t,0,"div");const o=rt(this._root_el,0,"div"),a=rt(this._root_el,1,"div");return this._root_el.style.position="relative",ai.debug||(o.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=ai.svgOnTop?a:o,this._canvasEl=ai.svgOnTop?o:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,s),this._svgRenderer.initialize(this._svgEl,n,i,r,s),super.initialize(t,n,i,r,s)}dirty(t){return ai.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(s=>!ai.svgMarkTypes.includes(s));this._svgRenderer.render(t,ai.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return ai.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class uD extends Zc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=rt(rt(t,0,"div"),ai.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const lD="canvas",cD="hybrid",fD="png",dD="svg",hD="none",gs={Canvas:lD,PNG:fD,SVG:dD,Hybrid:cD,None:hD},Lo={};Lo[lD]=Lo[fD]={renderer:dh,headless:dh,handler:Zc};Lo[dD]={renderer:yx,headless:aD,handler:YM};Lo[cD]={renderer:_1,headless:_1,handler:uD};Lo[hD]={};function rg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Lo[e]=t,this):Lo[e]}function pD(e,t,n){const i=[],r=new nt().union(t),s=e.marktype;return s?gD(e,r,n,i):s==="group"?mD(e,r,n,i):N("Intersect scene must be mark node or group item.")}function gD(e,t,n,i){if(IU(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a<o;++a)mD(r[a],t,n,i);else for(const u=Pn[s].isect;a<o;++a){const l=r[a];yD(l,t,u)&&i.push(l)}}return i}function IU(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function mD(e,t,n,i){n&&n(e.mark)&&yD(e,t,Pn.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const o=e.x||0,a=e.y||0;t.translate(-o,-a);for(let u=0;u<s;++u)gD(r[u],t,n,i);t.translate(o,a)}return i}function yD(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const qm=new nt;function bD(e){const t=e.clip;if(fe(t))t(Xc(qm.clear()));else if(t)qm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(qm)}const BU=1e-9;function bx(e,t,n){return e===t?!0:n==="path"?vD(e,t):e instanceof Date&&t instanceof Date?+e==+t:$e(e)&&$e(t)?Math.abs(e-t)<=BU:!e||!t||!X(e)&&!X(t)?e==t:UU(e,t)}function vD(e,t){return bx(iu(e),iu(t))}function UU(e,t){var n=Object.keys(e),i=Object.keys(t),r,s;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),s=n.length-1;s>=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!bx(e[r],t[r],r))return!1;return typeof e==typeof t}function jU(){SM(),d7()}const ou="top",ci="left",fi="right",Ds="bottom",qU="top-left",WU="top-right",HU="bottom-left",GU="bottom-right",vx="start",$1="middle",Yt="end",VU="x",XU="y",sg="group",xx="axis",wx="title",YU="frame",KU="scope",Ex="legend",xD="row-header",wD="row-footer",ED="row-title",SD="column-header",_D="column-footer",$D="column-title",JU="padding",QU="symbol",AD="fit",kD="fit-x",CD="fit-y",ZU="pad",Sx="none",Of="all",A1="each",_x="flush",ms="column",ys="row";function FD(e){D.call(this,null,e)}G(FD,D,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=Pn[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Rf(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===sg||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Rf(l,o))),i.role){case xx:case Ex:case wx:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Rf(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Rf(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return bD(i),t.modifies("bounds")}});function Rf(e,t,n){return t(e.bounds.clear(),e,n)}const XS=":vega_identifier:";function $x(e){D.call(this,0,e)}$x.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G($x,D,{transform(e,t){const n=ej(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function ej(e){return e._signals[XS]||(e._signals[XS]=e.add(0))}function TD(e){D.call(this,null,e)}G(TD,D,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,tj(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===sg?Kp:Yp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function tj(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function MD(e){D.call(this,null,e)}const YS={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!DD(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},DD=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),KS=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(DD(r,s=e[n].bounds,t))return!0},nj=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},ij=(e,t,n)=>{var i=e.range(),r=new nt;return t===ou||t===Ds?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},JS=e=>(e.forEach(t=>t.opacity=1),e),QS=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(MD,D,{transform(e,t){const n=YS[e.method]||YS.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(JS(r),t=QS(t,e)),t;if(r=r.filter(nj),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=JS(r),t=QS(t,e),s.length>=3&&KS(s,i)){do s=n(s,i);while(s.length>=3&&KS(s,i));s.length<3&&!xe(r).opacity&&(s.length>1&&(xe(s).opacity=0),xe(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=ij(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function OD(e){D.call(this,null,e)}G(OD,D,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Rt=new nt;function Ra(e,t,n){return e[t]===n?0:(e[t]=n,1)}function rj(e){var t=e.items[0].orient;return t===ci||t===fi}function sj(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function oj(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=sj(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&ax(p),b=0,v=0,x,E;switch(Rt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case ou:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),p&&Nf(e,p,E,g,y,0,-1,m);break;case ci:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),p&&Nf(e,p,E,g,y,1,-1,m);break;case fi:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),p&&Nf(e,p,E,g,y,1,1,m);break;case Ds:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),p&&Nf(e,p,E,g,0,0,1,m);break;default:b=r.x,v=r.y}return Hr(m.translate(b,v),r),Ra(r,"x",b+o)|Ra(r,"y",v+o)&&(r.bounds=Rt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Nf(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const ZS=(e,t)=>Math.floor(Math.min(e,t)),e_=(e,t)=>Math.ceil(Math.max(e,t));function aj(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],s=r.items,r.marktype===sg)switch(r.role){case xx:case Ex:case wx:break;case xD:o.rowheaders.push(...s);break;case wD:o.rowfooters.push(...s);break;case SD:o.colheaders.push(...s);break;case _D:o.colfooters.push(...s);break;case ED:o.rowtitle=s[0];break;case $D:o.coltitle=s[0];break;default:o.marks.push(...s)}return o}function uj(e){return new nt().set(0,0,e.width||0,e.height||0)}function lj(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function je(e,t,n){const i=X(e)?e[t]:e;return i??(n!==void 0?n:0)}function t_(e){return e<0?Math.ceil(-e):0}function RD(e,t,n){var i=!n.nodirty,r=n.bounds===_x?uj:lj,s=Rt.set(0,0,0,0),o=je(n.align,ms),a=je(n.align,ys),u=je(n.padding,ms),l=je(n.padding,ys),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),S,w,_,$,C,T,O,k,F,A,M;for(w=0;w<c;++w)p[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)T=t[w],C=E[w]=r(T),T.x=T.x||0,v[w]=0,T.y=T.y||0,x[w]=0,_=w%c,$=~~(w/c),g=Math.max(g,O=Math.ceil(C.x2)),b=Math.max(b,k=Math.ceil(C.y2)),p[_]=Math.max(p[_],O),y[$]=Math.max(y[$],k),h[w]=u+t_(C.x1),m[w]=l+t_(C.y1),i&&e.dirty(t[w]);for(w=0;w<d;++w)w%c===0&&(h[w]=0),w<c&&(m[w]=0);if(o===A1)for(_=1;_<c;++_){for(M=0,w=_;w<d;w+=c)M<h[w]&&(M=h[w]);for(w=_;w<d;w+=c)h[w]=M+p[_-1]}else if(o===Of){for(M=0,w=0;w<d;++w)w%c&&M<h[w]&&(M=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=M+g)}else for(o=!1,_=1;_<c;++_)for(w=_;w<d;w+=c)h[w]+=p[_-1];if(a===A1)for($=1;$<f;++$){for(M=0,w=$*c,S=w+c;w<S;++w)M<m[w]&&(M=m[w]);for(w=$*c;w<S;++w)m[w]=M+y[$-1]}else if(a===Of){for(M=0,w=c;w<d;++w)M<m[w]&&(M=m[w]);for(w=c;w<d;++w)m[w]=M+b}else for(a=!1,$=1;$<f;++$)for(w=$*c,S=w+c;w<S;++w)m[w]+=y[$-1];for(F=0,w=0;w<d;++w)F=h[w]+(w%c?F:0),v[w]+=F-t[w].x;for(_=0;_<c;++_)for(A=0,w=_;w<d;w+=c)A+=m[w],x[w]+=A-t[w].y;if(o&&je(n.center,ms)&&f>1)for(w=0;w<d;++w)C=o===Of?g:p[w%c],F=C-E[w].x2-t[w].x-v[w],F>0&&(v[w]+=F/2);if(a&&je(n.center,ys)&&c!==1)for(w=0;w<d;++w)C=a===Of?b:y[~~(w/c)],A=C-E[w].y2-t[w].y-x[w],A>0&&(x[w]+=A/2);for(w=0;w<d;++w)s.union(E[w].translate(v[w],x[w]));switch(F=je(n.anchor,VU),A=je(n.anchor,XU),je(n.anchor,ms)){case Yt:F-=s.width();break;case $1:F-=s.width()/2}switch(je(n.anchor,ys)){case Yt:A-=s.height();break;case $1:A-=s.height()/2}for(F=Math.round(F),A=Math.round(A),s.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)T=t[w],T.x+=v[w]+=F,T.y+=x[w]+=A,s.union(T.mark.bounds.union(T.bounds.translate(v[w],x[w]))),i&&e.dirty(T);return s}function cj(e,t,n){var i=aj(t),r=i.marks,s=n.bounds===_x?fj:dj,o=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,p,g,m;const y=RD(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=je(n.headerBand,ys,null),c=Lf(e,i.rowheaders,r,a,u,-je(o,"rowHeader"),ZS,0,s,"x1",0,a,1,g)),i.colheaders&&(g=je(n.headerBand,ms,null),f=Lf(e,i.colheaders,r,a,a,-je(o,"columnHeader"),ZS,1,s,"y1",0,1,a,g)),i.rowfooters&&(g=je(n.footerBand,ys,null),d=Lf(e,i.rowfooters,r,a,u,je(o,"rowFooter"),e_,0,s,"x2",a-1,a,1,g)),i.colfooters&&(g=je(n.footerBand,ms,null),h=Lf(e,i.colfooters,r,a,a,je(o,"columnFooter"),e_,1,s,"y2",l-a,1,a,g)),i.rowtitle&&(p=je(n.titleAnchor,ys),m=je(o,"rowTitle"),m=p===Yt?d+m:c-m,g=je(n.titleBand,ys,.5),n_(e,i.rowtitle,m,0,y,g)),i.coltitle&&(p=je(n.titleAnchor,ms),m=je(o,"columnTitle"),m=p===Yt?h+m:f-m,g=je(n.titleBand,ms,.5),n_(e,i.coltitle,m,1,y,g))}function fj(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function dj(e,t){return e.bounds[t]}function Lf(e,t,n,i,r,s,o,a,u,l,c,f,d,h){var p=n.length,g=0,m=0,y,b,v,x,E,S,w,_,$;if(!p)return g;for(y=c;y<p;y+=f)n[y]&&(g=o(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(S=t[b],E=S.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(_=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),$=g):(_=g,$=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(S.bounds.translate(_-(S.x||0),$-(S.y||0))),S.x=_,S.y=$,e.dirty(S),m=o(m,E[l])}return m}function n_(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function hj(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function pj(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function gj(e,t,n,i,r,s,o){const a=hj(n,t),u=pj(e,a("offset",0)),l=a("anchor",vx),c=l===Yt?1:l===$1?.5:0,f={align:A1,bounds:a("bounds",_x),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case ci:f.anchor={x:Math.floor(i.x1)-u,column:Yt,y:c*(o||i.height()+2*i.y1),row:l};break;case fi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case ou:f.anchor={y:Math.floor(r.y1)-u,row:Yt,x:c*(s||r.width()+2*r.x1),column:l};break;case Ds:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case qU:f.anchor={x:u,y:u};break;case WU:f.anchor={x:s-u,y:u,column:Yt};break;case HU:f.anchor={x:u,y:o-u,row:Yt};break;case GU:f.anchor={x:s-u,y:o-u,column:Yt,row:Yt};break}return f}function mj(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),bj(e,n,n.items[0].items[0]),s=yj(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===QU&&vj(n.items[0].items[0].items[0].items),r!==Sx&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,Hr(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function yj(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function bj(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&cl(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case ci:r+=Math.ceil(o.bounds.width())+u;break;case fi:case Ds:break;default:s+=o.bounds.height()+u}switch((r||s)&&cl(e,n,r,s),o.orient){case ci:c+=va(t,n,o,a,1,1);break;case fi:l+=va(t,n,o,Yt,0,0)+u,c+=va(t,n,o,a,1,1);break;case Ds:l+=va(t,n,o,a,0,0),c+=va(t,n,o,Yt,-1,0,1)+u;break;default:l+=va(t,n,o,a,0,0)}(l||c)&&cl(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(cl(e,n,-l,0),cl(e,o,-l,0))}}function va(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:ax(n);return Math.round(i===vx?f:i===Yt?d-h:.5*(c-h))}function cl(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function vj(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function xj(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===ci||a===fi?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==sg?a===ci?(p=r.y2,h=r.y1):a===fi?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===ci&&(p=i,h=0),v=u===vx?p:u===Yt?h:(p+h)/2,d&&d.text){switch(a){case ou:case Ds:b=f.bounds.height()+c;break;case ci:y=f.bounds.width()+c;break;case fi:y=-f.bounds.width()-c;break}Rt.clear().union(d.bounds),Rt.translate(y-(d.x||0),b-(d.y||0)),Ra(d,"x",y)|Ra(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Rt),d.mark.bounds.clear().union(Rt),e.dirty(d)),Rt.clear().union(d.bounds)}else Rt.clear();switch(Rt.union(f.bounds),a){case ou:g=v,m=r.y1-Rt.height()-l;break;case ci:g=r.x1-Rt.width()-l,m=v;break;case fi:g=r.x2+Rt.width()+l,m=v;break;case Ds:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return Ra(s,"x",g)|Ra(s,"y",m)&&(Rt.translate(g,m),e.dirty(s),s.bounds.clear().union(Rt),t.bounds.clear().union(Rt),e.dirty(s)),s.bounds}function ND(e){D.call(this,null,e)}G(ND,D,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&cj(n,i,e.layout),Ej(n,i,e)}),wj(e.mark.group)?t.reflow():t}});function wj(e){return e&&e.mark.role!=="legend-entry"}function Ej(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new nt().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p<g;++p)switch(f=i[p],f.role){case xx:h=rj(f)?a:u,h.union(oj(e,f,r,s));break;case wx:c=f;break;case Ex:l.push(mj(e,f));break;case YU:case KU:case xD:case wD:case ED:case SD:case _D:case $D:a.union(f.bounds),u.union(f.bounds);break;default:o.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||fi,d!==Sx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];RD(e,b,gj(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===AD||n.autosize.type===kD||n.autosize.type===CD))switch(y.orient){case ci:case fi:o.add(b.x1,0).add(b.x2,0);break;case ou:case Ds:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(xj(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),Sj(e,t,o,n)}function Sj(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===JU){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===Sx?(l=0,f=0,u=o,c=a):s===AD?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===kD?(u=Math.max(0,o-l-d),a=c+f+h):s===CD?(o=u+l+d,c=Math.max(0,a-f-h)):s===ZU&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const _j=Object.freeze(Object.defineProperty({__proto__:null,bound:FD,identifier:$x,mark:TD,overlap:MD,render:OD,viewlayout:ND},Symbol.toStringTag,{value:"Module"}));function LD(e){D.call(this,null,e)}G(LD,D,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=qv(s,o,e.minstep),u=e.format||lM(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?uM(s,e.values,a):Wv(s,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function PD(e){D.call(this,null,e)}function $j(){return Ce({})}function Aj(e){const t=Mu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(PD,D,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||$j,s=e.key||re,o=this.value;return L(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&N("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=Aj(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function zD(e){D.call(this,null,e)}G(zD,D,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(L(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||ns,u=r.enter||ns,l=r.exit||ns,c=(s&&!o?r[s]:a)||ns;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==ns&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ns&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==ns){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function ID(e){D.call(this,[],e)}G(ID,D,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||gd,o=e.scale,a=+e.limit,u=qv(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===gd,c=e.format||hM(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||dM(o,u),d,h,p,g,m;return r&&(i.rem=r),s===gd?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,fe(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=Ht(g=p||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===Z8?(d=o.domain(),h=sM(o,d[0],xe(d)),f.length<3&&!e.values&&d[0]!==xe(d)&&(f=[d[0],xe(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=c7(o),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const kj=e=>e.source.x,Cj=e=>e.source.y,Fj=e=>e.target.x,Tj=e=>e.target.y;function Ax(e){D.call(this,{},e)}Ax.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};G(Ax,D,{transform(e,t){var n=e.sourceX||kj,i=e.sourceY||Cj,r=e.targetX||Fj,s=e.targetY||Tj,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=i_.get(u+"-"+a)||i_.get(u);return l||N("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const BD=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,Mj=(e,t,n,i)=>BD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),UD=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},Dj=(e,t,n,i)=>UD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),jD=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},Oj=(e,t,n,i)=>jD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),Rj=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Nj=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,Lj=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},Pj=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},zj=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},Ij=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a},i_=Mu({line:BD,"line-radial":Mj,arc:UD,"arc-radial":Dj,curve:jD,"curve-radial":Oj,"orthogonal-horizontal":Rj,"orthogonal-vertical":Nj,"orthogonal-radial":Lj,"diagonal-horizontal":Pj,"diagonal-vertical":zj,"diagonal-radial":Ij});function kx(e){D.call(this,null,e)}kx.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};G(kx,D,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||Cu,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/_C(l),h=Fn(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)m=l[h[p]],g=u[h[p]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const Bj=5;function Uj(e){const t=e.type;return!e.bins&&(t===eu||t===Uc||t===jc)}function qD(e){return Bv(e)&&e!==Xi}const jj=yi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function WD(e){D.call(this,null,e),this.modified(!0)}G(WD,D,{transform(e,t){var n=t.dataflow,i=this.value,r=qj(e);(!i||r!==i.type)&&(this.value=i=ke(r)());for(r in e)if(!jj[r]){if(r==="padding"&&qD(i.type))continue;fe(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return Yj(i,e,Xj(i,e,Hj(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function qj(e){var t=e.type,n="",i;return t===Xi?Xi+"-"+eu:(Wj(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Xi+"-":i===3?Pu+"-":""),(n+t||eu).toLowerCase())}function Wj(e){const t=e.type;return Bv(t)&&t!==Ro&&t!==No&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function Hj(e,t,n){const i=Gj(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&Uj(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return qD(s)&&t.padding&&r[0]!==xe(r)&&(r=Vj(s,r,t.range,t.padding,t.exponent,t.constant)),e.domain(HD(s,r,n)),s===Lv&&e.unknown(t.domainImplicit?c1:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&qv(e,t.nice)||null),r.length}function Gj(e,t,n){return t?(e.domain(HD(e.type,t,n)),t.length):-1}function Vj(e,t,n,i,r,s){var o=Math.abs(xe(n)-n[0]),a=o/(o-2*i),u=e===Ur?ub(t,null,a):e===jc?jd(t,null,a,.5):e===Uc?jd(t,null,a,r||1):e===Wp?lb(t,null,a,s||1):ab(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function HD(e,t,n){if(eM(e)){var i=Math.abs(t.reduce((r,s)=>r+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function Xj(e,t,n){let i=t.bins;if(i&&!L(i)){const r=e.domain(),s=r[0],o=xe(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||N("Scale bins parameter missing step property."),u<s&&(u=a*Math.ceil(s/a)),l>o&&(l=a*Math.floor(o/a)),i=Fn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Pv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function Yj(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=Kj(i,t,n);else if(t.scheme&&(s=Jj(i,t,n),fe(s))){if(e.interpolator)return e.interpolator(s);N(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&tM(i))return e.interpolator(Vp(k1(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Uv(t.interpolate,t.interpolateGamma)):fe(e.round)?e.round(r):fe(e.rangeRound)&&e.interpolate(r?dp:Nc),s&&e.range(k1(s,t.reverse))}function Kj(e,t,n){e!==XT&&e!==d1&&N("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===d1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Nv(n,r,i)]}function Jj(e,t,n){var i=t.schemeExtent,r,s;return L(t.scheme)?s=Vp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=jv(r),s||N(`Unrecognized scheme name: ${t.scheme}`)),n=e===Gp?n+1:e===Pv?n-1:e===tu||e===Hp?+t.schemeCount||Bj:n,tM(e)?r_(s,i,t.reverse):fe(s)?rM(r_(s,i),n):e===Lv?s:s.slice(0,n)}function r_(e,t,n){return fe(e)&&(t||n)?iM(e,k1(t||[0,1],n)):e}function k1(e,t){return t?e.slice().reverse():e}function GD(e){D.call(this,null,e)}G(GD,D,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ea(e.sort)),this.modified(n),t}});const s_="zero",VD="center",XD="normalize",YD=["y0","y1"];function Cx(e){D.call(this,null,e)}Cx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:s_,values:[s_,VD,XD]},{name:"as",type:"string",array:!0,length:2,default:YD}]};G(Cx,D,{transform(e,t){var n=e.as||YD,i=n[0],r=n[1],s=ea(e.sort),o=e.field||Cu,a=e.offset===VD?Qj:e.offset===XD?Zj:eq,u,l,c,f;for(u=tq(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,o,i,r);return t.reflow(e.modified()).modifies(n)}});function Qj(e,t,n,i,r){for(var s=(t-e.sum)/2,o=e.length,a=0,u;a<o;++a)u=e[a],u[i]=s,u[r]=s+=Math.abs(n(u))}function Zj(e,t,n,i,r){for(var s=1/e.sum,o=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=o,c[r]=o=s*(l+=Math.abs(n(c)))}function eq(e,t,n,i,r){for(var s=0,o=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=o,c[r]=o+=l):(c[i]=s,c[r]=s+=l)}function tq(e,t,n,i){var r=[],s=g=>g(c),o,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(s),d=o[f],d||(o[f]=d=[],r.push(d)),d.push(c);for(f=0,p=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return r.max=p,r}const nq=Object.freeze(Object.defineProperty({__proto__:null,axisticks:LD,datajoin:PD,encode:zD,legendentries:ID,linkpath:Ax,pie:kx,scale:WD,sortitems:GD,stack:Cx},Symbol.toStringTag,{value:"Module"}));var oe=1e-6,gh=1e-12,me=Math.PI,Ye=me/2,mh=me/4,sn=me*2,Qe=180/me,pe=me/180,ve=Math.abs,Iu=Math.atan,Qn=Math.atan2,ae=Math.cos,Pf=Math.ceil,KD=Math.exp,C1=Math.hypot,yh=Math.log,Wm=Math.pow,se=Math.sin,Wn=Math.sign||function(e){return e>0?1:e<0?-1:0},on=Math.sqrt,Fx=Math.tan;function JD(e){return e>1?0:e<-1?me:Math.acos(e)}function bn(e){return e>1?Ye:e<-1?-Ye:Math.asin(e)}function _t(){}function bh(e,t){e&&a_.hasOwnProperty(e.type)&&a_[e.type](e,t)}var o_={Feature:function(e,t){bh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)bh(n[i].geometry,t)}},a_={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,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){F1(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)F1(n[i],t,0)},Polygon:function(e,t){u_(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)u_(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)bh(n[i],t)}};function F1(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function u_(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)F1(e[n],t,1);t.polygonEnd()}function $r(e,t){e&&o_.hasOwnProperty(e.type)?o_[e.type](e,t):bh(e,t)}var vh=new nn,xh=new nn,QD,ZD,T1,M1,D1,tr={point:_t,lineStart:_t,lineEnd:_t,polygonStart:function(){vh=new nn,tr.lineStart=iq,tr.lineEnd=rq},polygonEnd:function(){var e=+vh;xh.add(e<0?sn+e:e),this.lineStart=this.lineEnd=this.point=_t},sphere:function(){xh.add(sn)}};function iq(){tr.point=sq}function rq(){e3(QD,ZD)}function sq(e,t){tr.point=e3,QD=e,ZD=t,e*=pe,t*=pe,T1=e,M1=ae(t=t/2+mh),D1=se(t)}function e3(e,t){e*=pe,t*=pe,t=t/2+mh;var n=e-T1,i=n>=0?1:-1,r=i*n,s=ae(t),o=se(t),a=D1*o,u=M1*s+a*ae(r),l=a*i*se(r);vh.add(Qn(l,u)),T1=e,M1=s,D1=o}function oq(e){return xh=new nn,$r(e,tr),xh*2}function wh(e){return[Qn(e[1],e[0]),bn(e[2])]}function Po(e){var t=e[0],n=e[1],i=ae(n);return[i*ae(t),i*se(t),se(n)]}function zf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function au(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 Hm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function If(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Eh(e){var t=on(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,dn,Ve,An,go,t3,n3,Ba,Xl,as,jr,Sr={point:O1,lineStart:l_,lineEnd:c_,polygonStart:function(){Sr.point=r3,Sr.lineStart=aq,Sr.lineEnd=uq,Xl=new nn,tr.polygonStart()},polygonEnd:function(){tr.polygonEnd(),Sr.point=O1,Sr.lineStart=l_,Sr.lineEnd=c_,vh<0?(He=-(Ve=180),dn=-(An=90)):Xl>oe?An=90:Xl<-oe&&(dn=-90),jr[0]=He,jr[1]=Ve},sphere:function(){He=-(Ve=180),dn=-(An=90)}};function O1(e,t){as.push(jr=[He=e,Ve=e]),t<dn&&(dn=t),t>An&&(An=t)}function i3(e,t){var n=Po([e*pe,t*pe]);if(Ba){var i=au(Ba,n),r=[i[1],-i[0],0],s=au(r,i);Eh(s),s=wh(s);var o=e-go,a=o>0?1:-1,u=s[0]*Qe*a,l,c=ve(o)>180;c^(a*go<u&&u<a*e)?(l=s[1]*Qe,l>An&&(An=l)):(u=(u+360)%360-180,c^(a*go<u&&u<a*e)?(l=-s[1]*Qe,l<dn&&(dn=l)):(t<dn&&(dn=t),t>An&&(An=t))),c?e<go?$n(He,e)>$n(He,Ve)&&(Ve=e):$n(e,Ve)>$n(He,Ve)&&(He=e):Ve>=He?(e<He&&(He=e),e>Ve&&(Ve=e)):e>go?$n(He,e)>$n(He,Ve)&&(Ve=e):$n(e,Ve)>$n(He,Ve)&&(He=e)}else as.push(jr=[He=e,Ve=e]);t<dn&&(dn=t),t>An&&(An=t),Ba=n,go=e}function l_(){Sr.point=i3}function c_(){jr[0]=He,jr[1]=Ve,Sr.point=O1,Ba=null}function r3(e,t){if(Ba){var n=e-go;Xl.add(ve(n)>180?n+(n>0?360:-360):n)}else t3=e,n3=t;tr.point(e,t),i3(e,t)}function aq(){tr.lineStart()}function uq(){r3(t3,n3),tr.lineEnd(),ve(Xl)>oe&&(He=-(Ve=180)),jr[0]=He,jr[1]=Ve,Ba=null}function $n(e,t){return(t-=e)<0?t+360:t}function lq(e,t){return e[0]-t[0]}function f_(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function cq(e){var t,n,i,r,s,o,a;if(An=Ve=-(He=dn=1/0),as=[],$r(e,Sr),n=as.length){for(as.sort(lq),t=1,i=as[0],s=[i];t<n;++t)r=as[t],f_(i,r[0])||f_(i,r[1])?($n(i[0],r[1])>$n(i[0],i[1])&&(i[1]=r[1]),$n(r[0],i[1])>$n(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=$n(i[1],r[0]))>o&&(o=a,He=r[0],Ve=i[1])}return as=jr=null,He===1/0||dn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,dn],[Ve,An]]}var Dl,Sh,_h,$h,Ah,kh,Ch,Fh,R1,N1,L1,s3,o3,Kt,Jt,Qt,di={sphere:_t,point:Tx,lineStart:d_,lineEnd:h_,polygonStart:function(){di.lineStart=hq,di.lineEnd=pq},polygonEnd:function(){di.lineStart=d_,di.lineEnd=h_}};function Tx(e,t){e*=pe,t*=pe;var n=ae(t);ef(n*ae(e),n*se(e),se(t))}function ef(e,t,n){++Dl,_h+=(e-_h)/Dl,$h+=(t-$h)/Dl,Ah+=(n-Ah)/Dl}function d_(){di.point=fq}function fq(e,t){e*=pe,t*=pe;var n=ae(t);Kt=n*ae(e),Jt=n*se(e),Qt=se(t),di.point=dq,ef(Kt,Jt,Qt)}function dq(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Qn(on((o=Jt*s-Qt*r)*o+(o=Qt*i-Kt*s)*o+(o=Kt*r-Jt*i)*o),Kt*i+Jt*r+Qt*s);Sh+=o,kh+=o*(Kt+(Kt=i)),Ch+=o*(Jt+(Jt=r)),Fh+=o*(Qt+(Qt=s)),ef(Kt,Jt,Qt)}function h_(){di.point=Tx}function hq(){di.point=gq}function pq(){a3(s3,o3),di.point=Tx}function gq(e,t){s3=e,o3=t,e*=pe,t*=pe,di.point=a3;var n=ae(t);Kt=n*ae(e),Jt=n*se(e),Qt=se(t),ef(Kt,Jt,Qt)}function a3(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Jt*s-Qt*r,a=Qt*i-Kt*s,u=Kt*r-Jt*i,l=C1(o,a,u),c=bn(l),f=l&&-c/l;R1.add(f*o),N1.add(f*a),L1.add(f*u),Sh+=c,kh+=c*(Kt+(Kt=i)),Ch+=c*(Jt+(Jt=r)),Fh+=c*(Qt+(Qt=s)),ef(Kt,Jt,Qt)}function mq(e){Dl=Sh=_h=$h=Ah=kh=Ch=Fh=0,R1=new nn,N1=new nn,L1=new nn,$r(e,di);var t=+R1,n=+N1,i=+L1,r=C1(t,n,i);return r<gh&&(t=kh,n=Ch,i=Fh,Sh<oe&&(t=_h,n=$h,i=Ah),r=C1(t,n,i),r<gh)?[NaN,NaN]:[Qn(n,t)*Qe,bn(i/r)*Qe]}function P1(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function z1(e,t){return ve(e)>me&&(e-=Math.round(e/sn)*sn),[e,t]}z1.invert=z1;function u3(e,t,n){return(e%=sn)?t||n?P1(g_(e),m_(t,n)):g_(e):t||n?m_(t,n):z1}function p_(e){return function(t,n){return t+=e,ve(t)>me&&(t-=Math.round(t/sn)*sn),[t,n]}}function g_(e){var t=p_(e);return t.invert=p_(-e),t}function m_(e,t){var n=ae(e),i=se(e),r=ae(t),s=se(t);function o(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*n+c*i;return[Qn(f*r-h*s,c*n-d*i),bn(h*r+f*s)]}return o.invert=function(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*r-f*s;return[Qn(f*r+d*s,c*n+h*i),bn(h*n-c*i)]},o}function yq(e){e=u3(e[0]*pe,e[1]*pe,e.length>2?e[2]*pe:0);function t(n){return n=e(n[0]*pe,n[1]*pe),n[0]*=Qe,n[1]*=Qe,n}return t.invert=function(n){return n=e.invert(n[0]*pe,n[1]*pe),n[0]*=Qe,n[1]*=Qe,n},t}function bq(e,t,n,i,r,s){if(n){var o=ae(t),a=se(t),u=i*n;r==null?(r=t+i*sn,s=t-u/2):(r=y_(o,r),s=y_(o,s),(i>0?r<s:r>s)&&(r+=i*sn));for(var l,c=r;i>0?c>s:c<s;c-=u)l=wh([o,-a*ae(c),-a*se(c)]),e.point(l[0],l[1])}}function y_(e,t){t=Po(t),t[0]-=e,Eh(t);var n=JD(-t[1]);return((-t[2]<0?-n:n)+sn-oe)%sn}function l3(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:_t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function _d(e,t){return ve(e[0]-t[0])<oe&&ve(e[1]-t[1])<oe}function Bf(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function c3(e,t,n,i,r){var s=[],o=[],a,u;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(_d(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<g;++a)r.point((m=p[a])[0],m[1]);r.lineEnd();return}y[0]+=2*oe}s.push(b=new Bf(m,p,null,!0)),o.push(b.o=new Bf(m,null,b,!1)),s.push(b=new Bf(y,p,null,!1)),o.push(b.o=new Bf(y,null,b,!0))}}),!!s.length){for(o.sort(t),b_(s),b_(o),a=0,u=o.length;a<u;++a)o[a].e=n=!n;for(var l=s[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function b_(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Gm(e){return ve(e[0])<=me?e[0]:Wn(e[0])*((ve(e[0])+me)%sn-me)}function vq(e,t){var n=Gm(t),i=t[1],r=se(i),s=[se(n),-ae(n),0],o=0,a=0,u=new nn;r===1?i=Ye+oe:r===-1&&(i=-Ye-oe);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=Gm(h),g=h[1]/2+mh,m=se(g),y=ae(g),b=0;b<d;++b,p=x,m=S,y=w,h=v){var v=f[b],x=Gm(v),E=v[1]/2+mh,S=se(E),w=ae(E),_=x-p,$=_>=0?1:-1,C=$*_,T=C>me,O=m*S;if(u.add(Qn(O*$*se(C),y*w+O*ae(C))),o+=T?_+$*sn:_,T^p>=n^x>=n){var k=au(Po(h),Po(v));Eh(k);var F=au(s,k);Eh(F);var A=(T^_>=0?-1:1)*bn(F[2]);(i>A||i===A&&(k[0]||k[1]))&&(a+=T^_>=0?1:-1)}}return(o<-oe||o<oe&&u<-gh)^a&1}function f3(e,t,n,i){return function(r){var s=t(r),o=l3(),a=t(o),u=!1,l,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=SC(c);var x=vq(l,i);c.length?(u||(r.polygonStart(),u=!0),c3(c,wq,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,E){e(x,E)&&r.point(x,E)}function p(x,E){s.point(x,E)}function g(){d.point=p,s.lineStart()}function m(){d.point=h,s.lineEnd()}function y(x,E){f.push([x,E]),a.point(x,E)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),E=o.result(),S,w=E.length,_,$,C;if(f.pop(),l.push(f),f=null,!!w){if(x&1){if($=E[0],(_=$.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),S=0;S<_;++S)r.point((C=$[S])[0],C[1]);r.lineEnd()}return}w>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter(xq))}}return d}}function xq(e){return e.length>1}function wq(e,t){return((e=e.x)[0]<0?e[1]-Ye-oe:Ye-e[1])-((t=t.x)[0]<0?t[1]-Ye-oe:Ye-t[1])}const v_=f3(function(){return!0},Eq,_q,[-me,-Ye]);function Eq(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?me:-me,u=ve(s-t);ve(u-me)<oe?(e.point(t,n=(n+o)/2>0?Ye:-Ye),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=me&&(ve(t-i)<oe&&(t-=i*oe),ve(s-a)<oe&&(s-=a*oe),n=Sq(t,n,s,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=s,n=o),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Sq(e,t,n,i){var r,s,o=se(e-n);return ve(o)>oe?Iu((se(t)*(s=ae(i))*se(n)-se(i)*(r=ae(t))*se(e))/(r*s*o)):(t+i)/2}function _q(e,t,n,i){var r;if(e==null)r=n*Ye,i.point(-me,r),i.point(0,r),i.point(me,r),i.point(me,0),i.point(me,-r),i.point(0,-r),i.point(-me,-r),i.point(-me,0),i.point(-me,r);else if(ve(e[0]-t[0])>oe){var s=e[0]<t[0]?me:-me;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function $q(e){var t=ae(e),n=2*pe,i=t>0,r=ve(t)>oe;function s(c,f,d,h){bq(h,e,n,d,c,f)}function o(c,f){return ae(c)*ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),E=i?x?0:l(m,y):x?l(m+(m<0?me:-me),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||_d(f,v)||_d(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var S;!(E&d)&&(S=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!f||!_d(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Po(c),p=Po(f),g=[1,0,0],m=au(h,p),y=zf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,S=au(g,m),w=If(g,x),_=If(m,E);Hm(w,_);var $=S,C=zf(w,$),T=zf($,$),O=C*C-T*(zf(w,w)-1);if(!(O<0)){var k=on(O),F=If($,(-C-k)/T);if(Hm(F,w),F=wh(F),!d)return F;var A=c[0],M=f[0],P=c[1],z=f[1],U;M<A&&(U=A,A=M,M=U);var te=M-A,ne=ve(te-me)<oe,de=ne||te<oe;if(!ne&&z<P&&(U=P,P=z,z=U),de?ne?P+z>0^F[1]<(ve(F[0]-A)<oe?P:z):P<=F[1]&&F[1]<=z:te>me^(A<=F[0]&&F[0]<=M)){var Se=If($,(-C+k)/T);return Hm(Se,w),[F,wh(Se)]}}}function l(c,f){var d=i?e:me-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return f3(o,a,s,i?[0,-e]:[-me,e-me])}function Aq(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=i-a,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var Ol=1e9,Uf=-Ol;function d3(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(l,c){return ve(l[0]-e)<oe?c>0?0:3:ve(l[0]-n)<oe?c>0?2:1:ve(l[1]-t)<oe?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=l3(),d,h,p,g,m,y,b,v,x,E,S,w={point:_,lineStart:O,lineEnd:k,polygonStart:C,polygonEnd:T};function _(A,M){r(A,M)&&c.point(A,M)}function $(){for(var A=0,M=0,P=h.length;M<P;++M)for(var z=h[M],U=1,te=z.length,ne=z[0],de,Se,we=ne[0],Pe=ne[1];U<te;++U)de=we,Se=Pe,ne=z[U],we=ne[0],Pe=ne[1],Se<=i?Pe>i&&(we-de)*(i-Se)>(Pe-Se)*(e-de)&&++A:Pe<=i&&(we-de)*(i-Se)<(Pe-Se)*(e-de)&&--A;return A}function C(){c=f,d=[],h=[],S=!0}function T(){var A=$(),M=S&&A,P=(d=SC(d)).length;(M||P)&&(l.polygonStart(),M&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),P&&c3(d,a,A,s,l),l.polygonEnd()),c=l,d=h=p=null}function O(){w.point=F,h&&h.push(p=[]),E=!0,x=!1,b=v=NaN}function k(){d&&(F(g,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=_,x&&c.lineEnd()}function F(A,M){var P=r(A,M);if(h&&p.push([A,M]),E)g=A,m=M,y=P,E=!1,P&&(c.lineStart(),c.point(A,M));else if(P&&x)c.point(A,M);else{var z=[b=Math.max(Uf,Math.min(Ol,b)),v=Math.max(Uf,Math.min(Ol,v))],U=[A=Math.max(Uf,Math.min(Ol,A)),M=Math.max(Uf,Math.min(Ol,M))];Aq(z,U,e,t,n,i)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(U[0],U[1]),P||c.lineEnd(),S=!1):P&&(c.lineStart(),c.point(A,M),S=!1)}b=A,v=M,x=P}return w}}function x_(e,t,n){var i=Fn(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function w_(e,t,n){var i=Fn(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function kq(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Fn(Pf(i/c)*c,n,c).map(p).concat(Fn(Pf(a/f)*f,o,f).map(g)).concat(Fn(Pf(t/u)*u,e,u).filter(function(v){return ve(v%c)>oe}).map(d)).concat(Fn(Pf(s/l)*l,r,l).filter(function(v){return ve(v%f)>oe}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=x_(s,r,90),h=w_(t,e,m),p=x_(a,o,90),g=w_(i,n,m),y):m},y.extentMajor([[-180,-90+oe],[180,90-oe]]).extentMinor([[-180,-80-oe],[180,80+oe]])}const yc=e=>e;var Vm=new nn,I1=new nn,h3,p3,B1,U1,Ar={point:_t,lineStart:_t,lineEnd:_t,polygonStart:function(){Ar.lineStart=Cq,Ar.lineEnd=Tq},polygonEnd:function(){Ar.lineStart=Ar.lineEnd=Ar.point=_t,Vm.add(ve(I1)),I1=new nn},result:function(){var e=Vm/2;return Vm=new nn,e}};function Cq(){Ar.point=Fq}function Fq(e,t){Ar.point=g3,h3=B1=e,p3=U1=t}function g3(e,t){I1.add(U1*e-B1*t),B1=e,U1=t}function Tq(){g3(h3,p3)}var uu=1/0,Th=uu,bc=-uu,Mh=bc,Dh={point:Mq,lineStart:_t,lineEnd:_t,polygonStart:_t,polygonEnd:_t,result:function(){var e=[[uu,Th],[bc,Mh]];return bc=Mh=-(Th=uu=1/0),e}};function Mq(e,t){e<uu&&(uu=e),e>bc&&(bc=e),t<Th&&(Th=t),t>Mh&&(Mh=t)}var j1=0,q1=0,Rl=0,Oh=0,Rh=0,Na=0,W1=0,H1=0,Nl=0,m3,y3,qi,Wi,jn={point:zo,lineStart:E_,lineEnd:S_,polygonStart:function(){jn.lineStart=Rq,jn.lineEnd=Nq},polygonEnd:function(){jn.point=zo,jn.lineStart=E_,jn.lineEnd=S_},result:function(){var e=Nl?[W1/Nl,H1/Nl]:Na?[Oh/Na,Rh/Na]:Rl?[j1/Rl,q1/Rl]:[NaN,NaN];return j1=q1=Rl=Oh=Rh=Na=W1=H1=Nl=0,e}};function zo(e,t){j1+=e,q1+=t,++Rl}function E_(){jn.point=Dq}function Dq(e,t){jn.point=Oq,zo(qi=e,Wi=t)}function Oq(e,t){var n=e-qi,i=t-Wi,r=on(n*n+i*i);Oh+=r*(qi+e)/2,Rh+=r*(Wi+t)/2,Na+=r,zo(qi=e,Wi=t)}function S_(){jn.point=zo}function Rq(){jn.point=Lq}function Nq(){b3(m3,y3)}function Lq(e,t){jn.point=b3,zo(m3=qi=e,y3=Wi=t)}function b3(e,t){var n=e-qi,i=t-Wi,r=on(n*n+i*i);Oh+=r*(qi+e)/2,Rh+=r*(Wi+t)/2,Na+=r,r=Wi*e-qi*t,W1+=r*(qi+e),H1+=r*(Wi+t),Nl+=r*3,zo(qi=e,Wi=t)}function v3(e){this._context=e}v3.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,sn);break}}},result:_t};var G1=new nn,Xm,x3,w3,Ll,Pl,vc={point:_t,lineStart:function(){vc.point=Pq},lineEnd:function(){Xm&&E3(x3,w3),vc.point=_t},polygonStart:function(){Xm=!0},polygonEnd:function(){Xm=null},result:function(){var e=+G1;return G1=new nn,e}};function Pq(e,t){vc.point=E3,x3=Ll=e,w3=Pl=t}function E3(e,t){Ll-=e,Pl-=t,G1.add(on(Ll*Ll+Pl*Pl)),Ll=e,Pl=t}let __,Nh,$_,A_;class k_{constructor(t){this._append=t==null?S3:zq(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!==$_||this._append!==Nh){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,$_=i,Nh=this._append,A_=this._,this._=r}this._+=A_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function S3(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zq(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return S3;if(t!==__){const n=10**t;__=t,Nh=function(r){let s=1;this._+=r[0];for(const o=r.length;s<o;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return Nh}function _3(e,t){let n=3,i=4.5,r,s;function o(a){return a&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),$r(a,r(s))),s.result()}return o.area=function(a){return $r(a,r(Ar)),Ar.result()},o.measure=function(a){return $r(a,r(vc)),vc.result()},o.bounds=function(a){return $r(a,r(Dh)),Dh.result()},o.centroid=function(a){return $r(a,r(jn)),jn.result()},o.projection=function(a){return arguments.length?(r=a==null?(e=null,yc):(e=a).stream,o):e},o.context=function(a){return arguments.length?(s=a==null?(t=null,new k_(n)):new v3(t=a),typeof i!="function"&&s.pointRadius(i),o):t},o.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(s.pointRadius(+a),+a),o):i},o.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new k_(n)),o},o.projection(e).digits(n).context(t)}function og(e){return function(t){var n=new V1;for(var i in e)n[i]=e[i];return n.stream=t,n}}function V1(){}V1.prototype={constructor:V1,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 Mx(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),$r(n,e.stream(Dh)),t(Dh.result()),i!=null&&e.clipExtent(i),e}function ag(e,t,n){return Mx(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function Dx(e,t,n){return ag(e,[[0,0],t],n)}function Ox(e,t,n){return Mx(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Rx(e,t,n){return Mx(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var C_=16,Iq=ae(30*pe);function F_(e,t){return+t?Uq(e,t):Bq(e)}function Bq(e){return og({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Uq(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,E=a+h,S=u+p,w=on(x*x+E*E+S*S),_=bn(S/=w),$=ve(ve(S)-1)<oe||ve(s-f)<oe?(s+f)/2:Qn(E,x),C=e($,_),T=C[0],O=C[1],k=T-i,F=O-r,A=b*k-y*F;(A*A/v>t||ve((y*k+b*F)/v-.5)>.3||o*d+a*h+u*p<Iq)&&(n(i,r,s,o,a,u,T,O,$,x/=w,E/=w,S,g,m),m.point(T,O),n(T,O,$,x,E,S,l,c,f,d,h,p,g,m))}}return function(i){var r,s,o,a,u,l,c,f,d,h,p,g,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=E},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(_,$){_=e(_,$),i.point(_[0],_[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(_,$){var C=Po([_,$]),T=e(_,$);n(f,d,c,h,p,g,f=T[0],d=T[1],c=_,h=C[0],p=C[1],g=C[2],C_,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=S,m.lineEnd=w}function S(_,$){v(r=_,$),s=f,o=d,a=h,u=p,l=g,m.point=v}function w(){n(f,d,c,h,p,g,s,o,r,a,u,l,C_,i),m.lineEnd=x,x()}return m}}var jq=og({point:function(e,t){this.stream.point(e*pe,t*pe)}});function qq(e){return og({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Wq(e,t,n,i,r){function s(o,a){return o*=i,a*=r,[t+e*o,n-e*a]}return s.invert=function(o,a){return[(o-t)/e*i,(n-a)/e*r]},s}function T_(e,t,n,i,r,s){if(!s)return Wq(e,t,n,i,r);var o=ae(s),a=se(s),u=o*e,l=a*e,c=o/e,f=a/e,d=(a*n-o*t)/e,h=(a*t+o*n)/e;function p(g,m){return g*=i,m*=r,[u*g-l*m+t,n-l*g-u*m]}return p.invert=function(g,m){return[i*(c*g-f*m+d),r*(h-f*g-c*m)]},p}function lr(e){return $3(function(){return e})()}function $3(e){var t,n=150,i=480,r=250,s=0,o=0,a=0,u=0,l=0,c,f=0,d=1,h=1,p=null,g=v_,m=null,y,b,v,x=yc,E=.5,S,w,_,$,C;function T(A){return _(A[0]*pe,A[1]*pe)}function O(A){return A=_.invert(A[0],A[1]),A&&[A[0]*Qe,A[1]*Qe]}T.stream=function(A){return $&&C===A?$:$=jq(qq(c)(g(S(x(C=A)))))},T.preclip=function(A){return arguments.length?(g=A,p=void 0,F()):g},T.postclip=function(A){return arguments.length?(x=A,m=y=b=v=null,F()):x},T.clipAngle=function(A){return arguments.length?(g=+A?$q(p=A*pe):(p=null,v_),F()):p*Qe},T.clipExtent=function(A){return arguments.length?(x=A==null?(m=y=b=v=null,yc):d3(m=+A[0][0],y=+A[0][1],b=+A[1][0],v=+A[1][1]),F()):m==null?null:[[m,y],[b,v]]},T.scale=function(A){return arguments.length?(n=+A,k()):n},T.translate=function(A){return arguments.length?(i=+A[0],r=+A[1],k()):[i,r]},T.center=function(A){return arguments.length?(s=A[0]%360*pe,o=A[1]%360*pe,k()):[s*Qe,o*Qe]},T.rotate=function(A){return arguments.length?(a=A[0]%360*pe,u=A[1]%360*pe,l=A.length>2?A[2]%360*pe:0,k()):[a*Qe,u*Qe,l*Qe]},T.angle=function(A){return arguments.length?(f=A%360*pe,k()):f*Qe},T.reflectX=function(A){return arguments.length?(d=A?-1:1,k()):d<0},T.reflectY=function(A){return arguments.length?(h=A?-1:1,k()):h<0},T.precision=function(A){return arguments.length?(S=F_(w,E=A*A),F()):on(E)},T.fitExtent=function(A,M){return ag(T,A,M)},T.fitSize=function(A,M){return Dx(T,A,M)},T.fitWidth=function(A,M){return Ox(T,A,M)},T.fitHeight=function(A,M){return Rx(T,A,M)};function k(){var A=T_(n,0,0,d,h,f).apply(null,t(s,o)),M=T_(n,i-A[0],r-A[1],d,h,f);return c=u3(a,u,l),w=P1(t,M),_=P1(c,w),S=F_(w,E),F()}function F(){return $=C=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&O,k()}}function Nx(e){var t=0,n=me/3,i=$3(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*pe,n=s[1]*pe):[t*Qe,n*Qe]},r}function Hq(e){var t=ae(e);function n(i,r){return[i*t,se(r)/t]}return n.invert=function(i,r){return[i/t,bn(r*t)]},n}function Gq(e,t){var n=se(e),i=(n+se(t))/2;if(ve(i)<oe)return Hq(e);var r=1+n*(2*i-n),s=on(r)/i;function o(a,u){var l=on(r-2*i*se(u))/i;return[l*se(a*=i),s-l*ae(a)]}return o.invert=function(a,u){var l=s-u,c=Qn(a,ve(l))*Wn(l);return l*i<0&&(c-=me*Wn(a)*Wn(l)),[c/i,bn((r-(a*a+l*l)*i*i)/(2*i))]},o}function Lh(){return Nx(Gq).scale(155.424).center([0,33.6442])}function A3(){return Lh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Vq(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},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 Xq(){var e,t,n=A3(),i,r=Lh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s,o=Lh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,i.point(h,p),u||(s.point(h,p),u)||(a.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Vq([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+oe,g+.12*h+oe],[p-.214*h-oe,g+.234*h-oe]]).stream(l),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+oe,g+.166*h+oe],[p-.115*h-oe,g+.234*h-oe]]).stream(l),f()},c.fitExtent=function(d,h){return ag(c,d,h)},c.fitSize=function(d,h){return Dx(c,d,h)},c.fitWidth=function(d,h){return Ox(c,d,h)},c.fitHeight=function(d,h){return Rx(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function k3(e){return function(t,n){var i=ae(t),r=ae(n),s=e(i*r);return s===1/0?[2,0]:[s*r*se(t),s*se(n)]}}function tf(e){return function(t,n){var i=on(t*t+n*n),r=e(i),s=se(r),o=ae(r);return[Qn(t*s,i*o),bn(i&&n*s/i)]}}var C3=k3(function(e){return on(2/(1+e))});C3.invert=tf(function(e){return 2*bn(e/2)});function Yq(){return lr(C3).scale(124.75).clipAngle(180-.001)}var F3=k3(function(e){return(e=JD(e))&&e/se(e)});F3.invert=tf(function(e){return e});function Kq(){return lr(F3).scale(79.4188).clipAngle(180-.001)}function ug(e,t){return[e,yh(Fx((Ye+t)/2))]}ug.invert=function(e,t){return[e,2*Iu(KD(t))-Ye]};function Jq(){return T3(ug).scale(961/sn)}function T3(e){var t=lr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=me*i(),d=t(yq(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===ug?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function jf(e){return Fx((Ye+e)/2)}function Qq(e,t){var n=ae(e),i=e===t?se(e):yh(n/ae(t))/yh(jf(t)/jf(e)),r=n*Wm(jf(e),i)/i;if(!i)return ug;function s(o,a){r>0?a<-Ye+oe&&(a=-Ye+oe):a>Ye-oe&&(a=Ye-oe);var u=r/Wm(jf(a),i);return[u*se(i*o),r-u*ae(i*o)]}return s.invert=function(o,a){var u=r-a,l=Wn(i)*on(o*o+u*u),c=Qn(o,ve(u))*Wn(u);return u*i<0&&(c-=me*Wn(o)*Wn(u)),[c/i,2*Iu(Wm(r/l,1/i))-Ye]},s}function Zq(){return Nx(Qq).scale(109.5).parallels([30,30])}function Ph(e,t){return[e,t]}Ph.invert=Ph;function eW(){return lr(Ph).scale(152.63)}function tW(e,t){var n=ae(e),i=e===t?se(e):(n-ae(t))/(t-e),r=n/i+e;if(ve(i)<oe)return Ph;function s(o,a){var u=r-a,l=i*o;return[u*se(l),r-u*ae(l)]}return s.invert=function(o,a){var u=r-a,l=Qn(o,ve(u))*Wn(u);return u*i<0&&(l-=me*Wn(o)*Wn(u)),[l/i,r-Wn(i)*on(o*o+u*u)]},s}function nW(){return Nx(tW).scale(131.154).center([0,13.9389])}var Yl=1.340264,Kl=-.081106,Jl=893e-6,Ql=.003796,zh=on(3)/2,iW=12;function M3(e,t){var n=bn(zh*se(t)),i=n*n,r=i*i*i;return[e*ae(n)/(zh*(Yl+3*Kl*i+r*(7*Jl+9*Ql*i))),n*(Yl+Kl*i+r*(Jl+Ql*i))]}M3.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,o,a,u;s<iW&&(a=n*(Yl+Kl*i+r*(Jl+Ql*i))-t,u=Yl+3*Kl*i+r*(7*Jl+9*Ql*i),n-=o=a/u,i=n*n,r=i*i*i,!(ve(o)<gh));++s);return[zh*e*(Yl+3*Kl*i+r*(7*Jl+9*Ql*i))/ae(n),bn(se(n)/zh)]};function rW(){return lr(M3).scale(177.158)}function D3(e,t){var n=ae(t),i=ae(e)*n;return[n*se(e)/i,se(t)/i]}D3.invert=tf(Iu);function sW(){return lr(D3).scale(144.049).clipAngle(60)}function oW(){var e=1,t=0,n=0,i=1,r=1,s=0,o,a,u=null,l,c,f,d=1,h=1,p=og({point:function(x,E){var S=v([x,E]);this.stream.point(S[0],S[1])}}),g=yc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,S=x[1]*h;if(s){var w=S*o-E*a;E=E*o+S*a,S=w}return[E+t,S+n]}return v.invert=function(x){var E=x[0]-t,S=x[1]-n;if(s){var w=S*o+E*a;E=E*o-S*a,S=w}return[E/d,S/h]},v.stream=function(x){return m&&y===x?m:m=p(g(y=x))},v.postclip=function(x){return arguments.length?(g=x,u=l=c=f=null,b()):g},v.clipExtent=function(x){return arguments.length?(g=x==null?(u=l=c=f=null,yc):d3(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(s=x%360*pe,a=se(s),o=ae(s),b()):s*Qe},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return ag(v,x,E)},v.fitSize=function(x,E){return Dx(v,x,E)},v.fitWidth=function(x,E){return Ox(v,x,E)},v.fitHeight=function(x,E){return Rx(v,x,E)},v}function O3(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}O3.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,o=s*s;n-=r=(n*(1.007226+s*(.015085+o*(-.044475+.028874*s-.005916*o)))-t)/(1.007226+s*(.015085*3+o*(-.044475*7+.028874*9*s-.005916*11*o)))}while(ve(r)>oe&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function aW(){return lr(O3).scale(175.295)}function R3(e,t){return[ae(t)*se(e),se(t)]}R3.invert=tf(bn);function uW(){return lr(R3).scale(249.5).clipAngle(90+oe)}function N3(e,t){var n=ae(t),i=1+ae(e)*n;return[n*se(e)/i,se(t)/i]}N3.invert=tf(function(e){return 2*Iu(e)});function lW(){return lr(N3).scale(250).clipAngle(142)}function L3(e,t){return[yh(Fx((Ye+t)/2)),-e]}L3.invert=function(e,t){return[-t,2*Iu(KD(e))-Ye]};function cW(){var e=T3(L3),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var fW=Math.abs,X1=Math.cos,Ih=Math.sin,dW=1e-6,P3=Math.PI,Y1=P3/2,M_=hW(2);function D_(e){return e>1?Y1:e<-1?-Y1:Math.asin(e)}function hW(e){return e>0?Math.sqrt(e):0}function pW(e,t){var n=e*Ih(t),i=30,r;do t-=r=(t+Ih(t)-n)/(1+X1(t));while(fW(r)>dW&&--i>0);return t/2}function gW(e,t,n){function i(r,s){return[e*r*X1(s=pW(n,s)),t*Ih(s)]}return i.invert=function(r,s){return s=D_(s/t),[r/(e*X1(s)),D_((2*s+Ih(2*s))/n)]},i}var mW=gW(M_/Y1,M_,P3);function yW(){return lr(mW).scale(169.529)}const bW=_3(),K1=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function vW(e,t){return function n(){const i=t();return i.type=e,i.path=_3().projection(i),i.copy=i.copy||function(){const r=n();return K1.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},QT(i)}}function Lx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Bh[e]=vW(e,t),this):Bh[e]||null}function z3(e){return e&&e.path||bW}const Bh={albers:A3,albersusa:Xq,azimuthalequalarea:Yq,azimuthalequidistant:Kq,conicconformal:Zq,conicequalarea:Lh,conicequidistant:nW,equalEarth:rW,equirectangular:eW,gnomonic:sW,identity:oW,mercator:Jq,mollweide:yW,naturalEarth1:aW,orthographic:uW,stereographic:lW,transversemercator:cW};for(const e in Bh)Lx(e,Bh[e]);function xW(){}const vr=[[],[[[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 I3(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),wW(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h<p;++h)if(EW((g=c[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=[],d=[],h,p,g,m,y,b;for(h=p=-1,m=u[0]>=l,vr[m<<1].forEach(v);++h<e-1;)g=m,m=u[h+1]>=l,vr[g|m<<1].forEach(v);for(vr[m<<0].forEach(v);++p<t-1;){for(h=-1,m=u[p*e+e]>=l,y=u[p*e]>=l,vr[m<<1|y<<2].forEach(v);++h<e-1;)g=m,m=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,vr[g|m<<1|y<<2|b<<3].forEach(v);vr[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,vr[y<<2].forEach(v);++h<e-1;)b=y,y=u[p*e+h+1]>=l,vr[y<<2|b<<3].forEach(v);vr[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+p],S=[x[1][0]+h,x[1][1]+p],w=o(E),_=o(S),$,C;($=d[w])?(C=f[_])?(delete d[$.end],delete f[C.start],$===C?($.ring.push(S),c($.ring)):f[$.start]=d[C.end]={start:$.start,end:C.end,ring:$.ring.concat(C.ring)}):(delete d[$.end],$.ring.push(S),d[$.end=_]=$):($=f[_])?(C=d[w])?(delete f[$.start],delete d[C.end],$===C?($.ring.push(S),c($.ring)):f[C.start]=d[$.end]={start:C.start,end:$.end,ring:C.ring.concat($.ring)}):(delete f[$.start],$.ring.unshift(E),f[$.start=w]=$):f[w]=d[_]={start:w,end:_,ring:[E,S]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d<e&&p===d&&(m=l[g*e+p-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&g===h&&(m=l[(g-1)*e+p],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||N("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:xW,i):n===a},i}function wW(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function EW(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=SW(e,t[n]))return r;return 0}function SW(e,t){for(var n=t[0],i=t[1],r=-1,s=0,o=e.length,a=o-1;s<o;a=s++){var u=e[s],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(_W(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function _W(e,t,n){var i;return $W(e,t,n)&&AW(e[i=+(e[0]===t[0])],n[i],t[i])}function $W(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function AW(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function B3(e,t,n){return function(i){var r=Ji(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Oo(s,o,e):a/(e+1);return Fn(s+u,o,u)}}function Px(e){D.call(this,null,e)}Px.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};G(Px,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Wt,s=I3().smooth(e.smooth!==!1),o=e.thresholds||kW(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,L(o)?o:o(c.values));CW(f,c,l,e),f.forEach(d=>{u.push(Cp(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function kW(e,t,n){const i=B3(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>$o(t(r).values)))}function CW(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(fe(r)&&(r=r(n,i)),fe(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=($e(r)?r:r[0])||1,a=($e(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(U3(t,o,a,u,l))}function U3(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function O_(e,t,n){const i=e>=0?e:Mb(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Ym(e){return fe(e)?e:Ht(+e)}function j3(){var e=u=>u[0],t=u=>u[1],n=Cu,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=O_(i[0],u,e)>>o,f=O_(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const E=d+(+e(x)>>o),S=h+(+t(x)>>o);E>=0&&E<p&&S>=0&&S<g&&(m[E+S*p]+=+n(x))}),c>0&&f>0?(xa(p,g,m,y,c),wa(p,g,y,m,f),xa(p,g,m,y,c),wa(p,g,y,m,f),xa(p,g,m,y,c),wa(p,g,y,m,f)):c>0?(xa(p,g,m,y,c),xa(p,g,y,m,c),xa(p,g,m,y,c),b=y):f>0&&(wa(p,g,m,y,f),wa(p,g,y,m,f),wa(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/_C(b);for(let x=0,E=p*g;x<E;++x)b[x]*=v;return{values:b,scale:1<<o,width:p,height:g,x1:d,y1:h,x2:d+(r>>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=Ym(u),a):e},a.y=function(u){return arguments.length?(t=Ym(u),a):t},a.weight=function(u){return arguments.length?(n=Ym(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||N("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||N("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<<o},a.bandwidth=function(u){return arguments.length?(u=Y(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&N("invalid bandwidth"),i=u,a):i},a}function xa(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<t;++o)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+o*e]),a>=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function wa(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<e;++o)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[o+a*e]),a>=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function zx(e){D.call(this,null,e)}zx.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const FW=["x","y","weight","size","cellSize","bandwidth"];function q3(e,t){return FW.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(zx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=TW(i,e.groupby),s=(e.groupby||[]).map(Je),o=q3(j3(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<s.length;++d)c[s[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function TW(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Ix(e){D.call(this,null,e)}Ix.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};G(Ix,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=I3().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||B3(e.count||10,e.nice,!!r),o=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=q3(j3(),e)(r,!0),u=U3(a,a.scale||1,a.scale||1,0,0),o=[a.width,a.height],r=a.values),s=L(s)?s:s(r),r=i.size(o)(r,s),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const J1="Feature",Bx="FeatureCollection",MW="MultiPoint";function Ux(e){D.call(this,null,e)}Ux.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(Ux,D,{transform(e,t){var n=this._features,i=this._points,r=e.fields,s=r&&r[0],o=r&&r[1],a=e.geojson||!r&&Wt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(Bt(a))||s&&t.modified(Bt(s))||o&&t.modified(Bt(o)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:J1,geometry:{type:MW,coordinates:i}})),this.value={type:Bx,features:n}}});function jx(e){D.call(this,null,e)}jx.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};G(jx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Wt,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=z3(e.projection),n.materialize().reflow()):o=r===Wt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=DW(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function DW(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function qx(e){D.call(this,null,e)}qx.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};G(qx,D,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function Wx(e){D.call(this,null,e)}Wx.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};G(Wx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=OW(z3(e.projection),e.field||Yn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function OW(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function Hx(e){D.call(this,[],e),this.generator=kq()}Hx.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};G(Hx,D,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)fe(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(pF(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function Gx(e){D.call(this,null,e)}Gx.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};G(Gx,D,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Wt,s=NW(e.opacity,e),o=RW(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?$o(n.map(l=>$o(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=ce({},l,u);i||(f.$max=$o(c.values||[])),l[a]=LW(c,f,o.dep?o:Ht(o(f)),s.dep?s:Ht(s(f)))}),t.reflow(!0).modifies(a)}});function RW(e,t){let n;return fe(e)?(n=i=>zd(e(i,t)),n.dep=W3(e)):n=Ht(zd(e||"#888")),n}function NW(e,t){let n;return fe(e)?(n=i=>e(i,t),n.dep=W3(e)):e?n=Ht(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function W3(e){if(!fe(e))return!1;const t=yi(Bt(e));return t.$x||t.$y||t.$value||t.$max}function LW(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:cs,d=_s(u-o,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-o,l-a),g=p.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=o,v=m*r;b<u;++b,y+=4){t.$x=b-o,t.$value=f(b+v);const x=n(t);g[y+0]=x.r,g[y+1]=x.g,g[y+2]=x.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}function H3(e){D.call(this,null,e),this.modified(!0)}G(H3,D,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=zW(e.type),K1.forEach(i=>{e[i]!=null&&R_(n,i,e[i])})):K1.forEach(i=>{e.modified(i)&&R_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&PW(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function PW(e,t){const n=IW(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function zW(e){const t=Lx((e||"mercator").toLowerCase());return t||N("Unrecognized projection type: "+e),t()}function R_(e,t,n){fe(e[t])&&e[t](n)}function IW(e){return e=Y(e),e.length===1?e[0]:{type:Bx,features:e.reduce((t,n)=>t.concat(BW(n)),[])}}function BW(e){return e.type===Bx?e.features:Y(e).filter(t=>t!=null).map(t=>t.type===J1?t:{type:J1,geometry:t})}const UW=Object.freeze(Object.defineProperty({__proto__:null,contour:Ix,geojson:Ux,geopath:jx,geopoint:qx,geoshape:Wx,graticule:Hx,heatmap:Gx,isocontour:Px,kde2d:zx,projection:H3},Symbol.toStringTag,{value:"Module"}));function jW(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s<o;++s)a=n[s],u+=a.x,l+=a.y;for(u=(u/o-e)*i,l=(l/o-t)*i,s=0;s<o;++s)a=n[s],a.x-=u,a.y-=l}return r.initialize=function(s){n=s},r.x=function(s){return arguments.length?(e=+s,r):e},r.y=function(s){return arguments.length?(t=+s,r):t},r.strength=function(s){return arguments.length?(i=+s,r):i},r}function qW(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return G3(this.cover(t,n),t,n,e)}function G3(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,s=e._root,o={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,g,m,y,b;if(!s)return e._root=o,e;for(;s.length;)if((g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function WW(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(s=+this._y.call(null,t))||(o[n]=r,a[n]=s,r<u&&(u=r),r>c&&(c=r),s<l&&(l=s),s>f&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)G3(this,o[n],a[n],e[n]);return this}function HW(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,s=(i=Math.floor(t))+1;else{for(var o=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=s;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,o*=2,l){case 0:r=n+o,s=i+o;break;case 1:n=r-o,s=i+o;break;case 2:r=n+o,i=s-o;break;case 3:n=r-o,i=s-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function GW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function VW(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Zt(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function XW(e,t,n){var i,r=this._x0,s=this._y0,o,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new Zt(h,r,s,c,f)),n==null?n=1/0:(r=e-n,s=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(o=p.x0)>c||(a=p.y0)>f||(u=p.x1)<r||(l=p.y1)<s))if(h.length){var m=(o+u)/2,y=(a+l)/2;d.push(new Zt(h[3],m,y,u,l),new Zt(h[2],o,y,m,l),new Zt(h[1],m,a,u,y),new Zt(h[0],o,a,m,y)),(g=(t>=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,s=t-E,c=e+E,f=t+E,i=h.data}}return i}function YW(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,s,o=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,g,m,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(o+u)/2))?o=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function KW(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function JW(){return this._root}function QW(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function ZW(e){var t=[],n,i=this._root,r,s,o,a,u;for(i&&t.push(new Zt(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,s=n.x0,o=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(s+a)/2,c=(o+u)/2;(r=i[3])&&t.push(new Zt(r,l,c,a,u)),(r=i[2])&&t.push(new Zt(r,s,c,l,u)),(r=i[1])&&t.push(new Zt(r,l,o,a,c)),(r=i[0])&&t.push(new Zt(r,s,o,l,c))}return this}function eH(e){var t=[],n=[],i;for(this._root&&t.push(new Zt(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var s,o=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(o+u)/2,f=(a+l)/2;(s=r[0])&&t.push(new Zt(s,o,a,c,f)),(s=r[1])&&t.push(new Zt(s,c,a,u,f)),(s=r[2])&&t.push(new Zt(s,o,f,c,l)),(s=r[3])&&t.push(new Zt(s,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function tH(e){return e[0]}function nH(e){return arguments.length?(this._x=e,this):this._x}function iH(e){return e[1]}function rH(e){return arguments.length?(this._y=e,this):this._y}function Vx(e,t,n){var i=new Xx(t??tH,n??iH,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Xx(e,t,n,i,r,s){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function N_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var un=Vx.prototype=Xx.prototype;un.copy=function(){var e=new Xx(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=N_(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=N_(i));return e};un.add=qW;un.addAll=WW;un.cover=HW;un.data=GW;un.extent=VW;un.find=XW;un.remove=YW;un.removeAll=KW;un.root=JW;un.size=QW;un.visit=ZW;un.visitAfter=eH;un.x=nH;un.y=rH;function en(e){return function(){return e}}function bs(e){return(e()-.5)*1e-6}function sH(e){return e.x+e.vx}function oH(e){return e.y+e.vy}function aH(e){var t,n,i,r=1,s=1;typeof e!="function"&&(e=en(e==null?1:+e));function o(){for(var l,c=t.length,f,d,h,p,g,m,y=0;y<s;++y)for(f=Vx(t,sH,oH).visitAfter(a),l=0;l<c;++l)d=t[l],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(v,x,E,S,w){var _=v.data,$=v.r,C=g+$;if(_){if(_.index>d.index){var T=h-_.x-_.vx,O=p-_.y-_.vy,k=T*T+O*O;k<C*C&&(T===0&&(T=bs(i),k+=T*T),O===0&&(O=bs(i),k+=O*O),k=(C-(k=Math.sqrt(k)))/k*r,d.vx+=(T*=k)*(C=($*=$)/(m+$)),d.vy+=(O*=k)*C,_.vx-=T*(C=1-C),_.vy-=O*C)}return}return x>h+C||S<h-C||E>p+C||w<p-C}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return o.initialize=function(l,c){t=l,i=c,u()},o.iterations=function(l){return arguments.length?(s=+l,o):s},o.strength=function(l){return arguments.length?(r=+l,o):r},o.radius=function(l){return arguments.length?(e=typeof l=="function"?l:en(+l),u(),o):e},o}function uH(e){return e.index}function L_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function lH(e){var t=uH,n=f,i,r=en(30),s,o,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,S,w,_,$,C;v<b;++v)x=e[v],E=x.source,S=x.target,w=S.x+S.vx-E.x-E.vx||bs(l),_=S.y+S.vy-E.y-E.vy||bs(l),$=Math.sqrt(w*w+_*_),$=($-s[v])/$*m*i[v],w*=$,_*=$,S.vx-=w*(C=u[v]),S.vy-=_*C,E.vx+=w*(C=1-C),E.vy+=_*C}function h(){if(o){var m,y=o.length,b=e.length,v=new Map(o.map((E,S)=>[t(E,S,o),E])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=L_(v,x.source)),typeof x.target!="object"&&(x.target=L_(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),p(),s=new Array(b),g()}}function p(){if(o)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function g(){if(o)for(var m=0,y=e.length;m<y;++m)s[m]=+r(e[m],m,e)}return d.initialize=function(m,y){o=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:en(+m),p(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:en(+m),g(),d):r},d}var cH={value:()=>{}};function V3(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new $d(n)}function $d(e){this._=e}function fH(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}$d.prototype=V3.prototype={constructor:$d,on:function(e,t){var n=this._,i=fH(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s<o;)if((r=(e=i[s]).type)&&(r=dH(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(r=(e=i[s]).type)n[r]=P_(n[r],e.name,t);else if(t==null)for(r in n)n[r]=P_(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new $d(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function dH(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function P_(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=cH,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}function hH(e,t,n){var i=new qL,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?jL():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const pH=1664525,gH=1013904223,z_=4294967296;function mH(){let e=1;return()=>(e=(pH*e+gH)%z_)/z_}function yH(e){return e.x}function bH(e){return e.y}var vH=10,xH=Math.PI*(3-Math.sqrt(5));function wH(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=WL(f),l=V3("tick","end"),c=mH();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(g){var m,y=e.length,b;g===void 0&&(g=1);for(var v=0;v<g;++v)for(n+=(s-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=o:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=o:(b.y=b.fy,b.vy=0);return t}function h(){for(var g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=vH*Math.sqrt(.5+g),v=g*xH;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,c),g}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(i=+g,t):i},alphaDecay:function(g){return arguments.length?(r=+g,t):+r},alphaTarget:function(g){return arguments.length?(s=+g,t):s},velocityDecay:function(g){return arguments.length?(o=1-g,t):1-o},randomSource:function(g){return arguments.length?(c=g,a.forEach(p),t):c},force:function(g,m){return arguments.length>1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,E,S,w,_;for(y==null?y=1/0:y*=y,b=0;b<v;++b)w=e[b],x=g-w.x,E=m-w.y,S=x*x+E*E,S<y&&(_=w,y=S);return _},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function EH(){var e,t,n,i,r=en(-30),s,o=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=Vx(e,yH,bH).visitAfter(f);for(i=h,p=0;p<g;++p)t=e[p],m.visit(d)}function c(){if(e){var h,p=e.length,g;for(s=new Array(p),h=0;h<p;++h)g=e[h],s[g.index]=+r(g,h,e)}}function f(h){var p=0,g,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(g=h[x])&&(m=Math.abs(g.value))&&(p+=g.value,y+=m,b+=m*g.x,v+=m*g.y);h.x=b/y,h.y=v/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=s[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-p,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=bs(n),x+=y*y),b===0&&(b=bs(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=bs(n),x+=y*y),b===0&&(b=bs(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)));do h.data!==t&&(v=s[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:en(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function SH(e){var t=en(.1),n,i,r;typeof e!="function"&&(e=en(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:en(+a),o(),s):t},s.x=function(a){return arguments.length?(e=typeof a=="function"?a:en(+a),o(),s):e},s}function _H(e){var t=en(.1),n,i,r;typeof e!="function"&&(e=en(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:en(+a),o(),s):t},s.y=function(a){return arguments.length?(e=typeof a=="function"?a:en(+a),o(),s):e},s}const I_={center:jW,collide:aH,nbody:EH,link:lH,x:SH,y:_H},zl="forces",Q1=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],$H=["static","iterations"],X3=["x","y","vx","vy"];function Yx(e){D.call(this,null,e)}Yx.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:X3}]};G(Yx,D,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(Q1),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&Y3(n,e,0,t)):(this.value=n=kH(t.source,e),n.on("tick",AH(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified($H)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==zl||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,s=i.length,o;r<s;++r)if(i[r].name==="links"&&(o=i[r].op.source)){n.pulse(o,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(X3)}});function AH(e,t){return()=>e.touch(t).run()}function kH(e,t){const n=wH(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),Y3(n,t,!0).on("end",()=>s=!0)}function Y3(e,t,n,i){var r=Y(t.forces),s,o,a,u;for(s=0,o=Q1.length;s<o;++s)a=Q1[s],a!==zl&&t.modified(a)&&e[a](t[a]);for(s=0,o=r.length;s<o;++s)u=zl+s,a=n||t.modified(zl,s)?FH(r[s]):i&&CH(r[s],i)?e.force(u):null,a&&e.force(u,a);for(o=e.numForces||0;s<o;++s)e.force(zl+s,null);return e.numForces=r.length,e}function CH(e,t){var n,i;for(n in e)if(fe(i=e[n])&&t.modified(Bt(i)))return 1;return 0}function FH(e){var t,n;J(I_,e.force)||N("Unrecognized force: "+e.force),t=I_[e.force]();for(n in e)fe(t[n])&&TH(t[n],e[n],e);return t}function TH(e,t,n){e(fe(t)?i=>t(i,n):t)}const MH=Object.freeze(Object.defineProperty({__proto__:null,force:Yx},Symbol.toStringTag,{value:"Module"}));function DH(e,t){return e.parent===t.parent?1:2}function OH(e){return e.reduce(RH,0)/e.length}function RH(e,t){return e+t.x}function NH(e){return 1+e.reduce(LH,0)}function LH(e,t){return Math.max(e,t.y)}function PH(e){for(var t;t=e.children;)e=t[0];return e}function zH(e){for(var t;t=e.children;)e=t[t.length-1];return e}function IH(){var e=DH,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=OH(h),d.y=NH(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=PH(s),l=zH(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function BH(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function UH(){return this.eachAfter(BH)}function jH(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function qH(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function WH(e,t){for(var n=this,i=[n],r=[],s,o,a,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o<a;++o)i.push(s[o]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function HH(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function GH(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function VH(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function XH(e){for(var t=this,n=YH(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function YH(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function KH(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function JH(){return Array.from(this)}function QH(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function ZH(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*eG(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Kx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=iG)):t===void 0&&(t=nG);for(var n=new lu(e),i,r=[n],s,o,a,u;i=r.pop();)if((o=t(i.data))&&(u=(o=Array.from(o)).length))for(i.children=o,a=u-1;a>=0;--a)r.push(s=o[a]=new lu(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(K3)}function tG(){return Kx(this).eachBefore(rG)}function nG(e){return e.children}function iG(e){return Array.isArray(e)?e[1]:null}function rG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function K3(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function lu(e){this.data=e,this.depth=this.height=0,this.parent=null}lu.prototype=Kx.prototype={constructor:lu,count:UH,each:jH,eachAfter:WH,eachBefore:qH,find:HH,sum:GH,sort:VH,path:XH,ancestors:KH,descendants:JH,leaves:QH,links:ZH,copy:tG,[Symbol.iterator]:eG};function Ad(e){return e==null?null:J3(e)}function J3(e){if(typeof e!="function")throw new Error;return e}function xo(){return 0}function Fa(e){return function(){return e}}const sG=1664525,oG=1013904223,B_=4294967296;function aG(){let e=1;return()=>(e=(sG*e+oG)%B_)/B_}function uG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lG(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function cG(e,t){for(var n=0,i=(e=lG(Array.from(e),t)).length,r=[],s,o;n<i;)s=e[n],o&&Q3(o,s)?++n:(o=dG(r=fG(r,s)),n=0);return o}function fG(e,t){var n,i;if(Km(t,e))return[t];for(n=0;n<e.length;++n)if(qf(t,e[n])&&Km(Il(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(qf(Il(e[n],e[i]),t)&&qf(Il(e[n],t),e[i])&&qf(Il(e[i],t),e[n])&&Km(Z3(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function qf(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Q3(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Km(e,t){for(var n=0;n<t.length;++n)if(!Q3(e,t[n]))return!1;return!0}function dG(e){switch(e.length){case 1:return hG(e[0]);case 2:return Il(e[0],e[1]);case 3:return Z3(e[0],e[1],e[2])}}function hG(e){return{x:e.x,y:e.y,r:e.r}}function Il(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,o=t.y,a=t.r,u=s-n,l=o-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+s+u/f*c)/2,y:(i+o+l/f*c)/2,r:(f+r+a)/2}}function Z3(e,t,n){var i=e.x,r=e.y,s=e.r,o=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-o,h=i-l,p=r-a,g=r-c,m=u-s,y=f-s,b=i*i+r*r-s*s,v=b-o*o-a*a+u*u,x=b-l*l-c*c+f*f,E=h*p-d*g,S=(p*x-g*v)/(E*2)-i,w=(g*m-p*y)/E,_=(h*v-d*x)/(E*2)-r,$=(d*y-h*m)/E,C=w*w+$*$-1,T=2*(s+S*w+_*$),O=S*S+_*_-s*s,k=-(Math.abs(C)>1e-6?(T+Math.sqrt(T*T-4*C*O))/(2*C):O/T);return{x:i+S+w*k,y:r+_+$*k,r:k}}function U_(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function j_(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function q_(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Wf(e){this._=e,this.next=null,this.previous=null}function pG(e,t){if(!(s=(e=uG(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;U_(i,n,r=e[2]),n=new Wf(n),i=new Wf(i),r=new Wf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<s;++u){U_(n._,i._,r=e[u]),r=new Wf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(j_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(j_(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,o=q_(n);(r=r.next)!==i;)(a=q_(r))<o&&(n=r,o=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=cG(n,t),u=0;u<s;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function gG(e){return Math.sqrt(e.value)}function mG(){var e=null,t=1,n=1,i=xo;function r(s){const o=aG();return s.x=t/2,s.y=n/2,e?s.eachBefore(W_(e)).eachAfter(Jm(i,.5,o)).eachBefore(H_(1)):s.eachBefore(W_(gG)).eachAfter(Jm(xo,1,o)).eachAfter(Jm(i,s.r/Math.min(t,n),o)).eachBefore(H_(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=Ad(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:Fa(+s),r):i},r}function W_(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Jm(e,t,n){return function(i){if(r=i.children){var r,s,o=r.length,a=e(i)*t||0,u;if(a)for(s=0;s<o;++s)r[s].r+=a;if(u=pG(r,n),a)for(s=0;s<o;++s)r[s].r-=a;i.r=u+a}}}function H_(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function eO(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function nf(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(i-t)/e.value;++a<u;)o=s[a],o.y0=n,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function yG(){var e=1,t=1,n=0,i=!1;function r(o){var a=o.height+1;return o.x0=o.y0=n,o.x1=e,o.y1=t/a,o.eachBefore(s(t,a)),i&&o.eachBefore(eO),o}function s(o,a){return function(u){u.children&&nf(u,u.x0,o*(u.depth+1)/a,u.x1,o*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(o){return arguments.length?(i=!!o,r):i},r.size=function(o){return arguments.length?(e=+o[0],t=+o[1],r):[e,t]},r.padding=function(o){return arguments.length?(n=+o,r):n},r}var bG={depth:-1},G_={},Qm={};function vG(e){return e.id}function xG(e){return e.parentId}function V_(){var e=vG,t=xG,n;function i(r){var s=Array.from(r),o=e,a=t,u,l,c,f,d,h,p,g,m=new Map;if(n!=null){const y=s.map((x,E)=>wG(n(x,E,r))),b=y.map(X_),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(X_(x)),s.push(Qm));o=(x,E)=>y[E],a=(x,E)=>b[E]}for(c=0,u=s.length;c<u;++c)l=s[c],h=s[c]=new lu(l),(p=o(l,c,r))!=null&&(p+="")&&(g=h.id=p,m.set(g,m.has(g)?G_:h)),(p=a(l,c,r))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=s[c],p=h.parent){if(d=m.get(p),!d)throw new Error("missing: "+p);if(d===G_)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Qm&&f.children.length===1;)f=f.children[0],--u;for(let y=s.length-1;y>=0&&(h=s[y],h.data===Qm);--y)h.data=null}if(f.parent=bG,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(K3),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Ad(r),i):e},i.parentId=function(r){return arguments.length?(t=Ad(r),i):t},i.path=function(r){return arguments.length?(n=Ad(r),i):n},i}function wG(e){e=`${e}`;let t=e.length;return Z1(e,t-1)&&!Z1(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function X_(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Z1(e,t););return e.slice(0,t)}function Z1(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function EG(e,t){return e.parent===t.parent?1:2}function Zm(e){var t=e.children;return t?t[0]:e.t}function e0(e){var t=e.children;return t?t[t.length-1]:e.t}function SG(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function _G(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function $G(e,t,n){return e.a.parent===t.parent?e.a:n}function kd(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}kd.prototype=Object.create(lu.prototype);function AG(e){for(var t=new kd(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new kd(s[o],o)),r.parent=n;return(t.parent=new kd(null,0)).children=[t],t}function kG(){var e=EG,t=1,n=1,i=null;function r(l){var c=AG(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){_G(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=e0(p),d=Zm(d),p&&d;)g=Zm(g),h=e0(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(SG($G(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!e0(h)&&(h.t=p,h.m+=b-y),d&&!Zm(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function lg(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(r-n)/e.value;++a<u;)o=s[a],o.x0=t,o.x1=i,o.y0=n,o.y1=n+=o.value*l}var tO=(1+Math.sqrt(5))/2;function nO(e,t,n,i,r,s){for(var o=[],a=t.children,u,l,c=0,f=0,d=a.length,h,p,g=t.value,m,y,b,v,x,E,S;c<d;){h=r-n,p=s-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,E=Math.max(p/h,h/p)/(g*e),S=m*m*E,x=Math.max(b/S,S/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),S=m*m*E,v=Math.max(b/S,S/y),v>x){m-=l;break}x=v}o.push(u={value:m,dice:h<p,children:a.slice(c,f)}),u.dice?nf(u,n,i,r,g?i+=p*m/g:s):lg(u,n,i,g?n+=h*m/g:r,s),g-=m,c=f}return o}const iO=function e(t){function n(i,r,s,o,a){nO(t,i,r,s,o,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(tO);function CG(){var e=iO,t=!1,n=1,i=1,r=[0],s=xo,o=xo,a=xo,u=xo,l=xo;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(eO),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),d.x0=p,d.y0=g,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=s(d)/2,p+=l(d)-h,g+=o(d)-h,m-=a(d)-h,y-=u(d)-h,m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),e(d,p,g,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=J3(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:Fa(+d),c):s},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:Fa(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Fa(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Fa(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Fa(+d),c):l},c}function FG(e,t,n,i,r){var s=e.children,o,a=s.length,u,l=new Array(a+1);for(l[0]=u=o=0;o<a;++o)l[o+1]=u+=s[o].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,p,g,m,y){if(f>=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,S=d-1;E<S;){var w=E+S>>>1;l[w]<x?E=w+1:S=w}x-l[E-1]<l[E]-x&&f+1<E&&--E;var _=l[E]-v,$=h-_;if(m-p>y-g){var C=h?(p*$+m*_)/h:m;c(f,E,_,p,g,C,y),c(E,d,$,C,g,m,y)}else{var T=h?(g*$+y*_)/h:y;c(f,E,_,p,g,m,T),c(E,d,$,p,T,m,y)}}}function TG(e,t,n,i,r){(e.depth&1?lg:nf)(e,t,n,i,r)}const MG=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?nf(l,r,s,o,g?s+=(a-s)*l.value/g:a):lg(l,r,s,g?r+=(o-r)*l.value/g:o,a),g-=l.value}else i._squarify=u=nO(t,i,r,s,o,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(tO);function ey(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function Jx(e){D.call(this,null,e)}Jx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const DG=e=>e.values;G(Jx,D,{transform(e,t){t.source||N("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&kp(o.data)&&r.rem.push(o.data)}),this.value=s=Kx({values:Y(e.keys).reduce((o,a)=>(o.key(a),o),OG()).entries(r.source)},DG),n&&s.each(o=>{o.children&&(o=Ce(o.data),r.add.push(o),r.source.push(o))}),ey(s,re,re)),r.source.root=s,r}});function OG(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++c<o;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],s);return l}function i(r,s){if(++s>e.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Gr(e){D.call(this,null,e)}const RG=(e,t)=>e.parent===t.parent?1:2;G(Gr,D,{transform(e,t){(!t.source||!t.source.root)&&N(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ea(e.sort,o=>o.data)),NG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?RG:Cu);try{this.value=n(r)}catch(o){N(o)}return r.each(o=>LG(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function NG(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}function LG(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}const ty=["x","y","r","depth","children"];function Qx(e){Gr.call(this,e)}Qx.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ty.length,default:ty}]};G(Qx,Gr,{layout:mG,params:["radius","size","padding"],fields:ty});const ny=["x0","y0","x1","y1","depth","children"];function Zx(e){Gr.call(this,e)}Zx.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ny.length,default:ny}]};G(Zx,Gr,{layout:yG,params:["size","round","padding"],fields:ny});function e2(e){D.call(this,null,e)}e2.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(e2,D,{transform(e,t){t.source||N("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?ey(V_().id(e.key).parentId(e.parentKey)(r.source),e.key,Rn):ey(V_()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const Y_={tidy:kG,cluster:IH},iy=["x","y","depth","children"];function t2(e){Gr.call(this,e)}t2.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:iy.length,default:iy}]};G(t2,Gr,{layout(e){const t=e||"tidy";if(J(Y_,t))return Y_[t]();N("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:iy});function n2(e){D.call(this,[],e)}n2.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(n2,D,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||N("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,o=>s[re(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[re(a)]&&s[re(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[re(o)]=1),n.forEach(o=>{(s[re(o.source)]||s[re(o.target)])&&r.mod.push(o)})),r}});const K_={binary:FG,dice:nf,slice:lg,slicedice:TG,squarify:iO,resquarify:MG},ry=["x0","y0","x1","y1","depth","children"];function i2(e){Gr.call(this,e)}i2.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ry.length,default:ry}]};G(i2,Gr,{layout(){const e=CG();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{J(K_,t)?e.tile(K_[t]):N("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:ry});const PG=Object.freeze(Object.defineProperty({__proto__:null,nest:Jx,pack:Qx,partition:Zx,stratify:e2,tree:t2,treelinks:n2,treemap:i2},Symbol.toStringTag,{value:"Module"})),t0=4278190080;function zG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function IG(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=_s(s,o).getContext("2d"),l=_s(s,o).getContext("2d"),c=a&&_s(s,o).getContext("2d");n.forEach(_=>Cd(u,_,!1)),Cd(l,t,!1),a&&Cd(c,t,!0);const f=n0(u,s,o),d=n0(l,s,o),h=a&&n0(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,E,S,w;for(y=0;y<o;++y)for(m=0;m<s;++m)x=y*s+m,E=f[x]&t0,w=d[x]&t0,S=a&&h[x]&t0,(E||S||w)&&(b=e(m),v=e(y),!r&&(E||w)&&p.set(b,v),a&&(E||S)&&g.set(b,v));return[p,g]}function n0(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function Cd(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>Cd(e,s.items,n))}):Pn[i].draw(e,{items:n?t.map(BG):t})}function BG(e){const t=Cp(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const xr=5,Gt=31,xc=32,us=new Uint32Array(xc+1),li=new Uint32Array(xc+1);li[0]=0;us[0]=~li[0];for(let e=1;e<=xc;++e)li[e]=li[e-1]<<1|1,us[e]=~li[e];function UG(e,t){const n=new Uint32Array(~~((e*t+xc)/xc));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>xr]&1<<(a&Gt)},set:(s,o)=>{const a=o*e+s;i(a>>>xr,1<<(a&Gt))},clear:(s,o)=>{const a=o*e+s;r(a>>>xr,~(1<<(a&Gt)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>xr,h=f>>>xr,d===h){if(n[d]&us[c&Gt]&li[(f&Gt)+1])return!0}else{if(n[d]&us[c&Gt]||n[h]&li[(f&Gt)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>xr,d=c>>>xr,f===d)i(f,us[l&Gt]&li[(c&Gt)+1]);else for(i(f,us[l&Gt]),i(d,li[(c&Gt)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>xr,d=c>>>xr,f===d)r(f,li[l&Gt]|us[(c&Gt)+1]);else for(r(f,li[l&Gt]),r(d,us[(c&Gt)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(s,o,a,u)=>s<0||o<0||u>=t||a>=e}}function jG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>UG(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function qG(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Mn.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v<u;++v)d=a[v].x,p=a[v].y,h=a[v].x2===void 0?d:a[v].x2,g=a[v].y2===void 0?p:a[v].y2,m=(d+h)/2,y=(p+g)/2,b=Math.abs(h-d+g-p),b>=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&r<h&&(o.align="right"),o.baseline="middle",p<0&&g<=s?o.baseline="top":0<=p&&s<g&&(o.baseline="bottom"),!0}}function Uh(e,t,n,i,r,s){let o=n/2;return e-o<0||e+o>r||t-(o=i/2)<0||t+o>s}function vs(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function WG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Uh(p,g,d,h,r,s)&&!vs(e,p,g,h,d,m,o,a)&&!vs(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,vs(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Mn.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,E,S,w,_,$,C,T,O,k,F,A,M,P,z;for(let U=0;U<f;++U){for(b=c[U].x,x=c[U].y,v=c[U].x2===void 0?b:c[U].x2,E=c[U].y2===void 0?x:c[U].y2,b>v&&(z=b,b=v,v=z),x>E&&(z=x,x=E,E=z),C=e(b),O=e(v),T=~~((C+O)/2),k=e(x),A=e(E),F=~~((k+A)/2),_=T;_>=C;--_)for($=F;$>=k;--$)P=u(_,$,p,h,d),P&&([l.x,l.y,p,g]=P);for(_=T;_<=O;++_)for($=F;$<=A;++$)P=u(_,$,p,h,d),P&&([l.x,l.y,p,g]=P);!g&&!n&&(M=Math.abs(v-b+E-x),S=(b+v)/2,w=(x+E)/2,M>=y&&!Uh(S,w,h,d,r,s)&&!vs(e,S,w,d,h,d,o,null)&&(y=M,l.x=S,l.y=w,m=!0))}return g||m?(S=h/2,w=d/2,o.setRange(e(l.x-S),e(l.y-w),e(l.x+S),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const HG=[-1,-1,1,1],GG=[-1,1,-1,1];function VG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Mn.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,E,S,w,_,$,C,T,O,k,F;for(let A=0;A<f;++A){for(v=c[A].x,E=c[A].y,x=c[A].x2===void 0?v:c[A].x2,S=c[A].y2===void 0?E:c[A].y2,p.push([e((v+x)/2),e((E+S)/2)]);p.length;)if([$,C]=p.pop(),!(o.get($,C)||a.get($,C)||u.get($,C))){u.set($,C);for(let M=0;M<4;++M)w=$+HG[M],_=C+GG[M],u.outOfBounds(w,_,w,_)||p.push([w,_]);if(w=e.invert($),_=e.invert(C),T=g,O=s,!Uh(w,_,h,d,r,s)&&!vs(e,w,_,d,h,T,o,a)&&!vs(e,w,_,d,h,d,o,null)){for(;O-T>=1;)k=(T+O)/2,vs(e,w,_,d,h,k,o,a)?O=k:T=k;T>g&&(l.x=w,l.y=_,g=T,m=!0)}}!m&&!n&&(F=Math.abs(x-v+S-E),w=(v+x)/2,_=(E+S)/2,F>=b&&!Uh(w,_,h,d,r,s)&&!vs(e,w,_,d,h,d,o,null)&&(b=F,l.x=w,l.y=_,y=!0))}return m||y?(w=h/2,_=d/2,o.setRange(e(l.x-w),e(l.y-_),e(l.x+w),e(l.y+_)),l.align="center",l.baseline="middle",!0):!1}}const XG=["right","center","left"],YG=["bottom","middle","top"];function KG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,E,S,w,_,$,C,T;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,p=(n[O]>>>2&3)-1,g=h===0&&p===0||i[O]<0,m=h&&p?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+p]+y*f*p/2+i[O]*p*m,x=w-f/2,E=w+f/2,_=e(b),C=e(x),T=e(E),!d)if(J_(_,_,C,T,o,a,b,b,x,E,c,g))d=Mn.width(l.datum,l.datum.text);else continue;if(S=b+y*d*h/2,b=S-d/2,v=S+d/2,_=e(b),$=e(v),J_(_,$,C,T,o,a,b,v,x,E,c,g))return l.x=h?h*y<0?v:b:S,l.y=p?p*y<0?E:x:w,l.align=XG[h*y+1],l.baseline=YG[p*y+1],o.setRange(_,C,$,T),!0}return!1}}function J_(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const i0=0,r0=4,s0=8,o0=0,a0=1,u0=2,JG={"top-left":i0+o0,top:i0+a0,"top-right":i0+u0,left:r0+o0,middle:r0+a0,right:r0+u0,"bottom-left":s0+o0,bottom:s0+a0,"bottom-right":s0+u0},QG={naive:qG,"reduced-search":WG,floodfill:VG};function ZG(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=eV(i,f),h=tV(r,f),p=nV(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=iV(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const S=e.map(C=>{const T=b?Mn.width(C,C.text):void 0;return x=Math.max(x,T),E=Math.max(E,C.fontSize),{datum:C,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(C),textWidth:T}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=jG(t[0],t[1],l);let _;if(!v){n&&S.sort((O,k)=>n(O.datum,k.datum));let C=!1;for(let O=0;O<h.length&&!C;++O)C=h[O]===5||d[O]<0;const T=(p&&o||m)&&e.map(O=>O.datum);_=s.length||T?IG(w,T||[],s,C,m):zG(w,o&&S)}const $=m?QG[c](w,_,o,u):KG(w,_,h,d);return S.forEach(C=>C.opacity=+$(C)),S}function eV(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function tV(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=JG[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function nV(e){return e&&e.mark&&e.mark.marktype}function iV(e,t,n,i){const r=s=>[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const sy=["x","y","opacity","align","baseline"],rO=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function r2(e){D.call(this,null,e)}r2.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:rO},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:sy.length,default:sy}]};G(r2,D,{transform(e,t){function n(s){const o=e[s];return fe(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&N("Size parameter should be specified as a [width, height] array.");const r=e.as||sy;return ZG(t.materialize(t.SOURCE).source||[],e.size,e.sort,Y(e.offset==null?1:e.offset),Y(e.anchor||rO),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const rV=Object.freeze(Object.defineProperty({__proto__:null,label:r2},Symbol.toStringTag,{value:"Module"}));function sO(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function s2(e){D.call(this,null,e)}s2.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};G(s2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=sO(i,e.groupby),s=(e.groupby||[]).map(Je),o=s.length,a=e.as||[Je(e.x),Je(e.y)],u=[];r.forEach(l=>{DF(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<o;++d)f[s[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const oy={constant:qb,linear:Wb,log:CF,exp:FF,pow:TF,quad:Hb,poly:MF},sV=(e,t)=>e==="poly"?t:e==="quad"?2:1;function o2(e){D.call(this,null,e)}o2.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(oy)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};G(o2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=sO(i,e.groupby),s=(e.groupby||[]).map(Je),o=e.method||"linear",a=e.order==null?3:e.order,u=sV(o,a),l=e.as||[Je(e.x),Je(e.y)],c=oy[o],f=[];let d=e.extent;J(oy,o)||N("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Ji(h,e.x),y=b=>{const v={};for(let x=0;x<s.length;++x)v[s[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};o==="linear"||o==="constant"?m.forEach(b=>y([b,g.predict(b)])):Np(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const oV=Object.freeze(Object.defineProperty({__proto__:null,loess:s2,regression:o2},Symbol.toStringTag,{value:"Module"})),Rr=11102230246251565e-32,Dt=134217729,aV=(3+8*Rr)*Rr;function l0(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f<e;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f],s=o,a!==0&&(r[h++]=a);for(;d<n;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d],s=o,a!==0&&(r[h++]=a);return(s!==0||h===0)&&(r[h++]=s),h}function uV(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function rf(e){return new Float64Array(e)}const lV=(3+16*Rr)*Rr,cV=(2+12*Rr)*Rr,fV=(9+64*Rr)*Rr*Rr,Ea=rf(4),Q_=rf(8),Z_=rf(12),e$=rf(16),Vt=rf(4);function dV(e,t,n,i,r,s,o){let a,u,l,c,f,d,h,p,g,m,y,b,v,x,E,S,w,_;const $=e-r,C=n-r,T=t-s,O=i-s;x=$*O,d=Dt*$,h=d-(d-$),p=$-h,d=Dt*O,g=d-(d-O),m=O-g,E=p*m-(x-h*g-p*g-h*m),S=T*C,d=Dt*T,h=d-(d-T),p=T-h,d=Dt*C,g=d-(d-C),m=C-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Ea[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Ea[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Ea[2]=b-(_-f)+(y-f),Ea[3]=_;let k=uV(4,Ea),F=cV*o;if(k>=F||-k>=F||(f=e-$,a=e-($+f)+(f-r),f=n-C,l=n-(C+f)+(f-r),f=t-T,u=t-(T+f)+(f-s),f=i-O,c=i-(O+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(F=fV*o+aV*Math.abs(k),k+=$*c+O*a-(T*l+C*u),k>=F||-k>=F))return k;x=a*O,d=Dt*a,h=d-(d-a),p=a-h,d=Dt*O,g=d-(d-O),m=O-g,E=p*m-(x-h*g-p*g-h*m),S=u*C,d=Dt*u,h=d-(d-u),p=u-h,d=Dt*C,g=d-(d-C),m=C-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const A=l0(4,Ea,4,Vt,Q_);x=$*c,d=Dt*$,h=d-(d-$),p=$-h,d=Dt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),S=T*l,d=Dt*T,h=d-(d-T),p=T-h,d=Dt*l,g=d-(d-l),m=l-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const M=l0(A,Q_,4,Vt,Z_);x=a*c,d=Dt*a,h=d-(d-a),p=a-h,d=Dt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),S=u*l,d=Dt*u,h=d-(d-u),p=u-h,d=Dt*l,g=d-(d-l),m=l-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const P=l0(M,Z_,4,Vt,e$);return e$[P-1]}function Hf(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=lV*l?u:-dV(e,t,n,i,r,s,l)}const t$=Math.pow(2,-52),Gf=new Uint32Array(512);class jh{static from(t,n=yV,i=bV){const r=t.length,s=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];s[2*o]=n(a),s[2*o+1]=i(a)}return new jh(s)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*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(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let $=0;$<o;$++){const C=t[2*$],T=t[2*$+1];C<a&&(a=C),T<u&&(u=T),C>l&&(l=C),T>c&&(c=T),this._ids[$]=$}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let $=0,C=1/0;$<o;$++){const T=c0(f,d,t[2*$],t[2*$+1]);T<C&&(h=$,C=T)}const m=t[2*h],y=t[2*h+1];for(let $=0,C=1/0;$<o;$++){if($===h)continue;const T=c0(m,y,t[2*$],t[2*$+1]);T<C&&T>0&&(p=$,C=T)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let $=0;$<o;$++){if($===h||$===p)continue;const C=gV(m,y,b,v,t[2*$],t[2*$+1]);C<x&&(g=$,x=C)}let E=t[2*g],S=t[2*g+1];if(x===1/0){for(let T=0;T<o;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];La(this._ids,this._dists,0,o-1);const $=new Uint32Array(o);let C=0;for(let T=0,O=-1/0;T<o;T++){const k=this._ids[T],F=this._dists[k];F>O&&($[C++]=k,O=F)}this.hull=$.subarray(0,C),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Hf(m,y,b,v,E,S)<0){const $=p,C=b,T=v;p=g,b=E,v=S,g=$,E=C,S=T}const w=mV(m,y,b,v,E,S);this._cx=w.x,this._cy=w.y;for(let $=0;$<o;$++)this._dists[$]=c0(t[2*$],t[2*$+1],w.x,w.y);La(this._ids,this._dists,0,o-1),this._hullStart=h;let _=3;i[h]=n[g]=p,i[p]=n[h]=g,i[g]=n[p]=h,r[h]=0,r[p]=1,r[g]=2,s.fill(-1),s[this._hashKey(m,y)]=h,s[this._hashKey(b,v)]=p,s[this._hashKey(E,S)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(let $=0,C,T;$<this._ids.length;$++){const O=this._ids[$],k=t[2*O],F=t[2*O+1];if($>0&&Math.abs(k-C)<=t$&&Math.abs(F-T)<=t$||(C=k,T=F,O===h||O===p||O===g))continue;let A=0;for(let te=0,ne=this._hashKey(k,F);te<this._hashSize&&(A=s[(ne+te)%this._hashSize],!(A!==-1&&A!==i[A]));te++);A=n[A];let M=A,P;for(;P=i[M],Hf(k,F,t[2*M],t[2*M+1],t[2*P],t[2*P+1])>=0;)if(M=P,M===A){M=-1;break}if(M===-1)continue;let z=this._addTriangle(M,O,i[M],-1,-1,r[M]);r[O]=this._legalize(z+2),r[M]=z,_++;let U=i[M];for(;P=i[U],Hf(k,F,t[2*U],t[2*U+1],t[2*P],t[2*P+1])<0;)z=this._addTriangle(U,O,P,r[O],-1,r[U]),r[O]=this._legalize(z+2),i[U]=U,_--,U=P;if(M===A)for(;P=n[M],Hf(k,F,t[2*P],t[2*P+1],t[2*M],t[2*M+1])<0;)z=this._addTriangle(P,O,M,-1,r[M],r[P]),this._legalize(z+2),r[P]=z,i[M]=M,_--,M=P;this._hullStart=n[O]=M,i[M]=n[U]=O,i[O]=U,s[this._hashKey(k,F)]=O,s[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(_);for(let $=0,C=this._hullStart;$<_;$++)this.hull[$]=C,C=i[C];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(hV(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let s=0,o=0;for(;;){const a=i[t],u=t-t%3;if(o=u+(t+2)%3,a===-1){if(s===0)break;t=Gf[--s];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[o],h=n[t],p=n[c],g=n[f];if(pV(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*g],r[2*g+1])){n[t]=g,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[o]),this._link(o,f);const b=l+(a+1)%3;s<Gf.length&&(Gf[s++]=b)}else{if(s===0)break;t=Gf[--s]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,s,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,s),this._link(a+2,o),this.trianglesLen+=3,a}}function hV(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function c0(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function pV(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function gV(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function mV(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,p=t+(o*f-u*c)*d;return{x:h,y:p}}function La(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;fl(e,r,s),t[e[n]]>t[e[i]]&&fl(e,n,i),t[e[s]]>t[e[i]]&&fl(e,s,i),t[e[n]]>t[e[s]]&&fl(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]<u);do o--;while(t[e[o]]>u);if(o<s)break;fl(e,s,o)}e[n+1]=e[o],e[o]=a,i-s+1>=o-n?(La(e,t,s,i),La(e,t,n,o-1)):(La(e,t,n,o-1),La(e,t,s,i))}}function fl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function yV(e){return e[0]}function bV(e){return e[1]}const n$=1e-6;class So{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,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>n$||Math.abs(this._y1-s)>n$)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class ay{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}}let vV=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))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=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g<y;g+=3,m+=2){const x=i[g]*2,E=i[g+1]*2,S=i[g+2]*2,w=t[x],_=t[x+1],$=t[E],C=t[E+1],T=t[S],O=t[S+1],k=$-w,F=C-_,A=T-w,M=O-_,P=(k*M-F*A)*2;if(Math.abs(P)<1e-9){if(s===void 0){s=o=0;for(const U of n)s+=t[U*2],o+=t[U*2+1];s/=n.length,o/=n.length}const z=1e9*Math.sign((s-w)*M-(o-_)*A);b=(w+T)/2-z*M,v=(_+O)/2+z*A}else{const z=1/P,U=k*k+F*F,te=A*A+M*M;b=w+(M*U-F*te)*z,v=_+(k*te-A*U)*z}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];r.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],r[l+2]=r[c]=h-p,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new So:void 0,{delaunay:{halfedges:i,inedges:r,hull:s},circumcenters:o,vectors:a}=this;if(s.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,g=o[h],m=o[h+1],y=o[p],b=o[p+1];this._renderSegment(g,m,y,b,t)}let u,l=s[s.length-1];for(let c=0;c<s.length;++c){u=l,l=s[c];const f=Math.floor(r[l]/3)*2,d=o[f],h=o[f+1],p=u*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new So:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new So:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let s=r.length;for(;r[0]===r[s-2]&&r[1]===r[s-1]&&s>1;)s-=2;for(let o=2;o<s;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&n.lineTo(r[o],r[o+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new ay;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,s){let o;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(s.moveTo(t,n),s.lineTo(i,r)):(o=this._clipSegment(t,n,i,r,a,u))&&(s.moveTo(o[0],o[1]),s.lineTo(o[2],o[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let s=0,o=n.length;s<o;s+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[s]===r[a]&&n[s+1]===r[a+1]&&n[(s+2)%o]===r[(a+u-2)%u]&&n[(s+3)%o]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:s}}=this,o=i[t];if(o===-1)return null;const a=[];let u=o;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,s[u]!==t)break;u=r[u]}while(u!==o&&u!==-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];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,s,o,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(s=a,o=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let p,g,m,y,b;if(l===0){if((p=this._clipSegment(s,o,a,u,l,c))===null)continue;[g,m,y,b]=p}else{if((p=this._clipSegment(a,u,s,o,c,l))===null)continue;[y,b,g,m]=p,f=d,d=this._edgecode(g,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(g,m):r=[g,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.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 r}_clipSegment(t,n,i,r,s,o){const a=s<o;for(a&&([t,n,i,r,s,o]=[i,r,t,n,o,s]);;){if(s===0&&o===0)return a?[i,r,t,n]:[t,n,i,r];if(s&o)return null;let u,l,c=s||o;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),s?(t=u,n=l,s=this._regioncode(t,n)):(i=u,r=l,o=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,s,o){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],s,o))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=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,i,r,s){for(;n!==i;){let o,a;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,a=this.ymin;break}(r[s]!==o||r[s+1]!==a)&&this.contains(t,o,a)&&(r.splice(s,0,o,a),s+=2)}return s}_project(t,n,i,r){let s=1/0,o,a,u;if(r<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/r)<s&&(u=this.ymin,a=t+(s=o)*i)}else if(r>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)<s&&(u=this.ymax,a=t+(s=o)*i)}if(i>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)<s&&(a=this.xmax,u=n+(s=o)*r)}else if(i<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/i)<s&&(a=this.xmin,u=n+(s=o)*r)}return[a,u]}_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){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const xV=2*Math.PI,Sa=Math.pow;function wV(e){return e[0]}function EV(e){return e[1]}function SV(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],s=2*t[i+1],o=2*t[i+2];if((n[o]-n[r])*(n[s+1]-n[r+1])-(n[s]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}function _V(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class a2{static from(t,n=wV,i=EV,r){return new a2("length"in t?$V(t,n,i,r):Float64Array.from(AV(t,n,i,r)))}constructor(t){this._delaunator=new jh(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(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&SV(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const p=_V(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new jh(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=s[u%3===2?u-2:u+1];(i[u]===-1||o[c]===-1)&&(o[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new vV(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=s[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let s;for(;(s=this._step(i,t,n))>=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Sa(n-l[t*2],2)+Sa(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=Sa(n-l[p*2],2)+Sa(i-l[p*2+1],2);if(g<f&&(f=g,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=s[(o[t]+1)%s.length],h!==p&&Sa(n-l[h*2],2)+Sa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new So:void 0,{points:i,halfedges:r,triangles:s}=this;for(let o=0,a=r.length;o<a;++o){const u=r[o];if(u<o)continue;const l=s[o]*2,c=s[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+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;const i=t==null?t=new So:void 0,{points:r}=this;for(let s=0,o=r.length;s<o;s+=2){const a=r[s],u=r[s+1];t.moveTo(a+n,u),t.arc(a,u,n,0,xV)}return i&&i.value()}renderHull(t){const n=t==null?t=new So:void 0,{hull:i,points:r}=this,s=i[0]*2,o=i.length;t.moveTo(r[s],r[s+1]);for(let a=1;a<o;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new ay;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new So:void 0,{points:r,triangles:s}=this,o=s[t*=3]*2,a=s[t+1]*2,u=s[t+2]*2;return n.moveTo(r[o],r[o+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new ay;return this.renderTriangle(t,n),n.value()}}function $V(e,t,n,i){const r=e.length,s=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];s[o*2]=t.call(i,a,o,e),s[o*2+1]=n.call(i,a,o,e)}return s}function*AV(e,t,n,i){let r=0;for(const s of e)yield t.call(i,s,r,e),yield n.call(i,s,r,e),++r}function u2(e){D.call(this,null,e)}u2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const kV=[-1e5,-1e5,1e5,1e5];G(u2,D,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:kV;const s=this.value=a2.from(i,e.x,e.y).voronoi(r);for(let o=0,a=i.length;o<a;++o){const u=s.cellPolygon(o);i[o][n]=u&&!FV(u)?CV(u):null}return t.reflow(e.modified()).modifies(n)}});function CV(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function FV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const TV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:u2},Symbol.toStringTag,{value:"Module"}));var f0=Math.PI/180,Bl=64,Fd=2048;function MV(){var e=[256,256],t,n,i,r,s,o,a,u=oO,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(_s()),g=PV((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(S=>({text:t(S),font:n(S),style:r(S),weight:s(S),rotate:o(S),size:~~(i(S)+1e-14),padding:a(S),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:S})).sort((S,w)=>w.size-S.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,DV(p,E,x,b),E.hasText&&h(g,E,m)&&(v.push(E),m?RV(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(Bl<<5)/g,p.height=Fd/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,S=-E,w,_,$;(w=x(S+=E))&&(_=~~w[0],$=~~w[1],!(Math.min(Math.abs(_),Math.abs($))>=v));)if(g.x=y+_,g.y=b+$,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!OV(g,p,e[0]))&&(!m||NV(g,m))){for(var C=g.sprite,T=g.width>>5,O=e[0]>>5,k=g.x-(T<<4),F=k&127,A=32-F,M=g.y1-g.y0,P=(g.y+g.y0)*O+(k>>5),z,U=0;U<M;U++){z=0;for(var te=0;te<=T;te++)p[P+te]|=z<<A|(te<T?(z=C[U*T+te])>>>F:0);P+=O}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=no(p),f):n},f.fontStyle=function(p){return arguments.length?(r=no(p),f):r},f.fontWeight=function(p){return arguments.length?(s=no(p),f):s},f.rotate=function(p){return arguments.length?(o=no(p),f):o},f.text=function(p){return arguments.length?(t=no(p),f):t},f.spiral=function(p){return arguments.length?(u=zV[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=no(p),f):i},f.padding=function(p){return arguments.length?(a=no(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function DV(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Bl<<5)/s,Fd/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,c=r.measureText(t.text+"m").width*s,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*f0),m=Math.cos(t.rotate*f0),y=c*m,b=c*g,v=d*m,x=d*g;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=Bl<<5&&(o=0,a+=u,u=0),a+d>=Fd)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*f0),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var E=r.getImageData(0,0,(Bl<<5)/s,Fd/s).data,S=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)S[h]=0;if(o=t.xoff,o==null)return;a=t.yoff;var w=0,_=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var $=f*p+(h>>5),C=E[(a+p)*(Bl<<5)+(o+h)<<2]?1<<31-h%32:0;S[$]|=C,w|=C}w?_=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+_,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function OV(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>o:0))&t[l+d])return!0;l+=n}return!1}function RV(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function NV(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function oO(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function LV(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var o=s<0?-1:1;switch(Math.sqrt(1+4*o*s)-o&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function PV(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function no(e){return typeof e=="function"?e:function(){return e}}var zV={archimedean:oO,rectangular:LV};const aO=["x","y","font","fontSize","fontStyle","fontWeight","angle"],IV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function l2(e){D.call(this,MV(),e)}l2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:aO}]};G(l2,D,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&N("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return fe(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||IV.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,o=e.as||aO;let a=e.fontSize||14,u;if(fe(a)?u=e.fontSizeRange:a=Ht(a),u){const p=a,g=ke("sqrt")().domain(Ji(r,p)).range(u);a=m=>g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Jn).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;p<h;++p)g=l[p],m=g.datum,m[o[0]]=g.x+f,m[o[1]]=g.y+d,m[o[2]]=g.font,m[o[3]]=g.size,m[o[4]]=g.style,m[o[5]]=g.weight,m[o[6]]=g.rotate;return t.reflow(i).modifies(o)}});const BV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:l2},Symbol.toStringTag,{value:"Module"})),UV=e=>new Uint8Array(e),jV=e=>new Uint16Array(e),Zl=e=>new Uint32Array(e);function qV(){let e=8,t=[],n=Zl(0),i=Vf(0,e),r=Vf(0,e);return{data:()=>t,seen:()=>n=WV(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;o<u;++o)l=s[o],l._index=a++,t.push(l)},remove(s,o){const a=t.length,u=Array(a-s),l=t;let c,f,d;for(f=0;!o[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],o[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=Vf(s,e,i),r=Vf(s,e))}}}function WV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Vf(e,t,n){const i=(t<257?UV:t<65537?jV:Zl)(e);return n&&i.set(n),i}function i$(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,s){const o=this,a=o.bisect(o.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)s[u[d]]|=i;for(d=c;d<f;++d)s[u[d]]|=i;return o}}}function r$(){let e=Zl(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Zl(f);let h=Array(f),p,g,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=HV(h,d),c)p=t,g=e,t=Array(c+f),e=Zl(c+f),GV(l,p,g,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function s(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function o(a,u){let l;return u?l=u.length:(u=t,l=n),[DL(u,a[0],0,l),Va(u,a[1],0,l)]}return{insert:i,remove:r,bisect:o,reindex:s,index:()=>e,size:()=>n}}function HV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return r<s?-1:r>s?1:0}),zP(e,t)}function GV(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;l<i&&c<o;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=s[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<o;++c,++f)a[f]=r[c],u[f]=s[c]+e}function c2(e){D.call(this,qV(),e),this._indices=null,this._dims=null}c2.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};G(c2,D,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a<o;++a)u=n[a].fname,l=r[u]||(r[u]=r$()),s.push(i$(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,o=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,b,v,x,E,S,w;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,S=b.length;E<S;++E)x[b[E]._index]=1;for(E=0;E<h;++E)w=i[E],(!o[E]||e.modified("fields",E)||t.modified(w.fields))&&(y=w.fname,(g=p[y])||(s[y]=m=r$(),p[y]=g=m.insert(w,t.source,0)),o[E]=i$(m,E,r[E]).onAdd(g,u));for(E=0,S=a.data().length;E<S;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,s=this._dims,o=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=s.length;let d=r.size(),h,p,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)p=a[h].fname,g=u[p]||(u[p]=o[p].insert(a[h],i,d)),s[h].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),s=i.all(),o=e.mod;let a,u,l;for(a=0,u=o.length;a<u;++a)l=o[a]._index,r[l]!==s&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),o=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,o[h]=p=s[h],s[h]=a,p!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;l<o;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<o;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),o=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,s=r.curr(),o=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let p,g,m;if(l<f)for(p=l,g=Math.min(f,c);p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(l>f)for(p=f,g=Math.min(l,d);p<g;++p)m=o[p],s[m]^=h,i.push(m);if(c>d)for(p=Math.max(l,d),g=c;p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(c<d)for(p=Math.max(f,c),g=d;p<g;++p)m=o[p],s[m]^=h,i.push(m);e.range=t.slice()}});function f2(e){D.call(this,null,e)}f2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};G(f2,D,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const s=t.fork(t.ALL),o=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const VV=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:c2,resolvefilter:f2},Symbol.toStringTag,{value:"Module"})),XV="RawCode",Io="Literal",YV="Property",KV="Identifier",JV="ArrayExpression",QV="BinaryExpression",uO="CallExpression",ZV="ConditionalExpression",eX="LogicalExpression",tX="MemberExpression",nX="ObjectExpression",iX="UnaryExpression";function _i(e){this.type=e}_i.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=rX(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function rX(e){switch(e.type){case JV:return e.elements;case QV:case eX:return[e.left,e.right];case uO:return[e.callee].concat(e.arguments);case ZV:return[e.test,e.consequent,e.alternate];case tX:return[e.object,e.property];case nX:return e.properties;case YV:return[e.key,e.value];case iX:return[e.argument];case KV:case Io:case XV:default:return[]}}var cr,Z,R,jt,Me,cg=1,sf=2,Bo=3,Ws=4,fg=5,ia=6,fn=7,of=8,sX=9;cr={};cr[cg]="Boolean";cr[sf]="<end>";cr[Bo]="Identifier";cr[Ws]="Keyword";cr[fg]="Null";cr[ia]="Numeric";cr[fn]="Punctuator";cr[of]="String";cr[sX]="RegularExpression";var oX="ArrayExpression",aX="BinaryExpression",uX="CallExpression",lX="ConditionalExpression",lO="Identifier",cX="Literal",fX="LogicalExpression",dX="MemberExpression",hX="ObjectExpression",pX="Property",gX="UnaryExpression",dt="Unexpected token %0",mX="Unexpected number",yX="Unexpected string",bX="Unexpected identifier",vX="Unexpected reserved word",xX="Unexpected end of input",uy="Invalid regular expression",d0="Invalid regular expression: missing /",cO="Octal literals are not allowed in strict mode.",wX="Duplicate data property in object literal not allowed in strict mode",$t="ILLEGAL",wc="Disabled.",EX=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),SX=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function dg(e,t){if(!e)throw new Error("ASSERT: "+t)}function _r(e){return e>=48&&e<=57}function d2(e){return"0123456789abcdefABCDEF".includes(e)}function ec(e){return"01234567".includes(e)}function _X(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Ec(e){return e===10||e===13||e===8232||e===8233}function af(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&EX.test(String.fromCharCode(e))}function qh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&SX.test(String.fromCharCode(e))}const $X={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function fO(){for(;R<jt;){const e=Z.charCodeAt(R);if(_X(e)||Ec(e))++R;else break}}function ly(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<jt&&d2(Z[R])?(i=Z[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):_e({},dt,$t);return String.fromCharCode(r)}function AX(){var e,t,n,i;for(e=Z[R],t=0,e==="}"&&_e({},dt,$t);R<jt&&(e=Z[R++],!!d2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&_e({},dt,$t),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function dO(){var e,t;for(e=Z.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(Z.charCodeAt(R)!==117&&_e({},dt,$t),++R,e=ly("u"),(!e||e==="\\"||!af(e.charCodeAt(0)))&&_e({},dt,$t),t=e);R<jt&&(e=Z.charCodeAt(R),!!qh(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Z.charCodeAt(R)!==117&&_e({},dt,$t),++R,e=ly("u"),(!e||e==="\\"||!qh(e.charCodeAt(0)))&&_e({},dt,$t),t+=e);return t}function kX(){var e,t;for(e=R++;R<jt;){if(t=Z.charCodeAt(R),t===92)return R=e,dO();if(qh(t))++R;else break}return Z.slice(e,R)}function CX(){var e,t,n;return e=R,t=Z.charCodeAt(R)===92?dO():kX(),t.length===1?n=Bo:$X.hasOwnProperty(t)?n=Ws:t==="null"?n=fg:t==="true"||t==="false"?n=cg:n=Bo,{type:n,value:t,start:e,end:R}}function h0(){var e=R,t=Z.charCodeAt(R),n,i=Z[R],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:fn,value:String.fromCharCode(t),start:e,end:R};default:if(n=Z.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:fn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,Z.charCodeAt(R)===61&&++R,{type:fn,value:Z.slice(e,R),start:e,end:R}}}if(o=Z.substr(R,4),o===">>>=")return R+=4,{type:fn,value:o,start:e,end:R};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return R+=3,{type:fn,value:s,start:e,end:R};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:fn,value:r,start:e,end:R};if(r==="//"&&_e({},dt,$t),"<>=!+-*%&|^/".includes(i))return++R,{type:fn,value:i,start:e,end:R};_e({},dt,$t)}function FX(e){let t="";for(;R<jt&&d2(Z[R]);)t+=Z[R++];return t.length===0&&_e({},dt,$t),af(Z.charCodeAt(R))&&_e({},dt,$t),{type:ia,value:parseInt("0x"+t,16),start:e,end:R}}function TX(e){let t="0"+Z[R++];for(;R<jt&&ec(Z[R]);)t+=Z[R++];return(af(Z.charCodeAt(R))||_r(Z.charCodeAt(R)))&&_e({},dt,$t),{type:ia,value:parseInt(t,8),octal:!0,start:e,end:R}}function s$(){var e,t,n;if(n=Z[R],dg(_r(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=Z[R++],n=Z[R],e==="0"){if(n==="x"||n==="X")return++R,FX(t);if(ec(n))return TX(t);n&&_r(n.charCodeAt(0))&&_e({},dt,$t)}for(;_r(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="."){for(e+=Z[R++];_r(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="e"||n==="E")if(e+=Z[R++],n=Z[R],(n==="+"||n==="-")&&(e+=Z[R++]),_r(Z.charCodeAt(R)))for(;_r(Z.charCodeAt(R));)e+=Z[R++];else _e({},dt,$t);return af(Z.charCodeAt(R))&&_e({},dt,$t),{type:ia,value:parseFloat(e),start:t,end:R}}function MX(){var e="",t,n,i,r,s=!1;for(t=Z[R],dg(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<jt;)if(i=Z[R++],i===t){t="";break}else if(i==="\\")if(i=Z[R++],!i||!Ec(i.charCodeAt(0)))switch(i){case"u":case"x":Z[R]==="{"?(++R,e+=AX()):e+=ly(i);break;case"n":e+=`
|
19
19
|
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:ec(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),R<jt&&ec(Z[R])&&(s=!0,r=r*8+"01234567".indexOf(Z[R++]),"0123".includes(i)&&R<jt&&ec(Z[R])&&(r=r*8+"01234567".indexOf(Z[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Z[R]===`
|
20
|
-
`&&++R;else{if(Ec(i.charCodeAt(0)))break;e+=i}return t!==""&&_e({},dt,$t),{type:of,value:e,octal:s,start:n,end:R}}function DX(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";_e({},uy)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{_e({},uy)}try{return new RegExp(e,t)}catch{return null}}function OX(){var e,t,n,i,r;for(e=Z[R],dg(e==="/","Regular expression literal must start with a slash"),t=Z[R++],n=!1,i=!1;R<jt;)if(e=Z[R++],t+=e,e==="\\")e=Z[R++],Ec(e.charCodeAt(0))&&_e({},d0),t+=e;else if(Ec(e.charCodeAt(0)))_e({},d0);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||_e({},d0),r=t.substr(1,t.length-2),{value:r,literal:t}}function RX(){var e,t,n;for(t="",n="";R<jt&&(e=Z[R],!!qh(e.charCodeAt(0)));)++R,e==="\\"&&R<jt?_e({},dt,$t):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&_e({},uy,n),{value:n,literal:t}}function NX(){var e,t,n,i;return Me=null,fO(),e=R,t=OX(),n=RX(),i=DX(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function LX(e){return e.type===Bo||e.type===Ws||e.type===cg||e.type===fg}function hO(){if(fO(),R>=jt)return{type:sf,start:R,end:R};const e=Z.charCodeAt(R);return af(e)?CX():e===40||e===41||e===59?h0():e===39||e===34?MX():e===46?_r(Z.charCodeAt(R+1))?s$():h0():_r(e)?s$():h0()}function hn(){const e=Me;return R=e.end,Me=hO(),R=e.end,e}function pO(){const e=R;Me=hO(),R=e}function PX(e){const t=new _i(oX);return t.elements=e,t}function o$(e,t,n){const i=new _i(e==="||"||e==="&&"?fX:aX);return i.operator=e,i.left=t,i.right=n,i}function zX(e,t){const n=new _i(uX);return n.callee=e,n.arguments=t,n}function IX(e,t,n){const i=new _i(lX);return i.test=e,i.consequent=t,i.alternate=n,i}function h2(e){const t=new _i(lO);return t.name=e,t}function Ul(e){const t=new _i(cX);return t.value=e.value,t.raw=Z.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function a$(e,t,n){const i=new _i(dX);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function BX(e){const t=new _i(hX);return t.properties=e,t}function u$(e,t,n){const i=new _i(pX);return i.key=t,i.value=n,i.kind=e,i}function UX(e,t){const n=new _i(gX);return n.operator=e,n.argument=t,n.prefix=!0,n}function _e(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(dg(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=R,n.description=r,n}function hg(e){e.type===sf&&_e(e,xX),e.type===ia&&_e(e,mX),e.type===of&&_e(e,yX),e.type===Bo&&_e(e,bX),e.type===Ws&&_e(e,vX),_e(e,dt,e.value)}function qt(e){const t=hn();(t.type!==fn||t.value!==e)&&hg(t)}function Be(e){return Me.type===fn&&Me.value===e}function p0(e){return Me.type===Ws&&Me.value===e}function jX(){const e=[];for(R=Me.start,qt("[");!Be("]");)Be(",")?(hn(),e.push(null)):(e.push(Uo()),Be("]")||qt(","));return hn(),PX(e)}function l$(){R=Me.start;const e=hn();return e.type===of||e.type===ia?(e.octal&&_e(e,cO),Ul(e)):h2(e.value)}function qX(){var e,t,n,i;if(R=Me.start,e=Me,e.type===Bo)return n=l$(),qt(":"),i=Uo(),u$("init",n,i);if(e.type===sf||e.type===fn)hg(e);else return t=l$(),qt(":"),i=Uo(),u$("init",t,i)}function WX(){var e=[],t,n,i,r={},s=String;for(R=Me.start,qt("{");!Be("}");)t=qX(),t.key.type===lO?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?_e({},wX):r[i]=!0,e.push(t),Be("}")||qt(",");return qt("}"),BX(e)}function HX(){qt("(");const e=p2();return qt(")"),e}const GX={if:1};function VX(){var e,t,n;if(Be("("))return HX();if(Be("["))return jX();if(Be("{"))return WX();if(e=Me.type,R=Me.start,e===Bo||GX[Me.value])n=h2(hn().value);else if(e===of||e===ia)Me.octal&&_e(Me,cO),n=Ul(hn());else{if(e===Ws)throw new Error(wc);e===cg?(t=hn(),t.value=t.value==="true",n=Ul(t)):e===fg?(t=hn(),t.value=null,n=Ul(t)):Be("/")||Be("/=")?(n=Ul(NX()),pO()):hg(hn())}return n}function XX(){const e=[];if(qt("("),!Be(")"))for(;R<jt&&(e.push(Uo()),!Be(")"));)qt(",");return qt(")"),e}function YX(){R=Me.start;const e=hn();return LX(e)||hg(e),h2(e.value)}function KX(){return qt("."),YX()}function JX(){qt("[");const e=p2();return qt("]"),e}function QX(){var e,t,n;for(e=VX();;)if(Be("."))n=KX(),e=a$(".",e,n);else if(Be("("))t=XX(),e=zX(e,t);else if(Be("["))n=JX(),e=a$("[",e,n);else break;return e}function c$(){const e=QX();if(Me.type===fn&&(Be("++")||Be("--")))throw new Error(wc);return e}function Td(){var e,t;if(Me.type!==fn&&Me.type!==Ws)t=c$();else{if(Be("++")||Be("--"))throw new Error(wc);if(Be("+")||Be("-")||Be("~")||Be("!"))e=hn(),t=Td(),t=UX(e.value,t);else{if(p0("delete")||p0("void")||p0("typeof"))throw new Error(wc);t=c$()}}return t}function f$(e){let t=0;if(e.type!==fn&&e.type!==Ws)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function ZX(){var e,t,n,i,r,s,o,a,u,l;if(e=Me,u=Td(),i=Me,r=f$(i),r===0)return u;for(i.prec=r,hn(),t=[e,Me],o=Td(),s=[u,i,o];(r=f$(Me))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=o$(a,u,o),s.push(n);i=hn(),i.prec=r,s.push(i),t.push(Me),n=Td(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=o$(s[l-1].value,s[l-2],n),l-=2;return n}function Uo(){var e,t,n;return e=ZX(),Be("?")&&(hn(),t=Uo(),qt(":"),n=Uo(),e=IX(e,t,n)),e}function p2(){const e=Uo();if(Be(","))throw new Error(wc);return e}function g2(e){Z=e,R=0,jt=Z.length,Me=null,pO();const t=p2();if(Me.type!==sf)throw new Error("Unexpect token after expression.");return t}var gO={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function mO(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&N("Missing arguments to clamp function."),o.length>3&&N("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:s,test:n("test",s),if:function(o){o.length<3&&N("Missing arguments to if function."),o.length>3&&N("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function eY(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function yO(e){e=e||{};const t=e.allowed?yi(e.allowed):{},n=e.forbidden?yi(e.forbidden):{},i=e.constants||gO,r=(e.functions||mO)(f),s=e.globalvar,o=e.fieldvar,a=fe(s)?s:p=>`${s}["${p}"]`;let u={},l={},c=0;function f(p){if(K(p))return p;const g=d[p.type];return g==null&&N("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:J(n,g)?N("Illegal identifier: "+g):J(i,g)?i[g]:J(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(l[eY(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&N("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=J(r,g)&&r[g];return y||N("Unrecognized function: "+g),fe(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const d$=Symbol("vega_selection_getter");function bO(e){return(!e.getter||!e.getter[d$])&&(e.getter=Yn(e.field),e.getter[d$]=!0),e.getter}const m2="intersect",h$="union",tY="vlMulti",nY="vlPoint",p$="or",iY="and",Ui="_vgsid_",Sc=Yn(Ui),rY="E",sY="R",oY="R-E",aY="R-LE",uY="R-RE",Wh="index:unit";function g$(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s<r;++s)if(a=n[s],o=bO(a)(e),ws(o)&&(o=zt(o)),ws(i[s])&&(i[s]=zt(i[s])),L(i[s])&&ws(i[s][0])&&(i[s]=i[s].map(zt)),a.type===rY){if(L(i[s])?i[s].indexOf(o)<0:o!==i[s])return!1}else if(a.type===sY){if(!Da(o,i[s]))return!1}else if(a.type===uY){if(!Da(o,i[s],!0,!1))return!1}else if(a.type===oY){if(!Da(o,i[s],!1,!1))return!1}else if(a.type===aY&&!Da(o,i[s],!1,!0))return!1;return!0}function lY(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[Wh]&&i[Wh].value:void 0,o=n===m2,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],s&&o){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=g$(t,l),c[d]=h?-1:++f,h&&s.size===1)return!0;if(!h&&f===s.get(d).count)return!1}else if(h=g$(t,l),o^h)return h;return a&&o}const vO=fp(Sc),cY=vO.left,fY=vO.right;function dY(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[Wh]&&i[Wh].value:void 0,o=n===m2,a=Sc(t),u=cY(r,a);if(u===r.length||Sc(r[u])!==a)return!1;if(s&&o){if(s.size===1)return!0;if(fY(r,a)-u<s.size)return!1}return!0}function hY(e,t){return e.map(n=>ce(t.fields?{values:t.fields.map(i=>bO(i)(n.datum))}:{[Ui]:Sc(n.datum)},t))}function pY(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=s.length,x=0,E,S;x<v;++x)if(l=s[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,S=c.length;E<S;++E)h=c[E],g=o[h.field]||(o[h.field]={}),m=g[d]||(g[d]=[]),u[h.field]=y=h.type.charAt(0),b=g0[`${y}_union`],g[d]=b(m,Y(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(Y(f).reduce((w,_,$)=>(w[c[$].field]=_,w),{})))}else h=Ui,p=Sc(l),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Ui]:p}));if(t=t||h$,o[Ui]?o[Ui]=g0[`${Ui}_${t}`](...Object.values(o[Ui])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map(_=>o[w][_]).reduce((_,$)=>_===void 0?$:g0[`${u[w]}_${t}`](_,$))}),s=Object.keys(a),n&&s.length){const w=i?nY:tY;o[w]=t===h$?{[p$]:s.reduce((_,$)=>(_.push(...a[$]),_),[])}:{[iY]:s.map(_=>({[p$]:a[_]}))}}return o}var g0={[`${Ui}_union`]:WP,[`${Ui}_intersect`]:jP,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=zt(t[0]),i=zt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=zt(t[0]),i=zt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const gY=":",mY="@";function y2(e,t,n,i){t[0].type!==Io&&N("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&xe(t).value,o="unit",a=mY+o,u=gY+r;s===m2&&!J(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),J(i,u)||(i[u]=n.getData(r).tuplesRef())}function xO(e){const t=this.context.data[e];return t?t.values.value:[]}function yY(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function bY(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Rn).insert(t)),1}function vY(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const uf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},xY=uf("format"),wO=uf("timeFormat"),wY=uf("utcFormat"),EY=uf("timeParse"),SY=uf("utcParse"),Xf=new Date(2e3,0,1);function pg(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Xf.setYear(2e3),Xf.setMonth(e),Xf.setDate(t),wO.call(this,Xf,n))}function _Y(e){return pg.call(this,e,1,"%B")}function $Y(e){return pg.call(this,e,1,"%b")}function AY(e){return pg.call(this,0,2+e,"%A")}function kY(e){return pg.call(this,0,2+e,"%a")}const CY=":",FY="@",cy="%",EO="$";function b2(e,t,n,i){t[0].type!==Io&&N("First argument to data functions must be a string literal.");const r=t[0].value,s=CY+r;if(!J(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function TY(e,t,n,i){t[0].type!==Io&&N("First argument to indata must be a string literal."),t[1].type!==Io&&N("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=FY+s;J(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function rn(e,t,n,i){if(t[0].type===Io)m$(n,i,t[0].value);else for(e in n.scales)m$(n,i,e)}function m$(e,t,n){const i=cy+n;if(!J(t,i))try{t[i]=e.scaleRef(n)}catch{}}function fr(e,t){if(fe(e))return e;if(K(e)){const n=t.scales[e];return n&&H7(n.value)?n.value:void 0}}function MY(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=rn,n._range=rn,n._scale=rn;const i=r=>"_["+(r.type===Io?H(cy+r.value):H(cy)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function v2(e,t){return function(n,i,r){if(n){const s=fr(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const DY=v2("area",oq),OY=v2("bounds",cq),RY=v2("centroid",mq);function NY(e,t){const n=fr(e,(t||this).context);return n&&n.scale()}function LY(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function x2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function PY(){return x2(this.context.dataflow,"warn",arguments)}function zY(){return x2(this.context.dataflow,"info",arguments)}function IY(){return x2(this.context.dataflow,"debug",arguments)}function m0(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fy(e){const t=zd(e),n=m0(t.r),i=m0(t.g),r=m0(t.b);return .2126*n+.7152*i+.0722*r}function BY(e,t){const n=fy(e),i=fy(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function UY(){const e=[].slice.call(arguments);return e.unshift({}),ce(...e)}function SO(e,t){return e===t||e!==e&&t!==t?!0:L(e)?L(t)&&e.length===t.length?jY(e,t):!1:X(e)&&X(t)?_O(e,t):!1}function jY(e,t){for(let n=0,i=e.length;n<i;++n)if(!SO(e[n],t[n]))return!1;return!0}function _O(e,t){for(const n in e)if(!SO(e[n],t[n]))return!1;return!0}function y$(e){return t=>_O(e,t)}function qY(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=o.changeset(),c.stamp=l,o.runAfter(()=>{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Rn:L(n)||kp(n)?n:y$(n),c.remove(f)),t&&c.insert(t),i&&(f=y$(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function WY(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function HY(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const b$={};function GY(e,t){const n=b$[t]||(b$[t]=Yn(t));return L(e)?e.map(n):n(e)}function w2(e){return L(e)||ArrayBuffer.isView(e)?e:null}function E2(e){return w2(e)||(K(e)?e:null)}function VY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return w2(e).join(...n)}function XY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).indexOf(...n)}function YY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).lastIndexOf(...n)}function KY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).slice(...n)}function JY(e,t,n){return fe(n)&&N("Function argument passed to replace."),String(e).replace(t,n)}function QY(e){return w2(e).slice().reverse()}function ZY(e,t,n){return Nv(e||0,t||0,n||0)}function eK(e,t){const n=fr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function tK(e,t){const n=fr(e,(t||this).context);return n?n.copy():void 0}function nK(e,t){const n=fr(e,(t||this).context);return n?n.domain():[]}function iK(e,t,n){const i=fr(e,(n||this).context);return i?L(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function rK(e,t){const n=fr(e,(t||this).context);return n&&n.range?n.range():[]}function sK(e,t,n){const i=fr(e,(n||this).context);return i?i(t):void 0}function oK(e,t,n,i,r){e=fr(e,(r||this).context);const s=yM(t,n);let o=e.domain(),a=o[0],u=xe(o),l=Wt;return u-a?l=sM(e,a,u):e=(e.interpolator?ke("sequential")().interpolator(e.interpolator()):ke("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),u!==xe(o)&&o.push(u)),o.forEach(c=>s.stop(l(c),e(c))),s}function aK(e,t,n){const i=fr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function uK(e){let t=null;return function(n){return n?pc(n,t=t||iu(e)):e}}const $O=e=>e.data;function AO(e,t){const n=xO.call(t,e);return n.root&&n.root.lookup||{}}function lK(e,t,n){const i=AO(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map($O):void 0}function cK(e,t){const n=AO(e,this)[t];return n?n.ancestors().map($O):void 0}const kO=()=>typeof window<"u"&&window||null;function fK(){const e=kO();return e?e.screen:{}}function dK(){const e=kO();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function hK(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function CO(e,t,n){if(!e)return[];const[i,r]=e,s=new nt().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return pD(o,s,pK(t))}function pK(e){let t=null;if(e){const n=Y(e.marktype),i=Y(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function gK(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=Y(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function mK(e){return Y(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function yK(e,t,n){const{x:i,y:r,mark:s}=n,o=new nt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<o.x1&&(o.x1=u),u>o.x2&&(o.x2=u),l<o.y1&&(o.y1=l),l>o.y2&&(o.y2=l);return o.translate(i,r),CO([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>bK(u.x,u.y,t))}function bK(e,t,n){let i=0;for(let r=0,s=n.length-1;r<n.length;s=r++){const[o,a]=n[s],[u,l]=n[r];l>t!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const _c={random(){return Jn()},cumulativeNormal:Dp,cumulativeLogNormal:Pb,cumulativeUniform:Ub,densityNormal:Db,densityLogNormal:Lb,densityUniform:Bb,quantileNormal:Op,quantileLogNormal:zb,quantileUniform:jb,sampleNormal:Mp,sampleLogNormal:Nb,sampleUniform:Ib,isArray:L,isBoolean:js,isDate:ws,isDefined(e){return e!==void 0},isNumber:$e,isObject:X,isRegExp:uC,isString:K,isTuple:kp,isValid(e){return e!=null&&e===e},toBoolean:hb,toDate(e){return pb(e)},toNumber:zt,toString:gb,indexof:XY,join:VY,lastindexof:YY,replace:JY,reverse:QY,slice:KY,flush:oC,lerp:lC,merge:UY,pad:dC,peek:xe,pluck:GY,span:Pc,inrange:Da,truncate:hC,rgb:zd,lab:Zd,hcl:eh,hsl:q0,luminance:fy,contrast:BY,sequence:Fn,format:xY,utcFormat:wY,utcParse:SY,utcOffset:IC,utcSequence:jC,timeFormat:wO,timeParse:EY,timeOffset:zC,timeSequence:UC,timeUnitSpecifier:kC,monthFormat:_Y,monthAbbrevFormat:$Y,dayFormat:AY,dayAbbrevFormat:kY,quarter:nC,utcquarter:iC,week:FC,utcweek:DC,dayofyear:CC,utcdayofyear:MC,warn:PY,info:zY,debug:IY,extent(e){return Ji(e)},inScope:LY,intersect:CO,clampRange:rC,pinchDistance:WY,pinchAngle:HY,screen:fK,containerSize:hK,windowSize:dK,bandspace:ZY,setdata:bY,pathShape:uK,panLinear:Qk,panLog:Zk,panPow:eC,panSymlog:tC,zoomLinear:ab,zoomLog:ub,zoomPow:jd,zoomSymlog:lb,encode:vY,modify:qY,lassoAppend:gK,lassoPath:mK,intersectLasso:yK},vK=["view","item","group","xy","x","y"],xK="event.vega.",FO="this.",S2={},TO={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(EO+e)}]`,functions:wK,constants:gO,visitors:S2},dy=yO(TO);function wK(e){const t=mO(e);vK.forEach(n=>t[n]=xK+n);for(const n in _c)t[n]=FO+n;return ce(t,MY(e,_c,S2)),t}function tt(e,t,n){return arguments.length===1?_c[e]:(_c[e]=t,n&&(S2[e]=n),dy&&(dy.functions[e]=FO+e),this)}tt("bandwidth",eK,rn);tt("copy",tK,rn);tt("domain",nK,rn);tt("range",rK,rn);tt("invert",iK,rn);tt("scale",sK,rn);tt("gradient",oK,rn);tt("geoArea",DY,rn);tt("geoBounds",OY,rn);tt("geoCentroid",RY,rn);tt("geoShape",aK,rn);tt("geoScale",NY,rn);tt("indata",yY,TY);tt("data",xO,b2);tt("treePath",lK,b2);tt("treeAncestors",cK,b2);tt("vlSelectionTest",lY,y2);tt("vlSelectionIdTest",dY,y2);tt("vlSelectionResolve",pY,y2);tt("vlSelectionTuples",hY);function nr(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=g2(e)}catch{N("Expression parse error: "+e)}i.visit(s=>{if(s.type!==uO)return;const o=s.callee.name,a=TO.visitors[o];a&&a(o,s.arguments,t,n)});const r=dy(i);return r.globals.forEach(s=>{const o=EO+s;!J(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:ce({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function EK(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const SK=yi(["rule"]),v$=yi(["group","image","rect"]);function _K(e,t){let n="";return SK[t]||(e.x2&&(e.x?(v$[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(v$[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function _2(e){return(e+"").toLowerCase()}function $K(e){return _2(e)==="operator"}function AK(e){return _2(e)==="collect"}function dl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function kK(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
|
20
|
+
`&&++R;else{if(Ec(i.charCodeAt(0)))break;e+=i}return t!==""&&_e({},dt,$t),{type:of,value:e,octal:s,start:n,end:R}}function DX(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";_e({},uy)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{_e({},uy)}try{return new RegExp(e,t)}catch{return null}}function OX(){var e,t,n,i,r;for(e=Z[R],dg(e==="/","Regular expression literal must start with a slash"),t=Z[R++],n=!1,i=!1;R<jt;)if(e=Z[R++],t+=e,e==="\\")e=Z[R++],Ec(e.charCodeAt(0))&&_e({},d0),t+=e;else if(Ec(e.charCodeAt(0)))_e({},d0);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||_e({},d0),r=t.substr(1,t.length-2),{value:r,literal:t}}function RX(){var e,t,n;for(t="",n="";R<jt&&(e=Z[R],!!qh(e.charCodeAt(0)));)++R,e==="\\"&&R<jt?_e({},dt,$t):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&_e({},uy,n),{value:n,literal:t}}function NX(){var e,t,n,i;return Me=null,fO(),e=R,t=OX(),n=RX(),i=DX(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function LX(e){return e.type===Bo||e.type===Ws||e.type===cg||e.type===fg}function hO(){if(fO(),R>=jt)return{type:sf,start:R,end:R};const e=Z.charCodeAt(R);return af(e)?CX():e===40||e===41||e===59?h0():e===39||e===34?MX():e===46?_r(Z.charCodeAt(R+1))?s$():h0():_r(e)?s$():h0()}function hn(){const e=Me;return R=e.end,Me=hO(),R=e.end,e}function pO(){const e=R;Me=hO(),R=e}function PX(e){const t=new _i(oX);return t.elements=e,t}function o$(e,t,n){const i=new _i(e==="||"||e==="&&"?fX:aX);return i.operator=e,i.left=t,i.right=n,i}function zX(e,t){const n=new _i(uX);return n.callee=e,n.arguments=t,n}function IX(e,t,n){const i=new _i(lX);return i.test=e,i.consequent=t,i.alternate=n,i}function h2(e){const t=new _i(lO);return t.name=e,t}function Ul(e){const t=new _i(cX);return t.value=e.value,t.raw=Z.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function a$(e,t,n){const i=new _i(dX);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function BX(e){const t=new _i(hX);return t.properties=e,t}function u$(e,t,n){const i=new _i(pX);return i.key=t,i.value=n,i.kind=e,i}function UX(e,t){const n=new _i(gX);return n.operator=e,n.argument=t,n.prefix=!0,n}function _e(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(dg(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=R,n.description=r,n}function hg(e){e.type===sf&&_e(e,xX),e.type===ia&&_e(e,mX),e.type===of&&_e(e,yX),e.type===Bo&&_e(e,bX),e.type===Ws&&_e(e,vX),_e(e,dt,e.value)}function qt(e){const t=hn();(t.type!==fn||t.value!==e)&&hg(t)}function Be(e){return Me.type===fn&&Me.value===e}function p0(e){return Me.type===Ws&&Me.value===e}function jX(){const e=[];for(R=Me.start,qt("[");!Be("]");)Be(",")?(hn(),e.push(null)):(e.push(Uo()),Be("]")||qt(","));return hn(),PX(e)}function l$(){R=Me.start;const e=hn();return e.type===of||e.type===ia?(e.octal&&_e(e,cO),Ul(e)):h2(e.value)}function qX(){var e,t,n,i;if(R=Me.start,e=Me,e.type===Bo)return n=l$(),qt(":"),i=Uo(),u$("init",n,i);if(e.type===sf||e.type===fn)hg(e);else return t=l$(),qt(":"),i=Uo(),u$("init",t,i)}function WX(){var e=[],t,n,i,r={},s=String;for(R=Me.start,qt("{");!Be("}");)t=qX(),t.key.type===lO?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?_e({},wX):r[i]=!0,e.push(t),Be("}")||qt(",");return qt("}"),BX(e)}function HX(){qt("(");const e=p2();return qt(")"),e}const GX={if:1};function VX(){var e,t,n;if(Be("("))return HX();if(Be("["))return jX();if(Be("{"))return WX();if(e=Me.type,R=Me.start,e===Bo||GX[Me.value])n=h2(hn().value);else if(e===of||e===ia)Me.octal&&_e(Me,cO),n=Ul(hn());else{if(e===Ws)throw new Error(wc);e===cg?(t=hn(),t.value=t.value==="true",n=Ul(t)):e===fg?(t=hn(),t.value=null,n=Ul(t)):Be("/")||Be("/=")?(n=Ul(NX()),pO()):hg(hn())}return n}function XX(){const e=[];if(qt("("),!Be(")"))for(;R<jt&&(e.push(Uo()),!Be(")"));)qt(",");return qt(")"),e}function YX(){R=Me.start;const e=hn();return LX(e)||hg(e),h2(e.value)}function KX(){return qt("."),YX()}function JX(){qt("[");const e=p2();return qt("]"),e}function QX(){var e,t,n;for(e=VX();;)if(Be("."))n=KX(),e=a$(".",e,n);else if(Be("("))t=XX(),e=zX(e,t);else if(Be("["))n=JX(),e=a$("[",e,n);else break;return e}function c$(){const e=QX();if(Me.type===fn&&(Be("++")||Be("--")))throw new Error(wc);return e}function Td(){var e,t;if(Me.type!==fn&&Me.type!==Ws)t=c$();else{if(Be("++")||Be("--"))throw new Error(wc);if(Be("+")||Be("-")||Be("~")||Be("!"))e=hn(),t=Td(),t=UX(e.value,t);else{if(p0("delete")||p0("void")||p0("typeof"))throw new Error(wc);t=c$()}}return t}function f$(e){let t=0;if(e.type!==fn&&e.type!==Ws)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function ZX(){var e,t,n,i,r,s,o,a,u,l;if(e=Me,u=Td(),i=Me,r=f$(i),r===0)return u;for(i.prec=r,hn(),t=[e,Me],o=Td(),s=[u,i,o];(r=f$(Me))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=o$(a,u,o),s.push(n);i=hn(),i.prec=r,s.push(i),t.push(Me),n=Td(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=o$(s[l-1].value,s[l-2],n),l-=2;return n}function Uo(){var e,t,n;return e=ZX(),Be("?")&&(hn(),t=Uo(),qt(":"),n=Uo(),e=IX(e,t,n)),e}function p2(){const e=Uo();if(Be(","))throw new Error(wc);return e}function g2(e){Z=e,R=0,jt=Z.length,Me=null,pO();const t=p2();if(Me.type!==sf)throw new Error("Unexpect token after expression.");return t}var gO={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function mO(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&N("Missing arguments to clamp function."),o.length>3&&N("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:s,test:n("test",s),if:function(o){o.length<3&&N("Missing arguments to if function."),o.length>3&&N("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function eY(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function yO(e){e=e||{};const t=e.allowed?yi(e.allowed):{},n=e.forbidden?yi(e.forbidden):{},i=e.constants||gO,r=(e.functions||mO)(f),s=e.globalvar,o=e.fieldvar,a=fe(s)?s:p=>`${s}["${p}"]`;let u={},l={},c=0;function f(p){if(K(p))return p;const g=d[p.type];return g==null&&N("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:J(n,g)?N("Illegal identifier: "+g):J(i,g)?i[g]:J(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(l[eY(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&N("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=J(r,g)&&r[g];return y||N("Unrecognized function: "+g),fe(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const d$=Symbol("vega_selection_getter");function bO(e){return(!e.getter||!e.getter[d$])&&(e.getter=Yn(e.field),e.getter[d$]=!0),e.getter}const m2="intersect",h$="union",tY="vlMulti",nY="vlPoint",p$="or",iY="and",Ui="_vgsid_",Sc=Yn(Ui),rY="E",sY="R",oY="R-E",aY="R-LE",uY="R-RE",Wh="index:unit";function g$(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s<r;++s)if(a=n[s],o=bO(a)(e),ws(o)&&(o=zt(o)),ws(i[s])&&(i[s]=zt(i[s])),L(i[s])&&ws(i[s][0])&&(i[s]=i[s].map(zt)),a.type===rY){if(L(i[s])?i[s].indexOf(o)<0:o!==i[s])return!1}else if(a.type===sY){if(!Da(o,i[s]))return!1}else if(a.type===uY){if(!Da(o,i[s],!0,!1))return!1}else if(a.type===oY){if(!Da(o,i[s],!1,!1))return!1}else if(a.type===aY&&!Da(o,i[s],!1,!0))return!1;return!0}function lY(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[Wh]&&i[Wh].value:void 0,o=n===m2,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],s&&o){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=g$(t,l),c[d]=h?-1:++f,h&&s.size===1)return!0;if(!h&&f===s.get(d).count)return!1}else if(h=g$(t,l),o^h)return h;return a&&o}const vO=fp(Sc),cY=vO.left,fY=vO.right;function dY(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[Wh]&&i[Wh].value:void 0,o=n===m2,a=Sc(t),u=cY(r,a);if(u===r.length||Sc(r[u])!==a)return!1;if(s&&o){if(s.size===1)return!0;if(fY(r,a)-u<s.size)return!1}return!0}function hY(e,t){return e.map(n=>ce(t.fields?{values:t.fields.map(i=>bO(i)(n.datum))}:{[Ui]:Sc(n.datum)},t))}function pY(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=s.length,x=0,E,S;x<v;++x)if(l=s[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,S=c.length;E<S;++E)h=c[E],g=o[h.field]||(o[h.field]={}),m=g[d]||(g[d]=[]),u[h.field]=y=h.type.charAt(0),b=g0[`${y}_union`],g[d]=b(m,Y(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(Y(f).reduce((w,_,$)=>(w[c[$].field]=_,w),{})))}else h=Ui,p=Sc(l),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Ui]:p}));if(t=t||h$,o[Ui]?o[Ui]=g0[`${Ui}_${t}`](...Object.values(o[Ui])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map(_=>o[w][_]).reduce((_,$)=>_===void 0?$:g0[`${u[w]}_${t}`](_,$))}),s=Object.keys(a),n&&s.length){const w=i?nY:tY;o[w]=t===h$?{[p$]:s.reduce((_,$)=>(_.push(...a[$]),_),[])}:{[iY]:s.map(_=>({[p$]:a[_]}))}}return o}var g0={[`${Ui}_union`]:WP,[`${Ui}_intersect`]:jP,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=zt(t[0]),i=zt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=zt(t[0]),i=zt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const gY=":",mY="@";function y2(e,t,n,i){t[0].type!==Io&&N("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&xe(t).value,o="unit",a=mY+o,u=gY+r;s===m2&&!J(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),J(i,u)||(i[u]=n.getData(r).tuplesRef())}function xO(e){const t=this.context.data[e];return t?t.values.value:[]}function yY(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function bY(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Rn).insert(t)),1}function vY(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const uf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},xY=uf("format"),wO=uf("timeFormat"),wY=uf("utcFormat"),EY=uf("timeParse"),SY=uf("utcParse"),Xf=new Date(2e3,0,1);function pg(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Xf.setYear(2e3),Xf.setMonth(e),Xf.setDate(t),wO.call(this,Xf,n))}function _Y(e){return pg.call(this,e,1,"%B")}function $Y(e){return pg.call(this,e,1,"%b")}function AY(e){return pg.call(this,0,2+e,"%A")}function kY(e){return pg.call(this,0,2+e,"%a")}const CY=":",FY="@",cy="%",EO="$";function b2(e,t,n,i){t[0].type!==Io&&N("First argument to data functions must be a string literal.");const r=t[0].value,s=CY+r;if(!J(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function TY(e,t,n,i){t[0].type!==Io&&N("First argument to indata must be a string literal."),t[1].type!==Io&&N("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=FY+s;J(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function rn(e,t,n,i){if(t[0].type===Io)m$(n,i,t[0].value);else for(e in n.scales)m$(n,i,e)}function m$(e,t,n){const i=cy+n;if(!J(t,i))try{t[i]=e.scaleRef(n)}catch{}}function fr(e,t){if(fe(e))return e;if(K(e)){const n=t.scales[e];return n&&H8(n.value)?n.value:void 0}}function MY(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=rn,n._range=rn,n._scale=rn;const i=r=>"_["+(r.type===Io?H(cy+r.value):H(cy)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function v2(e,t){return function(n,i,r){if(n){const s=fr(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const DY=v2("area",oq),OY=v2("bounds",cq),RY=v2("centroid",mq);function NY(e,t){const n=fr(e,(t||this).context);return n&&n.scale()}function LY(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function x2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function PY(){return x2(this.context.dataflow,"warn",arguments)}function zY(){return x2(this.context.dataflow,"info",arguments)}function IY(){return x2(this.context.dataflow,"debug",arguments)}function m0(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fy(e){const t=zd(e),n=m0(t.r),i=m0(t.g),r=m0(t.b);return .2126*n+.7152*i+.0722*r}function BY(e,t){const n=fy(e),i=fy(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function UY(){const e=[].slice.call(arguments);return e.unshift({}),ce(...e)}function SO(e,t){return e===t||e!==e&&t!==t?!0:L(e)?L(t)&&e.length===t.length?jY(e,t):!1:X(e)&&X(t)?_O(e,t):!1}function jY(e,t){for(let n=0,i=e.length;n<i;++n)if(!SO(e[n],t[n]))return!1;return!0}function _O(e,t){for(const n in e)if(!SO(e[n],t[n]))return!1;return!0}function y$(e){return t=>_O(e,t)}function qY(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=o.changeset(),c.stamp=l,o.runAfter(()=>{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Rn:L(n)||kp(n)?n:y$(n),c.remove(f)),t&&c.insert(t),i&&(f=y$(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function WY(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function HY(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const b$={};function GY(e,t){const n=b$[t]||(b$[t]=Yn(t));return L(e)?e.map(n):n(e)}function w2(e){return L(e)||ArrayBuffer.isView(e)?e:null}function E2(e){return w2(e)||(K(e)?e:null)}function VY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return w2(e).join(...n)}function XY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).indexOf(...n)}function YY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).lastIndexOf(...n)}function KY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).slice(...n)}function JY(e,t,n){return fe(n)&&N("Function argument passed to replace."),String(e).replace(t,n)}function QY(e){return w2(e).slice().reverse()}function ZY(e,t,n){return Nv(e||0,t||0,n||0)}function eK(e,t){const n=fr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function tK(e,t){const n=fr(e,(t||this).context);return n?n.copy():void 0}function nK(e,t){const n=fr(e,(t||this).context);return n?n.domain():[]}function iK(e,t,n){const i=fr(e,(n||this).context);return i?L(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function rK(e,t){const n=fr(e,(t||this).context);return n&&n.range?n.range():[]}function sK(e,t,n){const i=fr(e,(n||this).context);return i?i(t):void 0}function oK(e,t,n,i,r){e=fr(e,(r||this).context);const s=yM(t,n);let o=e.domain(),a=o[0],u=xe(o),l=Wt;return u-a?l=sM(e,a,u):e=(e.interpolator?ke("sequential")().interpolator(e.interpolator()):ke("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),u!==xe(o)&&o.push(u)),o.forEach(c=>s.stop(l(c),e(c))),s}function aK(e,t,n){const i=fr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function uK(e){let t=null;return function(n){return n?pc(n,t=t||iu(e)):e}}const $O=e=>e.data;function AO(e,t){const n=xO.call(t,e);return n.root&&n.root.lookup||{}}function lK(e,t,n){const i=AO(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map($O):void 0}function cK(e,t){const n=AO(e,this)[t];return n?n.ancestors().map($O):void 0}const kO=()=>typeof window<"u"&&window||null;function fK(){const e=kO();return e?e.screen:{}}function dK(){const e=kO();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function hK(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function CO(e,t,n){if(!e)return[];const[i,r]=e,s=new nt().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return pD(o,s,pK(t))}function pK(e){let t=null;if(e){const n=Y(e.marktype),i=Y(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function gK(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=Y(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function mK(e){return Y(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function yK(e,t,n){const{x:i,y:r,mark:s}=n,o=new nt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<o.x1&&(o.x1=u),u>o.x2&&(o.x2=u),l<o.y1&&(o.y1=l),l>o.y2&&(o.y2=l);return o.translate(i,r),CO([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>bK(u.x,u.y,t))}function bK(e,t,n){let i=0;for(let r=0,s=n.length-1;r<n.length;s=r++){const[o,a]=n[s],[u,l]=n[r];l>t!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const _c={random(){return Jn()},cumulativeNormal:Dp,cumulativeLogNormal:Pb,cumulativeUniform:Ub,densityNormal:Db,densityLogNormal:Lb,densityUniform:Bb,quantileNormal:Op,quantileLogNormal:zb,quantileUniform:jb,sampleNormal:Mp,sampleLogNormal:Nb,sampleUniform:Ib,isArray:L,isBoolean:js,isDate:ws,isDefined(e){return e!==void 0},isNumber:$e,isObject:X,isRegExp:uC,isString:K,isTuple:kp,isValid(e){return e!=null&&e===e},toBoolean:hb,toDate(e){return pb(e)},toNumber:zt,toString:gb,indexof:XY,join:VY,lastindexof:YY,replace:JY,reverse:QY,slice:KY,flush:oC,lerp:lC,merge:UY,pad:dC,peek:xe,pluck:GY,span:Pc,inrange:Da,truncate:hC,rgb:zd,lab:Zd,hcl:eh,hsl:q0,luminance:fy,contrast:BY,sequence:Fn,format:xY,utcFormat:wY,utcParse:SY,utcOffset:IC,utcSequence:jC,timeFormat:wO,timeParse:EY,timeOffset:zC,timeSequence:UC,timeUnitSpecifier:kC,monthFormat:_Y,monthAbbrevFormat:$Y,dayFormat:AY,dayAbbrevFormat:kY,quarter:nC,utcquarter:iC,week:FC,utcweek:DC,dayofyear:CC,utcdayofyear:MC,warn:PY,info:zY,debug:IY,extent(e){return Ji(e)},inScope:LY,intersect:CO,clampRange:rC,pinchDistance:WY,pinchAngle:HY,screen:fK,containerSize:hK,windowSize:dK,bandspace:ZY,setdata:bY,pathShape:uK,panLinear:Qk,panLog:Zk,panPow:eC,panSymlog:tC,zoomLinear:ab,zoomLog:ub,zoomPow:jd,zoomSymlog:lb,encode:vY,modify:qY,lassoAppend:gK,lassoPath:mK,intersectLasso:yK},vK=["view","item","group","xy","x","y"],xK="event.vega.",FO="this.",S2={},TO={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(EO+e)}]`,functions:wK,constants:gO,visitors:S2},dy=yO(TO);function wK(e){const t=mO(e);vK.forEach(n=>t[n]=xK+n);for(const n in _c)t[n]=FO+n;return ce(t,MY(e,_c,S2)),t}function tt(e,t,n){return arguments.length===1?_c[e]:(_c[e]=t,n&&(S2[e]=n),dy&&(dy.functions[e]=FO+e),this)}tt("bandwidth",eK,rn);tt("copy",tK,rn);tt("domain",nK,rn);tt("range",rK,rn);tt("invert",iK,rn);tt("scale",sK,rn);tt("gradient",oK,rn);tt("geoArea",DY,rn);tt("geoBounds",OY,rn);tt("geoCentroid",RY,rn);tt("geoShape",aK,rn);tt("geoScale",NY,rn);tt("indata",yY,TY);tt("data",xO,b2);tt("treePath",lK,b2);tt("treeAncestors",cK,b2);tt("vlSelectionTest",lY,y2);tt("vlSelectionIdTest",dY,y2);tt("vlSelectionResolve",pY,y2);tt("vlSelectionTuples",hY);function nr(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=g2(e)}catch{N("Expression parse error: "+e)}i.visit(s=>{if(s.type!==uO)return;const o=s.callee.name,a=TO.visitors[o];a&&a(o,s.arguments,t,n)});const r=dy(i);return r.globals.forEach(s=>{const o=EO+s;!J(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:ce({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function EK(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const SK=yi(["rule"]),v$=yi(["group","image","rect"]);function _K(e,t){let n="";return SK[t]||(e.x2&&(e.x?(v$[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(v$[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function _2(e){return(e+"").toLowerCase()}function $K(e){return _2(e)==="operator"}function AK(e){return _2(e)==="collect"}function dl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function kK(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
|
21
21
|
: (u > v || v == null) && u != null ? ${i}
|
22
22
|
: ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
|
23
23
|
: v !== v && u === u ? ${i} : `}var CK={operator:(e,t)=>dl(e,["_"],t.code),parameter:(e,t)=>dl(e,["datum","_"],t.code),event:(e,t)=>dl(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return dl(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+H(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=_K(i,n),r+="return m;",dl(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(H).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),kK(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function FK(e){const t=this;$K(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function TK(e){const t=this;if(e.params){const n=t.get(e.id);n||N("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function MK(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=L(r)?r.map(s=>x$(s,n,t)):x$(r,n,t)}return t}function x$(e,t,n){if(!e||!X(e))return e;for(let i=0,r=w$.length,s;i<r;++i)if(s=w$[i],J(e,s.key))return s.parse(e,t,n);return e}var w$=[{key:"$ref",parse:DK},{key:"$key",parse:RK},{key:"$expr",parse:OK},{key:"$field",parse:NK},{key:"$encode",parse:PK},{key:"$compare",parse:LK},{key:"$context",parse:zK},{key:"$subflow",parse:IK},{key:"$tupleid",parse:BK}];function DK(e,t){return t.get(e.$ref)||N("Operator not defined: "+e.$ref)}function OK(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=En(t.parameterExpression(e.$expr),e.$fields))}function RK(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=db(e.$key,e.$flat,t.expr.codegen))}function NK(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Yn(e.$field,e.$name,t.expr.codegen))}function LK(e,t){const n="c:"+e.$compare+"_"+e.$order,i=Y(e.$compare).map(r=>r&&r.$tupleid?re:r);return t.fn[n]||(t.fn[n]=cb(i,e.$order,t.expr.codegen))}function PK(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=En(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function zK(e,t){return t}function IK(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function BK(){return re}function UK(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&N("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function jK(e){var t=this,n=X(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||N("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const qK={skip:!0};function WK(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function HK(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],qK)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Rn).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function MO(e,t,n,i){return new DO(e,t,n,i)}function DO(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||CK,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function E$(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}DO.prototype=E$.prototype={fork(){const e=new E$(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),AK(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[_2(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:EK,parseOperator:FK,parseOperatorParameters:TK,parseParameters:MK,parseStream:UK,parseUpdate:jK,getState:WK,setState:HK};function GK(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),OO(t,e.description()))}function OO(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function VK(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const y0="default";function XK(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:y0,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?K(r)?r:r.user:y0,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return K(i)||(r=i.item,i=i.user),hy(e,i&&i!==y0?i:r||i),r},{cursor:t})}function hy(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Hh(e,t){var n=e._runtime.data;return J(n,t)||N("Unrecognized data set: "+t),n[t]}function YK(e,t){return arguments.length<2?Hh(this,e).values.value:gg.call(this,e,ta().remove(Rn).insert(t))}function gg(e,t){gF(t)||N("Second argument to changes must be a changeset.");const n=Hh(this,e);return n.modified=!0,this.pulse(n.input,t)}function KK(e,t){return gg.call(this,e,ta().insert(t))}function JK(e,t){return gg.call(this,e,ta().remove(t))}function RO(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function NO(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function mg(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function QK(e){var t=mg(e),n=RO(e),i=NO(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function ZK(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=mg(e),o=t.changedTouches?t.changedTouches[0]:t,s=ig(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=eJ(e,n,s),t}function eJ(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;K(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:Ht(e),item:Ht(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const S$="view",tJ="timer",nJ="window",iJ={trap:!1};function rJ(e){const t=ce({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{L(i[s])&&(i[s]=yi(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function LO(e,t,n,i){e._eventListeners.push({type:n,sources:Y(t),handler:i})}function sJ(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function Yf(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||X(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function oJ(e,t,n){var i=this,r=new Tp(n),s=function(l,c){i.runAsync(null,()=>{e===S$&&sJ(i,t)&&l.preventDefault(),r.receive(ZK(i,l,c))})},o;if(e===tJ)Yf(i,"timer",t)&&i.timer(s,t);else if(e===S$)Yf(i,"view",t)&&i.addEventListener(t,s,iJ);else if(e===nJ?Yf(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&Yf(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a<u;++a)o[a].addEventListener(t,s);LO(i,o,t,s)}return r}function _$(e){return e.item}function $$(e){return e.item.mark.source}function A$(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function aJ(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",_$),$$,A$(e)),this.on(this.events("view","pointerout",_$),$$,A$(t)),this}function uJ(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,s,o,a,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Dn(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const lJ="vega-bind",cJ="vega-bind-name",fJ="vega-bind-radio";function dJ(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=fb(i.debounce,r.update))),(i.input==null&&i.element?hJ:gJ)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function hJ(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),LO(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(pJ(r))}}function pJ(e){return typeof Event<"u"?new Event(e):{type:e}}function gJ(e,t,n,i){const r=i.signal(n.signal),s=Dn("div",{class:lJ}),o=n.input==="radio"?s:s.appendChild(Dn("label"));o.appendChild(Dn("span",{class:cJ},n.name||n.signal)),t.appendChild(s);let a=mJ;switch(n.input){case"checkbox":a=yJ;break;case"select":a=bJ;break;case"radio":a=vJ;break;case"range":a=xJ;break}a(e,o,n,r)}function mJ(e,t,n,i){const r=Dn("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function yJ(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=Dn("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function bJ(e,t,n,i){const r=Dn("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};Gh(o,i)&&(u.selected=!0),r.appendChild(Dn("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a<u;++a)if(Gh(n.options[a],o)){r.selectedIndex=a;return}}}function vJ(e,t,n,i){const r=Dn("span",{class:fJ}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((o,a)=>{const u={type:"radio",name:n.signal,value:o};Gh(o,i)&&(u.checked=!0);const l=Dn("input",u);l.addEventListener("change",()=>e.update(o));const c=Dn("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)Gh(a[l].value,o)&&(a[l].checked=!0)}}function xJ(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,s=n.min||Math.min(0,r,+i)||0,o=n.step||Oo(s,r,100),a=Dn("input",{type:"range",name:n.signal,min:s,max:r,step:o});a.value=i;const u=Dn("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function Gh(e,t){return e===t||e+""==t+""}function PO(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,RO(e),NO(e),mg(e),r,s).background(e.background())}function $2(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function wJ(e,t,n,i){const r=new i(e.loader(),$2(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,mg(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function EJ(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=rg(i);e=n._el=e?b0(n,e,!0):null,GK(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Zc,a=e?s.renderer:s.headless;return n._renderer=a?PO(n,n._renderer,e,a):null,n._handler=wJ(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=b0(n,t,!0):e.appendChild(Dn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=b0(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{dJ(n,u.element||t,u)})),n}function b0(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const hl=e=>+e||0,SJ=e=>({top:e,bottom:e,left:e,right:e});function k$(e){return X(e)?{top:hl(e.top),bottom:hl(e.bottom),left:hl(e.left),right:hl(e.right)}:SJ(hl(e))}async function A2(e,t,n,i){const r=rg(t),s=r&&r.headless;return s||N("Unrecognized renderer type: "+t),await e.runAsync(),PO(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function _J(e,t){e!==gs.Canvas&&e!==gs.SVG&&e!==gs.PNG&&N("Unrecognized image type: "+e);const n=await A2(this,e,t);return e===gs.SVG?$J(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function $J(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function AJ(e,t){return(await A2(this,gs.Canvas,e,t)).canvas()}async function kJ(e){return(await A2(this,gs.SVG,e)).svg()}function CJ(e,t,n){return MO(e,Qa,_c,n).parse(t)}function FJ(e){var t=this._runtime.scales;return J(t,e)||N("Unrecognized scale or projection: "+e),t[e].value}var zO="width",IO="height",k2="padding",C$={skip:!0};function BO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===k2?i.left+i.right:0)}function UO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===k2?i.top+i.bottom:0)}function TJ(e){var t=e._signals,n=t[zO],i=t[IO],r=t[k2];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=BO(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=UO(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function MJ(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(zO,n,C$),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(IO,i,C$),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function DJ(e){return this._runtime.getState(e||{data:OJ,signals:RJ,recurse:!0})}function OJ(e,t){return t.modified&&L(t.input.value)&&!e.startsWith("_:vega:_")}function RJ(e,t){return!(e==="parent"||t instanceof Qa.proxy)}function NJ(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function LJ(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(hH(n,t))}function PJ(e,t,n,i){const r=e.element();r&&r.setAttribute("title",zJ(i))}function zJ(e){return e==null?"":L(e)?jO(e):X(e)&&!ws(e)?IJ(e):e+""}function IJ(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(L(n)?jO(n):qO(n))}).join(`
|