From 1a9064eae8e56f22e0130c83b06105e4c154a820 Mon Sep 17 00:00:00 2001 From: austensen Date: Mon, 23 Sep 2024 00:15:17 -0400 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=205c4fd?= =?UTF-8?q?ba3747caa7a59618b406a96f1b500c73efb=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{index-85ce95ee.js => index-d10585a8.js} | 12 +- assets/{viz-6bf477d7.js => viz-c193c48b.js} | 2 +- eviction-time-series.csv | 1 + eviction-time-series.json | 10 + index.html | 2 +- marshal-evictions-by-week.csv | 550 +++++++++--------- marshal-evictions-by-week.json | 550 +++++++++--------- 7 files changed, 569 insertions(+), 558 deletions(-) rename assets/{index-85ce95ee.js => index-d10585a8.js} (97%) rename assets/{viz-6bf477d7.js => viz-c193c48b.js} (99%) diff --git a/assets/index-85ce95ee.js b/assets/index-d10585a8.js similarity index 97% rename from assets/index-85ce95ee.js rename to assets/index-d10585a8.js index 997db40c..bd895b85 100644 --- a/assets/index-85ce95ee.js +++ b/assets/index-d10585a8.js @@ -84,14 +84,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)}function a(f,d){return d==null&&(d=fF(f)),o(f,d).join(` `)}function l(f){return f.map(u).join(` `)}function u(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?hZ(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:s,formatBody:a,formatRows:l,formatRow:u,formatValue:c}}function gZ(e){return e}function mZ(e){if(e==null)return gZ;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var u=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*r+o,f[1]=(n+=a[1])*i+s;u1)r=_Z(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);it?1:e>=t?0:NaN}function EZ(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Bg(e){let t,n,r;e.length!==2?(t=Qs,n=(a,l)=>Qs(e(a),l),r=(a,l)=>e(a)-l):(t=e===Qs||e===EZ?e:SZ,n=e,r=e);function i(a,l,u=0,c=a.length){if(u>>1;n(a[f],l)<0?u=f+1:c=f}while(u>>1;n(a[f],l)<=0?u=f+1:c=f}while(uu&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function SZ(){return 0}function nz(e){return e===null?NaN:+e}function*kZ(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const rz=Bg(Qs),t1=rz.right,CZ=rz.left;Bg(nz).center;const jg=t1;function AZ(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function TZ(e,t){const n=AZ(e,t);return n&&Math.sqrt(n)}class _r{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class hF extends Map{constructor(t,n=sz){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(yE(this,t))}has(t){return super.has(yE(this,t))}set(t,n){return super.set(iz(this,t),n)}delete(t){return super.delete(oz(this,t))}}class n1 extends Set{constructor(t,n=sz){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const r of t)this.add(r)}has(t){return super.has(yE(this,t))}add(t){return super.add(iz(this,t))}delete(t){return super.delete(oz(this,t))}}function yE({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function iz({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function oz({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function sz(e){return e!==null&&typeof e=="object"?e.valueOf():e}function RZ(e,t){return Array.from(t,n=>e[n])}function $Z(e=Qs){if(e===Qs)return az;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function az(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const OZ=Math.sqrt(50),NZ=Math.sqrt(10),MZ=Math.sqrt(2);function r1(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=OZ?10:o>=NZ?5:o>=MZ?2:1;let a,l,u;return i<0?(u=Math.pow(10,-i)/s,a=Math.round(e*u),l=Math.round(t*u),a/ut&&--l,u=-u):(u=Math.pow(10,i)*s,a=Math.round(e/u),l=Math.round(t/u),a*ut&&--l),l0))return[];if(e===t)return[e];const r=t=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let u=0;u=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function bE(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function lz(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?az:$Z(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/l+d)),p=Math.min(r,Math.floor(t+(l-u)*f/l+d));lz(e,t,h,p,i)}const o=e[t];let s=n,a=r;for(fh(e,n,t),i(e[r],o)>0&&fh(e,n,r);s0;)--a}i(e[n],o)===0?fh(e,n,a):(++a,fh(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function fh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function wE(e,t,n){if(e=Float64Array.from(kZ(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return bE(e);if(t>=1)return Mu(e);var r,i=(r-1)*t,o=Math.floor(i),s=Mu(lz(e,o).subarray(0,o+1)),a=bE(e.subarray(o+1));return s+(a-s)*(i-o)}}function uz(e,t,n=nz){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function FZ(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function cz(e,t){return wE(e,.5,t)}function*DZ(e){for(const t of e)yield*t}function fz(e){return Array.from(DZ(e))}function ci(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function i1(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Hf(e){return e=i1(Math.abs(e)),e?e[1]:NaN}function PZ(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function LZ(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zZ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qu(e){if(!(t=zZ.exec(e)))throw new Error("invalid format: "+e);var t;return new DC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}qu.prototype=DC.prototype;function DC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}DC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function BZ(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var hz;function jZ(e,t){var n=i1(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(hz=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+i1(e,Math.max(0,t+o-1))[0]}function pF(e,t){var n=i1(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const gF={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:IZ,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>pF(e*100,t),r:pF,s:jZ,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function mF(e){return e}var yF=Array.prototype.map,vF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function pz(e){var t=e.grouping===void 0||e.thousands===void 0?mF:PZ(yF.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?mF:LZ(yF.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=qu(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,v=f.comma,b=f.precision,w=f.trim,_=f.type;_==="n"?(v=!0,_="g"):gF[_]||(b===void 0&&(b=12),w=!0,_="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var k=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",E=g==="$"?r:/[%p]/.test(_)?s:"",A=gF[_],N=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function O(F){var U=k,M=E,L,I,B;if(_==="c")M=A(F)+M,F="";else{F=+F;var H=F<0||1/F<0;if(F=isNaN(F)?l:A(Math.abs(F),b),w&&(F=BZ(F)),H&&+F==0&&p!=="+"&&(H=!1),U=(H?p==="("?p:a:p==="-"||p==="("?"":p)+U,M=(_==="s"?vF[8+hz/3]:"")+M+(H&&p==="("?")":""),N){for(L=-1,I=F.length;++LB||B>57){M=(B===46?i+F.slice(L+1):F.slice(L))+M,F=F.slice(0,L);break}}}v&&!m&&(F=t(F,1/0));var z=U.length+F.length+M.length,j=z>1)+U+F+M+j.slice(z);break;default:F=j+U+F+M;break}return o(F)}return O.toString=function(){return f+""},O}function c(f,d){var h=u((f=qu(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Hf(d)/3)))*3,g=Math.pow(10,-p),m=vF[8+p/3];return function(y){return h(g*y)+m}}return{format:u,formatPrefix:c}}var n0,rx,IC;UZ({thousands:",",grouping:[3],currency:["$",""]});function UZ(e){return n0=pz(e),rx=n0.format,IC=n0.formatPrefix,n0}function gz(e){return Math.max(0,-Hf(Math.abs(e)))}function mz(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hf(t)/3)))*3-Hf(Math.abs(e)))}function yz(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hf(t)-Hf(e))+1}const Vw=new Date,qw=new Date;function gn(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let u;do l.push(u=new Date(+o)),t(o,a),e(o);while(ugn(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(Vw.setTime(+o),qw.setTime(+s),e(Vw),e(qw),Math.floor(n(Vw,qw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Gf=gn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Gf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?gn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Gf);Gf.range;const Ws=1e3,$i=Ws*60,Vs=$i*60,ua=Vs*24,PC=ua*7,xF=ua*30,Yw=ua*365,qs=gn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ws)},(e,t)=>(t-e)/Ws,e=>e.getUTCSeconds());qs.range;const ix=gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ws)},(e,t)=>{e.setTime(+e+t*$i)},(e,t)=>(t-e)/$i,e=>e.getMinutes());ix.range;const ox=gn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*$i)},(e,t)=>(t-e)/$i,e=>e.getUTCMinutes());ox.range;const sx=gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ws-e.getMinutes()*$i)},(e,t)=>{e.setTime(+e+t*Vs)},(e,t)=>(t-e)/Vs,e=>e.getHours());sx.range;const ax=gn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vs)},(e,t)=>(t-e)/Vs,e=>e.getUTCHours());ax.range;const Zs=gn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$i)/ua,e=>e.getDate()-1);Zs.range;const cl=gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ua,e=>e.getUTCDate()-1);cl.range;const vz=gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ua,e=>Math.floor(e/ua));vz.range;function vc(e){return gn(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())*$i)/PC)}const Fd=vc(0),o1=vc(1),HZ=vc(2),GZ=vc(3),Wf=vc(4),WZ=vc(5),VZ=vc(6);Fd.range;o1.range;HZ.range;GZ.range;Wf.range;WZ.range;VZ.range;function xc(e){return gn(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)/PC)}const Dd=xc(0),s1=xc(1),qZ=xc(2),YZ=xc(3),Vf=xc(4),XZ=xc(5),KZ=xc(6);Dd.range;s1.range;qZ.range;YZ.range;Vf.range;XZ.range;KZ.range;const Qp=gn(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());Qp.range;const Zp=gn(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());Zp.range;const ls=gn(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());ls.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:gn(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)});ls.range;const us=gn(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());us.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:gn(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)});us.range;function xz(e,t,n,r,i,o){const s=[[qs,1,Ws],[qs,5,5*Ws],[qs,15,15*Ws],[qs,30,30*Ws],[o,1,$i],[o,5,5*$i],[o,15,15*$i],[o,30,30*$i],[i,1,Vs],[i,3,3*Vs],[i,6,6*Vs],[i,12,12*Vs],[r,1,ua],[r,2,2*ua],[n,1,PC],[t,1,xF],[t,3,3*xF],[e,1,Yw]];function a(u,c,f){const d=cm).right(s,d);if(h===s.length)return e.every(vl(u/Yw,c/Yw,f));if(h===0)return Gf.every(Math.max(vl(u,c,f),1));const[p,g]=s[d/s[h-1][2](e[t]=1+n,e),{});function zC(e){const t=me(e).slice(),n={};return t.length||Y("Missing time unit."),t.forEach(i=>{Oe(Xw,i)?n[i]=1:Y(`Invalid time unit: ${i}.`)}),(n[dn]||n[Qn]?1:0)+(n[Yr]||n[rr]||n[Xr]?1:0)+(n[cs]?1:0)>1&&Y(`Incompatible time units: ${e}`),t.sort((i,o)=>Xw[i]-Xw[o]),t}const tee={[zn]:"%Y ",[Yr]:"Q%q ",[rr]:"%b ",[Xr]:"%d ",[dn]:"W%U ",[Qn]:"%a ",[cs]:"%j ",[gi]:"%H:00",[mi]:"00:%M",[Bi]:":%S",[ko]:".%L",[`${zn}-${rr}`]:"%Y-%m ",[`${zn}-${rr}-${Xr}`]:"%Y-%m-%d ",[`${gi}-${mi}`]:"%H:%M"};function bz(e,t){const n=We({},tee,t),r=zC(e),i=r.length;let o="",s=0,a,l;for(s=0;ss;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const gu=new Date;function BC(e){return gu.setFullYear(e),gu.setMonth(0),gu.setDate(1),gu.setHours(0,0,0,0),gu}function wz(e){return Ez(new Date(e))}function _z(e){return _E(new Date(e))}function Ez(e){return Zs.count(BC(e.getFullYear())-1,e)}function _E(e){return Fd.count(BC(e.getFullYear())-1,e)}function EE(e){return BC(e).getDay()}function nee(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,r,i,o,s);return a.setFullYear(e),a}return new Date(e,t,n,r,i,o,s)}function Sz(e){return Cz(new Date(e))}function kz(e){return SE(new Date(e))}function Cz(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return cl.count(t-1,e)}function SE(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Dd.count(t-1,e)}function kE(e){return gu.setTime(Date.UTC(e,0,1)),gu.getUTCDay()}function ree(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,r,i,o,s))}function Az(e,t,n,r,i){const o=t||1,s=it(e),a=(y,v,b)=>(b=b||y,iee(n[b],r[b],y===s&&o,v)),l=new Date,u=So(e),c=u[zn]?a(zn):lr(2012),f=u[rr]?a(rr):u[Yr]?a(Yr):Ba,d=u[dn]&&u[Qn]?a(Qn,1,dn+Qn):u[dn]?a(dn,1):u[Qn]?a(Qn,1):u[Xr]?a(Xr,1):u[cs]?a(cs,1):$d,h=u[gi]?a(gi):Ba,p=u[mi]?a(mi):Ba,g=u[Bi]?a(Bi):Ba,m=u[ko]?a(ko):Ba;return function(y){l.setTime(+y);const v=c(l);return i(v,f(l),d(l,v),h(l),p(l),g(l),m(l))}}function iee(e,t,n,r){const i=n<=1?e:r?(o,s)=>r+n*Math.floor((e(o,s)-r)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(i(o,s),s):i}function qf(e,t,n){return t+e*7-(n+6)%7}const oee={[zn]:e=>e.getFullYear(),[Yr]:e=>Math.floor(e.getMonth()/3),[rr]:e=>e.getMonth(),[Xr]:e=>e.getDate(),[gi]:e=>e.getHours(),[mi]:e=>e.getMinutes(),[Bi]:e=>e.getSeconds(),[ko]:e=>e.getMilliseconds(),[cs]:e=>Ez(e),[dn]:e=>_E(e),[dn+Qn]:(e,t)=>qf(_E(e),e.getDay(),EE(t)),[Qn]:(e,t)=>qf(1,e.getDay(),EE(t))},see={[Yr]:e=>3*e,[dn]:(e,t)=>qf(e,0,EE(t))};function Tz(e,t){return Az(e,t||1,oee,see,nee)}const aee={[zn]:e=>e.getUTCFullYear(),[Yr]:e=>Math.floor(e.getUTCMonth()/3),[rr]:e=>e.getUTCMonth(),[Xr]:e=>e.getUTCDate(),[gi]:e=>e.getUTCHours(),[mi]:e=>e.getUTCMinutes(),[Bi]:e=>e.getUTCSeconds(),[ko]:e=>e.getUTCMilliseconds(),[cs]:e=>Cz(e),[dn]:e=>SE(e),[Qn]:(e,t)=>qf(1,e.getUTCDay(),kE(t)),[dn+Qn]:(e,t)=>qf(SE(e),e.getUTCDay(),kE(t))},lee={[Yr]:e=>3*e,[dn]:(e,t)=>qf(e,0,kE(t))};function Rz(e,t){return Az(e,t||1,aee,lee,ree)}const uee={[zn]:ls,[Yr]:Qp.every(3),[rr]:Qp,[dn]:Fd,[Xr]:Zs,[Qn]:Zs,[cs]:Zs,[gi]:sx,[mi]:ix,[Bi]:qs,[ko]:Gf},cee={[zn]:us,[Yr]:Zp.every(3),[rr]:Zp,[dn]:Dd,[Xr]:cl,[Qn]:cl,[cs]:cl,[gi]:ax,[mi]:ox,[Bi]:qs,[ko]:Gf};function Id(e){return uee[e]}function Pd(e){return cee[e]}function $z(e,t,n){return e?e.offset(t,n):void 0}function Oz(e,t,n){return $z(Id(e),t,n)}function Nz(e,t,n){return $z(Pd(e),t,n)}function Mz(e,t,n,r){return e?e.range(t,n,r):void 0}function Fz(e,t,n,r){return Mz(Id(e),t,n,r)}function Dz(e,t,n,r){return Mz(Pd(e),t,n,r)}const jh=1e3,Uh=jh*60,Hh=Uh*60,lx=Hh*24,fee=lx*7,bF=lx*30,CE=lx*365,Iz=[zn,rr,Xr,gi,mi,Bi,ko],Gh=Iz.slice(0,-1),Wh=Gh.slice(0,-1),Vh=Wh.slice(0,-1),dee=Vh.slice(0,-1),hee=[zn,dn],wF=[zn,rr],Pz=[zn],dh=[[Gh,1,jh],[Gh,5,5*jh],[Gh,15,15*jh],[Gh,30,30*jh],[Wh,1,Uh],[Wh,5,5*Uh],[Wh,15,15*Uh],[Wh,30,30*Uh],[Vh,1,Hh],[Vh,3,3*Hh],[Vh,6,6*Hh],[Vh,12,12*Hh],[dee,1,lx],[hee,1,fee],[wF,1,bF],[wF,3,3*bF],[Pz,1,CE]];function Lz(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(zg(t))/n;let i=Bg(a=>a[2]).right(dh,r),o,s;return i===dh.length?(o=Pz,s=vl(t[0]/CE,t[1]/CE,n)):i?(i=dh[r/dh[i-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(at=Jw(hh(ee.y,0,1)),yn=at.getUTCDay(),at=yn>4||yn===0?s1.ceil(at):s1(at),at=cl.offset(at,(ee.V-1)*7),ee.y=at.getUTCFullYear(),ee.m=at.getUTCMonth(),ee.d=at.getUTCDate()+(ee.w+6)%7):(at=Kw(hh(ee.y,0,1)),yn=at.getDay(),at=yn>4||yn===0?o1.ceil(at):o1(at),at=Zs.offset(at,(ee.V-1)*7),ee.y=at.getFullYear(),ee.m=at.getMonth(),ee.d=at.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),yn="Z"in ee?Jw(hh(ee.y,0,1)).getUTCDay():Kw(hh(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-(yn+5)%7:ee.w+ee.U*7-(yn+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,Jw(ee)):Kw(ee)}}function A(xe,He,qe,ee){for(var en=0,at=He.length,yn=qe.length,Mn,Rs;en=yn)return-1;if(Mn=He.charCodeAt(en++),Mn===37){if(Mn=He.charAt(en++),Rs=_[Mn in _F?He.charAt(en++):Mn],!Rs||(ee=Rs(xe,qe,ee))<0)return-1}else if(Mn!=qe.charCodeAt(ee++))return-1}return ee}function N(xe,He,qe){var ee=u.exec(He.slice(qe));return ee?(xe.p=c.get(ee[0].toLowerCase()),qe+ee[0].length):-1}function O(xe,He,qe){var ee=h.exec(He.slice(qe));return ee?(xe.w=p.get(ee[0].toLowerCase()),qe+ee[0].length):-1}function F(xe,He,qe){var ee=f.exec(He.slice(qe));return ee?(xe.w=d.get(ee[0].toLowerCase()),qe+ee[0].length):-1}function U(xe,He,qe){var ee=y.exec(He.slice(qe));return ee?(xe.m=v.get(ee[0].toLowerCase()),qe+ee[0].length):-1}function M(xe,He,qe){var ee=g.exec(He.slice(qe));return ee?(xe.m=m.get(ee[0].toLowerCase()),qe+ee[0].length):-1}function L(xe,He,qe){return A(xe,t,He,qe)}function I(xe,He,qe){return A(xe,n,He,qe)}function B(xe,He,qe){return A(xe,r,He,qe)}function H(xe){return s[xe.getDay()]}function z(xe){return o[xe.getDay()]}function j(xe){return l[xe.getMonth()]}function J(xe){return a[xe.getMonth()]}function ce(xe){return i[+(xe.getHours()>=12)]}function _e(xe){return 1+~~(xe.getMonth()/3)}function Ye(xe){return s[xe.getUTCDay()]}function je(xe){return o[xe.getUTCDay()]}function ft(xe){return l[xe.getUTCMonth()]}function ln(xe){return a[xe.getUTCMonth()]}function ni(xe){return i[+(xe.getUTCHours()>=12)]}function Ts(xe){return 1+~~(xe.getUTCMonth()/3)}return{format:function(xe){var He=k(xe+="",b);return He.toString=function(){return xe},He},parse:function(xe){var He=E(xe+="",!1);return He.toString=function(){return xe},He},utcFormat:function(xe){var He=k(xe+="",w);return He.toString=function(){return xe},He},utcParse:function(xe){var He=E(xe+="",!0);return He.toString=function(){return xe},He}}}var _F={"-":"",_:" ",0:"0"},On=/^\s*\d+/,pee=/^%/,gee=/[\\^$*+?|[\]().{}]/g;function ht(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function yee(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vee(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function xee(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bee(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function wee(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function EF(e,t,n){var r=On.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function SF(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _ee(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Eee(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function See(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function kF(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function kee(e,t,n){var r=On.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function CF(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Cee(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Aee(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Tee(e,t,n){var r=On.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ree(e,t,n){var r=On.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function $ee(e,t,n){var r=pee.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Oee(e,t,n){var r=On.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Nee(e,t,n){var r=On.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function AF(e,t){return ht(e.getDate(),t,2)}function Mee(e,t){return ht(e.getHours(),t,2)}function Fee(e,t){return ht(e.getHours()%12||12,t,2)}function Dee(e,t){return ht(1+Zs.count(ls(e),e),t,3)}function Bz(e,t){return ht(e.getMilliseconds(),t,3)}function Iee(e,t){return Bz(e,t)+"000"}function Pee(e,t){return ht(e.getMonth()+1,t,2)}function Lee(e,t){return ht(e.getMinutes(),t,2)}function zee(e,t){return ht(e.getSeconds(),t,2)}function Bee(e){var t=e.getDay();return t===0?7:t}function jee(e,t){return ht(Fd.count(ls(e)-1,e),t,2)}function jz(e){var t=e.getDay();return t>=4||t===0?Wf(e):Wf.ceil(e)}function Uee(e,t){return e=jz(e),ht(Wf.count(ls(e),e)+(ls(e).getDay()===4),t,2)}function Hee(e){return e.getDay()}function Gee(e,t){return ht(o1.count(ls(e)-1,e),t,2)}function Wee(e,t){return ht(e.getFullYear()%100,t,2)}function Vee(e,t){return e=jz(e),ht(e.getFullYear()%100,t,2)}function qee(e,t){return ht(e.getFullYear()%1e4,t,4)}function Yee(e,t){var n=e.getDay();return e=n>=4||n===0?Wf(e):Wf.ceil(e),ht(e.getFullYear()%1e4,t,4)}function Xee(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ht(t/60|0,"0",2)+ht(t%60,"0",2)}function TF(e,t){return ht(e.getUTCDate(),t,2)}function Kee(e,t){return ht(e.getUTCHours(),t,2)}function Jee(e,t){return ht(e.getUTCHours()%12||12,t,2)}function Qee(e,t){return ht(1+cl.count(us(e),e),t,3)}function Uz(e,t){return ht(e.getUTCMilliseconds(),t,3)}function Zee(e,t){return Uz(e,t)+"000"}function ete(e,t){return ht(e.getUTCMonth()+1,t,2)}function tte(e,t){return ht(e.getUTCMinutes(),t,2)}function nte(e,t){return ht(e.getUTCSeconds(),t,2)}function rte(e){var t=e.getUTCDay();return t===0?7:t}function ite(e,t){return ht(Dd.count(us(e)-1,e),t,2)}function Hz(e){var t=e.getUTCDay();return t>=4||t===0?Vf(e):Vf.ceil(e)}function ote(e,t){return e=Hz(e),ht(Vf.count(us(e),e)+(us(e).getUTCDay()===4),t,2)}function ste(e){return e.getUTCDay()}function ate(e,t){return ht(s1.count(us(e)-1,e),t,2)}function lte(e,t){return ht(e.getUTCFullYear()%100,t,2)}function ute(e,t){return e=Hz(e),ht(e.getUTCFullYear()%100,t,2)}function cte(e,t){return ht(e.getUTCFullYear()%1e4,t,4)}function fte(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Vf(e):Vf.ceil(e),ht(e.getUTCFullYear()%1e4,t,4)}function dte(){return"+0000"}function RF(){return"%"}function $F(e){return+e}function OF(e){return Math.floor(+e/1e3)}var Ic,jC,Gz,UC,Wz;hte({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 hte(e){return Ic=zz(e),jC=Ic.format,Gz=Ic.parse,UC=Ic.utcFormat,Wz=Ic.utcParse,Ic}function qh(e){const t={};return n=>t[n]||(t[n]=e(n))}function pte(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=gte(r,i);const s=oi;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function gte(e,t){let n=e.lastIndexOf("e"),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function Vz(e){const t=qh(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(r){const i=qu(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return pte(t(i),t(".1f")(1)[1])}else return t(i)},formatSpan(r,i,o,s){s=qu(s??",f");const a=vl(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let u;if(s.precision==null)switch(s.type){case"s":return isNaN(u=mz(a,l))||(s.precision=u),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(u=yz(a,l))||(s.precision=u-(s.type==="e"));break}case"f":case"%":{isNaN(u=gz(a))||(s.precision=u-(s.type==="%")*2);break}}return t(s)}}}let AE;qz();function qz(){return AE=Vz({format:rx,formatPrefix:IC})}function Yz(e){return Vz(pz(e))}function a1(e){return arguments.length?AE=Yz(e):AE}function NF(e,t,n){n=n||{},ye(n)||Y(`Invalid time multi-format specifier: ${n}`);const r=t(Bi),i=t(mi),o=t(gi),s=t(Xr),a=t(dn),l=t(rr),u=t(Yr),c=t(zn),f=e(n[ko]||".%L"),d=e(n[Bi]||":%S"),h=e(n[mi]||"%I:%M"),p=e(n[gi]||"%I %p"),g=e(n[Xr]||n[Qn]||"%a %d"),m=e(n[dn]||"%b %d"),y=e(n[rr]||"%B"),v=e(n[Yr]||"%B"),b=e(n[zn]||"%Y");return w=>(r(w)pe(r)?t(r):NF(t,Id,r),utcFormat:r=>pe(r)?n(r):NF(n,Pd,r),timeParse:qh(e.parse),utcParse:qh(e.utcParse)}}let TE;Kz();function Kz(){return TE=Xz({format:jC,parse:Gz,utcFormat:UC,utcParse:Wz})}function Jz(e){return Xz(zz(e))}function eg(e){return arguments.length?TE=Jz(e):TE}const RE=(e,t)=>We({},e,t);function Qz(e,t){const n=e?Yz(e):a1(),r=t?Jz(t):eg();return RE(n,r)}function HC(e,t){const n=arguments.length;return n&&n!==2&&Y("defaultLocale expects either zero or two arguments."),n?RE(a1(e),eg(t)):RE(a1(),eg())}function mte(){return qz(),Kz(),HC()}const yte=/^(data:|([A-Za-z]+:)?\/\/)/,vte=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,xte=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,MF="file://";function bte(e,t){return n=>({options:n||{},sanitize:_te,load:wte,fileAccess:!!t,file:Ete(t),http:kte(e)})}async function wte(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function _te(e,t){t=We({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,s;const a=vte.test(e.replace(xte,""));(e==null||typeof e!="string"||!a)&&Y("Sanitize failure, invalid URI: "+ie(e));const l=yte.test(e);return(s=t.baseURL)&&!l&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(i=e.startsWith(MF))||t.mode==="file"||t.mode!=="http"&&!l&&n,i?e=e.slice(MF.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function Ete(e){return e?t=>new Promise((n,r)=>{e.readFile(t,(i,o)=>{i?r(i):n(o)})}):Ste}async function Ste(){Y("No file system access.")}function kte(e){return e?async function(t,n){const r=We({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?Ve(o[i])?o[i]():o.text():Y(o.status+""+o.statusText)}:Cte}async function Cte(){Y("No HTTP fetch method available.")}const Ate=e=>e!=null&&e===e,Tte=e=>e==="true"||e==="false"||e===!0||e===!1,Rte=e=>!Number.isNaN(Date.parse(e)),Zz=e=>!Number.isNaN(+e)&&!(e instanceof Date),$te=e=>Zz(e)&&Number.isInteger(+e),$E={boolean:NC,integer:Zn,number:Zn,date:MC,string:FC,unknown:ar},r0=[Tte,$te,Zz,Rte],Ote=["boolean","integer","number","date"];function e8(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=r0.length,i=r0.map((o,s)=>s+1);for(let o=0,s=0,a,l;oo===0?s:o,0)-1]}function t8(e,t){return t.reduce((n,r)=>(n[r]=e8(e,r),n),{})}function FF(e){const t=function(n,r){const i={delimiter:e};return GC(n,r?We(r,i):i)};return t.responseType="text",t}function GC(e,t){return t.header&&(e=t.header.map(ie).join(t.delimiter)+` -`+e),pZ(t.delimiter).parse(e+"")}GC.responseType="text";function Nte(e){return typeof Buffer=="function"&&Ve(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function WC(e,t){const n=t&&t.property?qr(t.property):ar;return ye(e)&&!Nte(e)?Mte(n(e),t):n(JSON.parse(e))}WC.responseType="json";function Mte(e,t){return!K(e)&&q6(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const Fte={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function n8(e,t){let n,r,i,o;return e=WC(e,t),t&&t.feature?(n=vZ,i=t.feature):t&&t.mesh?(n=bZ,i=t.mesh,o=Fte[t.filter]):Y("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):Y("Invalid TopoJSON object: "+i),r&&r.features||[r]}n8.responseType="json";const ey={dsv:GC,csv:FF(","),tsv:FF(" "),json:WC,topojson:n8};function VC(e,t){return arguments.length>1?(ey[e]=t,this):Oe(ey,e)?ey[e]:null}function r8(e){const t=VC(e);return t&&t.responseType||"text"}function i8(e,t,n,r){t=t||{};const i=VC(t.type||"json");return i||Y("Unknown data format type: "+t.type),e=i(e,t),t.parse&&Dte(e,t.parse,n,r),Oe(e,"columns")&&delete e.columns,e}function Dte(e,t,n,r){if(!e.length)return;const i=eg();n=n||i.timeParse,r=r||i.utcParse;let o=e.columns||Object.keys(e[0]),s,a,l,u,c,f;t==="auto"&&(t=t8(e,o)),o=Object.keys(t);const d=o.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"?r:n)(m);if(!$E[p])throw Error("Illegal format pattern: "+h+":"+p);return $E[p]});for(l=0,c=e.length,f=o.length;l{const o=t(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=t(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function ty(e,t){try{await t(e)}catch(n){e.error(n)}}const o8=Symbol("vega_id");let Ite=1;function fx(e){return!!(e&&Re(e))}function Re(e){return e[o8]}function s8(e,t){return e[o8]=t,e}function mt(e){const t=e===Object(e)?e:{data:e};return Re(t)?t:s8(t,Ite++)}function qC(e){return dx(e,mt({}))}function dx(e,t){for(const n in e)t[n]=e[n];return t}function a8(e,t){return s8(t,Re(e))}function bc(e,t){return e?t?(n,r)=>e(n,r)||Re(t(n))-Re(t(r)):(n,r)=>e(n,r)||Re(n)-Re(r):null}function l8(e){return e&&e.constructor===wc}function wc(){const e=[],t=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:wc,insert(a){const l=me(a),u=l.length;for(let c=0;c{p(v)&&(u[Re(v)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(v)&&u[Re(v)]>0&&y(v,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||r.length?l.filter(v=>u[Re(v)]>0):l.slice();else for(m in c)a.mod.push(c[m]);return(o||o==null&&(t.length||r.length))&&a.clean(!0),a}}}const ny="_:mod:_";function hx(){Object.defineProperty(this,ny,{writable:!0,value:{}})}hx.prototype={set(e,t,n,r){const i=this,o=i[e],s=i[ny];return t!=null&&t>=0?(o[t]!==n||r)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||r)&&(i[e]=n,s[e]=K(n)?1+n.length:-1),i},modified(e,t){const n=this[ny];if(arguments.length){if(K(e)){for(let r=0;r=0?t+1{h instanceof Ct?(h!==this&&(t&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in e)if(a=e[s],s===Lte)me(a).forEach(f=>{f instanceof Ct?f!==this&&(f.targets().add(this),o.push(f)):Y("Pulse parameters must be operator instances.")}),this.source=a;else if(K(a))for(r.set(s,-1,Array(l=a.length)),u=0;u{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Ra();return this.targets().add(Ra(null,null,$C(e,n=>{const r=n.dataflow;t.receive(n),r&&r.run&&r.run()}))),t},between(e,t){let n=!1;return e.targets().add(Ra(null,null,()=>n=!0)),t.targets().add(Ra(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=zi,this._targets=null}};function Wte(e,t,n,r){const i=this,o=Ra(n,r),s=function(u){u.dataflow=i;try{o.receive(u)}catch(c){i.error(c)}finally{i.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=me(e);const l=a.length;for(let u=0;ut=r);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const Jte={skip:!0};function Qte(e,t,n,r,i){return(e instanceof Ct?ene:Zte)(this,e,t,n,r,i),this}function Zte(e,t,n,r,i,o){const s=We({},o,Jte);let a,l;Ve(n)||(n=lr(n)),r===void 0?a=u=>e.touch(n(u)):Ve(r)?(l=new Ct(null,r,i,!1),a=u=>{l.evaluate(u);const c=n(u),f=l.value;l8(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=u=>e.update(n(u),r,s),t.apply(a)}function ene(e,t,n,r,i,o){if(r===void 0)t.targets().add(n);else{const s=o||{},a=new Ct(null,tne(n,r),i,!1);a.modified(s.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 tne(e,t){return t=Ve(t)?t:lr(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function nne(e){e.rank=++this._rank}function rne(e){const t=[e];let n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&Y("Cycle detected in dataflow graph.")}const l1={},Wo=1,Fa=2,Is=4,ine=Wo|Fa,IF=Wo|Is,Pc=Wo|Fa|Is,PF=8,mh=16,LF=32,zF=64;function fl(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Qw(e,t){const n=[];return Ma(e,t,r=>n.push(r)),n}function BF(e,t){const n={};return e.visit(t,r=>{n[Re(r)]=1}),r=>n[Re(r)]?null:r}function i0(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}fl.prototype={StopPropagation:l1,ADD:Wo,REM:Fa,MOD:Is,ADD_REM:ine,ADD_MOD:IF,ALL:Pc,REFLOW:PF,SOURCE:mh,NO_SOURCE:LF,NO_FIELDS:zF,fork(e){return new fl(this.dataflow).init(this,e)},clone(){const e=this.fork(Pc);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(Pc|mh)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new fl(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&zF)&&(n.fields=e.fields),t&Wo?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Fa?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Is?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&LF?(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||Pc;return t&Wo&&this.add.length||t&Fa&&this.rem.length||t&Is&&this.mod.length},reflow(e){if(e)return this.fork(Pc).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Is,BF(this,Wo))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return K(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?K(e)?e.some(r=>n[r]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Wo&&(n.addF=i0(n.addF,t)),e&Fa&&(n.remF=i0(n.remF,t)),e&Is&&(n.modF=i0(n.modF,t)),e&mh&&(n.srcF=i0(n.srcF,t)),n},materialize(e){e=e||Pc;const t=this;return e&Wo&&t.addF&&(t.add=Qw(t.add,t.addF),t.addF=null),e&Fa&&t.remF&&(t.rem=Qw(t.rem,t.remF),t.remF=null),e&Is&&t.modF&&(t.mod=Qw(t.mod,t.modF),t.modF=null),e&mh&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(e&mh)return Ma(n.source,n.srcF,r),n;e&Wo&&Ma(n.add,n.addF,r),e&Fa&&Ma(n.rem,n.remF,r),e&Is&&Ma(n.mod,n.modF,r);const i=n.source;if(e&PF&&i){const o=n.add.length+n.mod.length;o===i.length||(o?Ma(i,BF(n,IF),r):Ma(i,n.srcF,r))}return n}};function YC(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}oe(YC,fl,{fork(e){const t=new fl(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?K(e)?e.some(r=>n[r]):n[e]:0},filter(){Y("MultiPulse does not support filtering.")},materialize(){Y("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;or._enqueue(c,!0)),r._touched=cx(Lg);let s=0,a,l,u;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,e)),l.then?l=await l:l.async&&(i.push(l.async),l=l1),l!==l1&&a._targets&&a._targets.forEach(c=>r._enqueue(c)),++s}}catch(c){r._heap.clear(),u=c}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),u&&(r._postrun=[],r.error(u)),r._postrun.length){const c=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{c.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function sne(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function ane(e,t,n){return this._pulse?u8(this):(this.evaluate(e,t,n),this)}function lne(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(r){this.error(r)}}function u8(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function une(e,t){const n=e.stampi.pulse),t):this._input[e.id]||fne(this._pulse,n&&n.pulse)}function fne(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==l1&&(e.source=t.source),e)}const XC={skip:!1,force:!1};function dne(e,t){const n=t||XC;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function hne(e,t,n){const r=n||XC;return(e.set(t)||r.force)&&this.touch(e,r),this}function pne(e,t,n){this.touch(e,n||XC);const r=new fl(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function gne(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),c8(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,mne(t,0,e)):r=n,r}}}function c8(e,t,n,r){let i,o;const s=e[n];for(;n>t;){if(o=n-1>>1,i=e[o],r(s,i)<0){e[n]=i,n=o;continue}break}return e[n]=s}function mne(e,t,n){const r=t,i=e.length,o=e[t];let s=(t<<1)+1,a;for(;s=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,c8(e,r,t,n)}function kf(){this.logger(kC()),this.logLevel(EC),this._clock=0,this._rank=0,this._locale=HC();try{this._loader=ux()}catch{}this._touched=cx(Lg),this._input={},this._pulse=null,this._heap=gne((e,t)=>e.qrank-t.qrank),this._postrun=[]}function yh(e){return function(){return this._log[e].apply(this,arguments)}}kf.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:yh("error"),warn:yh("warn"),info:yh("info"),debug:yh("debug"),logLevel:yh("level"),cleanThreshold:1e4,add:Ute,connect:Hte,rank:nne,rerank:rne,pulse:pne,touch:dne,update:hne,changeset:wc,ingest:qte,parse:Vte,preload:Xte,request:Yte,events:Wte,on:Qte,evaluate:one,run:ane,runAsync:sne,runAfter:lne,_enqueue:une,_getPulse:cne};function G(e,t){Ct.call(this,e,null,t)}oe(G,Ct,{run(e){if(e.stampthis.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 Yf={};function f8(e){const t=d8(e);return t&&t.Definition||null}function d8(e){return e=e&&e.toLowerCase(),Oe(Yf,e)?Yf[e]:null}function*h8(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function KC(e,t,n){const r=Float64Array.from(h8(e,n));return r.sort(Qs),t.map(i=>uz(r,i))}function JC(e,t){return KC(e,[.25,.5,.75],t)}function QC(e,t){const n=e.length,r=TZ(e,t),i=JC(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function p8(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,l,u,c,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=i.length;f=u&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/r)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+g)*a,o=od);const i=e.length,o=new Float64Array(i);let s=0,a=1,l=r(e[0]),u=l,c=l+t,f;for(;a=c){for(u=(l+u)/2;s>1);si;)e[s--]=e[r]}r=i,i=o}return e}function xne(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function bne(e,t){t==null&&(t=e,e=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*ji())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(e).max(t)}const y8=Math.sqrt(2*Math.PI),wne=Math.SQRT2;let vh=NaN;function gx(e,t){e=e||0,t=t??1;let n=0,r=0,i,o;if(vh===vh)n=vh,vh=NaN;else{do n=ji()*2-1,r=ji()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,vh=r*o}return e+n*t}function ZC(e,t,n){n=n??1;const r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*y8)}function mx(e,t,n){t=t||0,n=n??1;const r=(e-t)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function yx(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*wne*_ne(2*e-1)}function _ne(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 eA(e,t){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>gx(n,r),pdf:o=>ZC(o,n,r),cdf:o=>mx(o,n,r),icdf:o=>yx(o,n,r)};return i.mean(e).stdev(t)}function tA(e,t){const n=eA();let r=0;const i={data(o){return arguments.length?(e=o,r=o?o.length:0,i.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=QC(e)),i):t},sample(){return e[~~(ji()*r)]+t*n.sample()},pdf(o){let s=0,a=0;for(;anA(n,r),pdf:o=>rA(o,n,r),cdf:o=>iA(o,n,r),icdf:o=>oA(o,n,r)};return i.mean(e).stdev(t)}function x8(e,t){let n=0,r;function i(s){const a=[];let l=0,u;for(u=0;u=t&&e<=n?1/(n-t):0}function lA(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function uA(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function b8(e,t){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>sA(n,r),pdf:o=>aA(o,n,r),cdf:o=>lA(o,n,r),icdf:o=>uA(o,n,r)};return t==null&&(t=e??1,e=0),i.min(e).max(t)}function cA(e,t,n){let r=0,i=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function Ug(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function vx(e,t,n,r){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&e.sort((h,p)=>t(h)-t(p));const i=e.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,u=0,c,f,d;for(d of e)o[a]=c=+t(d),s[a]=f=+n(d),++a,l+=(c-l)/a,u+=(f-u)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function Ld(e,t,n,r,i){let o=0,s=0;return Hg(e,t,n,(a,l)=>{const u=l-i(a),c=l-r;o+=u*u,s+=c*c}),1-o/s}function fA(e,t,n){let r=0,i=0,o=0,s=0,a=0;Hg(e,t,n,(c,f)=>{++a,r+=(c-r)/a,i+=(f-i)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const l=Ug(r,i,o,s),u=c=>l[0]+l[1]*c;return{coef:l,predict:u,rSquared:Ld(e,t,n,i,u)}}function w8(e,t,n){let r=0,i=0,o=0,s=0,a=0;Hg(e,t,n,(c,f)=>{++a,c=Math.log(c),r+=(c-r)/a,i+=(f-i)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const l=Ug(r,i,o,s),u=c=>l[0]+l[1]*Math.log(c);return{coef:l,predict:u,rSquared:Ld(e,t,n,i,u)}}function _8(e,t,n){const[r,i,o,s]=vx(e,t,n);let a=0,l=0,u=0,c=0,f=0,d,h,p;Hg(e,t,n,(v,b)=>{d=r[f++],h=Math.log(b),p=d*b,a+=(b*h-a)/f,l+=(p-l)/f,u+=(p*h-u)/f,c+=(d*p-c)/f});const[g,m]=Ug(l/s,a/s,u/s,c/s),y=v=>Math.exp(g+m*(v-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:Ld(e,t,n,s,y)}}function E8(e,t,n){let r=0,i=0,o=0,s=0,a=0,l=0;Hg(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const u=Ug(r,i,o,s),c=f=>u[0]*Math.pow(f,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:Ld(e,t,n,a,c)}}function dA(e,t,n){const[r,i,o,s]=vx(e,t,n),a=r.length;let l=0,u=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(E=E-o,b*E*E+w*E+_+s);return{coef:[_-w*o+b*o*o+s,w-2*b*o,b],predict:k,rSquared:Ld(e,t,n,s,k)}}function S8(e,t,n,r){if(r===0)return cA(e,t,n);if(r===1)return fA(e,t,n);if(r===2)return dA(e,t,n);const[i,o,s,a]=vx(e,t,n),l=i.length,u=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;d{b-=s;let w=a+y[0]+y[1]*b+y[2]*b*b;for(d=3;d=0;--o)for(a=t[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function Sne(e){const t=e.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(e[r][s])&&(s=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(a=0,o=i+1;oi[b]-y?v:b;let _=0,k=0,E=0,A=0,N=0;const O=1/Math.abs(i[w]-y||1);for(let M=v;M<=b;++M){const L=i[M],I=o[M],B=kne(Math.abs(y-L)*O)*d[M],H=L*B;_+=B,k+=H,E+=I*B,A+=I*H,N+=L*H}const[F,U]=Ug(k/_,E/_,A/_,N/_);c[m]=F+U*y,f[m]=Math.abs(o[m]-c[m]),Cne(i,m+1,p)}if(h===jF)break;const g=cz(f);if(Math.abs(g)=1?UF:(v=1-y*y)*v}return Ane(i,c,s,a)}function kne(e){return(e=1-e*e*e)*e*e}function Cne(e,t,n){const r=e[t];let i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}function Ane(e,t,n,r){const i=e.length,o=[];let s=0,a=0,l=[],u;for(;s[g,e(g)],o=t[0],s=t[1],a=s-o,l=a/r,u=[i(o)],c=[];if(n===r){for(let g=1;g0;)c.push(i(o+g/n*a))}let f=u[0],d=c[c.length-1];const h=1/a,p=Rne(f[1],c);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&$ne(f,g,d,h,p)>Tne?c.push(g):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function Rne(e,t){let n=e,r=e;const i=t.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function $ne(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),s=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-s)}function One(e){return t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r{},Nne={init:Zw,add:Zw,rem:Zw,idx:0},tg={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.sum,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{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{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}},Gg=Object.keys(tg).filter(e=>e!=="__count__");function Mne(e,t){return n=>We({name:e,out:n||e},Nne,t)}[...Gg,"__count__"].forEach(e=>{tg[e]=Mne(e,tg[e])});function A8(e,t){return tg[e](t)}function T8(e,t){return e.idx-t.idx}function Fne(e){const t={};e.forEach(r=>t[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{t[i]||n(t[i]=tg[i]())})};return e.forEach(n),Object.values(t).sort(T8)}function Dne(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function Ine(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function Pne(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function Lne(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function R8(e,t){const n=t||ar,r=Fne(e),i=e.slice().sort(T8);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=Dne,o.prototype.add=Ine,o.prototype.rem=Pne,o.prototype.set=Lne,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function hA(e){this._key=e?qr(e):Re,this.reset()}const Hn=hA.prototype;Hn.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Hn.add=function(e){this._add.push(e)};Hn.rem=function(e){this._rem.push(e)};Hn.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),s={};let a,l,u;for(a=0;a=0;)o=e(t[r])+"",Oe(n,o)||(n[o]=1,++i);return i};Hn.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=W6(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Hn.argmin=function(e){return this.extent(e)[0]||{}};Hn.argmax=function(e){return this.extent(e)[1]||{}};Hn.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Hn.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Hn.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=JC(this.values(),e),this._get=e),this._q};Hn.q1=function(e){return this.quartile(e)[0]};Hn.q2=function(e){return this.quartile(e)[1]};Hn.q3=function(e){return this.quartile(e)[2]};Hn.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=g8(this.values(),1e3,.05,e),this._get=e),this._ci};Hn.ci0=function(e){return this.ci(e)[0]};Hn.ci1=function(e){return this.ci(e)[1]};function xl(e){G.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}xl.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Gg},{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"}]};oe(xl,G,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,u,c,f;for(l in a)for(c=a[l].tuple,u=0;u{const y=Xt(m);return i(m),n.push(y),y}),this.cellkey=e.key?e.key:OE(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.as||[],l=o.length,u={};let c,f,d,h,p,g;for(l!==s.length&&Y("Unmatched number of fields and aggregate ops."),g=0;gR8(m,m.field)),Object.create(null)},cellkey:OE(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=r(c);c[a]=f,c[l]=f==null?null:i+o*(1+(f-i)/o)}:c=>c[a]=r(c)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=p8(e),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=e.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(u){let c=Zn(t(u));return c==null?null:co?1/0:(c=Math.max(i,Math.min(c,o-r)),i+r*Math.floor(zne+(c-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=ei(l,nr(t),e.name||"bin_"+Xt(t))}});function $8(e,t,n){const r=e;let i=t||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,u)=>(a&&(i=i.filter(c=>!s[r(c)]),s={},a=0),u&&l&&i.sort(l),o.length&&(i=l?J6(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function gA(e){G.call(this,[],e)}gA.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};oe(gA,G,{transform(e,t){const n=t.fork(t.ALL),r=$8(Re,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(bc(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function O8(e){Ct.call(this,null,Bne,e)}oe(O8,Ct);function Bne(e){return this.value&&!e.modified()?this.value:RC(e.fields,e.orders)}function mA(e){G.call(this,null,e)}mA.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 jne(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}oe(mA,G,{transform(e,t){const n=f=>d=>{for(var h=jne(a(d),e.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),c=n(f=>i[f]-=1);return r?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_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,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,u;for(a in n)l=r[a],u=n[a]||0,!l&&u?(r[a]=l=mt({}),l[i]=a,l[o]=u,s.add.push(l)):u===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==u&&(l[o]=u,s.mod.push(l));return s.modifies(t)}});function yA(e){G.call(this,null,e)}yA.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};oe(yA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=Une(a,i,o,e.filter||zi)):n.mod=a,n.source=this.value,n.modifies(r)}});function Une(e,t,n,r){for(var i=[],o={},s=e.length,a=0,l,u;aN8(o,t))):typeof r[i]===GF&&r[i](e[i]);return r}function vA(e){G.call(this,null,e)}const M8=[{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}]}],Wne={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:M8},{name:"weights",type:"number",array:!0}]};vA.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:M8.concat(Wne)},{name:"as",type:"string",array:!0,default:["value","density"]}]};oe(vA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=N8(e.distribution,Vne(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&Y("Invalid density method: "+s),!e.extent&&!r.data&&Y("Missing density extent parameter."),s=r[s];const a=e.as||["value","density"],l=e.extent||as(r.data()),u=xx(s,l,i,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],mt(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function Vne(e){return()=>e.materialize(e.SOURCE).source}function F8(e,t){return e?e.map((n,r)=>t[r]||Xt(n)):null}function xA(e,t,n){const r=[],i=f=>f(l);let o,s,a,l,u,c;if(t==null)r.push(e.map(n));else for(o={},s=0,a=e.length;szg(as(e,t))/30;oe(bA,G,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,r=xA(t.source,e.groupby,ar),i=e.smooth||!1,o=e.field,s=e.step||qne(n,o),a=bc((p,g)=>o(p)-o(g)),l=e.as||D8,u=r.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(l)}});function I8(e){Ct.call(this,null,Yne,e),this.modified(!0)}oe(I8,Ct);function Yne(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ei(n=>t(n,e),nr(t),Xt(t))}function wA(e){G.call(this,[void 0,void 0],e)}wA.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};oe(wA,G,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),t.visit(i?t.SOURCE:t.ADD,a=>{const l=Zn(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Xt(r);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function _A(e,t){Ct.call(this,e),this.parent=t,this.count=0}oe(_A,Ct,{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 bx(e){G.call(this,{},e),this._keys=Md();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let r=0,i=t.active;rr&&r.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(l,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const u=Re(l),c=o.get(u);c!==void 0&&(o.delete(u),a(c).rem(l))}),t.visit(t.ADD,l=>{const u=r(l);o.set(Re(l),u),a(u).add(l)}),s||t.modified(r.fields)?t.visit(t.MOD,l=>{const u=Re(l),c=o.get(u),f=r(l);c===f?a(f).mod(l):(o.set(u,f),a(c).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(o.get(Re(l))).mod(l)}),s&&t.visit(t.REFLOW,l=>{const u=Re(l),c=o.get(u),f=r(l);c!==f&&(o.set(u,f),a(c).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function P8(e){Ct.call(this,null,Xne,e)}oe(P8,Ct);function Xne(e){return this.value&&!e.modified()?this.value:K(e.name)?me(e.name).map(t=>qr(t)):qr(e.name,e.as)}function EA(e){G.call(this,Md(),e)}EA.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};oe(EA,G,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,s=i.rem,a=i.mod,l=e.expr;let u=!0;t.visit(t.REM,f=>{const d=Re(f);r.has(d)?r.delete(d):s.push(f)}),t.visit(t.ADD,f=>{l(f,e)?o.push(f):r.set(Re(f),1)});function c(f){const d=Re(f),h=l(f,e),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):u&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function SA(e){G.call(this,[],e)}SA.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}]};oe(SA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=F8(r,e.as||[]),o=e.index||null,s=i.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=r.map(p=>p(a)),u=l.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;cs[r]=n(s,e))}});function L8(e){G.call(this,[],e)}oe(L8,G,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i=this.value,o=e.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=mt(r(e))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const o0={value:"value",median:cz,mean:FZ,min:bE,max:Mu},Kne=[];function AA(e){G.call(this,[],e)}AA.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 Jne(e){var t=e.method||o0.value,n;if(o0[t]==null)Y("Unrecognized imputation method: "+t);else return t===o0.value?(n=e.value!==void 0?e.value:0,()=>n):o0[t]}function Qne(e){const t=e.field;return n=>n?t(n):NaN}oe(AA,G,{transform(e,t){var n=t.fork(t.ALL),r=Jne(e),i=Qne(e),o=Xt(e.field),s=Xt(e.key),a=(e.groupby||[]).map(Xt),l=Zne(t.source,e.groupby,e.key,e.keyvals),u=[],c=this.value,f=l.domain.length,d,h,p,g,m,y,v,b,w,_;for(m=0,b=l.length;my(m),o=[],s=r?r.slice():[],a={},l={},u,c,f,d,h,p,g,m;for(s.forEach((y,v)=>a[y]=v+1),d=0,g=e.length;dn.add(o))):(i=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{We(o,i[n.cellkey(o)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const p=tA(h,s)[a],g=e.counts?h.length:1,m=c||as(h);xx(p,m,f,d).forEach(y=>{const v={};for(let b=0;b(this._pending=me(i.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(r=>e_(this,t,me(r.data)))}});function tre(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function e_(e,t,n){n.forEach(mt);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function $A(e){G.call(this,{},e)}$A.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}]};oe($A,G,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let l=s?t.SOURCE:t.ADD,u=t,c=e.as,f,d,h;return i?(d=i.length,a>1&&!c&&Y('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&Y('The "as" parameter has too few output field names.'),c=c||i.map(Xt),f=function(p){for(var g=0,m=0,y,v;gt.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),u.modifies(c)}});function j8(e){Ct.call(this,null,nre,e)}oe(j8,Ct);function nre(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function U8(e){Ct.call(this,null,rre,e)}oe(U8,Ct);function rre(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function H8(e){G.call(this,null,e)}oe(H8,G,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function OA(e){xl.call(this,e)}OA.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:Gg,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};oe(OA,xl,{_transform:xl.prototype.transform,transform(e,t){return this._transform(ire(e,t),t)}});function ire(e,t){const n=e.field,r=e.value,i=(e.op==="count"?"__count__":e.op)||"sum",o=nr(n).concat(nr(r)),s=sre(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>i),fields:s.map(a=>ore(a,n,r,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function ore(e,t,n,r){return ei(i=>t(i)===e?n(i):NaN,r,e+"")}function sre(e,t,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=e(o);r[s]||(r[s]=1,i.push(s))}),i.sort(nx),t?i.slice(0,t):i}function G8(e){bx.call(this,e)}oe(G8,bx,{transform(e,t){const n=e.subflow,r=e.field,i=o=>this.subflow(Re(o),n,t,o);return(e.modified("field")||r&&t.modified(nr(r)))&&Y("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(mt(a)))}),t.visit(t.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>i(o).mod(o)),t.visit(t.ADD,o=>i(o).add(o)),t.visit(t.REM,o=>i(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function NA(e){G.call(this,null,e)}NA.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};oe(NA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=F8(e.fields,e.as||[]),o=r?(a,l)=>are(a,l,r,i):dx;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const l=Re(a);n.rem.push(s[l]),s[l]=null}),t.visit(t.ADD,a=>{const l=o(a,mt({}));s[Re(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[Re(a)]))}),n}});function are(e,t,n,r){for(let i=0,o=n.length;i{const d=KC(f,u);for(let h=0;h{const o=Re(i);n.rem.push(r[o]),r[o]=null}),t.visit(t.ADD,i=>{const o=qC(i);r[Re(i)]=o,n.add.push(o)}),t.visit(t.MOD,i=>{const o=r[Re(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function FA(e){G.call(this,[],e),this.count=0}FA.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};oe(FA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((c,f)=>(c[Re(f)]=1,c),{});let s=this.value,a=this.count,l=0;function u(c){let f,d;s.length=l&&(f=s[d],o[Re(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=Re(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[Re(c)]!==-1)),(t.rem.length||r)&&s.length{o[Re(c)]||u(c)}),l=-1),r&&s.length>i){const c=s.length-i;for(let f=0;f{o[Re(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=s.filter(c=>!o[Re(c)])),this.count=a,this.value=n.source=s,n}});function DA(e){G.call(this,null,e)}DA.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"}]};oe(DA,G,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=ci(e.start,e.stop,e.step||1).map(i=>{const o={};return o[r]=i,mt(o)}),n.add=t.add.concat(this.value),n}});function q8(e){G.call(this,null,e),this.modified(!0)}oe(q8,G,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function IA(e){G.call(this,null,e)}const Y8=["unit0","unit1"];IA.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:LC,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:Y8}]};oe(IA,G,{transform(e,t){const n=e.field,r=e.interval!==!1,i=e.timezone==="utc",o=this._floor(e,t),s=(i?Pd:Id)(o.unit).offset,a=e.as||Y8,l=a[0],u=a[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(nr(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[l]=null,r&&(p[u]=null)):(p[l]=m=y=o(g),r&&(p[u]=y=s(m,c)),md&&(d=y))}),o.start=f,o.stop=d,t.modifies(r?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:Lz({extent:e.extent||as(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=zC(r),s=this.value||{},a=(n?Rz:Tz)(o,i);return a.unit=it(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function X8(e){G.call(this,Md(),e)}oe(X8,G,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>i.delete(r(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}});function K8(e){G.call(this,null,e)}oe(K8,G,{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(bc(e.sort)):t.source).map(e.field))}});function ure(e,t,n,r){const i=ng[e](t,n);return{init:i.init||Ba,update:function(o,s){s[r]=i.next(o)}}}const ng={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=ng.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,r=t.compare;let i=t.index;if(e0||Y("ntile num must be greater than zero.");const n=ng.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(t*r(i))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(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||Y("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return r!=null?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=cre(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}};function cre(e,t,n){for(let r=t.length;na[p]=1)}d(e.sort),t.forEach((h,p)=>{const g=n[p],m=Xt(g),y=C8(h,m,i[p]);if(d(g),o.push(y),Oe(ng,h))s.push(ure(h,n[p],r[p],y));else{if(g==null&&h!=="count"&&Y("Null aggregate field specified."),h==="count"){u.push(y);return}f=!1;let v=l[m];v||(v=l[m]=[],v.field=g,c.push(v)),v.push(A8(h,y))}}),(u.length||c.length)&&(this.cell=dre(c,u,f)),this.inputs=Object.keys(a)}const Q8=J8.prototype;Q8.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};Q8.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let s;if(n){for(s=e.p0;sR8(l,l.field));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new J8(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),r1?0:e<-1?Xf:Math.acos(e)}function VF(e){return e>=1?u1:e<=-1?-u1:Math.asin(e)}const NE=Math.PI,ME=2*NE,hu=1e-6,xre=ME-hu;function e7(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return e7;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;ihu)if(!(Math.abs(f*l-u*c)>hu)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+u*u,m=h*h+p*p,y=Math.sqrt(g),v=Math.sqrt(d),b=o*Math.tan((NE-Math.acos((g+d-m)/(2*y*v)))/2),w=b/v,_=b/y;Math.abs(w-1)>hu&&this._append`L${t+w*c},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*h>c*p)},${this._x1=t+_*l},${this._y1=n+_*u}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),u=t+a,c=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>hu||Math.abs(this._y1-c)>hu)&&this._append`L${u},${c}`,r&&(d<0&&(d=d%ME+ME),d>xre?this._append`A${r},${r},0,1,${f},${t-a},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:d>hu&&this._append`A${r},${r},0,${+(d>=NE)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function wx(){return new LA}wx.prototype=LA.prototype;function _x(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new LA(t)}function wre(e){return e.innerRadius}function _re(e){return e.outerRadius}function Ere(e){return e.startAngle}function Sre(e){return e.endAngle}function kre(e){return e&&e.padAngle}function Cre(e,t,n,r,i,o,s,a){var l=n-e,u=r-t,c=s-i,f=a-o,d=f*l-c*u;if(!(d*dL*L+I*I&&(A=O,N=F),{cx:A,cy:N,x01:-c,y01:-f,x11:A*(i/_-1),y11:N*(i/_-1)}}function Are(){var e=wre,t=_re,n=yt(0),r=null,i=Ere,o=Sre,s=kre,a=null,l=_x(u);function u(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-u1,g=o.apply(this,arguments)-u1,m=WF(g-p),y=g>p;if(a||(a=c=l()),hYn))a.moveTo(0,0);else if(m>Z8-Yn)a.moveTo(h*Zl(p),h*zo(p)),a.arc(0,0,h,p,g,!y),d>Yn&&(a.moveTo(d*Zl(g),d*zo(g)),a.arc(0,0,d,g,p,y));else{var v=p,b=g,w=p,_=g,k=m,E=m,A=s.apply(this,arguments)/2,N=A>Yn&&(r?+r.apply(this,arguments):Su(d*d+h*h)),O=t_(WF(h-d)/2,+n.apply(this,arguments)),F=O,U=O,M,L;if(N>Yn){var I=VF(N/d*zo(A)),B=VF(N/h*zo(A));(k-=I*2)>Yn?(I*=y?1:-1,w+=I,_-=I):(k=0,w=_=(p+g)/2),(E-=B*2)>Yn?(B*=y?1:-1,v+=B,b-=B):(E=0,v=b=(p+g)/2)}var H=h*Zl(v),z=h*zo(v),j=d*Zl(_),J=d*zo(_);if(O>Yn){var ce=h*Zl(b),_e=h*zo(b),Ye=d*Zl(w),je=d*zo(w),ft;if(mYn?U>Yn?(M=s0(Ye,je,H,z,h,U,y),L=s0(ce,_e,j,J,h,U,y),a.moveTo(M.cx+M.x01,M.cy+M.y01),UYn)||!(k>Yn)?a.lineTo(j,J):F>Yn?(M=s0(j,J,ce,_e,d,-F,y),L=s0(H,z,Ye,je,d,-F,y),a.lineTo(M.cx+M.x01,M.cy+M.y01),F=h;--p)a.point(b[p],w[p]);a.lineEnd(),a.areaEnd()}y&&(b[d]=+e(m,d,f),w[d]=+t(m,d,f),a.point(r?+r(m,d,f):b[d],n?+n(m,d,f):w[d]))}if(v)return a=null,v+""||null}function c(){return o7().defined(i).curve(s).context(o)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:yt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:yt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:yt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:yt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:yt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:yt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:yt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),u):s},u.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),u):o},u}const Tre={draw(e,t){const n=Su(t/Xf);e.moveTo(n,0),e.arc(0,0,n,0,Z8)}};function Rre(e,t){let n=null,r=_x(i);e=typeof e=="function"?e:yt(e||Tre),t=typeof t=="function"?t:yt(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:yt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:yt(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function bl(){}function c1(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 Ex(e){this._context=e}Ex.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:c1(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:c1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $re(e){return new Ex(e)}function a7(e){this._context=e}a7.prototype={areaStart:bl,areaEnd:bl,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:c1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ore(e){return new a7(e)}function l7(e){this._context=e}l7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:c1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nre(e){return new l7(e)}function u7(e,t){this._basis=new Ex(e),this._beta=t}u7.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+l*o),this._beta*t[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Mre=function e(t){function n(r){return t===1?new Ex(r):new u7(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function f1(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 BA(e,t){this._context=e,this._k=(1-t)/6}BA.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:f1(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:f1(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 Fre=function e(t){function n(r){return new BA(r,t)}return n.tension=function(r){return e(+r)},n}(0);function jA(e,t){this._context=e,this._k=(1-t)/6}jA.prototype={areaStart:bl,areaEnd:bl,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:f1(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 Dre=function e(t){function n(r){return new jA(r,t)}return n.tension=function(r){return e(+r)},n}(0);function UA(e,t){this._context=e,this._k=(1-t)/6}UA.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:f1(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 Ire=function e(t){function n(r){return new UA(r,t)}return n.tension=function(r){return e(+r)},n}(0);function HA(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Yn){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Yn){var u=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);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,s=(s*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function c7(e,t){this._context=e,this._alpha=t}c7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:HA(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 Pre=function e(t){function n(r){return t?new c7(r,t):new BA(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function f7(e,t){this._context=e,this._alpha=t}f7.prototype={areaStart:bl,areaEnd:bl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:HA(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 Lre=function e(t){function n(r){return t?new f7(r,t):new jA(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function d7(e,t){this._context=e,this._alpha=t}d7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:HA(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 zre=function e(t){function n(r){return t?new d7(r,t):new UA(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function h7(e){this._context=e}h7.prototype={areaStart:bl,areaEnd:bl,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 Bre(e){return new h7(e)}function qF(e){return e<0?-1:1}function YF(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(qF(o)+qF(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function XF(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function n_(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function d1(e){this._context=e}d1.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:n_(this,this._t0,XF(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,n_(this,XF(this,n=YF(this,e,t)),n);break;default:n_(this,this._t0,n=YF(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function p7(e){this._context=new g7(e)}(p7.prototype=Object.create(d1.prototype)).point=function(e,t){d1.prototype.point.call(this,t,e)};function g7(e){this._context=e}g7.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function jre(e){return new d1(e)}function Ure(e){return new p7(e)}function m7(e){this._context=e}m7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=KF(e),i=KF(t),o=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t=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 Gre(e){return new Sx(e,.5)}function Wre(e){return new Sx(e,0)}function Vre(e){return new Sx(e,1)}function dl(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 qre=()=>typeof Image<"u"?Image:null;function ys(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function zl(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const FE=Symbol("implicit");function GA(){var e=new hF,t=[],n=[],r=FE;function i(o){let s=e.get(o);if(s===void 0){if(r!==FE)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new hF;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return GA(t,n).unknown(r)},ys.apply(i,arguments),i}function zd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Wg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Bl(){}var Yu=.7,Kf=1/Yu,Cf="\\s*([+-]?\\d+)\\s*",rg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ts="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yre=/^#([0-9a-f]{3,8})$/,Xre=new RegExp(`^rgb\\(${Cf},${Cf},${Cf}\\)$`),Kre=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),Jre=new RegExp(`^rgba\\(${Cf},${Cf},${Cf},${rg}\\)$`),Qre=new RegExp(`^rgba\\(${ts},${ts},${ts},${rg}\\)$`),Zre=new RegExp(`^hsl\\(${rg},${ts},${ts}\\)$`),eie=new RegExp(`^hsla\\(${rg},${ts},${ts},${rg}\\)$`),JF={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zd(Bl,ig,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:QF,formatHex:QF,formatHex8:tie,formatHsl:nie,formatRgb:ZF,toString:ZF});function QF(){return this.rgb().formatHex()}function tie(){return this.rgb().formatHex8()}function nie(){return y7(this).formatHsl()}function ZF(){return this.rgb().formatRgb()}function ig(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Yre.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?eD(t):n===3?new En(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?a0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?a0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Xre.exec(e))?new En(t[1],t[2],t[3],1):(t=Kre.exec(e))?new En(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Jre.exec(e))?a0(t[1],t[2],t[3],t[4]):(t=Qre.exec(e))?a0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Zre.exec(e))?rD(t[1],t[2]/100,t[3]/100,1):(t=eie.exec(e))?rD(t[1],t[2]/100,t[3]/100,t[4]):JF.hasOwnProperty(e)?eD(JF[e]):e==="transparent"?new En(NaN,NaN,NaN,0):null}function eD(e){return new En(e>>16&255,e>>8&255,e&255,1)}function a0(e,t,n,r){return r<=0&&(e=t=n=NaN),new En(e,t,n,r)}function WA(e){return e instanceof Bl||(e=ig(e)),e?(e=e.rgb(),new En(e.r,e.g,e.b,e.opacity)):new En}function wl(e,t,n,r){return arguments.length===1?WA(e):new En(e,t,n,r??1)}function En(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}zd(En,wl,Wg(Bl,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new En(Fu(this.r),Fu(this.g),Fu(this.b),h1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tD,formatHex:tD,formatHex8:rie,formatRgb:nD,toString:nD}));function tD(){return`#${ku(this.r)}${ku(this.g)}${ku(this.b)}`}function rie(){return`#${ku(this.r)}${ku(this.g)}${ku(this.b)}${ku((isNaN(this.opacity)?1:this.opacity)*255)}`}function nD(){const e=h1(this.opacity);return`${e===1?"rgb(":"rgba("}${Fu(this.r)}, ${Fu(this.g)}, ${Fu(this.b)}${e===1?")":`, ${e})`}`}function h1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ku(e){return e=Fu(e),(e<16?"0":"")+e.toString(16)}function rD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new so(e,t,n,r)}function y7(e){if(e instanceof so)return new so(e.h,e.s,e.l,e.opacity);if(e instanceof Bl||(e=ig(e)),!e)return new so;if(e instanceof so)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n0&&l<1?0:s,new so(s,a,l,e.opacity)}function p1(e,t,n,r){return arguments.length===1?y7(e):new so(e,t,n,r??1)}function so(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}zd(so,p1,Wg(Bl,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new so(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new so(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new En(r_(e>=240?e-240:e+120,i,r),r_(e,i,r),r_(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new so(iD(this.h),l0(this.s),l0(this.l),h1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=h1(this.opacity);return`${e===1?"hsl(":"hsla("}${iD(this.h)}, ${l0(this.s)*100}%, ${l0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function iD(e){return e=(e||0)%360,e<0?e+360:e}function l0(e){return Math.max(0,Math.min(1,e||0))}function r_(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const v7=Math.PI/180,x7=180/Math.PI,g1=18,b7=.96422,w7=1,_7=.82521,E7=4/29,Af=6/29,S7=3*Af*Af,iie=Af*Af*Af;function k7(e){if(e instanceof ns)return new ns(e.l,e.a,e.b,e.opacity);if(e instanceof Ys)return C7(e);e instanceof En||(e=WA(e));var t=a_(e.r),n=a_(e.g),r=a_(e.b),i=i_((.2225045*t+.7168786*n+.0606169*r)/w7),o,s;return t===n&&n===r?o=s=i:(o=i_((.4360747*t+.3850649*n+.1430804*r)/b7),s=i_((.0139322*t+.0971045*n+.7141733*r)/_7)),new ns(116*i-16,500*(o-i),200*(i-s),e.opacity)}function m1(e,t,n,r){return arguments.length===1?k7(e):new ns(e,t,n,r??1)}function ns(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}zd(ns,m1,Wg(Bl,{brighter(e){return new ns(this.l+g1*(e??1),this.a,this.b,this.opacity)},darker(e){return new ns(this.l-g1*(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=b7*o_(t),e=w7*o_(e),n=_7*o_(n),new En(s_(3.1338561*t-1.6168667*e-.4906146*n),s_(-.9787684*t+1.9161415*e+.033454*n),s_(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function i_(e){return e>iie?Math.pow(e,1/3):e/S7+E7}function o_(e){return e>Af?e*e*e:S7*(e-E7)}function s_(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function a_(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function oie(e){if(e instanceof Ys)return new Ys(e.h,e.c,e.l,e.opacity);if(e instanceof ns||(e=k7(e)),e.a===0&&e.b===0)return new Ys(NaN,0=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r()=>e;function O7(e,t){return function(n){return e+n*t}}function aie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Ax(e,t){var n=t-e;return n?O7(e,n>180||n<-180?n-360*Math.round(n/360):n):Cx(isNaN(e)?t:e)}function lie(e){return(e=+e)==1?Sn:function(t,n){return n-t?aie(t,n,e):Cx(isNaN(t)?n:t)}}function Sn(e,t){var n=t-e;return n?O7(e,n):Cx(isNaN(e)?t:e)}const IE=function e(t){var n=lie(t);function r(i,o){var s=n((i=wl(i)).r,(o=wl(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=Sn(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function N7(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:io(r,i)})),n=l_.lastIndex;return n180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:io(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function a(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:io(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,d,h,p){if(u!==f||c!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:io(u,f)},{i:g-2,x:io(c,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,d),s(u.rotate,c.rotate,f,d),a(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Die(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i2?Iie:Die,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(e.map(r),t,n)))(r(s(d)))}return f.invert=function(d){return s(i((u||(u=a(t,e.map(r),io)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,zE),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Vg,c()},f.clamp=function(d){return arguments.length?(s=d?!0:Br,c()):s!==Br},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,c()}}function H7(){return Tx()(Br,Br)}function G7(e,t,n,r){var i=vl(e,t,n),o;switch(r=qu(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=mz(i,s))&&(r.precision=o),IC(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=yz(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=gz(i))&&(r.precision=o-(r.type==="%")*2);break}}return rx(r)}function _c(e){var t=e.domain;return e.ticks=function(n){var r=t();return vE(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return G7(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,u,c=10;for(a0;){if(u=xE(s,a,n),u===l)return r[i]=s,r[o]=a,t(r);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function W7(){var e=H7();return e.copy=function(){return qg(e,W7())},ys.apply(e,arguments),_c(e)}function V7(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,zE),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return V7(e).unknown(t)},e=arguments.length?Array.from(e,zE):[0,1],_c(n)}function q7(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return oMath.pow(e,t)}function jie(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 hD(e){return(t,n)=>-e(-t,n)}function KA(e){const t=e(fD,dD),n=t.domain;let r=10,i,o;function s(){return i=jie(r),o=Bie(r),n()[0]<0?(i=hD(i),o=hD(o),e(Pie,Lie)):e(fD,dD),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=qu(l)).precision==null&&(l.trim=!0),l=rx(l)),a===1/0)return l;const u=Math.max(1,r*a/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*rn(q7(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function Y7(){const e=KA(Tx()).domain([1,10]);return e.copy=()=>qg(e,Y7()).base(e.base()),ys.apply(e,arguments),e}function pD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function JA(e){var t=1,n=e(pD(t),gD(t));return n.constant=function(r){return arguments.length?e(pD(t=+r),gD(t)):t},_c(n)}function X7(){var e=JA(Tx());return e.copy=function(){return qg(e,X7()).constant(e.constant())},ys.apply(e,arguments)}function mD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Uie(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hie(e){return e<0?-e*e:e*e}function QA(e){var t=e(Br,Br),n=1;function r(){return n===1?e(Br,Br):n===.5?e(Uie,Hie):e(mD(n),mD(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},_c(t)}function ZA(){var e=QA(Tx());return e.copy=function(){return qg(e,ZA()).exponent(e.exponent())},ys.apply(e,arguments),e}function Gie(){return ZA.apply(null,arguments).exponent(.5)}function K7(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s0?n[a-1]:e[0],a=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return J7().domain([e,t]).range(i).unknown(o)},ys.apply(_c(s),arguments)}function Q7(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[jg(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Q7().domain(e).range(t).unknown(n)},ys.apply(i,arguments)}function Wie(e){return new Date(e)}function Vie(e){return e instanceof Date?+e:+new Date(+e)}function eT(e,t,n,r,i,o,s,a,l,u){var c=H7(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),g=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),w=u("%Y");function _(k){return(l(k)0?r:1:0}const Jie="identity",Jf="linear",ca="log",Yg="pow",Xg="sqrt",Ox="symlog",Xu="time",Ku="utc",rs="sequential",Bd="diverging",Qf="quantile",Nx="quantize",Mx="threshold",oT="ordinal",jE="point",i9="band",sT="bin-ordinal",mn="continuous",Kg="discrete",Jg="discretizing",Vi="interpolating",aT="temporal";function Qie(e){return function(t){let n=t[0],r=t[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=e.invertExtent(n[o]),i=e.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function lT(){const e=GA().unknown(void 0),t=e.domain,n=e.range;let r=[0,1],i,o,s=!1,a=0,l=0,u=.5;delete e.unknown;function c(){const f=t().length,d=r[1]g+i*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?(r=[+f[0],+f[1]],c()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,c()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(f){return arguments.length?(s=!!f,c()):s},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,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?(l=Math.max(0,Math.min(1,f)),c()):l},e.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return y=Math.max(0,t1(h,g)-1),v=g===m?y:t1(h,m)-1,g-h[y]>o+1e-10&&++y,d&&(b=y,y=p-v,v=p-b),y>v?void 0:t().slice(y,v+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return lT().domain(t()).range(r).round(s).paddingInner(a).paddingOuter(l).align(u)},c()}function o9(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return o9(t())},e}function eoe(){return o9(lT().paddingInner(1))}var toe=Array.prototype.map;function noe(e){return toe.call(e,Zn)}const roe=Array.prototype.slice;function s9(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(jg(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=noe(r),n):e.slice()},n.range=function(r){return arguments.length?(t=roe.call(r),n):t.slice()},n.tickFormat=function(r,i){return G7(e[0],it(e),r??10,i)},n.copy=function(){return s9().domain(n.domain()).range(n.range())},n}const v1=new Map,a9=Symbol("vega_scale");function l9(e){return e[a9]=!0,e}function ioe(e){return e&&e[a9]===!0}function ooe(e,t,n){const r=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?Qie(o):o.invertExtent?Zie(o):void 0),o.type=e,l9(o)};return r.metadata=So(me(n)),r}function pt(e,t,n){return arguments.length>1?(v1.set(e,ooe(e,t,n)),this):u9(e)?v1.get(e):void 0}pt(Jie,V7);pt(Jf,W7,mn);pt(ca,Y7,[mn,ca]);pt(Yg,ZA,mn);pt(Xg,Gie,mn);pt(Ox,X7,mn);pt(Xu,qie,[mn,aT]);pt(Ku,Yie,[mn,aT]);pt(rs,tT,[mn,Vi]);pt(`${rs}-${Jf}`,tT,[mn,Vi]);pt(`${rs}-${ca}`,Z7,[mn,Vi,ca]);pt(`${rs}-${Yg}`,nT,[mn,Vi]);pt(`${rs}-${Xg}`,Xie,[mn,Vi]);pt(`${rs}-${Ox}`,e9,[mn,Vi]);pt(`${Bd}-${Jf}`,t9,[mn,Vi]);pt(`${Bd}-${ca}`,n9,[mn,Vi,ca]);pt(`${Bd}-${Yg}`,rT,[mn,Vi]);pt(`${Bd}-${Xg}`,Kie,[mn,Vi]);pt(`${Bd}-${Ox}`,r9,[mn,Vi]);pt(Qf,K7,[Jg,Qf]);pt(Nx,J7,Jg);pt(Mx,Q7,Jg);pt(sT,s9,[Kg,Jg]);pt(oT,GA,Kg);pt(i9,lT,Kg);pt(jE,eoe,Kg);function u9(e){return v1.has(e)}function Ec(e,t){const n=v1.get(e);return n&&n.metadata[t]}function uT(e){return Ec(e,mn)}function Zf(e){return Ec(e,Kg)}function UE(e){return Ec(e,Jg)}function c9(e){return Ec(e,ca)}function soe(e){return Ec(e,aT)}function f9(e){return Ec(e,Vi)}function d9(e){return Ec(e,Qf)}const aoe=["clamp","base","constant","exponent"];function h9(e,t){const n=t[0],r=it(t)-n;return function(i){return e(n+i*r)}}function Fx(e,t,n){return XA(cT(t||"rgb",n),e)}function p9(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[a]?s[a](e[a]()):0),s)}function cT(e,t){const n=Nie[loe(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function loe(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const uoe={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"},coe={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function m9(e){const t=e.length/6|0,n=new Array(t);for(let r=0;rFx(m9(e)));function fT(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(yD[e]=t,this):yD[e]}const ry="symbol",foe="discrete",doe="gradient",hoe=e=>K(e)?e.map(t=>String(t)):String(e),poe=(e,t)=>e[1]-t[1],goe=(e,t)=>t[1]-e[1];function dT(e,t,n){let r;return ct(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(zg(e.domain())/n||1)))),ye(t)&&(r=t.step,t=t.interval),pe(t)&&(t=e.type===Xu?Id(t):e.type==Ku?Pd(t):Y("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function v9(e,t,n){let r=e.range(),i=r[0],o=it(r),s=poe;if(i>o&&(r=o,o=i,i=r,s=goe),i=Math.floor(i),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],it(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,u)=>!(u%2));t.length<3&&(t=a)}return t}function hT(e,t){return e.bins?v9(e,e.bins):e.ticks?e.ticks(t):e.domain()}function x9(e,t,n,r,i,o){const s=t.type;let a=hoe;if(s===Xu||i===Xu)a=e.timeFormat(r);else if(s===Ku||i===Ku)a=e.utcFormat(r);else if(c9(s)){const l=e.formatFloat(r);if(o||t.bins)a=l;else{const u=b9(t,n,!1);a=c=>u(c)?l(c):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=e.format(r));return a}function b9(e,t,n){const r=hT(e,t),i=e.base(),o=Math.log(i),s=Math.max(1,i*t/r.length),a=l=>{let u=l/Math.pow(i,Math.round(Math.log(l)/o));return u*i1?r[1]-r[0]:r[0],s;for(s=1;sHE[e.type]||e.bins;function E9(e,t,n,r,i,o,s){const a=w9[t.type]&&o!==Xu&&o!==Ku?moe(e,t,i):x9(e,t,n,i,o,s);return r===ry&&xoe(t)?boe(a):r===foe?woe(a):_oe(a)}const boe=e=>(t,n,r)=>{const i=vD(r[n+1],vD(r.max,1/0)),o=xD(t,e),s=xD(i,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},vD=(e,t)=>e??t,woe=e=>(t,n)=>n?e(t):null,_oe=e=>t=>e(t),xD=(e,t)=>Number.isFinite(e)?t(e):null;function Eoe(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+it(t),o=i-r;if(e.type===Mx){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function Soe(e,t,n,r){const i=r||t.type;return pe(n)&&soe(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===Xu?e.timeFormat("%A, %d %B %Y, %X"):!n&&i===Ku?e.utcFormat("%A, %d %B %Y, %X UTC"):E9(e,t,5,null,n,r,!0)}function S9(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Soe(e,t,n.format,n.formatType);if(UE(t.type)){const o=_9(t).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(Zf(t.type)){const o=t.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${i(o[0])} to ${i(it(o))}`}}let k9=0;function koe(){k9=0}const x1="p_";function pT(e){return e&&e.gradient}function C9(e,t,n){const r=e.gradient;let i=e.id,o=r==="radial"?x1:"";return i||(i=e.id="gradient_"+k9++,r==="radial"?(e.x1=Bo(e.x1,.5),e.y1=Bo(e.y1,.5),e.r1=Bo(e.r1,0),e.x2=Bo(e.x2,.5),e.y2=Bo(e.y2,.5),e.r2=Bo(e.r2,.5),o=x1):(e.x1=Bo(e.x1,0),e.y1=Bo(e.y1,0),e.x2=Bo(e.x2,1),e.y2=Bo(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function Bo(e,t){return e??t}function A9(e,t){var n=[],r;return r={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(i,o){return n.push({offset:i,color:o}),r}}}const bD={basis:{curve:$re},"basis-closed":{curve:Ore},"basis-open":{curve:Nre},bundle:{curve:Mre,tension:"beta",value:.85},cardinal:{curve:Fre,tension:"tension",value:0},"cardinal-open":{curve:Ire,tension:"tension",value:0},"cardinal-closed":{curve:Dre,tension:"tension",value:0},"catmull-rom":{curve:Pre,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Lre,tension:"alpha",value:.5},"catmull-rom-open":{curve:zre,tension:"alpha",value:.5},linear:{curve:zA},"linear-closed":{curve:Bre},monotone:{horizontal:Ure,vertical:jre},natural:{curve:Hre},step:{curve:Gre},"step-after":{curve:Vre},"step-before":{curve:Wre}};function gT(e,t,n){var r=Oe(bD,e)&&bD[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const Coe={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Aoe=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Toe=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Roe=/^((\s+,?\s*)|(,\s*))/,$oe=/^[01]/;function ed(e){const t=[];return(e.match(Aoe)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=Coe[o],a=Ooe(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,y=f/n,v=-f/r,b=d/r,w=m*a+y*l,_=v*a+b*l,k=m*e+y*t,E=v*e+b*t;let N=1/((k-w)*(k-w)+(E-_)*(E-_))-.25;N<0&&(N=0);let O=Math.sqrt(N);o==i&&(O=-O);const F=.5*(w+k)-O*(E-_),U=.5*(_+E)+O*(k-w),M=Math.atan2(_-U,w-F);let I=Math.atan2(E-U,k-F)-M;I<0&&o===1?I+=Xo:I>0&&o===0&&(I-=Xo);const B=Math.ceil(Math.abs(I/(mu+.001))),H=[];for(let z=0;z+e}function c0(e,t,n){return Math.max(t,Math.min(e,n))}function $9(){var e=Poe,t=Loe,n=zoe,r=Boe,i=Os(0),o=i,s=i,a=i,l=null;function u(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+r.call(this,c),v=Math.min(m,y)/2,b=c0(+i.call(this,c),0,v),w=c0(+o.call(this,c),0,v),_=c0(+s.call(this,c),0,v),k=c0(+a.call(this,c),0,v);if(l||(l=h=wx()),b<=0&&w<=0&&_<=0&&k<=0)l.rect(p,g,m,y);else{var E=p+m,A=g+y;l.moveTo(p+b,g),l.lineTo(E-w,g),l.bezierCurveTo(E-Aa*w,g,E,g+Aa*w,E,g+w),l.lineTo(E,A-k),l.bezierCurveTo(E,A-Aa*k,E-Aa*k,A,E-k,A),l.lineTo(p+_,A),l.bezierCurveTo(p+Aa*_,A,p,A-Aa*_,p,A-_),l.lineTo(p,g+b),l.bezierCurveTo(p,g+Aa*b,p+Aa*b,g,p+b,g),l.closePath()}if(h)return l=null,h+""||null}return u.x=function(c){return arguments.length?(e=Os(c),u):e},u.y=function(c){return arguments.length?(t=Os(c),u):t},u.width=function(c){return arguments.length?(n=Os(c),u):n},u.height=function(c){return arguments.length?(r=Os(c),u):r},u.cornerRadius=function(c,f,d,h){return arguments.length?(i=Os(c),o=f!=null?Os(f):i,a=d!=null?Os(d):i,s=h!=null?Os(h):o,u):i},u.context=function(c){return arguments.length?(l=c??null,u):l},u}function O9(){var e,t,n,r,i=null,o,s,a,l;function u(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var y=Math.sqrt(g*g+m*m),v=(g/=y)*l,b=(m/=y)*l,w=Math.atan2(m,g);i.moveTo(s-v,a-b),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,w-Math.PI,w),i.lineTo(s+v,a+b),i.arc(s,a,l,w,w+Math.PI)}else i.arc(f,d,p,0,Xo);i.closePath()}else o=1;s=f,a=d,l=p}function c(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=wx()),d=0;d<=h;++d)!(de.x||0,em=e=>e.y||0,joe=e=>e.width||0,Uoe=e=>e.height||0,Hoe=e=>(e.x||0)+(e.width||0),Goe=e=>(e.y||0)+(e.height||0),Woe=e=>e.startAngle||0,Voe=e=>e.endAngle||0,qoe=e=>e.padAngle||0,Yoe=e=>e.innerRadius||0,Xoe=e=>e.outerRadius||0,Koe=e=>e.cornerRadius||0,Joe=e=>Qg(e.cornerRadiusTopLeft,e.cornerRadius)||0,Qoe=e=>Qg(e.cornerRadiusTopRight,e.cornerRadius)||0,Zoe=e=>Qg(e.cornerRadiusBottomRight,e.cornerRadius)||0,ese=e=>Qg(e.cornerRadiusBottomLeft,e.cornerRadius)||0,tse=e=>Qg(e.size,64),nse=e=>e.size||1,Dx=e=>e.defined!==!1,rse=e=>R9(e.shape||"circle"),ise=Are().startAngle(Woe).endAngle(Voe).padAngle(qoe).innerRadius(Yoe).outerRadius(Xoe).cornerRadius(Koe),ose=s7().x(Zg).y1(em).y0(Goe).defined(Dx),sse=s7().y(em).x1(Zg).x0(Hoe).defined(Dx),ase=o7().x(Zg).y(em).defined(Dx),lse=$9().x(Zg).y(em).width(joe).height(Uoe).cornerRadius(Joe,Qoe,Zoe,ese),use=Rre().type(rse).size(tse),cse=O9().x(Zg).y(em).defined(Dx).size(nse);function mT(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function fse(e,t){return ise.context(e)(t)}function dse(e,t){const n=t[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?sse:ose).curve(gT(r,n.orient,n.tension)).context(e)(t)}function hse(e,t){const n=t[0],r=n.interpolate||"linear";return ase.curve(gT(r,n.orient,n.tension)).context(e)(t)}function jd(e,t,n,r){return lse.context(e)(t,n,r)}function pse(e,t){return(t.mark.shape||t.shape).context(e)(t)}function gse(e,t){return use.context(e)(t)}function mse(e,t){return cse.context(e)(t)}var N9=1;function M9(){N9=1}function yT(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+N9++),s=i.clipping[o]||(i.clipping[o]={id:o});return Ve(r)?s.path=r(null):mT(n)?s.path=jd(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function sn(e){this.clear(),e&&this.union(e)}sn.prototype={clone(){return new sn(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,r){return nthis.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 r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(e),l=Math.sin(e),u=t-t*a+n*l,c=n-t*l-n*a;return[a*r-l*i+u,l*r+a*i+c,a*r-l*s+u,l*r+a*s+c,a*o-l*i+u,l*o+a*i+c,a*o-l*s+u,l*o+a*s+c]},union(e){return e.x1this.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=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.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Ix(e){this.mark=e,this.bounds=this.bounds||new sn}function Px(e){Ix.call(this,e),this.items=this.items||[]}oe(Px,Ix);function vT(e){this._pending=0,this._loader=e||ux()}function SD(e){e._pending+=1}function xh(e){e._pending-=1}vT.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return SD(t),t._loader.sanitize(e,{context:"href"}).then(n=>(xh(t),n)).catch(()=>(xh(t),null))},loadImage(e){const t=this,n=qre();return SD(t),t._loader.sanitize(e,{context:"image"}).then(r=>{const i=r.href;if(!i||!n)throw{url:i};const o=new n,s=Oe(r,"crossOrigin")?r.crossOrigin:"anonymous";return s!=null&&(o.crossOrigin=s),o.onload=()=>xh(t),o.onerror=()=>xh(t),o.src=i,o}).catch(r=>(xh(t),{complete:!1,width:0,height:0,src:r&&r.url||""}))},ready(){const e=this;return new Promise(t=>{function n(r){e.pending()?setTimeout(()=>{n(!0)},10):t(r)}n(!1)})}};function ga(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const r=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(r+(n?yse(t,r):0))}return e}function yse(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const vse=Xo-1e-8;let Lx,iy,oy,Cu,GE,sy,WE,VE;const Wa=(e,t)=>Lx.add(e,t),ay=(e,t)=>Wa(iy=e,oy=t),kD=e=>Wa(e,Lx.y1),CD=e=>Wa(Lx.x1,e),yu=(e,t)=>GE*e+WE*t,vu=(e,t)=>sy*e+VE*t,d_=(e,t)=>Wa(yu(e,t),vu(e,t)),h_=(e,t)=>ay(yu(e,t),vu(e,t));function tm(e,t){return Lx=e,t?(Cu=t*_l,GE=VE=Math.cos(Cu),sy=Math.sin(Cu),WE=-sy):(GE=VE=1,Cu=sy=WE=0),xse}const xse={beginPath(){},closePath(){},moveTo:h_,lineTo:h_,rect(e,t,n,r){Cu?(d_(e+n,t),d_(e+n,t+r),d_(e,t+r),h_(e,t)):(Wa(e+n,t+r),ay(e,t))},quadraticCurveTo(e,t,n,r){const i=yu(e,t),o=vu(e,t),s=yu(n,r),a=vu(n,r);AD(iy,i,s,kD),AD(oy,o,a,CD),ay(s,a)},bezierCurveTo(e,t,n,r,i,o){const s=yu(e,t),a=vu(e,t),l=yu(n,r),u=vu(n,r),c=yu(i,o),f=vu(i,o);TD(iy,s,l,c,kD),TD(oy,a,u,f,CD),ay(c,f)},arc(e,t,n,r,i,o){if(r+=Cu,i+=Cu,iy=n*Math.cos(i)+e,oy=n*Math.sin(i)+t,Math.abs(i-r)>vse)Wa(e-n,t-n),Wa(e+n,t+n);else{const s=u=>Wa(n*Math.cos(u)+e,n*Math.sin(u)+t);let a,l;if(s(r),s(i),i!==r)if(r=r%Xo,r<0&&(r+=Xo),i=i%Xo,i<0&&(i+=Xo),ii;++l,a-=mu)s(a);else for(a=r-r%mu+mu,l=0;l<4&&aNoe?(c=s*s+a*o,c>=0&&(c=Math.sqrt(c),l=(-s+c)/o,u=(-s-c)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=I9(e,t,t.fill),!0):!1}var wse=[];function nd(e,t,n){var r=(r=t.strokeWidth)!=null?r:1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=I9(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||wse),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function _se(e,t){return e.zindex-t.zindex||e.index-t.index}function wT(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,o;for(i=0,o=t.length;i=0;)if(r=t(n[i]))return r;if(n===o){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function _T(e){return function(t,n,r){Co(n,i=>{(!r||r.intersects(i.bounds))&&P9(e,t,i,i)})}}function Ese(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&P9(e,t,n.items[0],n.items)}}function P9(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(td(t,n),n.fill&&b1(t,n,i)&&t.fill(),n.stroke&&nd(t,n,i)&&t.stroke()))}function zx(e){return e=e||zi,function(t,n,r,i,o,s){return r*=t.pixelRatio,i*=t.pixelRatio,w1(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&e(t,a,r,i,o,s))return a})}}function nm(e,t){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=t??s.fill,l=s.stroke&&n.isPointInStroke,u,c;return l&&(u=s.strokeWidth,c=s.strokeCap,n.lineWidth=u??1,n.lineCap=c??"butt"),e(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function ET(e){return zx(nm(e))}function Iu(e,t){return"translate("+e+","+t+")"}function ST(e){return"rotate("+e+")"}function Sse(e,t){return"scale("+e+","+t+")"}function L9(e){return Iu(e.x||0,e.y||0)}function kse(e){return Iu(e.x||0,e.y||0)+(e.angle?" "+ST(e.angle):"")}function Cse(e){return Iu(e.x||0,e.y||0)+(e.angle?" "+ST(e.angle):"")+(e.scaleX||e.scaleY?" "+Sse(e.scaleX||1,e.scaleY||1):"")}function kT(e,t,n){function r(s,a){s("transform",kse(a)),s("d",t(null,a))}function i(s,a){return t(tm(s,a.angle),a),ga(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,u=a.y||0,c=a.angle||0;s.translate(l,u),c&&s.rotate(c*=_l),s.beginPath(),t(s,a),c&&s.rotate(-c),s.translate(-l,-u)}return{type:e,tag:"path",nested:!1,attr:r,bound:i,draw:_T(o),pick:ET(o),isect:n||xT(o)}}var Ase=kT("arc",fse);function Tse(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],r=e[0].orient==="horizontal"?"y":"x",i=e.length,o=1/0,s,a;--i>=0;)e[i].defined!==!1&&(a=Math.abs(e[i][r]-n),a=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],o=e[r].y-t[1],s=i*i+o*o,s=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],o=r*r+i*i,r=e[n].size||1,o.5&&t<1.5?.5-Math.abs(t-1):0}function Mse(e,t){e("transform",L9(t))}function j9(e,t){const n=B9(t);e("d",jd(null,t,n,n))}function Fse(e,t){e("class","background"),e("aria-hidden",!0),j9(e,t)}function Dse(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?j9(e,t):e("d","")}function Ise(e,t,n){const r=t.clip?yT(n,t,t):null;e("clip-path",r)}function Pse(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let i=0;i{const i=r.x||0,o=r.y||0,s=r.strokeForeground,a=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&a&&(ag(e,r,i,o),td(e,r),r.fill&&b1(e,r,a)&&e.fill(),r.stroke&&!s&&nd(e,r,a)&&e.stroke()),e.save(),e.translate(i,o),r.clip&&z9(e,r),n&&n.translate(-i,-o),Co(r,l=>{this.draw(e,l,n)}),n&&n.translate(i,o),e.restore(),s&&r.stroke&&a&&(ag(e,r,i,o),td(e,r),nd(e,r,a)&&e.stroke())})}function Use(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const s=n*e.pixelRatio,a=r*e.pixelRatio;return w1(t,l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(i,o))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,g&&mT(l)&&!Bse(e,l,s,a))return e.restore(),null;const m=l.strokeForeground,y=t.interactive!==!1;return y&&m&&l.stroke&&zse(e,l,s,a)?(e.restore(),l):(u=w1(l,v=>Hse(v,c,f)?this.pick(v,n,r,c,f):null),!u&&y&&(l.fill||!m&&l.stroke)&&Lse(e,l,s,a)&&(u=l),e.restore(),u||null)})}function Hse(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var Gse={type:"group",tag:"g",nested:!1,attr:Mse,bound:Pse,draw:jse,pick:Use,isect:F9,content:Ise,background:Fse,foreground:Dse},lg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function AT(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(r=>{e.image=r,e.image.url=e.url})),n}function TT(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 RT(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 Bx(e,t){return e==="center"?t/2:e==="right"?t:0}function jx(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function Wse(e,t,n){const r=AT(t,n),i=TT(t,r),o=RT(t,r),s=(t.x||0)-Bx(t.align,i),a=(t.y||0)-jx(t.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",l,lg["xmlns:xlink"],"xlink:href"),e("transform",Iu(s,a)),e("width",i),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function Vse(e,t){const n=t.image,r=TT(t,n),i=RT(t,n),o=(t.x||0)-Bx(t.align,r),s=(t.y||0)-jx(t.baseline,i);return e.set(o,s,o+r,s+i)}function qse(e,t,n){Co(t,r=>{if(n&&!n.intersects(r.bounds))return;const i=AT(r,this);let o=TT(r,i),s=RT(r,i);if(o===0||s===0)return;let a=(r.x||0)-Bx(r.align,o),l=(r.y||0)-jx(r.baseline,s),u,c,f,d;r.aspect!==!1&&(c=i.width/i.height,f=r.width/r.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&U9(e,r,i)&&(td(e,r),e.stroke())}})}function oae(e,t,n,r){return e.isPointInStroke?U9(e,t,1)&&e.isPointInStroke(n,r):!1}var sae={type:"rule",tag:"line",nested:!1,attr:nae,bound:rae,draw:iae,pick:zx(oae),isect:D9},aae=kT("shape",pse),lae=kT("symbol",gse,bT);const ND=K6();var xo={height:vs,measureWidth:$T,estimateWidth:YE,width:YE,canvas:H9};H9(!0);function H9(e){xo.width=e&&hl?$T:YE}function YE(e,t){return G9(Sl(e,t),vs(e))}function G9(e,t){return~~(.8*e.length*t)}function $T(e,t){return vs(e)<=0||!(t=Sl(e,t))?0:W9(t,Ux(e))}function W9(e,t){const n=`(${t}) ${e}`;let r=ND.get(n);return r===void 0&&(hl.font=t,r=hl.measureText(e).width,ND.set(n,r)),r}function vs(e){return e.fontSize!=null?+e.fontSize||0:11}function El(e){return e.lineHeight!=null?e.lineHeight:vs(e)+2}function uae(e){return K(e)?e.length>1?e:e[0]:e}function rm(e){return uae(e.lineBreak&&e.text&&!K(e.text)?e.text.split(e.lineBreak):e.text)}function OT(e){const t=rm(e);return(K(t)?t.length-1:0)*El(e)}function Sl(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?fae(e,n):n}function cae(e){if(xo.width===$T){const t=Ux(e);return n=>W9(n,t)}else{const t=vs(e);return n=>G9(n,t)}}function fae(e,t){var n=+e.limit,r=cae(e);if(r(t)>>1,r(t.slice(l))>n?s=l+1:a=l;return i+t.slice(s)}else{for(;s>>1),r(t.slice(0,l))Math.max(d,xo.width(t,h)),0)):f=xo.width(t,c),i==="center"?l-=f/2:i==="right"&&(l-=f),e.set(l+=s,u+=a,l+f,u+r),t.angle&&!n)e.rotate(t.angle*_l,s,a);else if(n===2)return e.rotatedPoints(t.angle*_l,s,a);return e}function pae(e,t,n){Co(t,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,u,c,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(e.font=Ux(r),e.textAlign=r.align||"left",o=Hx(r),s=o.x1,a=o.y1,r.angle&&(e.save(),e.translate(s,a),e.rotate(r.angle*_l),s=a=0),s+=r.dx||0,a+=(r.dy||0)+NT(r),c=rm(r),td(e,r),K(c))for(u=El(r),l=0;lt;)e.removeChild(n[--r]);return e}function J9(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Gx(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function bae(e,t,n,r){var i=e&&e.mark,o,s;if(i&&(o=yi[i.marktype]).tip){for(s=Gx(t,n),s[0]-=r[0],s[1]-=r[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(i.items,s)}return e}function kl(e,t){this._active=null,this._handlers={},this._loader=e||ux(),this._tooltip=t||wae}function wae(e,t,n,r){e.element().setAttribute("title",r||"")}kl.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const r in t)n.push(...t[r]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(r=>{const i=new MouseEvent(e.type,e),o=Va(null,"a");for(const s in r)o.setAttribute(s,r[s]);o.dispatchEvent(i)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=bae(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),s=i.height();let a=i.x1+r[0]+n.left,l=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,l+=e.y||0;return{x:a,y:l,width:o,height:s,left:a,top:l,right:a+o,bottom:l+s}}};function xs(e){this._el=null,this._bgcolor=null,this._loader=new vT(e)}xs.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const i=n._call;n._ready=n._loader.ready().then(o=>{o&&i(),n._ready=null})}return r},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const _ae="keydown",Eae="keypress",Sae="keyup",Q9="dragenter",uy="dragleave",Z9="dragover",KE="mousedown",kae="mouseup",_1="mousemove",xp="mouseout",eB="mouseover",E1="click",Cae="dblclick",Aae="wheel",tB="mousewheel",S1="touchstart",k1="touchmove",C1="touchend",Tae=[_ae,Eae,Sae,Q9,uy,Z9,KE,kae,_1,xp,eB,E1,Cae,Aae,tB,S1,k1,C1],JE=_1,ug=xp,QE=E1;function om(e,t){kl.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}const Rae=e=>e===S1||e===k1||e===C1?[S1,k1,C1]:[e];function FD(e,t){Rae(t).forEach(n=>$ae(e,n))}function $ae(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?r=>e[t](r):r=>e.fire(t,r)))}function DD(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?this.fire(e,r):((!i||!i.exit)&&this.fire(n,r),this._active=o,this.fire(t,r),this.fire(e,r))}}function ID(e){return function(t){this.fire(e,t),this._active=null}}oe(om,kl,{initialize(e,t,n){return this._canvas=e&&DT(e,"canvas"),[E1,KE,_1,xp,uy].forEach(r=>FD(this,r)),kl.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:Tae,DOMMouseScroll(e){this.fire(tB,e)},mousemove:DD(_1,eB,xp),dragover:DD(Z9,Q9,uy),mouseout:ID(xp),dragleave:ID(uy),mousedown(e){this._down=this._active,this.fire(KE,e)},click(e){this._down===this._active&&(this.fire(E1,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(S1,e,!0)},touchmove(e){this.fire(k1,e,!0)},touchend(e){this.fire(C1,e,!0),this._touch=null},fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===QE&&r&&r.href?this.handleHref(t,r,r.href):(e===JE||e===ug)&&this.handleTooltip(t,r,e!==ug),i)for(let o=0,s=i.length;o=0&&r.splice(i,1),this},pickEvent(e){const t=Gx(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,r,i){const o=this.context();return yi[e.marktype].pick.call(this,o,e,t,n,r,i)}});function Oae(){return typeof window<"u"&&window.devicePixelRatio||1}var Nae=Oae();function Mae(e,t,n,r,i,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=s?Nae:i;e.width=t*l,e.height=n*l;for(const u in o)a[u]=o[u];return s&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),e}function A1(e){xs.call(this,e),this._options={},this._redraw=!1,this._dirty=new sn,this._tempb=new sn}const PD=xs.prototype,Fae=(e,t,n)=>new sn().set(0,0,t,n).translate(-e[0],-e[1]);function Dae(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}oe(A1,xs,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:dl(1,1,this._options.type),e&&this._canvas&&(ao(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),PD.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(PD.resize.call(this,e,t,n,r),this._canvas)Mae(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const i=this._options.externalContext;i||Y("CanvasRenderer is missing a valid canvas or context"),i.scale(this._scale,this._scale),i.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(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,s=Fae(n,r,i);t.save();const a=this._redraw||o.empty()?(this._redraw=!1,s.expand(1)):Dae(t,s.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,a),t.restore(),o.clear(),this},draw(e,t,n){const r=yi[t.marktype];t.clip&&Nse(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();i.type!=="pdf"&&!i.externalContext&&o.clearRect(e,t,n,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});function IT(e,t){kl.call(this,e,t);const n=this;n._hrefHandler=ZE(n,(r,i)=>{i&&i.href&&n.handleHref(r,i,i.href)}),n._tooltipHandler=ZE(n,(r,i)=>{n.handleTooltip(r,i,r.type!==ug)})}const ZE=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)};oe(IT,kl,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(QE,this._hrefHandler),r.removeEventListener(JE,this._tooltipHandler),r.removeEventListener(ug,this._tooltipHandler)),this._svg=r=e&&DT(e,"svg"),r&&(r.addEventListener(QE,this._hrefHandler),r.addEventListener(JE,this._tooltipHandler),r.addEventListener(ug,this._tooltipHandler)),kl.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const o={type:e,handler:t,listener:ZE(this,t)};(r[n]||(r[n]=[])).push(o),this._svg&&this._svg.addEventListener(n,o.listener)}return this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const nB="aria-hidden",PT="aria-label",LT="role",zT="aria-roledescription",rB="graphics-object",BT="graphics-symbol",iB=(e,t,n)=>({[LT]:e,[zT]:t,[PT]:n||void 0}),Iae=So(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),LD={axis:{desc:"axis",caption:zae},legend:{desc:"legend",caption:Bae},"title-text":{desc:"title",caption:e=>`Title text '${BD(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${BD(e)}'`}},zD={ariaRole:LT,ariaRoleDescription:zT,description:PT};function oB(e,t){const n=t.aria===!1;if(e(nB,n||void 0),n||t.description==null)for(const r in zD)e(zD[r],void 0);else{const r=t.mark.marktype;e(PT,t.description),e(LT,t.ariaRole||(r==="group"?rB:BT)),e(zT,t.ariaRoleDescription||`${r} mark`)}}function sB(e){return e.aria===!1?{[nB]:!0}:Iae[e.role]?null:LD[e.role]?Lae(e,LD[e.role]):Pae(e)}function Pae(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(r=>r.description!=null&&r.aria!==!1);return iB(n?rB:BT,`${t} mark container`,e.description)}function Lae(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return iB(t.role||BT,t.desc,n.description||r(n))}catch{return null}}function BD(e){return me(e.text).join(" ")}function zae(e){const t=e.datum,n=e.orient,r=t.title?aB(e):null,i=e.context,o=i.scales[t.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${Zf(a)?"discrete":a} scale with ${S9(s,o,e)}`}function Bae(e){const t=e.datum,n=t.title?aB(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),s=e.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return Uae(r)+(n?` titled '${n}'`:"")+` for ${jae(o)} with ${S9(l,a,e)}`}function aB(e){try{return me(it(e.items).items[0].text).join(" ")}catch{return null}}function jae(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+it(e)}function Uae(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const lB=e=>(e+"").replace(/&/g,"&").replace(//g,">"),Hae=e=>lB(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function jT(){let e="",t="",n="";const r=[],i=()=>t=n="",o=l=>{t&&(e+=`${t}>${n}`,i()),r.push(l)},s=(l,u)=>(u!=null&&(t+=` ${l}="${Hae(u)}"`),a),a={open(l){o(l),t="<"+l;for(var u=arguments.length,c=new Array(u>1?u-1:0),f=1;f${n}`:"/>"):e+=``,i(),a},attr:s,text:l=>(n+=lB(l),a),toString:()=>e};return a}const uB=e=>cB(jT(),e)+"";function cB(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let i=0;i{u.dirty=t})),!r.zdirty){if(n.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null;continue}n=o.nested?r.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,UD(n,t)):this._update(o,n._svg,n),n._update=t)}return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=yi[t.marktype],o=t.interactive===!1?"none":null,s=i.tag==="g",a=HD(t,e,n,"g",r);a.setAttribute("class",J9(t));const l=sB(t);for(const d in l)hr(a,d,l[d]);s||hr(a,"pointer-events",o),hr(a,"clip-path",t.clip?yT(this,t,t.group):null);let u=null,c=0;const f=d=>{const h=this.isDirty(d),p=HD(d,a,u,i.tag,r);h&&(this._update(i,p,d),s&&Vae(this,p,d)),u=p,++c};return i.nested?t.items.length&&f(t.items[0]):Co(t,f),ao(a,c),a},_update(e,t,n){Xs=t,Kn=t.__values__,oB(bp,n),e.attr(bp,n,this);const r=Yae[e.type];r&&r.call(this,e,t,n),Xs&&this.style(Xs,n)},style(e,t){if(t!=null){for(const n in T1){let r=n==="font"?im(t):t[n];if(r===Kn[n])continue;const i=T1[n];r==null?e.removeAttribute(i):(pT(r)&&(r=C9(r,this._defs.gradient,dB())),e.setAttribute(i,r+"")),Kn[n]=r}for(const n in R1)cy(e,R1[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=Pr(e,bh+1,"defs",cn)),r=Gae(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=Pr(e,bh+1,"defs",cn)),r=Wae(n,t.clipping[i],r);n&&(r===0?(e.removeChild(n),t.el=null):ao(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});function UD(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 Gae(e,t,n){let r,i,o;if(t.gradient==="radial"){let s=Pr(e,n++,"pattern",cn);qa(s,{id:x1+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=Pr(s,0,"rect",cn),qa(s,{width:1,height:1,fill:`url(${dB()}#${t.id})`}),e=Pr(e,n++,"radialGradient",cn),qa(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Pr(e,n++,"linearGradient",cn),qa(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r{r=e.mark(t,o,r),++i}),ao(t,1+i)}function HD(e,t,n,r,i){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=Va(s,r,cn),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},r==="g"))){const a=Va(s,"path",cn);o.appendChild(a),a.__data__=e;const l=Va(s,"g",cn);o.appendChild(l),l.__data__=e;const u=Va(s,"path",cn);o.appendChild(u),u.__data__=e,u.__values__={fill:"default"}}return(o.ownerSVGElement!==i||qae(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function qae(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Xs=null,Kn=null;const Yae={group(e,t,n){const r=Xs=t.childNodes[2];Kn=r.__values__,e.foreground(bp,n,this),Kn=t.__values__,Xs=t.childNodes[1],e.content(bp,n,this);const i=Xs=t.childNodes[0];e.background(bp,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==Kn.events&&(hr(r,"pointer-events",o),hr(i,"pointer-events",o),Kn.events=o),n.strokeForeground&&n.stroke){const s=n.fill;hr(r,"display",null),this.style(i,n),hr(i,"stroke",null),s&&(n.fill=null),Kn=r.__values__,this.style(r,n),s&&(n.fill=s),Xs=null}else hr(r,"display","none")},image(e,t,n){n.smooth===!1?(cy(t,"image-rendering","optimizeSpeed"),cy(t,"image-rendering","pixelated")):cy(t,"image-rendering",null)},text(e,t,n){const r=rm(n);let i,o,s,a;K(r)?(o=r.map(l=>Sl(n,l)),i=o.join(` -`),i!==Kn.text&&(ao(t,0),s=t.ownerDocument,a=El(n),o.forEach((l,u)=>{const c=Va(s,"tspan",cn);c.__data__=n,c.textContent=l,u&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Kn.text=i)):(o=Sl(n,r),o!==Kn.text&&(t.textContent=o,Kn.text=o)),hr(t,"font-family",im(n)),hr(t,"font-size",vs(n)+"px"),hr(t,"font-style",n.fontStyle),hr(t,"font-variant",n.fontVariant),hr(t,"font-weight",n.fontWeight)}};function bp(e,t,n){t!==Kn[e]&&(n?Xae(Xs,e,t,n):hr(Xs,e,t),Kn[e]=t)}function cy(e,t,n){n!==Kn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Kn[t]=n)}function qa(e,t){for(const n in t)hr(e,n,t[n])}function hr(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function Xae(e,t,n,r){n!=null?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}function dB(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function HT(e){xs.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}oe(HT,xs,{svg(){return this._text},_render(e){const t=jT();t.open("svg",We({},lg,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&n!=="transparent"&&n!=="none"&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",fB,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=yi[t.marktype],r=n.tag,i=[oB,n.attr];e.open("g",{class:J9(t),"clip-path":t.clip?yT(this,t,t.group):null},sB(t),{"pointer-events":r!=="g"&&t.interactive===!1?"none":null});const o=s=>{const a=this.href(s);if(a&&e.open("a",a),e.open(r,this.attr(t,s,i,r!=="g"?r:null)),r==="text"){const l=rm(s);if(K(l)){const u={x:0,dy:El(s)};for(let c=0;cthis.mark(e,f)),e.close(),l&&c?(u&&(s.fill=null),s.stroke=c,e.open("path",this.attr(t,s,n.foreground,"bgrect")).close(),u&&(s.fill=u)):e.open("path",this.attr(t,s,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):Co(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[t]=r})}return null},attr(e,t,n,r){const i={},o=(s,a,l,u)=>{i[u||s]=a};return Array.isArray(n)?n.forEach(s=>s(o,t,this)):n(o,t,this),r&&Kae(i,t,e,r,this._defs),i},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open("defs");for(const i in t){const o=t[i],s=o.stops;o.gradient==="radial"?(e.open("pattern",{id:x1+i,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+i+")"}).close(),e.close(),e.open("radialGradient",{id:i,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):e.open("linearGradient",{id:i,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let a=0;a1?(rd[e]=t,this):rd[e]}function yB(e,t,n){const r=[],i=new sn().union(t),o=e.marktype;return o?vB(e,i,n,r):o==="group"?xB(e,i,n,r):Y("Intersect scene must be mark node or group item.")}function vB(e,t,n,r){if(Jae(e,t,n)){const i=e.items,o=e.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!GT(e[i],t[i],i))return!1;return typeof e==typeof t}function ele(){M9(),koe()}const id="top",lo="left",co="right",Cl="bottom",tle="top-left",nle="top-right",rle="bottom-left",ile="bottom-right",WT="start",eS="middle",gr="end",ole="x",sle="y",Vx="group",VT="axis",qT="title",ale="frame",lle="scope",YT="legend",EB="row-header",SB="row-footer",kB="row-title",CB="column-header",AB="column-footer",TB="column-title",ule="padding",cle="symbol",RB="fit",$B="fit-x",OB="fit-y",fle="pad",XT="none",f0="all",tS="each",KT="flush",Xa="column",Ka="row";function NB(e){G.call(this,null,e)}oe(NB,G,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=yi[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=d0(r,s),r.items.forEach(u=>{u.bounds.clear().union(a)});else if(i===Vx||e.modified())switch(t.visit(t.MOD,u=>n.dirty(u)),a.clear(),r.items.forEach(u=>a.union(d0(u,s))),r.role){case VT:case YT:case qT:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,u=>{a.union(d0(u,s))}),t.visit(t.MOD,u=>{l=l||a.alignsWith(u.bounds),n.dirty(u),a.union(d0(u,s))}),l&&(a.clear(),r.items.forEach(u=>a.union(u.bounds)));return wB(r),t.modifies("bounds")}});function d0(e,t,n){return t(e.bounds.clear(),e,n)}const GD=":vega_identifier:";function JT(e){G.call(this,0,e)}JT.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};oe(JT,G,{transform(e,t){const n=dle(t.dataflow),r=e.as;let i=n.value;return t.visit(t.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),t}});function dle(e){return e._signals[GD]||(e._signals[GD]=e.add(0))}function MB(e){G.call(this,null,e)}oe(MB,G,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,hle(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 r=n.marktype===Vx?Px:Ix;return t.visit(t.ADD,i=>r.call(i,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 hle(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 FB(e){G.call(this,null,e)}const WD={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((r,i)=>!i||!DB(n.bounds,r.bounds,t)?(n=r,1):r.opacity=0)}},DB=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),VD=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,o;n{const t=e.bounds;return t.width()>1&&t.height()>1},gle=(e,t,n)=>{var r=e.range(),i=new sn;return t===id||t===Cl?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},qD=e=>(e.forEach(t=>t.opacity=1),e),YD=(e,t)=>e.reflow(t.modified()).modifies("opacity");oe(FB,G,{transform(e,t){const n=WD[e.method]||WD.parity,r=e.separation||0;let i=t.materialize(t.SOURCE).source,o,s;if(!i||!i.length)return;if(!e.method)return e.modified("method")&&(qD(i),t=YD(t,e)),t;if(i=i.filter(ple),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),o=qD(i),t=YD(t,e),o.length>=3&&VD(o,r)){do o=n(o,r);while(o.length>=3&&VD(o,r));o.length<3&&!it(i).opacity&&(o.length>1&&(it(o).opacity=0),it(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=gle(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function IB(e){G.call(this,null,e)}oe(IB,G,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,r=>n.dirty(r)),t.fields&&t.fields.zindex){const r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});const Xn=new sn;function gf(e,t,n){return e[t]===n?0:(e[t]=n,1)}function mle(e){var t=e.items[0].orient;return t===lo||t===co}function yle(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function vle(e,t,n,r){var i=t.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=yle(o),u=i.range,c=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,y=p&&OT(p),v=0,b=0,w,_;switch(Xn.clear().union(m),m.clear(),(w=l[0])>-1&&m.union(i.items[w].bounds),(w=l[1])>-1&&m.union(i.items[w].bounds),a){case id:v=f||0,b=-c,_=Math.max(d,Math.min(h,-m.y1)),m.add(0,-_).add(u,0),p&&h0(e,p,_,g,y,0,-1,m);break;case lo:v=-c,b=f||0,_=Math.max(d,Math.min(h,-m.x1)),m.add(-_,0).add(0,u),p&&h0(e,p,_,g,y,1,-1,m);break;case co:v=n+c,b=f||0,_=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(_,u),p&&h0(e,p,_,g,y,1,1,m);break;case Cl:v=f||0,b=r+c,_=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(u,_),p&&h0(e,p,_,g,0,0,1,m);break;default:v=i.x,b=i.y}return ga(m.translate(v,b),i),gf(i,"x",v+s)|gf(i,"y",b+s)&&(i.bounds=Xn,e.dirty(i),i.bounds=m,e.dirty(i)),i.mark.bounds.clear().union(m)}function h0(e,t,n,r,i,o,s,a){const l=t.bounds;if(t.auto){const u=s*(n+i+r);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=u):f=(t.y||0)-(t.y=u),t.mark.bounds.clear().union(l.translate(-c,-f)),e.dirty(t)}a.union(l)}const XD=(e,t)=>Math.floor(Math.min(e,t)),KD=(e,t)=>Math.ceil(Math.max(e,t));function xle(e){var t=e.items,n=t.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(E=0;E0&&(b[E]+=L/2);if(a&&Dt(n.center,Ka)&&c!==1)for(E=0;E0&&(w[E]+=I/2);for(E=0;Ei&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),g+=o,v=0,w=t.length;v=0&&(E=n[b])==null;b-=d);a?(A=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),N=g):(A=g,N=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),_.union(k.bounds.translate(A-(k.x||0),N-(k.y||0))),k.x=A,k.y=N,e.dirty(k),m=s(m,_[u])}return m}function QD(e,t,n,r,i,o){if(t){e.dirty(t);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function kle(e,t){const n=e[t]||{};return(r,i)=>n[r]!=null?n[r]:e[r]!=null?e[r]:i}function Cle(e,t){let n=-1/0;return e.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:t}function Ale(e,t,n,r,i,o,s){const a=kle(n,t),l=Cle(e,a("offset",0)),u=a("anchor",WT),c=u===gr?1:u===eS?.5:0,f={align:tS,bounds:a("bounds",KT),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case lo:f.anchor={x:Math.floor(r.x1)-l,column:gr,y:c*(s||r.height()+2*r.y1),row:u};break;case co:f.anchor={x:Math.ceil(r.x2)+l,y:c*(s||r.height()+2*r.y1),row:u};break;case id:f.anchor={y:Math.floor(i.y1)-l,row:gr,x:c*(o||i.width()+2*i.x1),column:u};break;case Cl:f.anchor={y:Math.ceil(i.y2)+l,x:c*(o||i.width()+2*i.x1),column:u};break;case tle:f.anchor={x:l,y:l};break;case nle:f.anchor={x:o-l,y:l,column:gr};break;case rle:f.anchor={x:l,y:s-l,row:gr};break;case ile:f.anchor={x:o-l,y:s-l,column:gr,row:gr};break}return f}function Tle(e,t){var n=t.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,u;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),$le(e,n,n.items[0].items[0]),o=Rle(n,o),l=2*n.padding,u=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),u=Math.ceil(o.height()+u)),r.type===cle&&Ole(n.items[0].items[0].items[0].items),i!==XT&&(n.x=s=0,n.y=a=0),n.width=l,n.height=u,ga(o.set(s,a,s+l,a+u),n),n.mark.bounds.clear().union(o),n}function Rle(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function $le(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(!t.datum.title)(i||o)&&wh(e,n,i,o);else{var s=t.items[1].items[0],a=s.anchor,l=t.titlePadding||0,u=r-s.x,c=r-s.y;switch(s.orient){case lo:i+=Math.ceil(s.bounds.width())+l;break;case co:case Cl:break;default:o+=s.bounds.height()+l}switch((i||o)&&wh(e,n,i,o),s.orient){case lo:c+=zc(t,n,s,a,1,1);break;case co:u+=zc(t,n,s,gr,0,0)+l,c+=zc(t,n,s,a,1,1);break;case Cl:u+=zc(t,n,s,a,0,0),c+=zc(t,n,s,gr,-1,0,1)+l;break;default:u+=zc(t,n,s,a,0,0)}(u||c)&&wh(e,s,u,c),(u=Math.round(s.bounds.x1-r))<0&&(wh(e,n,-u,0),wh(e,s,-u,0))}}function zc(e,t,n,r,i,o,s){const a=e.datum.type!=="symbol",l=n.datum.vgrad,u=a&&(o||!l)&&!s?t.items[0]:t,c=u.bounds[i?"y2":"x2"]-e.padding,f=l&&o?c:0,d=l&&o?0:c,h=i<=0?0:OT(n);return Math.round(r===WT?f:r===gr?d-h:.5*(c-h))}function wh(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function Ole(e){const t=e.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function Nle(e,t,n,r,i){var o=t.items[0],s=o.frame,a=o.orient,l=o.anchor,u=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===lo||a===co?r:n,p=0,g=0,m=0,y=0,v=0,b;if(s!==Vx?a===lo?(p=i.y2,h=i.y1):a===co?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===lo&&(p=r,h=0),b=l===WT?p:l===gr?h:(p+h)/2,d&&d.text){switch(a){case id:case Cl:v=f.bounds.height()+c;break;case lo:y=f.bounds.width()+c;break;case co:y=-f.bounds.width()-c;break}Xn.clear().union(d.bounds),Xn.translate(y-(d.x||0),v-(d.y||0)),gf(d,"x",y)|gf(d,"y",v)&&(e.dirty(d),d.bounds.clear().union(Xn),d.mark.bounds.clear().union(Xn),e.dirty(d)),Xn.clear().union(d.bounds)}else Xn.clear();switch(Xn.union(f.bounds),a){case id:g=b,m=i.y1-Xn.height()-u;break;case lo:g=i.x1-Xn.width()-u,m=b;break;case co:g=i.x2+Xn.width()+u,m=b;break;case Cl:g=b,m=i.y2+u;break;default:g=o.x,m=o.y}return gf(o,"x",g)|gf(o,"y",m)&&(Xn.translate(g,m),e.dirty(o),o.bounds.clear().union(Xn),t.bounds.clear().union(Xn),e.dirty(o)),o.bounds}function LB(e){G.call(this,null,e)}oe(LB,G,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(r=>{e.layout&&_le(n,r,e.layout),Fle(n,r,e)}),Mle(e.mark.group)?t.reflow():t}});function Mle(e){return e&&e.mark.role!=="legend-entry"}function Fle(e,t,n){var r=t.items,i=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new sn().set(0,0,i,o),a=s.clone(),l=s.clone(),u=[],c,f,d,h,p,g;for(p=0,g=r.length;p{d=y.orient||co,d!==XT&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const v=m[y];PB(e,v,Ale(v,y,n.legends,a,l,i,o))}u.forEach(y=>{const v=y.bounds;if(v.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=v,e.dirty(y)),n.autosize&&(n.autosize.type===RB||n.autosize.type===$B||n.autosize.type===OB))switch(y.orient){case lo:case co:s.add(v.x1,0).add(v.x2,0);break;case id:case Cl:s.add(0,v.y1).add(0,v.y2)}else s.union(v)})}s.union(a).union(l),c&&s.union(Nle(e,c,i,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),Dle(e,t,s,n)}function Dle(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,l=Math.max(0,t.width||0),u=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-l)),h=Math.max(0,Math.ceil(n.y2-c));if(i.contains===ule){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===XT?(u=0,f=0,l=s,c=a):o===RB?(l=Math.max(0,s-u-d),c=Math.max(0,a-f-h)):o===$B?(l=Math.max(0,s-u-d),a=c+f+h):o===OB?(s=l+u+d,c=Math.max(0,a-f-h)):o===fle&&(s=l+u+d,a=c+f+h),e._resizeView(s,a,l,c,[u,f],i.resize)}const Ile=Object.freeze(Object.defineProperty({__proto__:null,bound:NB,identifier:JT,mark:MB,overlap:FB,render:IB,viewlayout:LB},Symbol.toStringTag,{value:"Module"}));function zB(e){G.call(this,null,e)}oe(zB,G,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=dT(o,s,e.minstep),l=e.format||x9(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?v9(o,e.values,a):hT(o,a);return i&&(r.rem=i),i=u.map((c,f)=>mt({index:f/(u.length-1||1),value:c,label:l(c)})),e.extra&&i.length&&i.push(mt({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function BB(e){G.call(this,null,e)}function Ple(){return mt({})}function Lle(e){const t=Md().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}oe(BB,G,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||Ple,o=e.key||Re,s=this.value;return K(r.encode)&&(r.encode=null),s&&(e.modified("key")||t.modified(o))&&Y("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=Lle(o)),t.visit(t.ADD,a=>{const l=o(a);let u=s.get(l);u?u.exit?(s.empty--,r.add.push(u)):r.mod.push(u):(u=i(a),s.set(l,u),r.add.push(u)),u.datum=a,u.exit=!1}),t.visit(t.MOD,a=>{const l=o(a),u=s.get(l);u&&(u.datum=a,r.mod.push(u))}),t.visit(t.REM,a=>{const l=o(a),u=s.get(l);a===u.datum&&!u.exit&&(r.rem.push(u),u.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function jB(e){G.call(this,null,e)}oe(jB,G,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(K(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=i.update||Ta,l=i.enter||Ta,u=i.exit||Ta,c=(o&&!s?i[o]:a)||Ta;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),c!==Ta&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&u!==Ta&&(t.visit(t.REM,f=>{u(f,e)}),n.modifies(u.output)),s||c!==Ta){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=l(d,e)||r;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(c(d,e)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function UB(e){G.call(this,[],e)}oe(UB,G,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.type||ry,s=e.scale,a=+e.limit,l=dT(s,e.count==null?5:e.count,e.minstep),u=!!e.values||o===ry,c=e.format||E9(n,s,l,o,e.formatSpecifier,e.formatType,u),f=e.values||_9(s,l),d,h,p,g,m;return i&&(r.rem=i),o===ry?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,Ve(p=e.size)?(!e.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((y,v)=>Math.max(y,p(v,e)),0)):p=lr(g=p||8),i=i.map((y,v)=>mt({index:v,label:c(y,v,i),value:y,offset:g,size:p(y,e)})),m&&(m=f[i.length],i.push(mt({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,e)})))):o===doe?(d=s.domain(),h=g9(s,d[0],it(d)),f.length<3&&!e.values&&d[0]!==it(d)&&(f=[d[0],it(d)]),i=f.map((y,v)=>mt({index:v,label:c(y,v,f),value:y,perc:h(y)}))):(p=f.length-1,h=Eoe(s),i=f.map((y,v)=>mt({index:v,label:c(y,v,f),value:y,perc:v?h(y):0,perc2:v===p?1:h(f[v+1])}))),r.source=i,r.add=i,this.value=i,r}});const zle=e=>e.source.x,Ble=e=>e.source.y,jle=e=>e.target.x,Ule=e=>e.target.y;function QT(e){G.call(this,{},e)}QT.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"}]};oe(QT,G,{transform(e,t){var n=e.sourceX||zle,r=e.sourceY||Ble,i=e.targetX||jle,o=e.targetY||Ule,s=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",u=ZD.get(l+"-"+a)||ZD.get(l);return u||Y("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=u(n(c),r(c),i(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const HB=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,Hle=(e,t,n,r)=>HB(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),GB=(e,t,n,r)=>{var i=n-e,o=r-t,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},Gle=(e,t,n,r)=>GB(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),WB=(e,t,n,r)=>{const i=n-e,o=r-t,s=.2*(i+o),a=.2*(o-i);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},Wle=(e,t,n,r)=>WB(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),Vle=(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,qle=(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,Yle=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*s+","+t*a+"L"+r*s+","+r*a},Xle=(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},Kle=(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},Jle=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=(t+r)/2;return"M"+t*i+","+t*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},ZD=Md({line:HB,"line-radial":Hle,arc:GB,"arc-radial":Gle,curve:WB,"curve-radial":Wle,"orthogonal-horizontal":Vle,"orthogonal-vertical":qle,"orthogonal-radial":Yle,"diagonal-horizontal":Xle,"diagonal-vertical":Kle,"diagonal-radial":Jle});function ZT(e){G.call(this,null,e)}ZT.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"]}]};oe(ZT,G,{transform(e,t){var n=e.as||["startAngle","endAngle"],r=n[0],i=n[1],o=e.field||$d,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,u=l.map(o),c=u.length,f=s,d=(a-s)/dz(u),h=ci(c),p,g,m;for(e.sort&&h.sort((y,v)=>u[y]-u[v]),p=0;p-1)return r;var i=t.domain,o=e.type,s=t.zero||t.zero===void 0&&Zle(e),a,l;if(!i)return 0;if(VB(o)&&t.padding&&i[0]!==it(i)&&(i=oue(o,i,t.range,t.padding,t.exponent,t.constant)),(s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const u=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==t.length&&n.warn("Log scale domain includes zero: "+ie(t))}return t}function sue(e,t,n){let r=t.bins;if(r&&!K(r)){const i=e.domain(),o=i[0],s=it(i),a=r.step;let l=r.start==null?o:r.start,u=r.stop==null?s:r.stop;a||Y("Scale bins parameter missing step property."),ls&&(u=a*Math.floor(s/a)),r=ci(l,u+a/2,a)}return r?e.bins=r:e.bins&&delete e.bins,e.type===sT&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function aue(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(t.rangeStep!=null)o=lue(r,t,n);else if(t.scheme&&(o=uue(r,t,n),Ve(o))){if(e.interpolator)return e.interpolator(o);Y(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&f9(r))return e.interpolator(Fx(nS(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(cT(t.interpolate,t.interpolateGamma)):Ve(e.round)?e.round(i):Ve(e.rangeRound)&&e.interpolate(i?Vg:jl),o&&e.range(nS(o,t.reverse))}function lue(e,t,n){e!==i9&&e!==jE&&Y("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===jE?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*iT(n,i,r)]}function uue(e,t,n){var r=t.schemeExtent,i,o;return K(t.scheme)?o=Fx(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),o=fT(i),o||Y(`Unrecognized scheme name: ${t.scheme}`)),n=e===Mx?n+1:e===sT?n-1:e===Qf||e===Nx?+t.schemeCount||Qle:n,f9(e)?e3(o,r,t.reverse):Ve(o)?p9(e3(o,r),n):e===oT?o:o.slice(0,n)}function e3(e,t,n){return Ve(e)&&(t||n)?h9(e,nS(t||[0,1],n)):e}function nS(e,t){return t?e.slice().reverse():e}function XB(e){G.call(this,null,e)}oe(XB,G,{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(bc(e.sort)),this.modified(n),t}});const t3="zero",KB="center",JB="normalize",QB=["y0","y1"];function eR(e){G.call(this,null,e)}eR.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:t3,values:[t3,KB,JB]},{name:"as",type:"string",array:!0,length:2,default:QB}]};oe(eR,G,{transform(e,t){var n=e.as||QB,r=n[0],i=n[1],o=bc(e.sort),s=e.field||$d,a=e.offset===KB?cue:e.offset===JB?fue:due,l,u,c,f;for(l=hue(t.source,e.groupby,o,s),u=0,c=l.length,f=l.max;ug(c),s,a,l,u,c,f,d,h,p;if(t==null)i.push(e.slice());else for(s={},a=0,l=e.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const pue=Object.freeze(Object.defineProperty({__proto__:null,axisticks:zB,datajoin:BB,encode:jB,legendentries:UB,linkpath:QT,pie:ZT,scale:qB,sortitems:XB,stack:eR},Symbol.toStringTag,{value:"Module"}));var Ne=1e-6,$1=1e-12,Je=Math.PI,Yt=Je/2,O1=Je/4,kr=Je*2,Kt=180/Je,Xe=Je/180,rt=Math.abs,Ud=Math.atan,Ui=Math.atan2,Me=Math.cos,g0=Math.ceil,ZB=Math.exp,rS=Math.hypot,N1=Math.log,m_=Math.pow,$e=Math.sin,Oi=Math.sign||function(e){return e>0?1:e<0?-1:0},Cr=Math.sqrt,tR=Math.tan;function ej(e){return e>1?0:e<-1?Je:Math.acos(e)}function Kr(e){return e>1?Yt:e<-1?-Yt:Math.asin(e)}function In(){}function M1(e,t){e&&r3.hasOwnProperty(e.type)&&r3[e.type](e,t)}var n3={Feature:function(e,t){M1(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Me(t),s=$e(t),a=aS*s,l=sS*o+a*Me(i),u=a*r*$e(i);F1.add(Ui(u,l)),oS=e,sS=o,aS=s}function vue(e){return D1=new _r,Us(e,fs),D1*2}function I1(e){return[Ui(e[1],e[0]),Kr(e[2])]}function Ju(e){var t=e[0],n=e[1],r=Me(n);return[r*Me(t),r*$e(t),$e(n)]}function m0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function od(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 y_(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function y0(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function P1(e){var t=Cr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var zt,Dr,Gt,si,pu,ij,oj,Tf,wp,Da,fa,zs={point:lS,lineStart:o3,lineEnd:s3,polygonStart:function(){zs.point=aj,zs.lineStart=xue,zs.lineEnd=bue,wp=new _r,fs.polygonStart()},polygonEnd:function(){fs.polygonEnd(),zs.point=lS,zs.lineStart=o3,zs.lineEnd=s3,F1<0?(zt=-(Gt=180),Dr=-(si=90)):wp>Ne?si=90:wp<-Ne&&(Dr=-90),fa[0]=zt,fa[1]=Gt},sphere:function(){zt=-(Gt=180),Dr=-(si=90)}};function lS(e,t){Da.push(fa=[zt=e,Gt=e]),tsi&&(si=t)}function sj(e,t){var n=Ju([e*Xe,t*Xe]);if(Tf){var r=od(Tf,n),i=[r[1],-r[0],0],o=od(i,r);P1(o),o=I1(o);var s=e-pu,a=s>0?1:-1,l=o[0]*Kt*a,u,c=rt(s)>180;c^(a*pusi&&(si=u)):(l=(l+360)%360-180,c^(a*pusi&&(si=t))),c?eoi(zt,Gt)&&(Gt=e):oi(e,Gt)>oi(zt,Gt)&&(zt=e):Gt>=zt?(eGt&&(Gt=e)):e>pu?oi(zt,e)>oi(zt,Gt)&&(Gt=e):oi(e,Gt)>oi(zt,Gt)&&(zt=e)}else Da.push(fa=[zt=e,Gt=e]);tsi&&(si=t),Tf=n,pu=e}function o3(){zs.point=sj}function s3(){fa[0]=zt,fa[1]=Gt,zs.point=lS,Tf=null}function aj(e,t){if(Tf){var n=e-pu;wp.add(rt(n)>180?n+(n>0?360:-360):n)}else ij=e,oj=t;fs.point(e,t),sj(e,t)}function xue(){fs.lineStart()}function bue(){aj(ij,oj),fs.lineEnd(),rt(wp)>Ne&&(zt=-(Gt=180)),fa[0]=zt,fa[1]=Gt,Tf=null}function oi(e,t){return(t-=e)<0?t+360:t}function wue(e,t){return e[0]-t[0]}function a3(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:toi(r[0],r[1])&&(r[1]=i[1]),oi(i[0],r[1])>oi(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(a=oi(r[1],i[0]))>s&&(s=a,zt=i[0],Gt=r[1])}return Da=fa=null,zt===1/0||Dr===1/0?[[NaN,NaN],[NaN,NaN]]:[[zt,Dr],[Gt,si]]}var Yh,L1,z1,B1,j1,U1,H1,G1,uS,cS,fS,lj,uj,mr,yr,vr,fo={sphere:In,point:nR,lineStart:l3,lineEnd:u3,polygonStart:function(){fo.lineStart=kue,fo.lineEnd=Cue},polygonEnd:function(){fo.lineStart=l3,fo.lineEnd=u3}};function nR(e,t){e*=Xe,t*=Xe;var n=Me(t);sm(n*Me(e),n*$e(e),$e(t))}function sm(e,t,n){++Yh,z1+=(e-z1)/Yh,B1+=(t-B1)/Yh,j1+=(n-j1)/Yh}function l3(){fo.point=Eue}function Eue(e,t){e*=Xe,t*=Xe;var n=Me(t);mr=n*Me(e),yr=n*$e(e),vr=$e(t),fo.point=Sue,sm(mr,yr,vr)}function Sue(e,t){e*=Xe,t*=Xe;var n=Me(t),r=n*Me(e),i=n*$e(e),o=$e(t),s=Ui(Cr((s=yr*o-vr*i)*s+(s=vr*r-mr*o)*s+(s=mr*i-yr*r)*s),mr*r+yr*i+vr*o);L1+=s,U1+=s*(mr+(mr=r)),H1+=s*(yr+(yr=i)),G1+=s*(vr+(vr=o)),sm(mr,yr,vr)}function u3(){fo.point=nR}function kue(){fo.point=Aue}function Cue(){cj(lj,uj),fo.point=nR}function Aue(e,t){lj=e,uj=t,e*=Xe,t*=Xe,fo.point=cj;var n=Me(t);mr=n*Me(e),yr=n*$e(e),vr=$e(t),sm(mr,yr,vr)}function cj(e,t){e*=Xe,t*=Xe;var n=Me(t),r=n*Me(e),i=n*$e(e),o=$e(t),s=yr*o-vr*i,a=vr*r-mr*o,l=mr*i-yr*r,u=rS(s,a,l),c=Kr(u),f=u&&-c/u;uS.add(f*s),cS.add(f*a),fS.add(f*l),L1+=c,U1+=c*(mr+(mr=r)),H1+=c*(yr+(yr=i)),G1+=c*(vr+(vr=o)),sm(mr,yr,vr)}function Tue(e){Yh=L1=z1=B1=j1=U1=H1=G1=0,uS=new _r,cS=new _r,fS=new _r,Us(e,fo);var t=+uS,n=+cS,r=+fS,i=rS(t,n,r);return i<$1&&(t=U1,n=H1,r=G1,L1Je&&(e-=Math.round(e/kr)*kr),[e,t]}hS.invert=hS;function fj(e,t,n){return(e%=kr)?t||n?dS(f3(e),d3(t,n)):f3(e):t||n?d3(t,n):hS}function c3(e){return function(t,n){return t+=e,rt(t)>Je&&(t-=Math.round(t/kr)*kr),[t,n]}}function f3(e){var t=c3(e);return t.invert=c3(-e),t}function d3(e,t){var n=Me(e),r=$e(e),i=Me(t),o=$e(t);function s(a,l){var u=Me(l),c=Me(a)*u,f=$e(a)*u,d=$e(l),h=d*n+c*r;return[Ui(f*i-h*o,c*n-d*r),Kr(h*i+f*o)]}return s.invert=function(a,l){var u=Me(l),c=Me(a)*u,f=$e(a)*u,d=$e(l),h=d*i-f*o;return[Ui(f*i+d*o,c*n+h*r),Kr(h*n-c*r)]},s}function Rue(e){e=fj(e[0]*Xe,e[1]*Xe,e.length>2?e[2]*Xe:0);function t(n){return n=e(n[0]*Xe,n[1]*Xe),n[0]*=Kt,n[1]*=Kt,n}return t.invert=function(n){return n=e.invert(n[0]*Xe,n[1]*Xe),n[0]*=Kt,n[1]*=Kt,n},t}function $ue(e,t,n,r,i,o){if(n){var s=Me(t),a=$e(t),l=r*n;i==null?(i=t+r*kr,o=t-l/2):(i=h3(s,i),o=h3(s,o),(r>0?io)&&(i+=r*kr));for(var u,c=i;r>0?c>o:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fy(e,t){return rt(e[0]-t[0])=0;--a)i.point((f=c[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);i.lineEnd()}}}function p3(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n=0?1:-1,O=N*A,F=O>Je,U=m*k;if(l.add(Ui(U*N*$e(O),y*E+U*Me(O))),s+=F?A+N*kr:A,F^p>=n^w>=n){var M=od(Ju(h),Ju(b));P1(M);var L=od(o,M);P1(L);var I=(F^A>=0?-1:1)*Kr(L[2]);(r>I||r===I&&(M[0]||M[1]))&&(a+=F^A>=0?1:-1)}}return(s<-Ne||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),k=0;k1&&w&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(Nue))}}return d}}function Nue(e){return e.length>1}function Mue(e,t){return((e=e.x)[0]<0?e[1]-Yt-Ne:Yt-e[1])-((t=t.x)[0]<0?t[1]-Yt-Ne:Yt-t[1])}const g3=pj(function(){return!0},Fue,Iue,[-Je,-Yt]);function Fue(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Je:-Je,l=rt(o-t);rt(l-Je)0?Yt:-Yt),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=Je&&(rt(t-r)Ne?Ud(($e(t)*(o=Me(r))*$e(n)-$e(r)*(i=Me(t))*$e(e))/(i*o*s)):(t+r)/2}function Iue(e,t,n,r){var i;if(e==null)i=n*Yt,r.point(-Je,i),r.point(0,i),r.point(Je,i),r.point(Je,0),r.point(Je,-i),r.point(0,-i),r.point(-Je,-i),r.point(-Je,0),r.point(-Je,i);else if(rt(e[0]-t[0])>Ne){var o=e[0]0,i=rt(t)>Ne;function o(c,f,d,h){$ue(h,e,n,d,c,f)}function s(c,f){return Me(c)*Me(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var v=[m,y],b,w=s(m,y),_=r?w?0:u(m,y):w?u(m+(m<0?Je:-Je),y):0;if(!f&&(p=h=w)&&c.lineStart(),w!==h&&(b=l(f,v),(!b||fy(f,b)||fy(v,b))&&(v[2]=1)),w!==h)g=0,w?(c.lineStart(),b=l(v,f),c.point(b[0],b[1])):(b=l(f,v),c.point(b[0],b[1],2),c.lineEnd()),f=b;else if(i&&f&&r^w){var k;!(_&d)&&(k=l(v,f,!0))&&(g=0,r?(c.lineStart(),c.point(k[0][0],k[0][1]),c.point(k[1][0],k[1][1]),c.lineEnd()):(c.point(k[1][0],k[1][1]),c.lineEnd(),c.lineStart(),c.point(k[0][0],k[0][1],3)))}w&&(!f||!fy(f,v))&&c.point(v[0],v[1]),f=v,h=w,d=_},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(c,f,d){var h=Ju(c),p=Ju(f),g=[1,0,0],m=od(h,p),y=m0(m,m),v=m[0],b=y-v*v;if(!b)return!d&&c;var w=t*y/b,_=-t*v/b,k=od(g,m),E=y0(g,w),A=y0(m,_);y_(E,A);var N=k,O=m0(E,N),F=m0(N,N),U=O*O-F*(m0(E,E)-1);if(!(U<0)){var M=Cr(U),L=y0(N,(-O-M)/F);if(y_(L,E),L=I1(L),!d)return L;var I=c[0],B=f[0],H=c[1],z=f[1],j;B0^L[1]<(rt(L[0]-I)Je^(I<=L[0]&&L[0]<=B)){var Ye=y0(N,(-O+M)/F);return y_(Ye,E),[L,I1(Ye)]}}}function u(c,f){var d=r?e:Je-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return pj(s,a,o,r?[0,-e]:[-Je,e-Je])}function Lue(e,t,n,r,i,o){var s=e[0],a=e[1],l=t[0],u=t[1],c=0,f=1,d=l-s,h=u-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var Xh=1e9,x0=-Xh;function gj(e,t,n,r){function i(u,c){return e<=u&&u<=n&&t<=c&&c<=r}function o(u,c,f,d){var h=0,p=0;if(u==null||(h=s(u,f))!==(p=s(c,f))||l(u,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function s(u,c){return rt(u[0]-e)0?0:3:rt(u[0]-n)0?2:1:rt(u[1]-t)0?1:0:c>0?3:2}function a(u,c){return l(u.x,c.x)}function l(u,c){var f=s(u,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=dj(),d,h,p,g,m,y,v,b,w,_,k,E={point:A,lineStart:U,lineEnd:M,polygonStart:O,polygonEnd:F};function A(I,B){i(I,B)&&c.point(I,B)}function N(){for(var I=0,B=0,H=h.length;Br&&(je-_e)*(r-Ye)>(ft-Ye)*(e-_e)&&++I:ft<=r&&(je-_e)*(r-Ye)<(ft-Ye)*(e-_e)&&--I;return I}function O(){c=f,d=[],h=[],k=!0}function F(){var I=N(),B=k&&I,H=(d=fz(d)).length;(B||H)&&(u.polygonStart(),B&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),H&&hj(d,a,I,o,u),u.polygonEnd()),c=u,d=h=p=null}function U(){E.point=L,h&&h.push(p=[]),_=!0,w=!1,v=b=NaN}function M(){d&&(L(g,m),y&&w&&f.rejoin(),d.push(f.result())),E.point=A,w&&c.lineEnd()}function L(I,B){var H=i(I,B);if(h&&p.push([I,B]),_)g=I,m=B,y=H,_=!1,H&&(c.lineStart(),c.point(I,B));else if(H&&w)c.point(I,B);else{var z=[v=Math.max(x0,Math.min(Xh,v)),b=Math.max(x0,Math.min(Xh,b))],j=[I=Math.max(x0,Math.min(Xh,I)),B=Math.max(x0,Math.min(Xh,B))];Lue(z,j,e,t,n,r)?(w||(c.lineStart(),c.point(z[0],z[1])),c.point(j[0],j[1]),H||c.lineEnd(),k=!1):H&&(c.lineStart(),c.point(I,B),k=!1)}v=I,b=B,w=H}return E}}function m3(e,t,n){var r=ci(e,t-Ne,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function y3(e,t,n){var r=ci(e,t-Ne,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function zue(){var e,t,n,r,i,o,s,a,l=10,u=l,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return ci(g0(r/c)*c,n,c).map(p).concat(ci(g0(a/f)*f,s,f).map(g)).concat(ci(g0(t/l)*l,e,l).filter(function(b){return rt(b%c)>Ne}).map(d)).concat(ci(g0(o/u)*u,i,u).filter(function(b){return rt(b%f)>Ne}).map(h))}return y.lines=function(){return v().map(function(b){return{type:"LineString",coordinates:b}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(b){return arguments.length?y.extentMajor(b).extentMinor(b):y.extentMinor()},y.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),y.precision(m)):[[r,a],[n,s]]},y.extentMinor=function(b){return arguments.length?(t=+b[0][0],e=+b[1][0],o=+b[0][1],i=+b[1][1],t>e&&(b=t,t=e,e=b),o>i&&(b=o,o=i,i=b),y.precision(m)):[[t,o],[e,i]]},y.step=function(b){return arguments.length?y.stepMajor(b).stepMinor(b):y.stepMinor()},y.stepMajor=function(b){return arguments.length?(c=+b[0],f=+b[1],y):[c,f]},y.stepMinor=function(b){return arguments.length?(l=+b[0],u=+b[1],y):[l,u]},y.precision=function(b){return arguments.length?(m=+b,d=m3(o,i,90),h=y3(t,e,m),p=m3(a,s,90),g=y3(r,n,m),y):m},y.extentMajor([[-180,-90+Ne],[180,90-Ne]]).extentMinor([[-180,-80-Ne],[180,80+Ne]])}const cg=e=>e;var x_=new _r,pS=new _r,mj,yj,gS,mS,ja={point:In,lineStart:In,lineEnd:In,polygonStart:function(){ja.lineStart=Bue,ja.lineEnd=Uue},polygonEnd:function(){ja.lineStart=ja.lineEnd=ja.point=In,x_.add(rt(pS)),pS=new _r},result:function(){var e=x_/2;return x_=new _r,e}};function Bue(){ja.point=jue}function jue(e,t){ja.point=vj,mj=gS=e,yj=mS=t}function vj(e,t){pS.add(mS*e-gS*t),gS=e,mS=t}function Uue(){vj(mj,yj)}const v3=ja;var sd=1/0,W1=sd,fg=-sd,V1=fg,Hue={point:Gue,lineStart:In,lineEnd:In,polygonStart:In,polygonEnd:In,result:function(){var e=[[sd,W1],[fg,V1]];return fg=V1=-(W1=sd=1/0),e}};function Gue(e,t){efg&&(fg=e),tV1&&(V1=t)}const q1=Hue;var yS=0,vS=0,Kh=0,Y1=0,X1=0,mf=0,xS=0,bS=0,Jh=0,xj,bj,Ko,Jo,uo={point:Qu,lineStart:x3,lineEnd:b3,polygonStart:function(){uo.lineStart=que,uo.lineEnd=Yue},polygonEnd:function(){uo.point=Qu,uo.lineStart=x3,uo.lineEnd=b3},result:function(){var e=Jh?[xS/Jh,bS/Jh]:mf?[Y1/mf,X1/mf]:Kh?[yS/Kh,vS/Kh]:[NaN,NaN];return yS=vS=Kh=Y1=X1=mf=xS=bS=Jh=0,e}};function Qu(e,t){yS+=e,vS+=t,++Kh}function x3(){uo.point=Wue}function Wue(e,t){uo.point=Vue,Qu(Ko=e,Jo=t)}function Vue(e,t){var n=e-Ko,r=t-Jo,i=Cr(n*n+r*r);Y1+=i*(Ko+e)/2,X1+=i*(Jo+t)/2,mf+=i,Qu(Ko=e,Jo=t)}function b3(){uo.point=Qu}function que(){uo.point=Xue}function Yue(){wj(xj,bj)}function Xue(e,t){uo.point=wj,Qu(xj=Ko=e,bj=Jo=t)}function wj(e,t){var n=e-Ko,r=t-Jo,i=Cr(n*n+r*r);Y1+=i*(Ko+e)/2,X1+=i*(Jo+t)/2,mf+=i,i=Jo*e-Ko*t,xS+=i*(Ko+e),bS+=i*(Jo+t),Jh+=i*3,Qu(Ko=e,Jo=t)}const w3=uo;function _j(e){this._context=e}_j.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,kr);break}}},result:In};var wS=new _r,b_,Ej,Sj,Qh,Zh,K1={point:In,lineStart:function(){K1.point=Kue},lineEnd:function(){b_&&kj(Ej,Sj),K1.point=In},polygonStart:function(){b_=!0},polygonEnd:function(){b_=null},result:function(){var e=+wS;return wS=new _r,e}};function Kue(e,t){K1.point=kj,Ej=Qh=e,Sj=Zh=t}function kj(e,t){Qh-=e,Zh-=t,wS.add(Cr(Qh*Qh+Zh*Zh)),Qh=e,Zh=t}const _3=K1;let E3,J1,S3,k3;class C3{constructor(t){this._append=t==null?Cj:Jue(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!==S3||this._append!==J1){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,S3=r,J1=this._append,k3=this._,this._=i}this._+=k3;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Cj(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Cj;if(t!==E3){const n=10**t;E3=t,J1=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(o=new C3(n)),s},s.projection(e).digits(n).context(t)}function qx(e){return function(t){var n=new _S;for(var r in e)n[r]=e[r];return n.stream=t,n}}function _S(){}_S.prototype={constructor:_S,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 rR(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Us(n,e.stream(q1)),t(q1.result()),r!=null&&e.clipExtent(r),e}function Yx(e,t,n){return rR(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function iR(e,t,n){return Yx(e,[[0,0],t],n)}function oR(e,t,n){return rR(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function sR(e,t,n){return rR(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var A3=16,Que=Me(30*Xe);function T3(e,t){return+t?ece(e,t):Zue(e)}function Zue(e){return qx({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function ece(e,t){function n(r,i,o,s,a,l,u,c,f,d,h,p,g,m){var y=u-r,v=c-i,b=y*y+v*v;if(b>4*t&&g--){var w=s+d,_=a+h,k=l+p,E=Cr(w*w+_*_+k*k),A=Kr(k/=E),N=rt(rt(k)-1)t||rt((y*M+v*L)/b-.5)>.3||s*d+a*h+l*p2?I[2]%360*Xe:0,M()):[a*Kt,l*Kt,u*Kt]},F.angle=function(I){return arguments.length?(f=I%360*Xe,M()):f*Kt},F.reflectX=function(I){return arguments.length?(d=I?-1:1,M()):d<0},F.reflectY=function(I){return arguments.length?(h=I?-1:1,M()):h<0},F.precision=function(I){return arguments.length?(k=T3(E,_=I*I),L()):Cr(_)},F.fitExtent=function(I,B){return Yx(F,I,B)},F.fitSize=function(I,B){return iR(F,I,B)},F.fitWidth=function(I,B){return oR(F,I,B)},F.fitHeight=function(I,B){return sR(F,I,B)};function M(){var I=R3(n,0,0,d,h,f).apply(null,t(o,s)),B=R3(n,r-I[0],i-I[1],d,h,f);return c=fj(a,l,u),E=dS(t,B),A=dS(c,E),k=T3(E,_),L()}function L(){return N=O=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&U,M()}}function aR(e){var t=0,n=Je/3,r=Tj(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*Xe,n=o[1]*Xe):[t*Kt,n*Kt]},i}function ice(e){var t=Me(e);function n(r,i){return[r*t,$e(i)/t]}return n.invert=function(r,i){return[r/t,Kr(i*t)]},n}function oce(e,t){var n=$e(e),r=(n+$e(t))/2;if(rt(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=sce([n.stream(t=d),i.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.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 r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(u),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Ne,g+.12*h+Ne],[p-.214*h-Ne,g+.234*h-Ne]]).stream(u),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Ne,g+.166*h+Ne],[p-.115*h-Ne,g+.234*h-Ne]]).stream(u),f()},c.fitExtent=function(d,h){return Yx(c,d,h)},c.fitSize=function(d,h){return iR(c,d,h)},c.fitWidth=function(d,h){return oR(c,d,h)},c.fitHeight=function(d,h){return sR(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function $j(e){return function(t,n){var r=Me(t),i=Me(n),o=e(r*i);return o===1/0?[2,0]:[o*i*$e(t),o*$e(n)]}}function am(e){return function(t,n){var r=Cr(t*t+n*n),i=e(r),o=$e(i),s=Me(i);return[Ui(t*o,r*s),Kr(r&&n*o/r)]}}var Oj=$j(function(e){return Cr(2/(1+e))});Oj.invert=am(function(e){return 2*Kr(e/2)});function lce(){return bs(Oj).scale(124.75).clipAngle(180-.001)}var Nj=$j(function(e){return(e=ej(e))&&e/$e(e)});Nj.invert=am(function(e){return e});function uce(){return bs(Nj).scale(79.4188).clipAngle(180-.001)}function Xx(e,t){return[e,N1(tR((Yt+t)/2))]}Xx.invert=function(e,t){return[e,2*Ud(ZB(t))-Yt]};function cce(){return Mj(Xx).scale(961/kr)}function Mj(e){var t=bs(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,l,u;t.scale=function(f){return arguments.length?(r(f),c()):r()},t.translate=function(f){return arguments.length?(i(f),c()):i()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=l=u=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):s==null?null:[[s,a],[l,u]]};function c(){var f=Je*r(),d=t(Rue(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Xx?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),u]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,u)]])}return c()}function b0(e){return tR((Yt+e)/2)}function fce(e,t){var n=Me(e),r=e===t?$e(e):N1(n/Me(t))/N1(b0(t)/b0(e)),i=n*m_(b0(e),r)/r;if(!r)return Xx;function o(s,a){i>0?a<-Yt+Ne&&(a=-Yt+Ne):a>Yt-Ne&&(a=Yt-Ne);var l=i/m_(b0(a),r);return[l*$e(r*s),i-l*Me(r*s)]}return o.invert=function(s,a){var l=i-a,u=Oi(r)*Cr(s*s+l*l),c=Ui(s,rt(l))*Oi(l);return l*r<0&&(c-=Je*Oi(s)*Oi(l)),[c/r,2*Ud(m_(i/u,1/r))-Yt]},o}function dce(){return aR(fce).scale(109.5).parallels([30,30])}function Z1(e,t){return[e,t]}Z1.invert=Z1;function hce(){return bs(Z1).scale(152.63)}function pce(e,t){var n=Me(e),r=e===t?$e(e):(n-Me(t))/(t-e),i=n/r+e;if(rt(r)Ne&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function bce(){return bs(Ij).scale(175.295)}function Pj(e,t){return[Me(t)*$e(e),$e(t)]}Pj.invert=am(Kr);function wce(){return bs(Pj).scale(249.5).clipAngle(90+Ne)}function Lj(e,t){var n=Me(t),r=1+Me(e)*n;return[n*$e(e)/r,$e(t)/r]}Lj.invert=am(function(e){return 2*Ud(e)});function _ce(){return bs(Lj).scale(250).clipAngle(142)}function zj(e,t){return[N1(tR((Yt+t)/2)),-e]}zj.invert=function(e,t){return[-t,2*Ud(ZB(e))-Yt]};function Ece(){var e=Mj(zj),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var Sce=Math.abs,ES=Math.cos,tv=Math.sin,kce=1e-6,Bj=Math.PI,SS=Bj/2,$3=Cce(2);function O3(e){return e>1?SS:e<-1?-SS:Math.asin(e)}function Cce(e){return e>0?Math.sqrt(e):0}function Ace(e,t){var n=e*tv(t),r=30,i;do t-=i=(t+tv(t)-n)/(1+ES(t));while(Sce(i)>kce&&--r>0);return t/2}function Tce(e,t,n){function r(i,o){return[e*i*ES(o=Ace(n,o)),t*tv(o)]}return r.invert=function(i,o){return o=O3(o/t),[i/(e*ES(o)),O3((2*o+tv(2*o))/n)]},r}var Rce=Tce($3/SS,$3,Bj);function $ce(){return bs(Rce).scale(169.529)}const Oce=Aj(),kS=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Nce(e,t){return function n(){const r=t();return r.type=e,r.path=Aj().projection(r),r.copy=r.copy||function(){const i=n();return kS.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},l9(r)}}function lR(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(nv[e]=Nce(e,t),this):nv[e]||null}function jj(e){return e&&e.path||Oce}const nv={albers:Rj,albersusa:ace,azimuthalequalarea:lce,azimuthalequidistant:uce,conicconformal:dce,conicequalarea:Q1,conicequidistant:gce,equalEarth:yce,equirectangular:hce,gnomonic:vce,identity:xce,mercator:cce,mollweide:$ce,naturalEarth1:bce,orthographic:wce,stereographic:_ce,transversemercator:Ece};for(const e in nv)lR(e,nv[e]);function Mce(){}const Ns=[[],[[[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 Uj(){var e=1,t=1,n=a;function r(l,u){return u.map(c=>i(l,c))}function i(l,u){var c=[],f=[];return o(l,u,d=>{n(d,l,u),Fce(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=u,Ns[m<<1].forEach(b);++h=u,Ns[g|m<<1].forEach(b);for(Ns[m<<0].forEach(b);++p=u,y=l[p*e]>=u,Ns[m<<1|y<<2].forEach(b);++h=u,v=y,y=l[p*e+h+1]>=u,Ns[g|m<<1|y<<2|v<<3].forEach(b);Ns[m|y<<3].forEach(b)}for(h=-1,y=l[p*e]>=u,Ns[y<<2].forEach(b);++h=u,Ns[y<<2|v<<3].forEach(b);Ns[y<<3].forEach(b);function b(w){var _=[w[0][0]+h,w[0][1]+p],k=[w[1][0]+h,w[1][1]+p],E=s(_),A=s(k),N,O;(N=d[E])?(O=f[A])?(delete d[N.end],delete f[O.start],N===O?(N.ring.push(k),c(N.ring)):f[N.start]=d[O.end]={start:N.start,end:O.end,ring:N.ring.concat(O.ring)}):(delete d[N.end],N.ring.push(k),d[N.end=A]=N):(N=f[A])?(O=d[E])?(delete f[N.start],delete d[O.end],N===O?(N.ring.push(k),c(N.ring)):f[O.start]=d[N.end]={start:O.start,end:N.end,ring:O.ring.concat(N.ring)}):(delete f[N.start],N.ring.unshift(_),f[N.start=E]=N):f[E]=d[A]={start:E,end:A,ring:[_,k]}}}function s(l){return l[0]*2+l[1]*(e+1)*4}function a(l,u,c){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=u[g*e+p];d>0&&d0&&h=0&&c>=0||Y("invalid size"),e=u,t=c,r},r.smooth=function(l){return arguments.length?(n=l?a:Mce,r):n===a},r}function Fce(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++tr!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(i=-i)}return i}function Pce(e,t,n){var r;return Lce(e,t,n)&&zce(e[r=+(e[0]===t[0])],n[r],t[r])}function Lce(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function zce(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function Hj(e,t,n){return function(r){var i=as(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=t?vl(o,s,e):a/(e+1);return ci(o+l,s,l)}}function uR(e){G.call(this,null,e)}uR.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"}]};oe(uR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||ar,o=Uj().smooth(e.smooth!==!1),s=e.thresholds||Bce(r,i,e),a=e.as===null?null:e.as||"contour",l=[];return r.forEach(u=>{const c=i(u),f=o.size([c.width,c.height])(c.values,K(s)?s:s(c.values));jce(f,c,u,e),f.forEach(d=>{l.push(dx(u,mt(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function Bce(e,t,n){const r=Hj(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(e.map(i=>Mu(t(i).values)))}function jce(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(Ve(i)&&(i=i(n,r)),Ve(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(ct(i)?i:i[0])||1,a=(ct(i)?i:i[1])||1,l=o&&o[0]||0,u=o&&o[1]||0;e.forEach(Gj(t,s,a,l,u))}function Gj(e,t,n,r,i){const o=e.x1||0,s=e.y1||0,a=t*n<0;function l(f){f.forEach(u)}function u(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function N3(e,t,n){const r=e>=0?e:QC(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function w_(e){return Ve(e)?e:lr(+e)}function Wj(){var e=l=>l[0],t=l=>l[1],n=$d,r=[-1,-1],i=960,o=500,s=2;function a(l,u){const c=N3(r[0],l,e)>>s,f=N3(r[1],l,t)>>s,d=c?c+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),y=new Float32Array(p*g);let v=m;l.forEach(w=>{const _=d+(+e(w)>>s),k=h+(+t(w)>>s);_>=0&&_=0&&k0&&f>0?(Bc(p,g,m,y,c),jc(p,g,y,m,f),Bc(p,g,m,y,c),jc(p,g,y,m,f),Bc(p,g,m,y,c),jc(p,g,y,m,f)):c>0?(Bc(p,g,m,y,c),Bc(p,g,y,m,c),Bc(p,g,m,y,c),v=y):f>0&&(jc(p,g,m,y,f),jc(p,g,y,m,f),jc(p,g,m,y,f),v=y);const b=u?Math.pow(2,-2*s):1/dz(v);for(let w=0,_=p*g;w<_;++w)v[w]*=b;return{values:v,scale:1<>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(e=w_(l),a):e},a.y=function(l){return arguments.length?(t=w_(l),a):t},a.weight=function(l){return arguments.length?(n=w_(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var u=+l[0],c=+l[1];return u>=0&&c>=0||Y("invalid size"),i=u,o=c,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||Y("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*e]),r[a-i+s*e]=l/Math.min(a+1,e-1+o-a,o))}function jc(e,t,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*e]),r[s+(a-i)*e]=l/Math.min(a+1,t-1+o-a,o))}function cR(e){G.call(this,null,e)}cR.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 Uce=["x","y","weight","size","cellSize","bandwidth"];function Vj(e,t){return Uce.forEach(n=>t[n]!=null?e[n](t[n]):0),e}oe(cR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=Hce(r,e.groupby),o=(e.groupby||[]).map(Xt),s=Vj(Wj(),e),a=e.as||"grid",l=[];function u(c,f){for(let d=0;dmt(u({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function Hce(e,t){var n=[],r=c=>c(a),i,o,s,a,l,u;if(t==null)n.push(e);else for(i={},o=0,s=e.length;on.push(a(c))),o&&s&&(t.visit(l,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:CS,geometry:{type:Gce,coordinates:r}})),this.value={type:dR,features:n}}});function pR(e){G.call(this,null,e)}pR.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"}]};oe(pR,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||ar,o=e.as||"path",s=n.SOURCE;!r||e.modified()?(this.value=r=jj(e.projection),n.materialize().reflow()):s=i===ar||t.modified(i.fields)?n.ADD_MOD:n.ADD;const a=Wce(r,e.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function Wce(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function gR(e){G.call(this,null,e)}gR.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"]}]};oe(gR,G,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],l;function u(c){const f=n([r(c),i(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(l=t.modified(r.fields)||t.modified(i.fields),t.visit(l?t.ADD_MOD:t.ADD,u)),t.modifies(o)}});function mR(e){G.call(this,null,e)}mR.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"}]};oe(mR,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return(!r||e.modified())&&(this.value=r=Vce(jj(e.projection),e.field||qr("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function Vce(e,t,n){const r=n==null?i=>e(t(i)):i=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(i));return e.pointRadius(o),s};return r.context=i=>(e.context(i),r),r}function yR(e){G.call(this,[],e),this.generator=zue()}yR.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}]};oe(yR,G,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(const o in e)Ve(r[o])&&r[o](e[o]);return i=r(),n.length?t.mod.push(a8(n[0],i)):t.add.push(mt(i)),n[0]=i,t}});function vR(e){G.call(this,null,e)}vR.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"}]};oe(vR,G,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve==="shared",i=e.field||ar,o=Yce(e.opacity,e),s=qce(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:r?Mu(n.map(u=>Mu(i(u).values))):0};return n.forEach(u=>{const c=i(u),f=We({},u,l);r||(f.$max=Mu(c.values||[])),u[a]=Xce(c,f,s.dep?s:lr(s(f)),o.dep?o:lr(o(f)))}),t.reflow(!0).modifies(a)}});function qce(e,t){let n;return Ve(e)?(n=r=>wl(e(r,t)),n.dep=qj(e)):n=lr(wl(e||"#888")),n}function Yce(e,t){let n;return Ve(e)?(n=r=>e(r,t),n.dep=qj(e)):e?n=lr(e):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function qj(e){if(!Ve(e))return!1;const t=So(nr(e));return t.$x||t.$y||t.$value||t.$max}function Xce(e,t,n,r){const i=e.width,o=e.height,s=e.x1||0,a=e.y1||0,l=e.x2||i,u=e.y2||o,c=e.values,f=c?m=>c[m]:Ba,d=dl(l-s,u-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,u-a),g=p.data;for(let m=a,y=0;m{e[r]!=null&&M3(n,r,e[r])})):kS.forEach(r=>{e.modified(r)&&M3(n,r,e[r])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&Kce(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Kce(e,t){const n=Qce(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function Jce(e){const t=lR((e||"mercator").toLowerCase());return t||Y("Unrecognized projection type: "+e),t()}function M3(e,t,n){Ve(e[t])&&e[t](n)}function Qce(e){return e=me(e),e.length===1?e[0]:{type:dR,features:e.reduce((t,n)=>t.concat(Zce(n)),[])}}function Zce(e){return e.type===dR?e.features:me(e).filter(t=>t!=null).map(t=>t.type===CS?t:{type:CS,geometry:t})}const efe=Object.freeze(Object.defineProperty({__proto__:null,contour:fR,geojson:hR,geopath:pR,geopoint:gR,geoshape:mR,graticule:yR,heatmap:vR,isocontour:uR,kde2d:cR,projection:Yj},Symbol.toStringTag,{value:"Module"}));function tfe(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,s=n.length,a,l=0,u=0;for(o=0;o=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d,i=o,!(o=o[y=m<<1|g]))return i[y]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,i?i[y]=s:e._root=s,e;do i=i?i[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d;while((y=m<<1|g)===(v=(p>=d)<<1|h>=f));return i[v]=o,i[y]=s,e}function rfe(e){var t,n,r=e.length,i,o,s=new Array(r),a=new Array(r),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=i),of&&(f=o));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(u=(tc||(a=p.y0)>f||(l=p.x1)=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 v=e-+this._x.call(null,h.data),b=t-+this._y.call(null,h.data),w=v*v+b*b;if(w=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+u)/2))?a=h:u=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])&&(r=t,y=m)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function ufe(e){for(var t=0,n=e.length;td.index){var F=h-A.x-A.vx,U=p-A.y-A.vy,M=F*F+U*U;Mh+O||kp+O||Eu.r&&(u.r=u[c].r)}function l(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u[t(_,k,s),_])),w;for(m=0,a=new Array(y);m{}};function Kj(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}dy.prototype=Kj.prototype={constructor:dy,on:function(e,t){var n=this._,r=Sfe(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&e._call.call(void 0,t),e=e._next;--ad}function P3(){Zu=(iv=dg.now())+Kx,ad=ep=0;try{Afe()}finally{ad=0,Rfe(),Zu=0}}function Tfe(){var e=dg.now(),t=e-iv;t>Jj&&(Kx-=t,iv=e)}function Rfe(){for(var e,t=rv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:rv=n);tp=e,AS(r)}function AS(e){if(!ad){ep&&(ep=clearTimeout(ep));var t=e-Zu;t>24?(e<1/0&&(ep=setTimeout(P3,e-dg.now()-Kx)),_h&&(_h=clearInterval(_h))):(_h||(iv=dg.now(),_h=setInterval(Tfe,Jj)),ad=1,Qj(P3))}}function $fe(e,t,n){var r=new ov,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?wR():+a,r._restart(function l(u){u+=i,r._restart(l,i+=s,a),o(u)},s,a)},r.restart(e,t,n),r)}const Ofe=1664525,Nfe=1013904223,L3=4294967296;function Mfe(){let e=1;return()=>(e=(Ofe*e+Nfe)%L3)/L3}function Ffe(e){return e.x}function Dfe(e){return e.y}var Ife=10,Pfe=Math.PI*(3-Math.sqrt(5));function Lfe(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=Zj(f),u=Kj("tick","end"),c=Mfe();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var v=0,b=e.length,w,_,k,E,A;for(y==null?y=1/0:y*=y,v=0;v1?(u.on(g,m),t):u.on(g)}}}function zfe(){var e,t,n,r,i=br(-30),o,s=1,a=1/0,l=.81;function u(h){var p,g=e.length,m=xR(e,Ffe,Dfe).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=Ja(n),w+=y*y),v===0&&(v=Ja(n),w+=v*v),w=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,u=a.length,c;le.touch(t).run()}function Gfe(e,t){const n=Lfe(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),tU(n,t,!0).on("end",()=>o=!0)}function tU(e,t,n,r){var i=me(t.forces),o,s,a,l;for(o=0,s=TS.length;ot(r,n):t)}const Yfe=Object.freeze(Object.defineProperty({__proto__:null,force:_R},Symbol.toStringTag,{value:"Module"}));function Xfe(e,t){return e.parent===t.parent?1:2}function Kfe(e){return e.reduce(Jfe,0)/e.length}function Jfe(e,t){return e+t.x}function Qfe(e){return 1+e.reduce(Zfe,0)}function Zfe(e,t){return Math.max(e,t.y)}function ede(e){for(var t;t=e.children;)e=t[0];return e}function tde(e){for(var t;t=e.children;)e=t[t.length-1];return e}function nde(){var e=Xfe,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=Kfe(h),d.y=Qfe(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var l=ede(o),u=tde(o),c=l.x-e(l,u)/2,f=u.x+e(u,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function rde(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function ide(){return this.eachAfter(rde)}function ode(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function sde(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function ade(e,t){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;t.value=n})}function cde(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function fde(e){for(var t=this,n=dde(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function dde(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function hde(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function pde(){return Array.from(this)}function gde(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function mde(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*yde(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new ld(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(nU)}function vde(){return ER(this).eachBefore(wde)}function xde(e){return e.children}function bde(e){return Array.isArray(e)?e[1]:null}function wde(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function nU(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ld(e){this.data=e,this.depth=this.height=0,this.parent=null}ld.prototype=ER.prototype={constructor:ld,count:ide,each:ode,eachAfter:ade,eachBefore:sde,find:lde,sum:ude,sort:cde,path:fde,ancestors:hde,descendants:pde,leaves:gde,links:mde,copy:vde,[Symbol.iterator]:yde};function hy(e){return e==null?null:rU(e)}function rU(e){if(typeof e!="function")throw new Error;return e}function xu(){return 0}function Jc(e){return function(){return e}}const _de=1664525,Ede=1013904223,B3=4294967296;function Sde(){let e=1;return()=>(e=(_de*e+Ede)%B3)/B3}function kde(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Cde(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function Ade(e,t){for(var n=0,r=(e=Cde(Array.from(e),t)).length,i=[],o,s;n0&&n*n>r*r+i*i}function __(e,t){for(var n=0;n1e-6?(F+Math.sqrt(F*F-4*O*U))/(2*O):U/F);return{x:r+k+E*M,y:i+A+N*M,r:M}}function j3(e,t,n){var r=e.x-t.x,i,o,s=e.y-t.y,a,l,u=r*r+s*s;u?(o=t.r+n.r,o*=o,l=e.r+n.r,l*=l,o>l?(i=(u+l-o)/(2*u),a=Math.sqrt(Math.max(0,l/u-i*i)),n.x=e.x-i*r-a*s,n.y=e.y-i*s+a*r):(i=(u+o-l)/(2*u),a=Math.sqrt(Math.max(0,o/u-i*i)),n.x=t.x+i*r-a*s,n.y=t.y+i*s+a*r)):(n.x=t.x+n.r,n.y=t.y)}function U3(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function H3(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function _0(e){this._=e,this.next=null,this.previous=null}function Ode(e,t){if(!(o=(e=kde(e)).length))return 0;var n,r,i,o,s,a,l,u,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;j3(r,n,i=e[2]),n=new _0(n),r=new _0(r),i=new _0(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lLde(n(w,_,i))),v=y.map(Y3),b=new Set(y).add("");for(const w of v)b.has(w)||(b.add(w),y.push(w),v.push(Y3(w)),o.push(S_));s=(w,_)=>y[_],a=(w,_)=>v[_]}for(c=0,l=o.length;c=0&&(h=o[y],h.data===S_);--y)h.data=null}if(f.parent=Dde,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(nU),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=hy(i),r):e},r.parentId=function(i){return arguments.length?(t=hy(i),r):t},r.path=function(i){return arguments.length?(n=hy(i),r):n},r}function Lde(e){e=`${e}`;let t=e.length;return RS(e,t-1)&&!RS(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function Y3(e){let t=e.length;if(t<2)return"";for(;--t>1&&!RS(e,t););return e.slice(0,t)}function RS(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function zde(e,t){return e.parent===t.parent?1:2}function k_(e){var t=e.children;return t?t[0]:e.t}function C_(e){var t=e.children;return t?t[t.length-1]:e.t}function Bde(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function jde(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function Ude(e,t,n){return e.a.parent===t.parent?e.a:n}function py(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}py.prototype=Object.create(ld.prototype);function Hde(e){for(var t=new py(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new py(o[s],s)),i.parent=n;return(t.parent=new py(null,0)).children=[t],t}function Gde(){var e=zde,t=1,n=1,r=null;function i(u){var c=Hde(u);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),r)u.eachBefore(l);else{var f=u,d=u,h=u;u.eachBefore(function(v){v.xd.x&&(d=v),v.depth>h.depth&&(h=v)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);u.eachBefore(function(v){v.x=(v.x+g)*m,v.y=v.depth*y})}return u}function o(u){var c=u.children,f=u.parent.children,d=u.i?f[u.i-1]:null;if(c){jde(u);var h=(c[0].z+c[c.length-1].z)/2;d?(u.z=d.z+e(u._,d._),u.m=u.z-h):u.z=h}else d&&(u.z=d.z+e(u._,d._));u.parent.A=a(u,d,u.parent.A||f[0])}function s(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function a(u,c,f){if(c){for(var d=u,h=u,p=c,g=d.parent.children[0],m=d.m,y=h.m,v=p.m,b=g.m,w;p=C_(p),d=k_(d),p&&d;)g=k_(g),h=C_(h),h.a=u,w=p.z+v-d.z-m+e(p._,d._),w>0&&(Bde(Ude(p,u,f),u,w),m+=w,y+=w),v+=p.m,m+=d.m,b+=g.m,y+=h.m;p&&!C_(h)&&(h.t=p,h.m+=v-y),d&&!k_(g)&&(g.t=d,g.m+=m-b,f=u)}return f}function l(u){u.x*=t,u.y=u.depth*n}return i.separation=function(u){return arguments.length?(e=u,i):e},i.size=function(u){return arguments.length?(r=!1,t=+u[0],n=+u[1],i):r?null:[t,n]},i.nodeSize=function(u){return arguments.length?(r=!0,t=+u[0],n=+u[1],i):r?[t,n]:null},i}function Jx(e,t,n,r,i){for(var o=e.children,s,a=-1,l=o.length,u=e.value&&(i-n)/e.value;++av&&(v=u),k=m*m*_,b=Math.max(v/k,k/y),b>w){m-=u;break}w=b}s.push(l={value:m,dice:h1?r:1)},n}(aU);function Wde(){var e=uU,t=!1,n=1,r=1,i=[0],o=xu,s=xu,a=xu,l=xu,u=xu;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],t&&d.eachBefore(sU),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var v=o[f];v.x0=p,v.y0=g,v.x1=m,v.y1=y;return}for(var b=u[f],w=h/2+b,_=f+1,k=d-1;_>>1;u[E]y-g){var O=h?(p*N+m*A)/h:m;c(f,_,A,p,g,O,y),c(_,d,N,O,g,m,y)}else{var F=h?(g*N+y*A)/h:y;c(f,_,A,p,g,m,F),c(_,d,N,p,F,m,y)}}}function qde(e,t,n,r,i){(e.depth&1?Jx:lm)(e,t,n,r,i)}const Yde=function e(t){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===t)for(var l,u,c,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n}(aU);function $S(e,t,n){const r={};return e.each(i=>{const o=i.data;n(o)&&(r[t(o)]=i)}),e.lookup=r,e}function SR(e){G.call(this,null,e)}SR.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Xde=e=>e.values;oe(SR,G,{transform(e,t){t.source||Y("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each(s=>{s.children&&fx(s.data)&&i.rem.push(s.data)}),this.value=o=ER({values:me(e.keys).reduce((s,a)=>(s.key(a),s),Kde()).entries(i.source)},Xde),n&&o.each(s=>{s.children&&(s=mt(s.data),i.add.push(s),i.source.push(s))}),$S(o,Re,Re)),i.source.root=o,i}});function Kde(){const e=[],t={entries:i=>r(n(i,0),0),key:i=>(e.push(i),t)};function n(i,o){if(o>=e.length)return i;const s=i.length,a=e[o++],l={},u={};let c=-1,f,d,h;for(;++ce.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return t}function ma(e){G.call(this,null,e)}const Jde=(e,t)=>e.parent===t.parent?1:2;oe(ma,G,{transform(e,t){(!t.source||!t.source.root)&&Y(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(bc(e.sort,s=>s.data)),Qde(n,this.params,e),n.separation&&n.separation(e.separation!==!1?Jde:$d);try{this.value=n(i)}catch(s){Y(s)}return i.each(s=>Zde(s,r,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function Qde(e,t,n){for(let r,i=0,o=t.length;io[Re(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[Re(a)]&&o[Re(l)]&&i.add.push(mt({source:l,target:a}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[Re(s)]=1),n.forEach(s=>{(o[Re(s.source)]||o[Re(s.target)])&&i.mod.push(s)})),i}});const K3={binary:Vde,dice:lm,slice:Jx,slicedice:qde,squarify:uU,resquarify:Yde},FS=["x0","y0","x1","y1","depth","children"];function $R(e){ma.call(this,e)}$R.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:FS.length,default:FS}]};oe($R,ma,{layout(){const e=Wde();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Oe(K3,t)?e.tile(K3[t]):Y("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:FS});const ehe=Object.freeze(Object.defineProperty({__proto__:null,nest:SR,pack:kR,partition:CR,stratify:AR,tree:TR,treelinks:RR,treemap:$R},Symbol.toStringTag,{value:"Module"})),A_=4278190080;function the(e,t){const n=e.bitmap();return(t||[]).forEach(r=>n.set(e(r.boundary[0]),e(r.boundary[3]))),[n,void 0]}function nhe(e,t,n,r,i){const o=e.width,s=e.height,a=r||i,l=dl(o,s).getContext("2d"),u=dl(o,s).getContext("2d"),c=a&&dl(o,s).getContext("2d");n.forEach(A=>gy(l,A,!1)),gy(u,t,!1),a&&gy(c,t,!0);const f=T_(l,o,s),d=T_(u,o,s),h=a&&T_(c,o,s),p=e.bitmap(),g=a&&e.bitmap();let m,y,v,b,w,_,k,E;for(y=0;y{i.items.forEach(o=>gy(e,o.items,n))}):yi[r].draw(e,{items:n?t.map(rhe):t})}function rhe(e){const t=dx(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Ms=5,fr=31,hg=32,Ia=new Uint32Array(hg+1),oo=new Uint32Array(hg+1);oo[0]=0;Ia[0]=~oo[0];for(let e=1;e<=hg;++e)oo[e]=oo[e-1]<<1|1,Ia[e]=~oo[e];function ihe(e,t){const n=new Uint32Array(~~((e*t+hg)/hg));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>Ms]&1<<(a&fr)},set:(o,s)=>{const a=s*e+o;r(a>>>Ms,1<<(a&fr))},clear:(o,s)=>{const a=s*e+o;i(a>>>Ms,~(1<<(a&fr)))},getRange:(o,s,a,l)=>{let u=l,c,f,d,h;for(;u>=s;--u)if(c=u*e+o,f=u*e+a,d=c>>>Ms,h=f>>>Ms,d===h){if(n[d]&Ia[c&fr]&oo[(f&fr)+1])return!0}else{if(n[d]&Ia[c&fr]||n[h]&oo[(f&fr)+1])return!0;for(let p=d+1;p{let u,c,f,d,h;for(;s<=l;++s)if(u=s*e+o,c=s*e+a,f=u>>>Ms,d=c>>>Ms,f===d)r(f,Ia[u&fr]&oo[(c&fr)+1]);else for(r(f,Ia[u&fr]),r(d,oo[(c&fr)+1]),h=f+1;h{let u,c,f,d,h;for(;s<=l;++s)if(u=s*e+o,c=s*e+a,f=u>>>Ms,d=c>>>Ms,f===d)i(f,oo[u&fr]|Ia[(c&fr)+1]);else for(i(f,oo[u&fr]),i(d,Ia[(c&fr)+1]),h=f+1;ho<0||s<0||l>=t||a>=e}}function ohe(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>ihe(i,o),s.ratio=r,s.padding=n,s.width=e,s.height=t,s}function she(e,t,n,r){const i=e.width,o=e.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,u=s.datum.fontSize,c=xo.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,y,v;for(let b=0;b=f&&(f=v,s.x=m,s.y=y);return m=c/2,y=u/2,d=s.x-m,h=s.x+m,p=s.y-y,g=s.y+y,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||t-(s=r/2)<0||t+s>o}function Qa(e,t,n,r,i,o,s,a){const l=i*o/(r*2),u=e(t-l),c=e(t+l),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(u,f,c,d)||s.getRange(u,f,c,d)||a&&a.getRange(u,f,c,d)}function ahe(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1];function l(u,c,f,d,h){const p=e.invert(u),g=e.invert(c);let m=f,y=o,v;if(!sv(p,g,d,h,i,o)&&!Qa(e,p,g,h,d,m,s,a)&&!Qa(e,p,g,h,d,h,s,null)){for(;y-m>=1;)v=(m+y)/2,Qa(e,p,g,h,d,v,s,a)?y=v:m=v;if(m>f)return[p,g,m,!0]}}return function(u){const c=u.datum.datum.items[r].items,f=c.length,d=u.datum.fontSize,h=xo.width(u.datum,u.datum.text);let p=n?d:0,g=!1,m=!1,y=0,v,b,w,_,k,E,A,N,O,F,U,M,L,I,B,H,z;for(let j=0;jb&&(z=v,v=b,b=z),w>_&&(z=w,w=_,_=z),O=e(v),U=e(b),F=~~((O+U)/2),M=e(w),I=e(_),L=~~((M+I)/2),A=F;A>=O;--A)for(N=L;N>=M;--N)H=l(A,N,p,h,d),H&&([u.x,u.y,p,g]=H);for(A=F;A<=U;++A)for(N=L;N<=I;++N)H=l(A,N,p,h,d),H&&([u.x,u.y,p,g]=H);!g&&!n&&(B=Math.abs(b-v+_-w),k=(v+b)/2,E=(w+_)/2,B>=y&&!sv(k,E,h,d,i,o)&&!Qa(e,k,E,d,h,d,s,null)&&(y=B,u.x=k,u.y=E,m=!0))}return g||m?(k=h/2,E=d/2,s.setRange(e(u.x-k),e(u.y-E),e(u.x+k),e(u.y+E)),u.align="center",u.baseline="middle",!0):!1}}const lhe=[-1,-1,1,1],uhe=[-1,1,-1,1];function che(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=e.bitmap();return function(u){const c=u.datum.datum.items[r].items,f=c.length,d=u.datum.fontSize,h=xo.width(u.datum,u.datum.text),p=[];let g=n?d:0,m=!1,y=!1,v=0,b,w,_,k,E,A,N,O,F,U,M,L;for(let I=0;I=1;)M=(F+U)/2,Qa(e,E,A,d,h,M,s,a)?U=M:F=M;F>g&&(u.x=E,u.y=A,g=F,m=!0)}}!m&&!n&&(L=Math.abs(w-b+k-_),E=(b+w)/2,A=(_+k)/2,L>=v&&!sv(E,A,h,d,i,o)&&!Qa(e,E,A,d,h,d,s,null)&&(v=L,u.x=E,u.y=A,y=!0))}return m||y?(E=h/2,A=d/2,s.setRange(e(u.x-E),e(u.y-A),e(u.x+E),e(u.y+A)),u.align="center",u.baseline="middle",!0):!1}}const fhe=["right","center","left"],dhe=["bottom","middle","top"];function hhe(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=r.length;return function(u){const c=u.boundary,f=u.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>i||c[3]>o)return!1;let d=u.textWidth??0,h,p,g,m,y,v,b,w,_,k,E,A,N,O,F;for(let U=0;U>>2&3)-1,g=h===0&&p===0||r[U]<0,m=h&&p?Math.SQRT1_2:1,y=r[U]<0?-1:1,v=c[1+h]+r[U]*h*m,E=c[4+p]+y*f*p/2+r[U]*p*m,w=E-f/2,_=E+f/2,A=e(v),O=e(w),F=e(_),!d)if(J3(A,A,O,F,s,a,v,v,w,_,c,g))d=xo.width(u.datum,u.datum.text);else continue;if(k=v+y*d*h/2,v=k-d/2,b=k+d/2,A=e(v),N=e(b),J3(A,N,O,F,s,a,v,b,w,_,c,g))return u.x=h?h*y<0?b:v:k,u.y=p?p*y<0?_:w:E,u.align=fhe[h*y+1],u.baseline=dhe[p*y+1],s.setRange(A,O,N,F),!0}return!1}}function J3(e,t,n,r,i,o,s,a,l,u,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const R_=0,$_=4,O_=8,N_=0,M_=1,F_=2,phe={"top-left":R_+N_,top:R_+M_,"top-right":R_+F_,left:$_+N_,middle:$_+M_,right:$_+F_,"bottom-left":O_+N_,bottom:O_+M_,"bottom-right":O_+F_},ghe={naive:she,"reduced-search":ahe,floodfill:che};function mhe(e,t,n,r,i,o,s,a,l,u,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=yhe(r,f),h=vhe(i,f),p=xhe(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,m=g==="area",y=bhe(p,g,a,l),v=u===null||u===1/0,b=m&&c==="naive";let w=-1,_=-1;const k=e.map(O=>{const F=v?xo.width(O,O.text):void 0;return w=Math.max(w,F),_=Math.max(_,O.fontSize),{datum:O,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(O),textWidth:F}});u=u===null||u===1/0?Math.max(w,_)+Math.max(...r):u;const E=ohe(t[0],t[1],u);let A;if(!b){n&&k.sort((U,M)=>n(U.datum,M.datum));let O=!1;for(let U=0;UU.datum);A=o.length||F?nhe(E,F||[],o,O,m):the(E,s&&k)}const N=m?ghe[c](E,A,s,l):hhe(E,A,h,d);return k.forEach(O=>O.opacity=+N(O)),k}function yhe(e,t){const n=new Float64Array(t),r=e.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>i(o.datum):t==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const DS=["x","y","opacity","align","baseline"],cU=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function OR(e){G.call(this,null,e)}OR.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:cU},{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:DS.length,default:DS}]};oe(OR,G,{transform(e,t){function n(o){const s=e[o];return Ve(s)&&t.modified(s.fields)}const r=e.modified();if(!(r||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&Y("Size parameter should be specified as a [width, height] array.");const i=e.as||DS;return mhe(t.materialize(t.SOURCE).source||[],e.size,e.sort,me(e.offset==null?1:e.offset),me(e.anchor||cU),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),t.reflow(r).modifies(i)}});const whe=Object.freeze(Object.defineProperty({__proto__:null,label:OR},Symbol.toStringTag,{value:"Module"}));function fU(e,t){var n=[],r=function(c){return c(a)},i,o,s,a,l,u;if(t==null)n.push(e);else for(i={},o=0,s=e.length;o{k8(u,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function MR(e){G.call(this,null,e)}MR.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(IS)},{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}]};oe(MR,G,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=fU(r,e.groupby),o=(e.groupby||[]).map(Xt),s=e.method||"linear",a=e.order==null?3:e.order,l=_he(s,a),u=e.as||[Xt(e.x),Xt(e.y)],c=IS[s],f=[];let d=e.extent;Oe(IS,s)||Y("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){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(mt({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||as(h,e.x),y=v=>{const b={};for(let w=0;wy([v,g.predict(v)])):xx(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Ehe=Object.freeze(Object.defineProperty({__proto__:null,loess:NR,regression:MR},Symbol.toStringTag,{value:"Module"})),ea=11102230246251565e-32,qn=134217729,She=(3+8*ea)*ea;function D_(e,t,n,r,i){let o,s,a,l,u=t[0],c=r[0],f=0,d=0;c>u==c>-u?(o=u,u=t[++f]):(o=c,c=r[++d]);let h=0;if(fu==c>-u?(s=u+o,a=o-(s-u),u=t[++f]):(s=c+o,a=o-(s-c),c=r[++d]),o=s,a!==0&&(i[h++]=a);fu==c>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=t[++f]):(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=L||-M>=L||(f=e-N,a=e-(N+f)+(f-i),f=n-O,u=n-(O+f)+(f-i),f=t-F,l=t-(F+f)+(f-o),f=r-U,c=r-(U+f)+(f-o),a===0&&l===0&&u===0&&c===0)||(L=The*s+She*Math.abs(M),M+=N*c+U*a-(F*u+O*l),M>=L||-M>=L))return M;w=a*U,d=qn*a,h=d-(d-a),p=a-h,d=qn*U,g=d-(d-U),m=U-g,_=p*m-(w-h*g-p*g-h*m),k=l*O,d=qn*l,h=d-(d-l),p=l-h,d=qn*O,g=d-(d-O),m=O-g,E=p*m-(k-h*g-p*g-h*m),y=_-E,f=_-y,dr[0]=_-(y+f)+(f-E),v=w+y,f=v-w,b=w-(v-f)+(y-f),y=b-k,f=b-y,dr[1]=b-(y+f)+(f-k),A=v+y,f=A-v,dr[2]=v-(A-f)+(y-f),dr[3]=A;const I=D_(4,Uc,4,dr,Q3);w=N*c,d=qn*N,h=d-(d-N),p=N-h,d=qn*c,g=d-(d-c),m=c-g,_=p*m-(w-h*g-p*g-h*m),k=F*u,d=qn*F,h=d-(d-F),p=F-h,d=qn*u,g=d-(d-u),m=u-g,E=p*m-(k-h*g-p*g-h*m),y=_-E,f=_-y,dr[0]=_-(y+f)+(f-E),v=w+y,f=v-w,b=w-(v-f)+(y-f),y=b-k,f=b-y,dr[1]=b-(y+f)+(f-k),A=v+y,f=A-v,dr[2]=v-(A-f)+(y-f),dr[3]=A;const B=D_(I,Q3,4,dr,Z3);w=a*c,d=qn*a,h=d-(d-a),p=a-h,d=qn*c,g=d-(d-c),m=c-g,_=p*m-(w-h*g-p*g-h*m),k=l*u,d=qn*l,h=d-(d-l),p=l-h,d=qn*u,g=d-(d-u),m=u-g,E=p*m-(k-h*g-p*g-h*m),y=_-E,f=_-y,dr[0]=_-(y+f)+(f-E),v=w+y,f=v-w,b=w-(v-f)+(y-f),y=b-k,f=b-y,dr[1]=b-(y+f)+(f-k),A=v+y,f=A-v,dr[2]=v-(A-f)+(y-f),dr[3]=A;const H=D_(B,Z3,4,dr,eI);return eI[H-1]}function E0(e,t,n,r,i,o){const s=(t-o)*(n-i),a=(e-i)*(r-o),l=s-a,u=Math.abs(s+a);return Math.abs(l)>=Che*u?l:-Rhe(e,t,n,r,i,o,u)}const tI=Math.pow(2,-52),S0=new Uint32Array(512);class av{static from(t,n=Fhe,r=Dhe){const i=t.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1;let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let O=0;Ou&&(u=F),U>c&&(c=U),this._ids[O]=O}const f=(a+u)/2,d=(l+c)/2;let h=1/0,p,g,m;for(let O=0;O0&&(g=O,h=F)}let b=t[2*g],w=t[2*g+1],_=1/0;for(let O=0;OM&&(O[F++]=L,M=this._dists[L])}this.hull=O.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(E0(y,v,b,w,k,E)<0){const O=g,F=b,U=w;g=m,b=k,w=E,m=O,k=F,E=U}const A=Mhe(y,v,b,w,k,E);this._cx=A.x,this._cy=A.y;for(let O=0;O0&&Math.abs(L-F)<=tI&&Math.abs(I-U)<=tI||(F=L,U=I,M===p||M===g||M===m))continue;let B=0;for(let ce=0,_e=this._hashKey(L,I);ce=0;)if(H=z,H===B){H=-1;break}if(H===-1)continue;let j=this._addTriangle(H,M,r[H],-1,-1,i[H]);i[M]=this._legalize(j+2),i[H]=j,N++;let J=r[H];for(;z=r[J],E0(L,I,t[2*J],t[2*J+1],t[2*z],t[2*z+1])<0;)j=this._addTriangle(J,M,z,i[M],-1,i[J]),i[M]=this._legalize(j+2),r[J]=J,N--,J=z;if(H===B)for(;z=n[H],E0(L,I,t[2*z],t[2*z+1],t[2*H],t[2*H+1])<0;)j=this._addTriangle(z,M,H,-1,i[H],i[z]),this._legalize(j+2),i[z]=j,r[H]=H,N--,H=z;this._hullStart=n[M]=H,r[H]=n[J]=M,r[M]=J,o[this._hashKey(L,I)]=M,o[this._hashKey(t[2*H],t[2*H+1])]=H}this.hull=new Uint32Array(N);for(let O=0,F=this._hullStart;O0?3-n:1+n)/4}function I_(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function Ohe(e,t,n,r,i,o,s,a){const l=e-s,u=t-a,c=n-s,f=r-a,d=i-s,h=o-a,p=l*l+u*u,g=c*c+f*f,m=d*d+h*h;return l*(f*m-g*h)-u*(c*m-g*d)+p*(c*h-f*d)<0}function Nhe(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,u=o-t,c=s*s+a*a,f=l*l+u*u,d=.5/(s*u-a*l),h=(u*c-a*f)*d,p=(s*f-l*c)*d;return h*h+p*p}function Mhe(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,u=o-t,c=s*s+a*a,f=l*l+u*u,d=.5/(s*u-a*l),h=e+(u*c-a*f)*d,p=t+(s*f-l*c)*d;return{x:h,y:p}}function yf(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],s=t[o];let a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;Eh(e,i,o),t[e[n]]>t[e[r]]&&Eh(e,n,r),t[e[o]]>t[e[r]]&&Eh(e,o,r),t[e[n]]>t[e[o]]&&Eh(e,n,o);const a=e[o],l=t[a];for(;;){do o++;while(t[e[o]]l);if(s=s-n?(yf(e,t,o,r),yf(e,t,n,s-1)):(yf(e,t,n,s-1),yf(e,t,o,r))}}function Eh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Fhe(e){return e[0]}function Dhe(e){return e[1]}const nI=1e-6;class Au{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>nI||Math.abs(this._y1-o)>nI)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class PS{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 Ihe=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,y=r.length,v,b;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function jhe(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class FR{static from(t,n=Lhe,r=zhe,i){return new FR("length"in t?Uhe(t,n,r,i):Float64Array.from(Hhe(t,n,r,i)))}constructor(t){this._delaunator=new av(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&&Bhe(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 l=this.collinear[0],u=this.collinear[this.collinear.length-1],c=[n[2*l],n[2*l+1],n[2*u],n[2*u+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Ihe(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:u}=this;if(i[t]===-1||!u.length)return(t+1)%(u.length>>1);let c=t,f=Hc(n-u[t*2],2)+Hc(r-u[t*2+1],2);const d=i[t];let h=d;do{let p=l[h];const g=Hc(n-u[p*2],2)+Hc(r-u[p*2+1],2);if(g>5)*e[1]),m=null,y=u.length,v=-1,b=[],w=u.map(k=>({text:t(k),font:n(k),style:i(k),weight:o(k),rotate:s(k),size:~~(r(k)+1e-14),padding:a(k),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:k})).sort((k,E)=>E.size-k.size);++v>1,_.y=e[1]*(c()+.5)>>1,Yhe(p,_,w,v),_.hasText&&h(g,_,m)&&(b.push(_),m?Khe(m,_):m=[{x:_.x+_.x0,y:_.y+_.y0},{x:_.x+_.x1,y:_.y+_.y1}],_.x-=e[0]>>1,_.y-=e[1]>>1)}return b};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=(ip<<5)/g,p.height=my/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,v=g.y,b=Math.sqrt(e[0]*e[0]+e[1]*e[1]),w=l(e),_=c()<.5?1:-1,k=-_,E,A,N;(E=w(k+=_))&&(A=~~E[0],N=~~E[1],!(Math.min(Math.abs(A),Math.abs(N))>=b));)if(g.x=y+A,g.y=v+N,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!Xhe(g,p,e[0]))&&(!m||Jhe(g,m))){for(var O=g.sprite,F=g.width>>5,U=e[0]>>5,M=g.x-(F<<4),L=M&127,I=32-L,B=g.y1-g.y0,H=(g.y+g.y0)*U+(M>>5),z,j=0;j>>L:0);H+=U}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(u=p,f):u},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=eu(p),f):n},f.fontStyle=function(p){return arguments.length?(i=eu(p),f):i},f.fontWeight=function(p){return arguments.length?(o=eu(p),f):o},f.rotate=function(p){return arguments.length?(s=eu(p),f):s},f.text=function(p){return arguments.length?(t=eu(p),f):t},f.spiral=function(p){return arguments.length?(l=epe[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=eu(p),f):r},f.padding=function(p){return arguments.length?(a=eu(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function Yhe(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,(ip<<5)/o,my/o);var s=0,a=0,l=0,u=n.length,c,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else c=c+31>>5<<5;if(d>l&&(l=d),s+c>=ip<<5&&(s=0,a+=l,l=0),a+d>=my)break;i.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&i.rotate(t.rotate*P_),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var _=i.getImageData(0,0,(ip<<5)/o,my/o).data,k=[];--r>=0;)if(t=n[r],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),O=_[(a+p)*(ip<<5)+(s+h)<<2]?1<<31-h%32:0;k[N]|=O,E|=O}E?A=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+A,t.sprite=k.slice(0,(t.y1-t.y0)*f)}}}function Xhe(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,o=e.x-(i<<4),s=o&127,a=32-s,l=e.y1-e.y0,u=(e.y+e.y0)*n+(o>>5),c,f=0;f>>s:0))&t[u+d])return!0;u+=n}return!1}function Khe(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function Jhe(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const u=o.words(i).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(ji).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=u.length;for(let p=0,g,m;pnew Uint8Array(e),ipe=e=>new Uint16Array(e),Cp=e=>new Uint32Array(e);function ope(){let e=8,t=[],n=Cp(0),r=k0(0,e),i=k0(0,e);return{data:()=>t,seen:()=>n=spe(n,t.length),add(o){for(let s=0,a=t.length,l=o.length,u;st.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>e)&&(e=Math.max(s,e),r=k0(o,e,r),i=k0(o,e))}}}function spe(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function k0(e,t,n){const r=(t<257?rpe:t<65537?ipe:Cp)(e);return n&&r.set(n),r}function rI(e,t,n){const r=1<0)for(m=0;me,size:()=>n}}function ape(e,t){return e.sort.call(t,(n,r)=>{const i=e[n],o=e[r];return io?1:0}),RZ(e,t)}function lpe(e,t,n,r,i,o,s,a,l){let u=0,c=0,f;for(f=0;ut.modified(r.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,u;for(;a{const o=i.remove(t,n);for(const s in r)r[s].reindex(o)})},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,s=r.length;let a=0,l,u;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(u,d);pd)for(p=Math.max(u,d),g=c;pa[c]&n?null:s[c];return o.filter(o.MOD,u),i&i-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^l[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^l[c]&n))?s[c]:null})):(o.filter(o.ADD,u),o.filter(o.REM,c=>(a[c]&n)===i?s[c]:null)),o.filter(o.SOURCE,c=>u(c._index))}});const upe=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:PR,resolvefilter:LR},Symbol.toStringTag,{value:"Module"})),cpe="RawCode",ec="Literal",fpe="Property",dpe="Identifier",hpe="ArrayExpression",ppe="BinaryExpression",pU="CallExpression",gpe="ConditionalExpression",mpe="LogicalExpression",ype="MemberExpression",vpe="ObjectExpression",xpe="UnaryExpression";function $o(e){this.type=e}$o.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=bpe(this),n=0,r=t.length;n";ws[tc]="Identifier";ws[Hl]="Keyword";ws[Zx]="Null";ws[Sc]="Numeric";ws[Mr]="Punctuator";ws[fm]="String";ws[wpe]="RegularExpression";var _pe="ArrayExpression",Epe="BinaryExpression",Spe="CallExpression",kpe="ConditionalExpression",gU="Identifier",Cpe="Literal",Ape="LogicalExpression",Tpe="MemberExpression",Rpe="ObjectExpression",$pe="Property",Ope="UnaryExpression",kn="Unexpected token %0",Npe="Unexpected number",Mpe="Unexpected string",Fpe="Unexpected identifier",Dpe="Unexpected reserved word",Ipe="Unexpected end of input",LS="Invalid regular expression",L_="Invalid regular expression: missing /",mU="Octal literals are not allowed in strict mode.",Ppe="Duplicate data property in object literal not allowed in strict mode",Pn="ILLEGAL",pg="Disabled.",Lpe=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]"),zpe=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 eb(e,t){if(!e)throw new Error("ASSERT: "+t)}function Bs(e){return e>=48&&e<=57}function zR(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function Ap(e){return"01234567".indexOf(e)>=0}function Bpe(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].indexOf(e)>=0}function gg(e){return e===10||e===13||e===8232||e===8233}function dm(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Lpe.test(String.fromCharCode(e))}function lv(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&zpe.test(String.fromCharCode(e))}const jpe={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 yU(){for(;q1114111||e!=="}")&&dt({},kn,Pn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function vU(){var e,t;for(e=Ee.charCodeAt(q++),t=String.fromCharCode(e),e===92&&(Ee.charCodeAt(q)!==117&&dt({},kn,Pn),++q,e=zS("u"),(!e||e==="\\"||!dm(e.charCodeAt(0)))&&dt({},kn,Pn),t=e);q>>=")return q+=4,{type:Mr,value:s,start:e,end:q};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return q+=3,{type:Mr,value:o,start:e,end:q};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".indexOf(r)>=0||i==="=>")return q+=2,{type:Mr,value:i,start:e,end:q};if(i==="//"&&dt({},kn,Pn),"<>=!+-*%&|^/".indexOf(r)>=0)return++q,{type:Mr,value:r,start:e,end:q};dt({},kn,Pn)}function Wpe(e){let t="";for(;qe!==t,exterior:(e,t)=>e===t};function n8(e,t){let n,r,i,o;return e=WC(e,t),t&&t.feature?(n=vZ,i=t.feature):t&&t.mesh?(n=bZ,i=t.mesh,o=Fte[t.filter]):Y("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):Y("Invalid TopoJSON object: "+i),r&&r.features||[r]}n8.responseType="json";const ey={dsv:GC,csv:FF(","),tsv:FF(" "),json:WC,topojson:n8};function VC(e,t){return arguments.length>1?(ey[e]=t,this):Oe(ey,e)?ey[e]:null}function r8(e){const t=VC(e);return t&&t.responseType||"text"}function i8(e,t,n,r){t=t||{};const i=VC(t.type||"json");return i||Y("Unknown data format type: "+t.type),e=i(e,t),t.parse&&Dte(e,t.parse,n,r),Oe(e,"columns")&&delete e.columns,e}function Dte(e,t,n,r){if(!e.length)return;const i=eg();n=n||i.timeParse,r=r||i.utcParse;let o=e.columns||Object.keys(e[0]),s,a,l,u,c,f;t==="auto"&&(t=t8(e,o)),o=Object.keys(t);const d=o.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"?r:n)(m);if(!$E[p])throw Error("Illegal format pattern: "+h+":"+p);return $E[p]});for(l=0,c=e.length,f=o.length;l{const o=t(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=t(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function ty(e,t){try{await t(e)}catch(n){e.error(n)}}const o8=Symbol("vega_id");let Ite=1;function fx(e){return!!(e&&Re(e))}function Re(e){return e[o8]}function s8(e,t){return e[o8]=t,e}function mt(e){const t=e===Object(e)?e:{data:e};return Re(t)?t:s8(t,Ite++)}function qC(e){return dx(e,mt({}))}function dx(e,t){for(const n in e)t[n]=e[n];return t}function a8(e,t){return s8(t,Re(e))}function bc(e,t){return e?t?(n,r)=>e(n,r)||Re(t(n))-Re(t(r)):(n,r)=>e(n,r)||Re(n)-Re(r):null}function l8(e){return e&&e.constructor===wc}function wc(){const e=[],t=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:wc,insert(a){const l=me(a),u=l.length;for(let c=0;c{p(v)&&(u[Re(v)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(v)&&u[Re(v)]>0&&y(v,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||r.length?l.filter(v=>u[Re(v)]>0):l.slice();else for(m in c)a.mod.push(c[m]);return(o||o==null&&(t.length||r.length))&&a.clean(!0),a}}}const ny="_:mod:_";function hx(){Object.defineProperty(this,ny,{writable:!0,value:{}})}hx.prototype={set(e,t,n,r){const i=this,o=i[e],s=i[ny];return t!=null&&t>=0?(o[t]!==n||r)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||r)&&(i[e]=n,s[e]=K(n)?1+n.length:-1),i},modified(e,t){const n=this[ny];if(arguments.length){if(K(e)){for(let r=0;r=0?t+1{h instanceof Ct?(h!==this&&(t&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in e)if(a=e[s],s===Lte)me(a).forEach(f=>{f instanceof Ct?f!==this&&(f.targets().add(this),o.push(f)):Y("Pulse parameters must be operator instances.")}),this.source=a;else if(K(a))for(r.set(s,-1,Array(l=a.length)),u=0;u{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Ra();return this.targets().add(Ra(null,null,$C(e,n=>{const r=n.dataflow;t.receive(n),r&&r.run&&r.run()}))),t},between(e,t){let n=!1;return e.targets().add(Ra(null,null,()=>n=!0)),t.targets().add(Ra(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=zi,this._targets=null}};function Wte(e,t,n,r){const i=this,o=Ra(n,r),s=function(u){u.dataflow=i;try{o.receive(u)}catch(c){i.error(c)}finally{i.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=me(e);const l=a.length;for(let u=0;ut=r);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const Jte={skip:!0};function Qte(e,t,n,r,i){return(e instanceof Ct?ene:Zte)(this,e,t,n,r,i),this}function Zte(e,t,n,r,i,o){const s=We({},o,Jte);let a,l;Ve(n)||(n=lr(n)),r===void 0?a=u=>e.touch(n(u)):Ve(r)?(l=new Ct(null,r,i,!1),a=u=>{l.evaluate(u);const c=n(u),f=l.value;l8(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=u=>e.update(n(u),r,s),t.apply(a)}function ene(e,t,n,r,i,o){if(r===void 0)t.targets().add(n);else{const s=o||{},a=new Ct(null,tne(n,r),i,!1);a.modified(s.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 tne(e,t){return t=Ve(t)?t:lr(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function nne(e){e.rank=++this._rank}function rne(e){const t=[e];let n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&Y("Cycle detected in dataflow graph.")}const l1={},Wo=1,Fa=2,Is=4,ine=Wo|Fa,IF=Wo|Is,Pc=Wo|Fa|Is,PF=8,mh=16,LF=32,zF=64;function fl(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Qw(e,t){const n=[];return Ma(e,t,r=>n.push(r)),n}function BF(e,t){const n={};return e.visit(t,r=>{n[Re(r)]=1}),r=>n[Re(r)]?null:r}function i0(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}fl.prototype={StopPropagation:l1,ADD:Wo,REM:Fa,MOD:Is,ADD_REM:ine,ADD_MOD:IF,ALL:Pc,REFLOW:PF,SOURCE:mh,NO_SOURCE:LF,NO_FIELDS:zF,fork(e){return new fl(this.dataflow).init(this,e)},clone(){const e=this.fork(Pc);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(Pc|mh)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new fl(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&zF)&&(n.fields=e.fields),t&Wo?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Fa?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Is?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&LF?(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||Pc;return t&Wo&&this.add.length||t&Fa&&this.rem.length||t&Is&&this.mod.length},reflow(e){if(e)return this.fork(Pc).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Is,BF(this,Wo))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return K(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?K(e)?e.some(r=>n[r]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Wo&&(n.addF=i0(n.addF,t)),e&Fa&&(n.remF=i0(n.remF,t)),e&Is&&(n.modF=i0(n.modF,t)),e&mh&&(n.srcF=i0(n.srcF,t)),n},materialize(e){e=e||Pc;const t=this;return e&Wo&&t.addF&&(t.add=Qw(t.add,t.addF),t.addF=null),e&Fa&&t.remF&&(t.rem=Qw(t.rem,t.remF),t.remF=null),e&Is&&t.modF&&(t.mod=Qw(t.mod,t.modF),t.modF=null),e&mh&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(e&mh)return Ma(n.source,n.srcF,r),n;e&Wo&&Ma(n.add,n.addF,r),e&Fa&&Ma(n.rem,n.remF,r),e&Is&&Ma(n.mod,n.modF,r);const i=n.source;if(e&PF&&i){const o=n.add.length+n.mod.length;o===i.length||(o?Ma(i,BF(n,IF),r):Ma(i,n.srcF,r))}return n}};function YC(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}oe(YC,fl,{fork(e){const t=new fl(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?K(e)?e.some(r=>n[r]):n[e]:0},filter(){Y("MultiPulse does not support filtering.")},materialize(){Y("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;or._enqueue(c,!0)),r._touched=cx(Lg);let s=0,a,l,u;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,e)),l.then?l=await l:l.async&&(i.push(l.async),l=l1),l!==l1&&a._targets&&a._targets.forEach(c=>r._enqueue(c)),++s}}catch(c){r._heap.clear(),u=c}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),u&&(r._postrun=[],r.error(u)),r._postrun.length){const c=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{c.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function sne(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function ane(e,t,n){return this._pulse?u8(this):(this.evaluate(e,t,n),this)}function lne(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(r){this.error(r)}}function u8(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function une(e,t){const n=e.stampi.pulse),t):this._input[e.id]||fne(this._pulse,n&&n.pulse)}function fne(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==l1&&(e.source=t.source),e)}const XC={skip:!1,force:!1};function dne(e,t){const n=t||XC;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function hne(e,t,n){const r=n||XC;return(e.set(t)||r.force)&&this.touch(e,r),this}function pne(e,t,n){this.touch(e,n||XC);const r=new fl(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function gne(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),c8(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,mne(t,0,e)):r=n,r}}}function c8(e,t,n,r){let i,o;const s=e[n];for(;n>t;){if(o=n-1>>1,i=e[o],r(s,i)<0){e[n]=i,n=o;continue}break}return e[n]=s}function mne(e,t,n){const r=t,i=e.length,o=e[t];let s=(t<<1)+1,a;for(;s=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,c8(e,r,t,n)}function kf(){this.logger(kC()),this.logLevel(EC),this._clock=0,this._rank=0,this._locale=HC();try{this._loader=ux()}catch{}this._touched=cx(Lg),this._input={},this._pulse=null,this._heap=gne((e,t)=>e.qrank-t.qrank),this._postrun=[]}function yh(e){return function(){return this._log[e].apply(this,arguments)}}kf.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:yh("error"),warn:yh("warn"),info:yh("info"),debug:yh("debug"),logLevel:yh("level"),cleanThreshold:1e4,add:Ute,connect:Hte,rank:nne,rerank:rne,pulse:pne,touch:dne,update:hne,changeset:wc,ingest:qte,parse:Vte,preload:Xte,request:Yte,events:Wte,on:Qte,evaluate:one,run:ane,runAsync:sne,runAfter:lne,_enqueue:une,_getPulse:cne};function G(e,t){Ct.call(this,e,null,t)}oe(G,Ct,{run(e){if(e.stampthis.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 Yf={};function f8(e){const t=d8(e);return t&&t.Definition||null}function d8(e){return e=e&&e.toLowerCase(),Oe(Yf,e)?Yf[e]:null}function*h8(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function KC(e,t,n){const r=Float64Array.from(h8(e,n));return r.sort(Qs),t.map(i=>uz(r,i))}function JC(e,t){return KC(e,[.25,.5,.75],t)}function QC(e,t){const n=e.length,r=TZ(e,t),i=JC(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function p8(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,l,u,c,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=i.length;f=u&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/r)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+g)*a,o=od);const i=e.length,o=new Float64Array(i);let s=0,a=1,l=r(e[0]),u=l,c=l+t,f;for(;a=c){for(u=(l+u)/2;s>1);si;)e[s--]=e[r]}r=i,i=o}return e}function xne(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function bne(e,t){t==null&&(t=e,e=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*ji())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(e).max(t)}const y8=Math.sqrt(2*Math.PI),wne=Math.SQRT2;let vh=NaN;function gx(e,t){e=e||0,t=t??1;let n=0,r=0,i,o;if(vh===vh)n=vh,vh=NaN;else{do n=ji()*2-1,r=ji()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,vh=r*o}return e+n*t}function ZC(e,t,n){n=n??1;const r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*y8)}function mx(e,t,n){t=t||0,n=n??1;const r=(e-t)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function yx(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*wne*_ne(2*e-1)}function _ne(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 eA(e,t){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>gx(n,r),pdf:o=>ZC(o,n,r),cdf:o=>mx(o,n,r),icdf:o=>yx(o,n,r)};return i.mean(e).stdev(t)}function tA(e,t){const n=eA();let r=0;const i={data(o){return arguments.length?(e=o,r=o?o.length:0,i.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=QC(e)),i):t},sample(){return e[~~(ji()*r)]+t*n.sample()},pdf(o){let s=0,a=0;for(;anA(n,r),pdf:o=>rA(o,n,r),cdf:o=>iA(o,n,r),icdf:o=>oA(o,n,r)};return i.mean(e).stdev(t)}function x8(e,t){let n=0,r;function i(s){const a=[];let l=0,u;for(u=0;u=t&&e<=n?1/(n-t):0}function lA(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function uA(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function b8(e,t){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>sA(n,r),pdf:o=>aA(o,n,r),cdf:o=>lA(o,n,r),icdf:o=>uA(o,n,r)};return t==null&&(t=e??1,e=0),i.min(e).max(t)}function cA(e,t,n){let r=0,i=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function Ug(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function vx(e,t,n,r){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&e.sort((h,p)=>t(h)-t(p));const i=e.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,u=0,c,f,d;for(d of e)o[a]=c=+t(d),s[a]=f=+n(d),++a,l+=(c-l)/a,u+=(f-u)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function Ld(e,t,n,r,i){let o=0,s=0;return Hg(e,t,n,(a,l)=>{const u=l-i(a),c=l-r;o+=u*u,s+=c*c}),1-o/s}function fA(e,t,n){let r=0,i=0,o=0,s=0,a=0;Hg(e,t,n,(c,f)=>{++a,r+=(c-r)/a,i+=(f-i)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const l=Ug(r,i,o,s),u=c=>l[0]+l[1]*c;return{coef:l,predict:u,rSquared:Ld(e,t,n,i,u)}}function w8(e,t,n){let r=0,i=0,o=0,s=0,a=0;Hg(e,t,n,(c,f)=>{++a,c=Math.log(c),r+=(c-r)/a,i+=(f-i)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const l=Ug(r,i,o,s),u=c=>l[0]+l[1]*Math.log(c);return{coef:l,predict:u,rSquared:Ld(e,t,n,i,u)}}function _8(e,t,n){const[r,i,o,s]=vx(e,t,n);let a=0,l=0,u=0,c=0,f=0,d,h,p;Hg(e,t,n,(v,b)=>{d=r[f++],h=Math.log(b),p=d*b,a+=(b*h-a)/f,l+=(p-l)/f,u+=(p*h-u)/f,c+=(d*p-c)/f});const[g,m]=Ug(l/s,a/s,u/s,c/s),y=v=>Math.exp(g+m*(v-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:Ld(e,t,n,s,y)}}function E8(e,t,n){let r=0,i=0,o=0,s=0,a=0,l=0;Hg(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const u=Ug(r,i,o,s),c=f=>u[0]*Math.pow(f,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:Ld(e,t,n,a,c)}}function dA(e,t,n){const[r,i,o,s]=vx(e,t,n),a=r.length;let l=0,u=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(E=E-o,b*E*E+w*E+_+s);return{coef:[_-w*o+b*o*o+s,w-2*b*o,b],predict:k,rSquared:Ld(e,t,n,s,k)}}function S8(e,t,n,r){if(r===0)return cA(e,t,n);if(r===1)return fA(e,t,n);if(r===2)return dA(e,t,n);const[i,o,s,a]=vx(e,t,n),l=i.length,u=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;d{b-=s;let w=a+y[0]+y[1]*b+y[2]*b*b;for(d=3;d=0;--o)for(a=t[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function Sne(e){const t=e.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(e[r][s])&&(s=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(a=0,o=i+1;oi[b]-y?v:b;let _=0,k=0,E=0,A=0,N=0;const O=1/Math.abs(i[w]-y||1);for(let M=v;M<=b;++M){const L=i[M],I=o[M],B=kne(Math.abs(y-L)*O)*d[M],H=L*B;_+=B,k+=H,E+=I*B,A+=I*H,N+=L*H}const[F,U]=Ug(k/_,E/_,A/_,N/_);c[m]=F+U*y,f[m]=Math.abs(o[m]-c[m]),Cne(i,m+1,p)}if(h===jF)break;const g=cz(f);if(Math.abs(g)=1?UF:(v=1-y*y)*v}return Ane(i,c,s,a)}function kne(e){return(e=1-e*e*e)*e*e}function Cne(e,t,n){const r=e[t];let i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}function Ane(e,t,n,r){const i=e.length,o=[];let s=0,a=0,l=[],u;for(;s[g,e(g)],o=t[0],s=t[1],a=s-o,l=a/r,u=[i(o)],c=[];if(n===r){for(let g=1;g0;)c.push(i(o+g/n*a))}let f=u[0],d=c[c.length-1];const h=1/a,p=Rne(f[1],c);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&$ne(f,g,d,h,p)>Tne?c.push(g):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function Rne(e,t){let n=e,r=e;const i=t.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function $ne(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),s=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-s)}function One(e){return t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r{},Nne={init:Zw,add:Zw,rem:Zw,idx:0},tg={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.sum,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{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{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}},Gg=Object.keys(tg).filter(e=>e!=="__count__");function Mne(e,t){return n=>We({name:e,out:n||e},Nne,t)}[...Gg,"__count__"].forEach(e=>{tg[e]=Mne(e,tg[e])});function A8(e,t){return tg[e](t)}function T8(e,t){return e.idx-t.idx}function Fne(e){const t={};e.forEach(r=>t[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{t[i]||n(t[i]=tg[i]())})};return e.forEach(n),Object.values(t).sort(T8)}function Dne(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function Ine(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function Pne(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function Lne(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function R8(e,t){const n=t||ar,r=Fne(e),i=e.slice().sort(T8);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=Dne,o.prototype.add=Ine,o.prototype.rem=Pne,o.prototype.set=Lne,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function hA(e){this._key=e?qr(e):Re,this.reset()}const Hn=hA.prototype;Hn.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Hn.add=function(e){this._add.push(e)};Hn.rem=function(e){this._rem.push(e)};Hn.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),s={};let a,l,u;for(a=0;a=0;)o=e(t[r])+"",Oe(n,o)||(n[o]=1,++i);return i};Hn.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=W6(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Hn.argmin=function(e){return this.extent(e)[0]||{}};Hn.argmax=function(e){return this.extent(e)[1]||{}};Hn.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Hn.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Hn.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=JC(this.values(),e),this._get=e),this._q};Hn.q1=function(e){return this.quartile(e)[0]};Hn.q2=function(e){return this.quartile(e)[1]};Hn.q3=function(e){return this.quartile(e)[2]};Hn.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=g8(this.values(),1e3,.05,e),this._get=e),this._ci};Hn.ci0=function(e){return this.ci(e)[0]};Hn.ci1=function(e){return this.ci(e)[1]};function xl(e){G.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}xl.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Gg},{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"}]};oe(xl,G,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,u,c,f;for(l in a)for(c=a[l].tuple,u=0;u{const y=Xt(m);return i(m),n.push(y),y}),this.cellkey=e.key?e.key:OE(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.as||[],l=o.length,u={};let c,f,d,h,p,g;for(l!==s.length&&Y("Unmatched number of fields and aggregate ops."),g=0;gR8(m,m.field)),Object.create(null)},cellkey:OE(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=r(c);c[a]=f,c[l]=f==null?null:i+o*(1+(f-i)/o)}:c=>c[a]=r(c)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=p8(e),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=e.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(u){let c=Zn(t(u));return c==null?null:co?1/0:(c=Math.max(i,Math.min(c,o-r)),i+r*Math.floor(zne+(c-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=ei(l,nr(t),e.name||"bin_"+Xt(t))}});function $8(e,t,n){const r=e;let i=t||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,u)=>(a&&(i=i.filter(c=>!s[r(c)]),s={},a=0),u&&l&&i.sort(l),o.length&&(i=l?J6(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function gA(e){G.call(this,[],e)}gA.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};oe(gA,G,{transform(e,t){const n=t.fork(t.ALL),r=$8(Re,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(bc(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function O8(e){Ct.call(this,null,Bne,e)}oe(O8,Ct);function Bne(e){return this.value&&!e.modified()?this.value:RC(e.fields,e.orders)}function mA(e){G.call(this,null,e)}mA.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 jne(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}oe(mA,G,{transform(e,t){const n=f=>d=>{for(var h=jne(a(d),e.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),c=n(f=>i[f]-=1);return r?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_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,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,u;for(a in n)l=r[a],u=n[a]||0,!l&&u?(r[a]=l=mt({}),l[i]=a,l[o]=u,s.add.push(l)):u===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==u&&(l[o]=u,s.mod.push(l));return s.modifies(t)}});function yA(e){G.call(this,null,e)}yA.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};oe(yA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=Une(a,i,o,e.filter||zi)):n.mod=a,n.source=this.value,n.modifies(r)}});function Une(e,t,n,r){for(var i=[],o={},s=e.length,a=0,l,u;aN8(o,t))):typeof r[i]===GF&&r[i](e[i]);return r}function vA(e){G.call(this,null,e)}const M8=[{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}]}],Wne={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:M8},{name:"weights",type:"number",array:!0}]};vA.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:M8.concat(Wne)},{name:"as",type:"string",array:!0,default:["value","density"]}]};oe(vA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=N8(e.distribution,Vne(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&Y("Invalid density method: "+s),!e.extent&&!r.data&&Y("Missing density extent parameter."),s=r[s];const a=e.as||["value","density"],l=e.extent||as(r.data()),u=xx(s,l,i,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],mt(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function Vne(e){return()=>e.materialize(e.SOURCE).source}function F8(e,t){return e?e.map((n,r)=>t[r]||Xt(n)):null}function xA(e,t,n){const r=[],i=f=>f(l);let o,s,a,l,u,c;if(t==null)r.push(e.map(n));else for(o={},s=0,a=e.length;szg(as(e,t))/30;oe(bA,G,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,r=xA(t.source,e.groupby,ar),i=e.smooth||!1,o=e.field,s=e.step||qne(n,o),a=bc((p,g)=>o(p)-o(g)),l=e.as||D8,u=r.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(l)}});function I8(e){Ct.call(this,null,Yne,e),this.modified(!0)}oe(I8,Ct);function Yne(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ei(n=>t(n,e),nr(t),Xt(t))}function wA(e){G.call(this,[void 0,void 0],e)}wA.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};oe(wA,G,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),t.visit(i?t.SOURCE:t.ADD,a=>{const l=Zn(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Xt(r);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function _A(e,t){Ct.call(this,e),this.parent=t,this.count=0}oe(_A,Ct,{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 bx(e){G.call(this,{},e),this._keys=Md();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let r=0,i=t.active;rr&&r.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(l,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const u=Re(l),c=o.get(u);c!==void 0&&(o.delete(u),a(c).rem(l))}),t.visit(t.ADD,l=>{const u=r(l);o.set(Re(l),u),a(u).add(l)}),s||t.modified(r.fields)?t.visit(t.MOD,l=>{const u=Re(l),c=o.get(u),f=r(l);c===f?a(f).mod(l):(o.set(u,f),a(c).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(o.get(Re(l))).mod(l)}),s&&t.visit(t.REFLOW,l=>{const u=Re(l),c=o.get(u),f=r(l);c!==f&&(o.set(u,f),a(c).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function P8(e){Ct.call(this,null,Xne,e)}oe(P8,Ct);function Xne(e){return this.value&&!e.modified()?this.value:K(e.name)?me(e.name).map(t=>qr(t)):qr(e.name,e.as)}function EA(e){G.call(this,Md(),e)}EA.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};oe(EA,G,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,s=i.rem,a=i.mod,l=e.expr;let u=!0;t.visit(t.REM,f=>{const d=Re(f);r.has(d)?r.delete(d):s.push(f)}),t.visit(t.ADD,f=>{l(f,e)?o.push(f):r.set(Re(f),1)});function c(f){const d=Re(f),h=l(f,e),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):u&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function SA(e){G.call(this,[],e)}SA.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}]};oe(SA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=F8(r,e.as||[]),o=e.index||null,s=i.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=r.map(p=>p(a)),u=l.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;cs[r]=n(s,e))}});function L8(e){G.call(this,[],e)}oe(L8,G,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i=this.value,o=e.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=mt(r(e))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const o0={value:"value",median:cz,mean:FZ,min:bE,max:Mu},Kne=[];function AA(e){G.call(this,[],e)}AA.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 Jne(e){var t=e.method||o0.value,n;if(o0[t]==null)Y("Unrecognized imputation method: "+t);else return t===o0.value?(n=e.value!==void 0?e.value:0,()=>n):o0[t]}function Qne(e){const t=e.field;return n=>n?t(n):NaN}oe(AA,G,{transform(e,t){var n=t.fork(t.ALL),r=Jne(e),i=Qne(e),o=Xt(e.field),s=Xt(e.key),a=(e.groupby||[]).map(Xt),l=Zne(t.source,e.groupby,e.key,e.keyvals),u=[],c=this.value,f=l.domain.length,d,h,p,g,m,y,v,b,w,_;for(m=0,b=l.length;my(m),o=[],s=r?r.slice():[],a={},l={},u,c,f,d,h,p,g,m;for(s.forEach((y,v)=>a[y]=v+1),d=0,g=e.length;dn.add(o))):(i=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{We(o,i[n.cellkey(o)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const p=tA(h,s)[a],g=e.counts?h.length:1,m=c||as(h);xx(p,m,f,d).forEach(y=>{const v={};for(let b=0;b(this._pending=me(i.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(r=>e_(this,t,me(r.data)))}});function tre(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function e_(e,t,n){n.forEach(mt);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function $A(e){G.call(this,{},e)}$A.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}]};oe($A,G,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let l=s?t.SOURCE:t.ADD,u=t,c=e.as,f,d,h;return i?(d=i.length,a>1&&!c&&Y('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&Y('The "as" parameter has too few output field names.'),c=c||i.map(Xt),f=function(p){for(var g=0,m=0,y,v;gt.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),u.modifies(c)}});function j8(e){Ct.call(this,null,nre,e)}oe(j8,Ct);function nre(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function U8(e){Ct.call(this,null,rre,e)}oe(U8,Ct);function rre(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function H8(e){G.call(this,null,e)}oe(H8,G,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function OA(e){xl.call(this,e)}OA.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:Gg,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};oe(OA,xl,{_transform:xl.prototype.transform,transform(e,t){return this._transform(ire(e,t),t)}});function ire(e,t){const n=e.field,r=e.value,i=(e.op==="count"?"__count__":e.op)||"sum",o=nr(n).concat(nr(r)),s=sre(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>i),fields:s.map(a=>ore(a,n,r,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function ore(e,t,n,r){return ei(i=>t(i)===e?n(i):NaN,r,e+"")}function sre(e,t,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=e(o);r[s]||(r[s]=1,i.push(s))}),i.sort(nx),t?i.slice(0,t):i}function G8(e){bx.call(this,e)}oe(G8,bx,{transform(e,t){const n=e.subflow,r=e.field,i=o=>this.subflow(Re(o),n,t,o);return(e.modified("field")||r&&t.modified(nr(r)))&&Y("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(mt(a)))}),t.visit(t.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>i(o).mod(o)),t.visit(t.ADD,o=>i(o).add(o)),t.visit(t.REM,o=>i(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function NA(e){G.call(this,null,e)}NA.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};oe(NA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=F8(e.fields,e.as||[]),o=r?(a,l)=>are(a,l,r,i):dx;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const l=Re(a);n.rem.push(s[l]),s[l]=null}),t.visit(t.ADD,a=>{const l=o(a,mt({}));s[Re(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[Re(a)]))}),n}});function are(e,t,n,r){for(let i=0,o=n.length;i{const d=KC(f,u);for(let h=0;h{const o=Re(i);n.rem.push(r[o]),r[o]=null}),t.visit(t.ADD,i=>{const o=qC(i);r[Re(i)]=o,n.add.push(o)}),t.visit(t.MOD,i=>{const o=r[Re(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function FA(e){G.call(this,[],e),this.count=0}FA.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};oe(FA,G,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((c,f)=>(c[Re(f)]=1,c),{});let s=this.value,a=this.count,l=0;function u(c){let f,d;s.length=l&&(f=s[d],o[Re(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=Re(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[Re(c)]!==-1)),(t.rem.length||r)&&s.length{o[Re(c)]||u(c)}),l=-1),r&&s.length>i){const c=s.length-i;for(let f=0;f{o[Re(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=s.filter(c=>!o[Re(c)])),this.count=a,this.value=n.source=s,n}});function DA(e){G.call(this,null,e)}DA.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"}]};oe(DA,G,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=ci(e.start,e.stop,e.step||1).map(i=>{const o={};return o[r]=i,mt(o)}),n.add=t.add.concat(this.value),n}});function q8(e){G.call(this,null,e),this.modified(!0)}oe(q8,G,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function IA(e){G.call(this,null,e)}const Y8=["unit0","unit1"];IA.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:LC,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:Y8}]};oe(IA,G,{transform(e,t){const n=e.field,r=e.interval!==!1,i=e.timezone==="utc",o=this._floor(e,t),s=(i?Pd:Id)(o.unit).offset,a=e.as||Y8,l=a[0],u=a[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(nr(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[l]=null,r&&(p[u]=null)):(p[l]=m=y=o(g),r&&(p[u]=y=s(m,c)),md&&(d=y))}),o.start=f,o.stop=d,t.modifies(r?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:Lz({extent:e.extent||as(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=zC(r),s=this.value||{},a=(n?Rz:Tz)(o,i);return a.unit=it(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function X8(e){G.call(this,Md(),e)}oe(X8,G,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>i.delete(r(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}});function K8(e){G.call(this,null,e)}oe(K8,G,{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(bc(e.sort)):t.source).map(e.field))}});function ure(e,t,n,r){const i=ng[e](t,n);return{init:i.init||Ba,update:function(o,s){s[r]=i.next(o)}}}const ng={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=ng.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,r=t.compare;let i=t.index;if(e0||Y("ntile num must be greater than zero.");const n=ng.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(t*r(i))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(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||Y("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return r!=null?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=cre(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}};function cre(e,t,n){for(let r=t.length;na[p]=1)}d(e.sort),t.forEach((h,p)=>{const g=n[p],m=Xt(g),y=C8(h,m,i[p]);if(d(g),o.push(y),Oe(ng,h))s.push(ure(h,n[p],r[p],y));else{if(g==null&&h!=="count"&&Y("Null aggregate field specified."),h==="count"){u.push(y);return}f=!1;let v=l[m];v||(v=l[m]=[],v.field=g,c.push(v)),v.push(A8(h,y))}}),(u.length||c.length)&&(this.cell=dre(c,u,f)),this.inputs=Object.keys(a)}const Q8=J8.prototype;Q8.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};Q8.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let s;if(n){for(s=e.p0;sR8(l,l.field));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new J8(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),r1?0:e<-1?Xf:Math.acos(e)}function VF(e){return e>=1?u1:e<=-1?-u1:Math.asin(e)}const NE=Math.PI,ME=2*NE,hu=1e-6,xre=ME-hu;function eB(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return eB;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;ihu)if(!(Math.abs(f*l-u*c)>hu)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+u*u,m=h*h+p*p,y=Math.sqrt(g),v=Math.sqrt(d),b=o*Math.tan((NE-Math.acos((g+d-m)/(2*y*v)))/2),w=b/v,_=b/y;Math.abs(w-1)>hu&&this._append`L${t+w*c},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*h>c*p)},${this._x1=t+_*l},${this._y1=n+_*u}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),u=t+a,c=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>hu||Math.abs(this._y1-c)>hu)&&this._append`L${u},${c}`,r&&(d<0&&(d=d%ME+ME),d>xre?this._append`A${r},${r},0,1,${f},${t-a},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:d>hu&&this._append`A${r},${r},0,${+(d>=NE)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function wx(){return new LA}wx.prototype=LA.prototype;function _x(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new LA(t)}function wre(e){return e.innerRadius}function _re(e){return e.outerRadius}function Ere(e){return e.startAngle}function Sre(e){return e.endAngle}function kre(e){return e&&e.padAngle}function Cre(e,t,n,r,i,o,s,a){var l=n-e,u=r-t,c=s-i,f=a-o,d=f*l-c*u;if(!(d*dL*L+I*I&&(A=O,N=F),{cx:A,cy:N,x01:-c,y01:-f,x11:A*(i/_-1),y11:N*(i/_-1)}}function Are(){var e=wre,t=_re,n=yt(0),r=null,i=Ere,o=Sre,s=kre,a=null,l=_x(u);function u(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-u1,g=o.apply(this,arguments)-u1,m=WF(g-p),y=g>p;if(a||(a=c=l()),hYn))a.moveTo(0,0);else if(m>Z8-Yn)a.moveTo(h*Zl(p),h*zo(p)),a.arc(0,0,h,p,g,!y),d>Yn&&(a.moveTo(d*Zl(g),d*zo(g)),a.arc(0,0,d,g,p,y));else{var v=p,b=g,w=p,_=g,k=m,E=m,A=s.apply(this,arguments)/2,N=A>Yn&&(r?+r.apply(this,arguments):Su(d*d+h*h)),O=t_(WF(h-d)/2,+n.apply(this,arguments)),F=O,U=O,M,L;if(N>Yn){var I=VF(N/d*zo(A)),B=VF(N/h*zo(A));(k-=I*2)>Yn?(I*=y?1:-1,w+=I,_-=I):(k=0,w=_=(p+g)/2),(E-=B*2)>Yn?(B*=y?1:-1,v+=B,b-=B):(E=0,v=b=(p+g)/2)}var H=h*Zl(v),z=h*zo(v),j=d*Zl(_),J=d*zo(_);if(O>Yn){var ce=h*Zl(b),_e=h*zo(b),Ye=d*Zl(w),je=d*zo(w),ft;if(mYn?U>Yn?(M=s0(Ye,je,H,z,h,U,y),L=s0(ce,_e,j,J,h,U,y),a.moveTo(M.cx+M.x01,M.cy+M.y01),UYn)||!(k>Yn)?a.lineTo(j,J):F>Yn?(M=s0(j,J,ce,_e,d,-F,y),L=s0(H,z,Ye,je,d,-F,y),a.lineTo(M.cx+M.x01,M.cy+M.y01),F=h;--p)a.point(b[p],w[p]);a.lineEnd(),a.areaEnd()}y&&(b[d]=+e(m,d,f),w[d]=+t(m,d,f),a.point(r?+r(m,d,f):b[d],n?+n(m,d,f):w[d]))}if(v)return a=null,v+""||null}function c(){return oB().defined(i).curve(s).context(o)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:yt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:yt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:yt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:yt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:yt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:yt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:yt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),u):s},u.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),u):o},u}const Tre={draw(e,t){const n=Su(t/Xf);e.moveTo(n,0),e.arc(0,0,n,0,Z8)}};function Rre(e,t){let n=null,r=_x(i);e=typeof e=="function"?e:yt(e||Tre),t=typeof t=="function"?t:yt(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:yt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:yt(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function bl(){}function c1(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 Ex(e){this._context=e}Ex.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:c1(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:c1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $re(e){return new Ex(e)}function aB(e){this._context=e}aB.prototype={areaStart:bl,areaEnd:bl,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:c1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ore(e){return new aB(e)}function lB(e){this._context=e}lB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:c1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nre(e){return new lB(e)}function uB(e,t){this._basis=new Ex(e),this._beta=t}uB.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+l*o),this._beta*t[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Mre=function e(t){function n(r){return t===1?new Ex(r):new uB(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function f1(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 BA(e,t){this._context=e,this._k=(1-t)/6}BA.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:f1(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:f1(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 Fre=function e(t){function n(r){return new BA(r,t)}return n.tension=function(r){return e(+r)},n}(0);function jA(e,t){this._context=e,this._k=(1-t)/6}jA.prototype={areaStart:bl,areaEnd:bl,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:f1(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 Dre=function e(t){function n(r){return new jA(r,t)}return n.tension=function(r){return e(+r)},n}(0);function UA(e,t){this._context=e,this._k=(1-t)/6}UA.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:f1(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 Ire=function e(t){function n(r){return new UA(r,t)}return n.tension=function(r){return e(+r)},n}(0);function HA(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Yn){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Yn){var u=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);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,s=(s*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function cB(e,t){this._context=e,this._alpha=t}cB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:HA(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 Pre=function e(t){function n(r){return t?new cB(r,t):new BA(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function fB(e,t){this._context=e,this._alpha=t}fB.prototype={areaStart:bl,areaEnd:bl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:HA(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 Lre=function e(t){function n(r){return t?new fB(r,t):new jA(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function dB(e,t){this._context=e,this._alpha=t}dB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:HA(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 zre=function e(t){function n(r){return t?new dB(r,t):new UA(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function hB(e){this._context=e}hB.prototype={areaStart:bl,areaEnd:bl,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 Bre(e){return new hB(e)}function qF(e){return e<0?-1:1}function YF(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(qF(o)+qF(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function XF(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function n_(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function d1(e){this._context=e}d1.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:n_(this,this._t0,XF(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,n_(this,XF(this,n=YF(this,e,t)),n);break;default:n_(this,this._t0,n=YF(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function pB(e){this._context=new gB(e)}(pB.prototype=Object.create(d1.prototype)).point=function(e,t){d1.prototype.point.call(this,t,e)};function gB(e){this._context=e}gB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function jre(e){return new d1(e)}function Ure(e){return new pB(e)}function mB(e){this._context=e}mB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=KF(e),i=KF(t),o=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t=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 Gre(e){return new Sx(e,.5)}function Wre(e){return new Sx(e,0)}function Vre(e){return new Sx(e,1)}function dl(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 qre=()=>typeof Image<"u"?Image:null;function ys(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function zl(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const FE=Symbol("implicit");function GA(){var e=new hF,t=[],n=[],r=FE;function i(o){let s=e.get(o);if(s===void 0){if(r!==FE)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new hF;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return GA(t,n).unknown(r)},ys.apply(i,arguments),i}function zd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Wg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Bl(){}var Yu=.7,Kf=1/Yu,Cf="\\s*([+-]?\\d+)\\s*",rg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ts="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yre=/^#([0-9a-f]{3,8})$/,Xre=new RegExp(`^rgb\\(${Cf},${Cf},${Cf}\\)$`),Kre=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),Jre=new RegExp(`^rgba\\(${Cf},${Cf},${Cf},${rg}\\)$`),Qre=new RegExp(`^rgba\\(${ts},${ts},${ts},${rg}\\)$`),Zre=new RegExp(`^hsl\\(${rg},${ts},${ts}\\)$`),eie=new RegExp(`^hsla\\(${rg},${ts},${ts},${rg}\\)$`),JF={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zd(Bl,ig,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:QF,formatHex:QF,formatHex8:tie,formatHsl:nie,formatRgb:ZF,toString:ZF});function QF(){return this.rgb().formatHex()}function tie(){return this.rgb().formatHex8()}function nie(){return yB(this).formatHsl()}function ZF(){return this.rgb().formatRgb()}function ig(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Yre.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?eD(t):n===3?new En(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?a0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?a0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Xre.exec(e))?new En(t[1],t[2],t[3],1):(t=Kre.exec(e))?new En(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Jre.exec(e))?a0(t[1],t[2],t[3],t[4]):(t=Qre.exec(e))?a0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Zre.exec(e))?rD(t[1],t[2]/100,t[3]/100,1):(t=eie.exec(e))?rD(t[1],t[2]/100,t[3]/100,t[4]):JF.hasOwnProperty(e)?eD(JF[e]):e==="transparent"?new En(NaN,NaN,NaN,0):null}function eD(e){return new En(e>>16&255,e>>8&255,e&255,1)}function a0(e,t,n,r){return r<=0&&(e=t=n=NaN),new En(e,t,n,r)}function WA(e){return e instanceof Bl||(e=ig(e)),e?(e=e.rgb(),new En(e.r,e.g,e.b,e.opacity)):new En}function wl(e,t,n,r){return arguments.length===1?WA(e):new En(e,t,n,r??1)}function En(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}zd(En,wl,Wg(Bl,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new En(Fu(this.r),Fu(this.g),Fu(this.b),h1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tD,formatHex:tD,formatHex8:rie,formatRgb:nD,toString:nD}));function tD(){return`#${ku(this.r)}${ku(this.g)}${ku(this.b)}`}function rie(){return`#${ku(this.r)}${ku(this.g)}${ku(this.b)}${ku((isNaN(this.opacity)?1:this.opacity)*255)}`}function nD(){const e=h1(this.opacity);return`${e===1?"rgb(":"rgba("}${Fu(this.r)}, ${Fu(this.g)}, ${Fu(this.b)}${e===1?")":`, ${e})`}`}function h1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ku(e){return e=Fu(e),(e<16?"0":"")+e.toString(16)}function rD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new so(e,t,n,r)}function yB(e){if(e instanceof so)return new so(e.h,e.s,e.l,e.opacity);if(e instanceof Bl||(e=ig(e)),!e)return new so;if(e instanceof so)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n0&&l<1?0:s,new so(s,a,l,e.opacity)}function p1(e,t,n,r){return arguments.length===1?yB(e):new so(e,t,n,r??1)}function so(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}zd(so,p1,Wg(Bl,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new so(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yu:Math.pow(Yu,e),new so(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new En(r_(e>=240?e-240:e+120,i,r),r_(e,i,r),r_(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new so(iD(this.h),l0(this.s),l0(this.l),h1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=h1(this.opacity);return`${e===1?"hsl(":"hsla("}${iD(this.h)}, ${l0(this.s)*100}%, ${l0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function iD(e){return e=(e||0)%360,e<0?e+360:e}function l0(e){return Math.max(0,Math.min(1,e||0))}function r_(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const vB=Math.PI/180,xB=180/Math.PI,g1=18,bB=.96422,wB=1,_B=.82521,EB=4/29,Af=6/29,SB=3*Af*Af,iie=Af*Af*Af;function kB(e){if(e instanceof ns)return new ns(e.l,e.a,e.b,e.opacity);if(e instanceof Ys)return CB(e);e instanceof En||(e=WA(e));var t=a_(e.r),n=a_(e.g),r=a_(e.b),i=i_((.2225045*t+.7168786*n+.0606169*r)/wB),o,s;return t===n&&n===r?o=s=i:(o=i_((.4360747*t+.3850649*n+.1430804*r)/bB),s=i_((.0139322*t+.0971045*n+.7141733*r)/_B)),new ns(116*i-16,500*(o-i),200*(i-s),e.opacity)}function m1(e,t,n,r){return arguments.length===1?kB(e):new ns(e,t,n,r??1)}function ns(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}zd(ns,m1,Wg(Bl,{brighter(e){return new ns(this.l+g1*(e??1),this.a,this.b,this.opacity)},darker(e){return new ns(this.l-g1*(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=bB*o_(t),e=wB*o_(e),n=_B*o_(n),new En(s_(3.1338561*t-1.6168667*e-.4906146*n),s_(-.9787684*t+1.9161415*e+.033454*n),s_(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function i_(e){return e>iie?Math.pow(e,1/3):e/SB+EB}function o_(e){return e>Af?e*e*e:SB*(e-EB)}function s_(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function a_(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function oie(e){if(e instanceof Ys)return new Ys(e.h,e.c,e.l,e.opacity);if(e instanceof ns||(e=kB(e)),e.a===0&&e.b===0)return new Ys(NaN,0=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r()=>e;function OB(e,t){return function(n){return e+n*t}}function aie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Ax(e,t){var n=t-e;return n?OB(e,n>180||n<-180?n-360*Math.round(n/360):n):Cx(isNaN(e)?t:e)}function lie(e){return(e=+e)==1?Sn:function(t,n){return n-t?aie(t,n,e):Cx(isNaN(t)?n:t)}}function Sn(e,t){var n=t-e;return n?OB(e,n):Cx(isNaN(e)?t:e)}const IE=function e(t){var n=lie(t);function r(i,o){var s=n((i=wl(i)).r,(o=wl(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=Sn(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function NB(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:io(r,i)})),n=l_.lastIndex;return n180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:io(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function a(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:io(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,d,h,p){if(u!==f||c!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:io(u,f)},{i:g-2,x:io(c,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,d),s(u.rotate,c.rotate,f,d),a(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Die(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i2?Iie:Die,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(e.map(r),t,n)))(r(s(d)))}return f.invert=function(d){return s(i((u||(u=a(t,e.map(r),io)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,zE),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Vg,c()},f.clamp=function(d){return arguments.length?(s=d?!0:Br,c()):s!==Br},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,c()}}function HB(){return Tx()(Br,Br)}function GB(e,t,n,r){var i=vl(e,t,n),o;switch(r=qu(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=mz(i,s))&&(r.precision=o),IC(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=yz(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=gz(i))&&(r.precision=o-(r.type==="%")*2);break}}return rx(r)}function _c(e){var t=e.domain;return e.ticks=function(n){var r=t();return vE(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return GB(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,u,c=10;for(a0;){if(u=xE(s,a,n),u===l)return r[i]=s,r[o]=a,t(r);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function WB(){var e=HB();return e.copy=function(){return qg(e,WB())},ys.apply(e,arguments),_c(e)}function VB(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,zE),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return VB(e).unknown(t)},e=arguments.length?Array.from(e,zE):[0,1],_c(n)}function qB(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return oMath.pow(e,t)}function jie(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 hD(e){return(t,n)=>-e(-t,n)}function KA(e){const t=e(fD,dD),n=t.domain;let r=10,i,o;function s(){return i=jie(r),o=Bie(r),n()[0]<0?(i=hD(i),o=hD(o),e(Pie,Lie)):e(fD,dD),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=qu(l)).precision==null&&(l.trim=!0),l=rx(l)),a===1/0)return l;const u=Math.max(1,r*a/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*rn(qB(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function YB(){const e=KA(Tx()).domain([1,10]);return e.copy=()=>qg(e,YB()).base(e.base()),ys.apply(e,arguments),e}function pD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function JA(e){var t=1,n=e(pD(t),gD(t));return n.constant=function(r){return arguments.length?e(pD(t=+r),gD(t)):t},_c(n)}function XB(){var e=JA(Tx());return e.copy=function(){return qg(e,XB()).constant(e.constant())},ys.apply(e,arguments)}function mD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Uie(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hie(e){return e<0?-e*e:e*e}function QA(e){var t=e(Br,Br),n=1;function r(){return n===1?e(Br,Br):n===.5?e(Uie,Hie):e(mD(n),mD(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},_c(t)}function ZA(){var e=QA(Tx());return e.copy=function(){return qg(e,ZA()).exponent(e.exponent())},ys.apply(e,arguments),e}function Gie(){return ZA.apply(null,arguments).exponent(.5)}function KB(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s0?n[a-1]:e[0],a=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return JB().domain([e,t]).range(i).unknown(o)},ys.apply(_c(s),arguments)}function QB(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[jg(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return QB().domain(e).range(t).unknown(n)},ys.apply(i,arguments)}function Wie(e){return new Date(e)}function Vie(e){return e instanceof Date?+e:+new Date(+e)}function eT(e,t,n,r,i,o,s,a,l,u){var c=HB(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),g=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),w=u("%Y");function _(k){return(l(k)0?r:1:0}const Jie="identity",Jf="linear",ca="log",Yg="pow",Xg="sqrt",Ox="symlog",Xu="time",Ku="utc",rs="sequential",Bd="diverging",Qf="quantile",Nx="quantize",Mx="threshold",oT="ordinal",jE="point",i9="band",sT="bin-ordinal",mn="continuous",Kg="discrete",Jg="discretizing",Vi="interpolating",aT="temporal";function Qie(e){return function(t){let n=t[0],r=t[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=e.invertExtent(n[o]),i=e.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function lT(){const e=GA().unknown(void 0),t=e.domain,n=e.range;let r=[0,1],i,o,s=!1,a=0,l=0,u=.5;delete e.unknown;function c(){const f=t().length,d=r[1]g+i*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?(r=[+f[0],+f[1]],c()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,c()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(f){return arguments.length?(s=!!f,c()):s},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,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?(l=Math.max(0,Math.min(1,f)),c()):l},e.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return y=Math.max(0,t1(h,g)-1),v=g===m?y:t1(h,m)-1,g-h[y]>o+1e-10&&++y,d&&(b=y,y=p-v,v=p-b),y>v?void 0:t().slice(y,v+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return lT().domain(t()).range(r).round(s).paddingInner(a).paddingOuter(l).align(u)},c()}function o9(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return o9(t())},e}function eoe(){return o9(lT().paddingInner(1))}var toe=Array.prototype.map;function noe(e){return toe.call(e,Zn)}const roe=Array.prototype.slice;function s9(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(jg(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=noe(r),n):e.slice()},n.range=function(r){return arguments.length?(t=roe.call(r),n):t.slice()},n.tickFormat=function(r,i){return GB(e[0],it(e),r??10,i)},n.copy=function(){return s9().domain(n.domain()).range(n.range())},n}const v1=new Map,a9=Symbol("vega_scale");function l9(e){return e[a9]=!0,e}function ioe(e){return e&&e[a9]===!0}function ooe(e,t,n){const r=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?Qie(o):o.invertExtent?Zie(o):void 0),o.type=e,l9(o)};return r.metadata=So(me(n)),r}function pt(e,t,n){return arguments.length>1?(v1.set(e,ooe(e,t,n)),this):u9(e)?v1.get(e):void 0}pt(Jie,VB);pt(Jf,WB,mn);pt(ca,YB,[mn,ca]);pt(Yg,ZA,mn);pt(Xg,Gie,mn);pt(Ox,XB,mn);pt(Xu,qie,[mn,aT]);pt(Ku,Yie,[mn,aT]);pt(rs,tT,[mn,Vi]);pt(`${rs}-${Jf}`,tT,[mn,Vi]);pt(`${rs}-${ca}`,ZB,[mn,Vi,ca]);pt(`${rs}-${Yg}`,nT,[mn,Vi]);pt(`${rs}-${Xg}`,Xie,[mn,Vi]);pt(`${rs}-${Ox}`,e9,[mn,Vi]);pt(`${Bd}-${Jf}`,t9,[mn,Vi]);pt(`${Bd}-${ca}`,n9,[mn,Vi,ca]);pt(`${Bd}-${Yg}`,rT,[mn,Vi]);pt(`${Bd}-${Xg}`,Kie,[mn,Vi]);pt(`${Bd}-${Ox}`,r9,[mn,Vi]);pt(Qf,KB,[Jg,Qf]);pt(Nx,JB,Jg);pt(Mx,QB,Jg);pt(sT,s9,[Kg,Jg]);pt(oT,GA,Kg);pt(i9,lT,Kg);pt(jE,eoe,Kg);function u9(e){return v1.has(e)}function Ec(e,t){const n=v1.get(e);return n&&n.metadata[t]}function uT(e){return Ec(e,mn)}function Zf(e){return Ec(e,Kg)}function UE(e){return Ec(e,Jg)}function c9(e){return Ec(e,ca)}function soe(e){return Ec(e,aT)}function f9(e){return Ec(e,Vi)}function d9(e){return Ec(e,Qf)}const aoe=["clamp","base","constant","exponent"];function h9(e,t){const n=t[0],r=it(t)-n;return function(i){return e(n+i*r)}}function Fx(e,t,n){return XA(cT(t||"rgb",n),e)}function p9(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[a]?s[a](e[a]()):0),s)}function cT(e,t){const n=Nie[loe(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function loe(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const uoe={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"},coe={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function m9(e){const t=e.length/6|0,n=new Array(t);for(let r=0;rFx(m9(e)));function fT(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(yD[e]=t,this):yD[e]}const ry="symbol",foe="discrete",doe="gradient",hoe=e=>K(e)?e.map(t=>String(t)):String(e),poe=(e,t)=>e[1]-t[1],goe=(e,t)=>t[1]-e[1];function dT(e,t,n){let r;return ct(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(zg(e.domain())/n||1)))),ye(t)&&(r=t.step,t=t.interval),pe(t)&&(t=e.type===Xu?Id(t):e.type==Ku?Pd(t):Y("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function v9(e,t,n){let r=e.range(),i=r[0],o=it(r),s=poe;if(i>o&&(r=o,o=i,i=r,s=goe),i=Math.floor(i),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],it(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,u)=>!(u%2));t.length<3&&(t=a)}return t}function hT(e,t){return e.bins?v9(e,e.bins):e.ticks?e.ticks(t):e.domain()}function x9(e,t,n,r,i,o){const s=t.type;let a=hoe;if(s===Xu||i===Xu)a=e.timeFormat(r);else if(s===Ku||i===Ku)a=e.utcFormat(r);else if(c9(s)){const l=e.formatFloat(r);if(o||t.bins)a=l;else{const u=b9(t,n,!1);a=c=>u(c)?l(c):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=e.format(r));return a}function b9(e,t,n){const r=hT(e,t),i=e.base(),o=Math.log(i),s=Math.max(1,i*t/r.length),a=l=>{let u=l/Math.pow(i,Math.round(Math.log(l)/o));return u*i1?r[1]-r[0]:r[0],s;for(s=1;sHE[e.type]||e.bins;function E9(e,t,n,r,i,o,s){const a=w9[t.type]&&o!==Xu&&o!==Ku?moe(e,t,i):x9(e,t,n,i,o,s);return r===ry&&xoe(t)?boe(a):r===foe?woe(a):_oe(a)}const boe=e=>(t,n,r)=>{const i=vD(r[n+1],vD(r.max,1/0)),o=xD(t,e),s=xD(i,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},vD=(e,t)=>e??t,woe=e=>(t,n)=>n?e(t):null,_oe=e=>t=>e(t),xD=(e,t)=>Number.isFinite(e)?t(e):null;function Eoe(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+it(t),o=i-r;if(e.type===Mx){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function Soe(e,t,n,r){const i=r||t.type;return pe(n)&&soe(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===Xu?e.timeFormat("%A, %d %B %Y, %X"):!n&&i===Ku?e.utcFormat("%A, %d %B %Y, %X UTC"):E9(e,t,5,null,n,r,!0)}function S9(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Soe(e,t,n.format,n.formatType);if(UE(t.type)){const o=_9(t).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(Zf(t.type)){const o=t.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${i(o[0])} to ${i(it(o))}`}}let k9=0;function koe(){k9=0}const x1="p_";function pT(e){return e&&e.gradient}function C9(e,t,n){const r=e.gradient;let i=e.id,o=r==="radial"?x1:"";return i||(i=e.id="gradient_"+k9++,r==="radial"?(e.x1=Bo(e.x1,.5),e.y1=Bo(e.y1,.5),e.r1=Bo(e.r1,0),e.x2=Bo(e.x2,.5),e.y2=Bo(e.y2,.5),e.r2=Bo(e.r2,.5),o=x1):(e.x1=Bo(e.x1,0),e.y1=Bo(e.y1,0),e.x2=Bo(e.x2,1),e.y2=Bo(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function Bo(e,t){return e??t}function A9(e,t){var n=[],r;return r={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(i,o){return n.push({offset:i,color:o}),r}}}const bD={basis:{curve:$re},"basis-closed":{curve:Ore},"basis-open":{curve:Nre},bundle:{curve:Mre,tension:"beta",value:.85},cardinal:{curve:Fre,tension:"tension",value:0},"cardinal-open":{curve:Ire,tension:"tension",value:0},"cardinal-closed":{curve:Dre,tension:"tension",value:0},"catmull-rom":{curve:Pre,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Lre,tension:"alpha",value:.5},"catmull-rom-open":{curve:zre,tension:"alpha",value:.5},linear:{curve:zA},"linear-closed":{curve:Bre},monotone:{horizontal:Ure,vertical:jre},natural:{curve:Hre},step:{curve:Gre},"step-after":{curve:Vre},"step-before":{curve:Wre}};function gT(e,t,n){var r=Oe(bD,e)&&bD[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const Coe={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Aoe=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Toe=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Roe=/^((\s+,?\s*)|(,\s*))/,$oe=/^[01]/;function ed(e){const t=[];return(e.match(Aoe)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=Coe[o],a=Ooe(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,y=f/n,v=-f/r,b=d/r,w=m*a+y*l,_=v*a+b*l,k=m*e+y*t,E=v*e+b*t;let N=1/((k-w)*(k-w)+(E-_)*(E-_))-.25;N<0&&(N=0);let O=Math.sqrt(N);o==i&&(O=-O);const F=.5*(w+k)-O*(E-_),U=.5*(_+E)+O*(k-w),M=Math.atan2(_-U,w-F);let I=Math.atan2(E-U,k-F)-M;I<0&&o===1?I+=Xo:I>0&&o===0&&(I-=Xo);const B=Math.ceil(Math.abs(I/(mu+.001))),H=[];for(let z=0;z+e}function c0(e,t,n){return Math.max(t,Math.min(e,n))}function $9(){var e=Poe,t=Loe,n=zoe,r=Boe,i=Os(0),o=i,s=i,a=i,l=null;function u(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+r.call(this,c),v=Math.min(m,y)/2,b=c0(+i.call(this,c),0,v),w=c0(+o.call(this,c),0,v),_=c0(+s.call(this,c),0,v),k=c0(+a.call(this,c),0,v);if(l||(l=h=wx()),b<=0&&w<=0&&_<=0&&k<=0)l.rect(p,g,m,y);else{var E=p+m,A=g+y;l.moveTo(p+b,g),l.lineTo(E-w,g),l.bezierCurveTo(E-Aa*w,g,E,g+Aa*w,E,g+w),l.lineTo(E,A-k),l.bezierCurveTo(E,A-Aa*k,E-Aa*k,A,E-k,A),l.lineTo(p+_,A),l.bezierCurveTo(p+Aa*_,A,p,A-Aa*_,p,A-_),l.lineTo(p,g+b),l.bezierCurveTo(p,g+Aa*b,p+Aa*b,g,p+b,g),l.closePath()}if(h)return l=null,h+""||null}return u.x=function(c){return arguments.length?(e=Os(c),u):e},u.y=function(c){return arguments.length?(t=Os(c),u):t},u.width=function(c){return arguments.length?(n=Os(c),u):n},u.height=function(c){return arguments.length?(r=Os(c),u):r},u.cornerRadius=function(c,f,d,h){return arguments.length?(i=Os(c),o=f!=null?Os(f):i,a=d!=null?Os(d):i,s=h!=null?Os(h):o,u):i},u.context=function(c){return arguments.length?(l=c??null,u):l},u}function O9(){var e,t,n,r,i=null,o,s,a,l;function u(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var y=Math.sqrt(g*g+m*m),v=(g/=y)*l,b=(m/=y)*l,w=Math.atan2(m,g);i.moveTo(s-v,a-b),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,w-Math.PI,w),i.lineTo(s+v,a+b),i.arc(s,a,l,w,w+Math.PI)}else i.arc(f,d,p,0,Xo);i.closePath()}else o=1;s=f,a=d,l=p}function c(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=wx()),d=0;d<=h;++d)!(de.x||0,em=e=>e.y||0,joe=e=>e.width||0,Uoe=e=>e.height||0,Hoe=e=>(e.x||0)+(e.width||0),Goe=e=>(e.y||0)+(e.height||0),Woe=e=>e.startAngle||0,Voe=e=>e.endAngle||0,qoe=e=>e.padAngle||0,Yoe=e=>e.innerRadius||0,Xoe=e=>e.outerRadius||0,Koe=e=>e.cornerRadius||0,Joe=e=>Qg(e.cornerRadiusTopLeft,e.cornerRadius)||0,Qoe=e=>Qg(e.cornerRadiusTopRight,e.cornerRadius)||0,Zoe=e=>Qg(e.cornerRadiusBottomRight,e.cornerRadius)||0,ese=e=>Qg(e.cornerRadiusBottomLeft,e.cornerRadius)||0,tse=e=>Qg(e.size,64),nse=e=>e.size||1,Dx=e=>e.defined!==!1,rse=e=>R9(e.shape||"circle"),ise=Are().startAngle(Woe).endAngle(Voe).padAngle(qoe).innerRadius(Yoe).outerRadius(Xoe).cornerRadius(Koe),ose=sB().x(Zg).y1(em).y0(Goe).defined(Dx),sse=sB().y(em).x1(Zg).x0(Hoe).defined(Dx),ase=oB().x(Zg).y(em).defined(Dx),lse=$9().x(Zg).y(em).width(joe).height(Uoe).cornerRadius(Joe,Qoe,Zoe,ese),use=Rre().type(rse).size(tse),cse=O9().x(Zg).y(em).defined(Dx).size(nse);function mT(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function fse(e,t){return ise.context(e)(t)}function dse(e,t){const n=t[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?sse:ose).curve(gT(r,n.orient,n.tension)).context(e)(t)}function hse(e,t){const n=t[0],r=n.interpolate||"linear";return ase.curve(gT(r,n.orient,n.tension)).context(e)(t)}function jd(e,t,n,r){return lse.context(e)(t,n,r)}function pse(e,t){return(t.mark.shape||t.shape).context(e)(t)}function gse(e,t){return use.context(e)(t)}function mse(e,t){return cse.context(e)(t)}var N9=1;function M9(){N9=1}function yT(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+N9++),s=i.clipping[o]||(i.clipping[o]={id:o});return Ve(r)?s.path=r(null):mT(n)?s.path=jd(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function sn(e){this.clear(),e&&this.union(e)}sn.prototype={clone(){return new sn(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,r){return nthis.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 r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(e),l=Math.sin(e),u=t-t*a+n*l,c=n-t*l-n*a;return[a*r-l*i+u,l*r+a*i+c,a*r-l*s+u,l*r+a*s+c,a*o-l*i+u,l*o+a*i+c,a*o-l*s+u,l*o+a*s+c]},union(e){return e.x1this.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=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.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Ix(e){this.mark=e,this.bounds=this.bounds||new sn}function Px(e){Ix.call(this,e),this.items=this.items||[]}oe(Px,Ix);function vT(e){this._pending=0,this._loader=e||ux()}function SD(e){e._pending+=1}function xh(e){e._pending-=1}vT.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return SD(t),t._loader.sanitize(e,{context:"href"}).then(n=>(xh(t),n)).catch(()=>(xh(t),null))},loadImage(e){const t=this,n=qre();return SD(t),t._loader.sanitize(e,{context:"image"}).then(r=>{const i=r.href;if(!i||!n)throw{url:i};const o=new n,s=Oe(r,"crossOrigin")?r.crossOrigin:"anonymous";return s!=null&&(o.crossOrigin=s),o.onload=()=>xh(t),o.onerror=()=>xh(t),o.src=i,o}).catch(r=>(xh(t),{complete:!1,width:0,height:0,src:r&&r.url||""}))},ready(){const e=this;return new Promise(t=>{function n(r){e.pending()?setTimeout(()=>{n(!0)},10):t(r)}n(!1)})}};function ga(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const r=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(r+(n?yse(t,r):0))}return e}function yse(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const vse=Xo-1e-8;let Lx,iy,oy,Cu,GE,sy,WE,VE;const Wa=(e,t)=>Lx.add(e,t),ay=(e,t)=>Wa(iy=e,oy=t),kD=e=>Wa(e,Lx.y1),CD=e=>Wa(Lx.x1,e),yu=(e,t)=>GE*e+WE*t,vu=(e,t)=>sy*e+VE*t,d_=(e,t)=>Wa(yu(e,t),vu(e,t)),h_=(e,t)=>ay(yu(e,t),vu(e,t));function tm(e,t){return Lx=e,t?(Cu=t*_l,GE=VE=Math.cos(Cu),sy=Math.sin(Cu),WE=-sy):(GE=VE=1,Cu=sy=WE=0),xse}const xse={beginPath(){},closePath(){},moveTo:h_,lineTo:h_,rect(e,t,n,r){Cu?(d_(e+n,t),d_(e+n,t+r),d_(e,t+r),h_(e,t)):(Wa(e+n,t+r),ay(e,t))},quadraticCurveTo(e,t,n,r){const i=yu(e,t),o=vu(e,t),s=yu(n,r),a=vu(n,r);AD(iy,i,s,kD),AD(oy,o,a,CD),ay(s,a)},bezierCurveTo(e,t,n,r,i,o){const s=yu(e,t),a=vu(e,t),l=yu(n,r),u=vu(n,r),c=yu(i,o),f=vu(i,o);TD(iy,s,l,c,kD),TD(oy,a,u,f,CD),ay(c,f)},arc(e,t,n,r,i,o){if(r+=Cu,i+=Cu,iy=n*Math.cos(i)+e,oy=n*Math.sin(i)+t,Math.abs(i-r)>vse)Wa(e-n,t-n),Wa(e+n,t+n);else{const s=u=>Wa(n*Math.cos(u)+e,n*Math.sin(u)+t);let a,l;if(s(r),s(i),i!==r)if(r=r%Xo,r<0&&(r+=Xo),i=i%Xo,i<0&&(i+=Xo),ii;++l,a-=mu)s(a);else for(a=r-r%mu+mu,l=0;l<4&&aNoe?(c=s*s+a*o,c>=0&&(c=Math.sqrt(c),l=(-s+c)/o,u=(-s-c)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=I9(e,t,t.fill),!0):!1}var wse=[];function nd(e,t,n){var r=(r=t.strokeWidth)!=null?r:1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=I9(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||wse),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function _se(e,t){return e.zindex-t.zindex||e.index-t.index}function wT(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,o;for(i=0,o=t.length;i=0;)if(r=t(n[i]))return r;if(n===o){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function _T(e){return function(t,n,r){Co(n,i=>{(!r||r.intersects(i.bounds))&&P9(e,t,i,i)})}}function Ese(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&P9(e,t,n.items[0],n.items)}}function P9(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(td(t,n),n.fill&&b1(t,n,i)&&t.fill(),n.stroke&&nd(t,n,i)&&t.stroke()))}function zx(e){return e=e||zi,function(t,n,r,i,o,s){return r*=t.pixelRatio,i*=t.pixelRatio,w1(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&e(t,a,r,i,o,s))return a})}}function nm(e,t){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=t??s.fill,l=s.stroke&&n.isPointInStroke,u,c;return l&&(u=s.strokeWidth,c=s.strokeCap,n.lineWidth=u??1,n.lineCap=c??"butt"),e(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function ET(e){return zx(nm(e))}function Iu(e,t){return"translate("+e+","+t+")"}function ST(e){return"rotate("+e+")"}function Sse(e,t){return"scale("+e+","+t+")"}function L9(e){return Iu(e.x||0,e.y||0)}function kse(e){return Iu(e.x||0,e.y||0)+(e.angle?" "+ST(e.angle):"")}function Cse(e){return Iu(e.x||0,e.y||0)+(e.angle?" "+ST(e.angle):"")+(e.scaleX||e.scaleY?" "+Sse(e.scaleX||1,e.scaleY||1):"")}function kT(e,t,n){function r(s,a){s("transform",kse(a)),s("d",t(null,a))}function i(s,a){return t(tm(s,a.angle),a),ga(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,u=a.y||0,c=a.angle||0;s.translate(l,u),c&&s.rotate(c*=_l),s.beginPath(),t(s,a),c&&s.rotate(-c),s.translate(-l,-u)}return{type:e,tag:"path",nested:!1,attr:r,bound:i,draw:_T(o),pick:ET(o),isect:n||xT(o)}}var Ase=kT("arc",fse);function Tse(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],r=e[0].orient==="horizontal"?"y":"x",i=e.length,o=1/0,s,a;--i>=0;)e[i].defined!==!1&&(a=Math.abs(e[i][r]-n),a=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],o=e[r].y-t[1],s=i*i+o*o,s=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],o=r*r+i*i,r=e[n].size||1,o.5&&t<1.5?.5-Math.abs(t-1):0}function Mse(e,t){e("transform",L9(t))}function j9(e,t){const n=B9(t);e("d",jd(null,t,n,n))}function Fse(e,t){e("class","background"),e("aria-hidden",!0),j9(e,t)}function Dse(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?j9(e,t):e("d","")}function Ise(e,t,n){const r=t.clip?yT(n,t,t):null;e("clip-path",r)}function Pse(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let i=0;i{const i=r.x||0,o=r.y||0,s=r.strokeForeground,a=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&a&&(ag(e,r,i,o),td(e,r),r.fill&&b1(e,r,a)&&e.fill(),r.stroke&&!s&&nd(e,r,a)&&e.stroke()),e.save(),e.translate(i,o),r.clip&&z9(e,r),n&&n.translate(-i,-o),Co(r,l=>{this.draw(e,l,n)}),n&&n.translate(i,o),e.restore(),s&&r.stroke&&a&&(ag(e,r,i,o),td(e,r),nd(e,r,a)&&e.stroke())})}function Use(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const s=n*e.pixelRatio,a=r*e.pixelRatio;return w1(t,l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(i,o))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,g&&mT(l)&&!Bse(e,l,s,a))return e.restore(),null;const m=l.strokeForeground,y=t.interactive!==!1;return y&&m&&l.stroke&&zse(e,l,s,a)?(e.restore(),l):(u=w1(l,v=>Hse(v,c,f)?this.pick(v,n,r,c,f):null),!u&&y&&(l.fill||!m&&l.stroke)&&Lse(e,l,s,a)&&(u=l),e.restore(),u||null)})}function Hse(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var Gse={type:"group",tag:"g",nested:!1,attr:Mse,bound:Pse,draw:jse,pick:Use,isect:F9,content:Ise,background:Fse,foreground:Dse},lg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function AT(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(r=>{e.image=r,e.image.url=e.url})),n}function TT(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 RT(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 Bx(e,t){return e==="center"?t/2:e==="right"?t:0}function jx(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function Wse(e,t,n){const r=AT(t,n),i=TT(t,r),o=RT(t,r),s=(t.x||0)-Bx(t.align,i),a=(t.y||0)-jx(t.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",l,lg["xmlns:xlink"],"xlink:href"),e("transform",Iu(s,a)),e("width",i),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function Vse(e,t){const n=t.image,r=TT(t,n),i=RT(t,n),o=(t.x||0)-Bx(t.align,r),s=(t.y||0)-jx(t.baseline,i);return e.set(o,s,o+r,s+i)}function qse(e,t,n){Co(t,r=>{if(n&&!n.intersects(r.bounds))return;const i=AT(r,this);let o=TT(r,i),s=RT(r,i);if(o===0||s===0)return;let a=(r.x||0)-Bx(r.align,o),l=(r.y||0)-jx(r.baseline,s),u,c,f,d;r.aspect!==!1&&(c=i.width/i.height,f=r.width/r.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&U9(e,r,i)&&(td(e,r),e.stroke())}})}function oae(e,t,n,r){return e.isPointInStroke?U9(e,t,1)&&e.isPointInStroke(n,r):!1}var sae={type:"rule",tag:"line",nested:!1,attr:nae,bound:rae,draw:iae,pick:zx(oae),isect:D9},aae=kT("shape",pse),lae=kT("symbol",gse,bT);const ND=K6();var xo={height:vs,measureWidth:$T,estimateWidth:YE,width:YE,canvas:H9};H9(!0);function H9(e){xo.width=e&&hl?$T:YE}function YE(e,t){return G9(Sl(e,t),vs(e))}function G9(e,t){return~~(.8*e.length*t)}function $T(e,t){return vs(e)<=0||!(t=Sl(e,t))?0:W9(t,Ux(e))}function W9(e,t){const n=`(${t}) ${e}`;let r=ND.get(n);return r===void 0&&(hl.font=t,r=hl.measureText(e).width,ND.set(n,r)),r}function vs(e){return e.fontSize!=null?+e.fontSize||0:11}function El(e){return e.lineHeight!=null?e.lineHeight:vs(e)+2}function uae(e){return K(e)?e.length>1?e:e[0]:e}function rm(e){return uae(e.lineBreak&&e.text&&!K(e.text)?e.text.split(e.lineBreak):e.text)}function OT(e){const t=rm(e);return(K(t)?t.length-1:0)*El(e)}function Sl(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?fae(e,n):n}function cae(e){if(xo.width===$T){const t=Ux(e);return n=>W9(n,t)}else{const t=vs(e);return n=>G9(n,t)}}function fae(e,t){var n=+e.limit,r=cae(e);if(r(t)>>1,r(t.slice(l))>n?s=l+1:a=l;return i+t.slice(s)}else{for(;s>>1),r(t.slice(0,l))Math.max(d,xo.width(t,h)),0)):f=xo.width(t,c),i==="center"?l-=f/2:i==="right"&&(l-=f),e.set(l+=s,u+=a,l+f,u+r),t.angle&&!n)e.rotate(t.angle*_l,s,a);else if(n===2)return e.rotatedPoints(t.angle*_l,s,a);return e}function pae(e,t,n){Co(t,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,u,c,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(e.font=Ux(r),e.textAlign=r.align||"left",o=Hx(r),s=o.x1,a=o.y1,r.angle&&(e.save(),e.translate(s,a),e.rotate(r.angle*_l),s=a=0),s+=r.dx||0,a+=(r.dy||0)+NT(r),c=rm(r),td(e,r),K(c))for(u=El(r),l=0;lt;)e.removeChild(n[--r]);return e}function J9(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Gx(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function bae(e,t,n,r){var i=e&&e.mark,o,s;if(i&&(o=yi[i.marktype]).tip){for(s=Gx(t,n),s[0]-=r[0],s[1]-=r[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(i.items,s)}return e}function kl(e,t){this._active=null,this._handlers={},this._loader=e||ux(),this._tooltip=t||wae}function wae(e,t,n,r){e.element().setAttribute("title",r||"")}kl.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const r in t)n.push(...t[r]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(r=>{const i=new MouseEvent(e.type,e),o=Va(null,"a");for(const s in r)o.setAttribute(s,r[s]);o.dispatchEvent(i)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=bae(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),s=i.height();let a=i.x1+r[0]+n.left,l=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,l+=e.y||0;return{x:a,y:l,width:o,height:s,left:a,top:l,right:a+o,bottom:l+s}}};function xs(e){this._el=null,this._bgcolor=null,this._loader=new vT(e)}xs.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const i=n._call;n._ready=n._loader.ready().then(o=>{o&&i(),n._ready=null})}return r},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const _ae="keydown",Eae="keypress",Sae="keyup",Q9="dragenter",uy="dragleave",Z9="dragover",KE="mousedown",kae="mouseup",_1="mousemove",xp="mouseout",ej="mouseover",E1="click",Cae="dblclick",Aae="wheel",tj="mousewheel",S1="touchstart",k1="touchmove",C1="touchend",Tae=[_ae,Eae,Sae,Q9,uy,Z9,KE,kae,_1,xp,ej,E1,Cae,Aae,tj,S1,k1,C1],JE=_1,ug=xp,QE=E1;function om(e,t){kl.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}const Rae=e=>e===S1||e===k1||e===C1?[S1,k1,C1]:[e];function FD(e,t){Rae(t).forEach(n=>$ae(e,n))}function $ae(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?r=>e[t](r):r=>e.fire(t,r)))}function DD(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?this.fire(e,r):((!i||!i.exit)&&this.fire(n,r),this._active=o,this.fire(t,r),this.fire(e,r))}}function ID(e){return function(t){this.fire(e,t),this._active=null}}oe(om,kl,{initialize(e,t,n){return this._canvas=e&&DT(e,"canvas"),[E1,KE,_1,xp,uy].forEach(r=>FD(this,r)),kl.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:Tae,DOMMouseScroll(e){this.fire(tj,e)},mousemove:DD(_1,ej,xp),dragover:DD(Z9,Q9,uy),mouseout:ID(xp),dragleave:ID(uy),mousedown(e){this._down=this._active,this.fire(KE,e)},click(e){this._down===this._active&&(this.fire(E1,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(S1,e,!0)},touchmove(e){this.fire(k1,e,!0)},touchend(e){this.fire(C1,e,!0),this._touch=null},fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===QE&&r&&r.href?this.handleHref(t,r,r.href):(e===JE||e===ug)&&this.handleTooltip(t,r,e!==ug),i)for(let o=0,s=i.length;o=0&&r.splice(i,1),this},pickEvent(e){const t=Gx(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,r,i){const o=this.context();return yi[e.marktype].pick.call(this,o,e,t,n,r,i)}});function Oae(){return typeof window<"u"&&window.devicePixelRatio||1}var Nae=Oae();function Mae(e,t,n,r,i,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=s?Nae:i;e.width=t*l,e.height=n*l;for(const u in o)a[u]=o[u];return s&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),e}function A1(e){xs.call(this,e),this._options={},this._redraw=!1,this._dirty=new sn,this._tempb=new sn}const PD=xs.prototype,Fae=(e,t,n)=>new sn().set(0,0,t,n).translate(-e[0],-e[1]);function Dae(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}oe(A1,xs,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:dl(1,1,this._options.type),e&&this._canvas&&(ao(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),PD.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(PD.resize.call(this,e,t,n,r),this._canvas)Mae(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const i=this._options.externalContext;i||Y("CanvasRenderer is missing a valid canvas or context"),i.scale(this._scale,this._scale),i.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(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,s=Fae(n,r,i);t.save();const a=this._redraw||o.empty()?(this._redraw=!1,s.expand(1)):Dae(t,s.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,a),t.restore(),o.clear(),this},draw(e,t,n){const r=yi[t.marktype];t.clip&&Nse(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();i.type!=="pdf"&&!i.externalContext&&o.clearRect(e,t,n,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});function IT(e,t){kl.call(this,e,t);const n=this;n._hrefHandler=ZE(n,(r,i)=>{i&&i.href&&n.handleHref(r,i,i.href)}),n._tooltipHandler=ZE(n,(r,i)=>{n.handleTooltip(r,i,r.type!==ug)})}const ZE=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)};oe(IT,kl,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(QE,this._hrefHandler),r.removeEventListener(JE,this._tooltipHandler),r.removeEventListener(ug,this._tooltipHandler)),this._svg=r=e&&DT(e,"svg"),r&&(r.addEventListener(QE,this._hrefHandler),r.addEventListener(JE,this._tooltipHandler),r.addEventListener(ug,this._tooltipHandler)),kl.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const o={type:e,handler:t,listener:ZE(this,t)};(r[n]||(r[n]=[])).push(o),this._svg&&this._svg.addEventListener(n,o.listener)}return this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const nj="aria-hidden",PT="aria-label",LT="role",zT="aria-roledescription",rj="graphics-object",BT="graphics-symbol",ij=(e,t,n)=>({[LT]:e,[zT]:t,[PT]:n||void 0}),Iae=So(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),LD={axis:{desc:"axis",caption:zae},legend:{desc:"legend",caption:Bae},"title-text":{desc:"title",caption:e=>`Title text '${BD(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${BD(e)}'`}},zD={ariaRole:LT,ariaRoleDescription:zT,description:PT};function oj(e,t){const n=t.aria===!1;if(e(nj,n||void 0),n||t.description==null)for(const r in zD)e(zD[r],void 0);else{const r=t.mark.marktype;e(PT,t.description),e(LT,t.ariaRole||(r==="group"?rj:BT)),e(zT,t.ariaRoleDescription||`${r} mark`)}}function sj(e){return e.aria===!1?{[nj]:!0}:Iae[e.role]?null:LD[e.role]?Lae(e,LD[e.role]):Pae(e)}function Pae(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(r=>r.description!=null&&r.aria!==!1);return ij(n?rj:BT,`${t} mark container`,e.description)}function Lae(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return ij(t.role||BT,t.desc,n.description||r(n))}catch{return null}}function BD(e){return me(e.text).join(" ")}function zae(e){const t=e.datum,n=e.orient,r=t.title?aj(e):null,i=e.context,o=i.scales[t.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${Zf(a)?"discrete":a} scale with ${S9(s,o,e)}`}function Bae(e){const t=e.datum,n=t.title?aj(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),s=e.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return Uae(r)+(n?` titled '${n}'`:"")+` for ${jae(o)} with ${S9(l,a,e)}`}function aj(e){try{return me(it(e.items).items[0].text).join(" ")}catch{return null}}function jae(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+it(e)}function Uae(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const lj=e=>(e+"").replace(/&/g,"&").replace(//g,">"),Hae=e=>lj(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function jT(){let e="",t="",n="";const r=[],i=()=>t=n="",o=l=>{t&&(e+=`${t}>${n}`,i()),r.push(l)},s=(l,u)=>(u!=null&&(t+=` ${l}="${Hae(u)}"`),a),a={open(l){o(l),t="<"+l;for(var u=arguments.length,c=new Array(u>1?u-1:0),f=1;f${n}`:"/>"):e+=``,i(),a},attr:s,text:l=>(n+=lj(l),a),toString:()=>e};return a}const uj=e=>cj(jT(),e)+"";function cj(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let i=0;i{u.dirty=t})),!r.zdirty){if(n.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null;continue}n=o.nested?r.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,UD(n,t)):this._update(o,n._svg,n),n._update=t)}return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=yi[t.marktype],o=t.interactive===!1?"none":null,s=i.tag==="g",a=HD(t,e,n,"g",r);a.setAttribute("class",J9(t));const l=sj(t);for(const d in l)hr(a,d,l[d]);s||hr(a,"pointer-events",o),hr(a,"clip-path",t.clip?yT(this,t,t.group):null);let u=null,c=0;const f=d=>{const h=this.isDirty(d),p=HD(d,a,u,i.tag,r);h&&(this._update(i,p,d),s&&Vae(this,p,d)),u=p,++c};return i.nested?t.items.length&&f(t.items[0]):Co(t,f),ao(a,c),a},_update(e,t,n){Xs=t,Kn=t.__values__,oj(bp,n),e.attr(bp,n,this);const r=Yae[e.type];r&&r.call(this,e,t,n),Xs&&this.style(Xs,n)},style(e,t){if(t!=null){for(const n in T1){let r=n==="font"?im(t):t[n];if(r===Kn[n])continue;const i=T1[n];r==null?e.removeAttribute(i):(pT(r)&&(r=C9(r,this._defs.gradient,dj())),e.setAttribute(i,r+"")),Kn[n]=r}for(const n in R1)cy(e,R1[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=Pr(e,bh+1,"defs",cn)),r=Gae(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=Pr(e,bh+1,"defs",cn)),r=Wae(n,t.clipping[i],r);n&&(r===0?(e.removeChild(n),t.el=null):ao(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});function UD(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 Gae(e,t,n){let r,i,o;if(t.gradient==="radial"){let s=Pr(e,n++,"pattern",cn);qa(s,{id:x1+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=Pr(s,0,"rect",cn),qa(s,{width:1,height:1,fill:`url(${dj()}#${t.id})`}),e=Pr(e,n++,"radialGradient",cn),qa(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Pr(e,n++,"linearGradient",cn),qa(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r{r=e.mark(t,o,r),++i}),ao(t,1+i)}function HD(e,t,n,r,i){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=Va(s,r,cn),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},r==="g"))){const a=Va(s,"path",cn);o.appendChild(a),a.__data__=e;const l=Va(s,"g",cn);o.appendChild(l),l.__data__=e;const u=Va(s,"path",cn);o.appendChild(u),u.__data__=e,u.__values__={fill:"default"}}return(o.ownerSVGElement!==i||qae(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function qae(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Xs=null,Kn=null;const Yae={group(e,t,n){const r=Xs=t.childNodes[2];Kn=r.__values__,e.foreground(bp,n,this),Kn=t.__values__,Xs=t.childNodes[1],e.content(bp,n,this);const i=Xs=t.childNodes[0];e.background(bp,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==Kn.events&&(hr(r,"pointer-events",o),hr(i,"pointer-events",o),Kn.events=o),n.strokeForeground&&n.stroke){const s=n.fill;hr(r,"display",null),this.style(i,n),hr(i,"stroke",null),s&&(n.fill=null),Kn=r.__values__,this.style(r,n),s&&(n.fill=s),Xs=null}else hr(r,"display","none")},image(e,t,n){n.smooth===!1?(cy(t,"image-rendering","optimizeSpeed"),cy(t,"image-rendering","pixelated")):cy(t,"image-rendering",null)},text(e,t,n){const r=rm(n);let i,o,s,a;K(r)?(o=r.map(l=>Sl(n,l)),i=o.join(` +`),i!==Kn.text&&(ao(t,0),s=t.ownerDocument,a=El(n),o.forEach((l,u)=>{const c=Va(s,"tspan",cn);c.__data__=n,c.textContent=l,u&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Kn.text=i)):(o=Sl(n,r),o!==Kn.text&&(t.textContent=o,Kn.text=o)),hr(t,"font-family",im(n)),hr(t,"font-size",vs(n)+"px"),hr(t,"font-style",n.fontStyle),hr(t,"font-variant",n.fontVariant),hr(t,"font-weight",n.fontWeight)}};function bp(e,t,n){t!==Kn[e]&&(n?Xae(Xs,e,t,n):hr(Xs,e,t),Kn[e]=t)}function cy(e,t,n){n!==Kn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Kn[t]=n)}function qa(e,t){for(const n in t)hr(e,n,t[n])}function hr(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function Xae(e,t,n,r){n!=null?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}function dj(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function HT(e){xs.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}oe(HT,xs,{svg(){return this._text},_render(e){const t=jT();t.open("svg",We({},lg,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&n!=="transparent"&&n!=="none"&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",fj,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=yi[t.marktype],r=n.tag,i=[oj,n.attr];e.open("g",{class:J9(t),"clip-path":t.clip?yT(this,t,t.group):null},sj(t),{"pointer-events":r!=="g"&&t.interactive===!1?"none":null});const o=s=>{const a=this.href(s);if(a&&e.open("a",a),e.open(r,this.attr(t,s,i,r!=="g"?r:null)),r==="text"){const l=rm(s);if(K(l)){const u={x:0,dy:El(s)};for(let c=0;cthis.mark(e,f)),e.close(),l&&c?(u&&(s.fill=null),s.stroke=c,e.open("path",this.attr(t,s,n.foreground,"bgrect")).close(),u&&(s.fill=u)):e.open("path",this.attr(t,s,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):Co(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[t]=r})}return null},attr(e,t,n,r){const i={},o=(s,a,l,u)=>{i[u||s]=a};return Array.isArray(n)?n.forEach(s=>s(o,t,this)):n(o,t,this),r&&Kae(i,t,e,r,this._defs),i},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open("defs");for(const i in t){const o=t[i],s=o.stops;o.gradient==="radial"?(e.open("pattern",{id:x1+i,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+i+")"}).close(),e.close(),e.open("radialGradient",{id:i,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):e.open("linearGradient",{id:i,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let a=0;a1?(rd[e]=t,this):rd[e]}function yj(e,t,n){const r=[],i=new sn().union(t),o=e.marktype;return o?vj(e,i,n,r):o==="group"?xj(e,i,n,r):Y("Intersect scene must be mark node or group item.")}function vj(e,t,n,r){if(Jae(e,t,n)){const i=e.items,o=e.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!GT(e[i],t[i],i))return!1;return typeof e==typeof t}function ele(){M9(),koe()}const id="top",lo="left",co="right",Cl="bottom",tle="top-left",nle="top-right",rle="bottom-left",ile="bottom-right",WT="start",eS="middle",gr="end",ole="x",sle="y",Vx="group",VT="axis",qT="title",ale="frame",lle="scope",YT="legend",Ej="row-header",Sj="row-footer",kj="row-title",Cj="column-header",Aj="column-footer",Tj="column-title",ule="padding",cle="symbol",Rj="fit",$j="fit-x",Oj="fit-y",fle="pad",XT="none",f0="all",tS="each",KT="flush",Xa="column",Ka="row";function Nj(e){G.call(this,null,e)}oe(Nj,G,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=yi[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=d0(r,s),r.items.forEach(u=>{u.bounds.clear().union(a)});else if(i===Vx||e.modified())switch(t.visit(t.MOD,u=>n.dirty(u)),a.clear(),r.items.forEach(u=>a.union(d0(u,s))),r.role){case VT:case YT:case qT:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,u=>{a.union(d0(u,s))}),t.visit(t.MOD,u=>{l=l||a.alignsWith(u.bounds),n.dirty(u),a.union(d0(u,s))}),l&&(a.clear(),r.items.forEach(u=>a.union(u.bounds)));return wj(r),t.modifies("bounds")}});function d0(e,t,n){return t(e.bounds.clear(),e,n)}const GD=":vega_identifier:";function JT(e){G.call(this,0,e)}JT.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};oe(JT,G,{transform(e,t){const n=dle(t.dataflow),r=e.as;let i=n.value;return t.visit(t.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),t}});function dle(e){return e._signals[GD]||(e._signals[GD]=e.add(0))}function Mj(e){G.call(this,null,e)}oe(Mj,G,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,hle(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 r=n.marktype===Vx?Px:Ix;return t.visit(t.ADD,i=>r.call(i,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 hle(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 Fj(e){G.call(this,null,e)}const WD={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((r,i)=>!i||!Dj(n.bounds,r.bounds,t)?(n=r,1):r.opacity=0)}},Dj=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),VD=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,o;n{const t=e.bounds;return t.width()>1&&t.height()>1},gle=(e,t,n)=>{var r=e.range(),i=new sn;return t===id||t===Cl?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},qD=e=>(e.forEach(t=>t.opacity=1),e),YD=(e,t)=>e.reflow(t.modified()).modifies("opacity");oe(Fj,G,{transform(e,t){const n=WD[e.method]||WD.parity,r=e.separation||0;let i=t.materialize(t.SOURCE).source,o,s;if(!i||!i.length)return;if(!e.method)return e.modified("method")&&(qD(i),t=YD(t,e)),t;if(i=i.filter(ple),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),o=qD(i),t=YD(t,e),o.length>=3&&VD(o,r)){do o=n(o,r);while(o.length>=3&&VD(o,r));o.length<3&&!it(i).opacity&&(o.length>1&&(it(o).opacity=0),it(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=gle(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function Ij(e){G.call(this,null,e)}oe(Ij,G,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,r=>n.dirty(r)),t.fields&&t.fields.zindex){const r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});const Xn=new sn;function gf(e,t,n){return e[t]===n?0:(e[t]=n,1)}function mle(e){var t=e.items[0].orient;return t===lo||t===co}function yle(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function vle(e,t,n,r){var i=t.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=yle(o),u=i.range,c=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,y=p&&OT(p),v=0,b=0,w,_;switch(Xn.clear().union(m),m.clear(),(w=l[0])>-1&&m.union(i.items[w].bounds),(w=l[1])>-1&&m.union(i.items[w].bounds),a){case id:v=f||0,b=-c,_=Math.max(d,Math.min(h,-m.y1)),m.add(0,-_).add(u,0),p&&h0(e,p,_,g,y,0,-1,m);break;case lo:v=-c,b=f||0,_=Math.max(d,Math.min(h,-m.x1)),m.add(-_,0).add(0,u),p&&h0(e,p,_,g,y,1,-1,m);break;case co:v=n+c,b=f||0,_=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(_,u),p&&h0(e,p,_,g,y,1,1,m);break;case Cl:v=f||0,b=r+c,_=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(u,_),p&&h0(e,p,_,g,0,0,1,m);break;default:v=i.x,b=i.y}return ga(m.translate(v,b),i),gf(i,"x",v+s)|gf(i,"y",b+s)&&(i.bounds=Xn,e.dirty(i),i.bounds=m,e.dirty(i)),i.mark.bounds.clear().union(m)}function h0(e,t,n,r,i,o,s,a){const l=t.bounds;if(t.auto){const u=s*(n+i+r);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=u):f=(t.y||0)-(t.y=u),t.mark.bounds.clear().union(l.translate(-c,-f)),e.dirty(t)}a.union(l)}const XD=(e,t)=>Math.floor(Math.min(e,t)),KD=(e,t)=>Math.ceil(Math.max(e,t));function xle(e){var t=e.items,n=t.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(E=0;E0&&(b[E]+=L/2);if(a&&Dt(n.center,Ka)&&c!==1)for(E=0;E0&&(w[E]+=I/2);for(E=0;Ei&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),g+=o,v=0,w=t.length;v=0&&(E=n[b])==null;b-=d);a?(A=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),N=g):(A=g,N=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),_.union(k.bounds.translate(A-(k.x||0),N-(k.y||0))),k.x=A,k.y=N,e.dirty(k),m=s(m,_[u])}return m}function QD(e,t,n,r,i,o){if(t){e.dirty(t);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function kle(e,t){const n=e[t]||{};return(r,i)=>n[r]!=null?n[r]:e[r]!=null?e[r]:i}function Cle(e,t){let n=-1/0;return e.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:t}function Ale(e,t,n,r,i,o,s){const a=kle(n,t),l=Cle(e,a("offset",0)),u=a("anchor",WT),c=u===gr?1:u===eS?.5:0,f={align:tS,bounds:a("bounds",KT),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case lo:f.anchor={x:Math.floor(r.x1)-l,column:gr,y:c*(s||r.height()+2*r.y1),row:u};break;case co:f.anchor={x:Math.ceil(r.x2)+l,y:c*(s||r.height()+2*r.y1),row:u};break;case id:f.anchor={y:Math.floor(i.y1)-l,row:gr,x:c*(o||i.width()+2*i.x1),column:u};break;case Cl:f.anchor={y:Math.ceil(i.y2)+l,x:c*(o||i.width()+2*i.x1),column:u};break;case tle:f.anchor={x:l,y:l};break;case nle:f.anchor={x:o-l,y:l,column:gr};break;case rle:f.anchor={x:l,y:s-l,row:gr};break;case ile:f.anchor={x:o-l,y:s-l,column:gr,row:gr};break}return f}function Tle(e,t){var n=t.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,u;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),$le(e,n,n.items[0].items[0]),o=Rle(n,o),l=2*n.padding,u=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),u=Math.ceil(o.height()+u)),r.type===cle&&Ole(n.items[0].items[0].items[0].items),i!==XT&&(n.x=s=0,n.y=a=0),n.width=l,n.height=u,ga(o.set(s,a,s+l,a+u),n),n.mark.bounds.clear().union(o),n}function Rle(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function $le(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(!t.datum.title)(i||o)&&wh(e,n,i,o);else{var s=t.items[1].items[0],a=s.anchor,l=t.titlePadding||0,u=r-s.x,c=r-s.y;switch(s.orient){case lo:i+=Math.ceil(s.bounds.width())+l;break;case co:case Cl:break;default:o+=s.bounds.height()+l}switch((i||o)&&wh(e,n,i,o),s.orient){case lo:c+=zc(t,n,s,a,1,1);break;case co:u+=zc(t,n,s,gr,0,0)+l,c+=zc(t,n,s,a,1,1);break;case Cl:u+=zc(t,n,s,a,0,0),c+=zc(t,n,s,gr,-1,0,1)+l;break;default:u+=zc(t,n,s,a,0,0)}(u||c)&&wh(e,s,u,c),(u=Math.round(s.bounds.x1-r))<0&&(wh(e,n,-u,0),wh(e,s,-u,0))}}function zc(e,t,n,r,i,o,s){const a=e.datum.type!=="symbol",l=n.datum.vgrad,u=a&&(o||!l)&&!s?t.items[0]:t,c=u.bounds[i?"y2":"x2"]-e.padding,f=l&&o?c:0,d=l&&o?0:c,h=i<=0?0:OT(n);return Math.round(r===WT?f:r===gr?d-h:.5*(c-h))}function wh(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function Ole(e){const t=e.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function Nle(e,t,n,r,i){var o=t.items[0],s=o.frame,a=o.orient,l=o.anchor,u=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===lo||a===co?r:n,p=0,g=0,m=0,y=0,v=0,b;if(s!==Vx?a===lo?(p=i.y2,h=i.y1):a===co?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===lo&&(p=r,h=0),b=l===WT?p:l===gr?h:(p+h)/2,d&&d.text){switch(a){case id:case Cl:v=f.bounds.height()+c;break;case lo:y=f.bounds.width()+c;break;case co:y=-f.bounds.width()-c;break}Xn.clear().union(d.bounds),Xn.translate(y-(d.x||0),v-(d.y||0)),gf(d,"x",y)|gf(d,"y",v)&&(e.dirty(d),d.bounds.clear().union(Xn),d.mark.bounds.clear().union(Xn),e.dirty(d)),Xn.clear().union(d.bounds)}else Xn.clear();switch(Xn.union(f.bounds),a){case id:g=b,m=i.y1-Xn.height()-u;break;case lo:g=i.x1-Xn.width()-u,m=b;break;case co:g=i.x2+Xn.width()+u,m=b;break;case Cl:g=b,m=i.y2+u;break;default:g=o.x,m=o.y}return gf(o,"x",g)|gf(o,"y",m)&&(Xn.translate(g,m),e.dirty(o),o.bounds.clear().union(Xn),t.bounds.clear().union(Xn),e.dirty(o)),o.bounds}function Lj(e){G.call(this,null,e)}oe(Lj,G,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(r=>{e.layout&&_le(n,r,e.layout),Fle(n,r,e)}),Mle(e.mark.group)?t.reflow():t}});function Mle(e){return e&&e.mark.role!=="legend-entry"}function Fle(e,t,n){var r=t.items,i=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new sn().set(0,0,i,o),a=s.clone(),l=s.clone(),u=[],c,f,d,h,p,g;for(p=0,g=r.length;p{d=y.orient||co,d!==XT&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const v=m[y];Pj(e,v,Ale(v,y,n.legends,a,l,i,o))}u.forEach(y=>{const v=y.bounds;if(v.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=v,e.dirty(y)),n.autosize&&(n.autosize.type===Rj||n.autosize.type===$j||n.autosize.type===Oj))switch(y.orient){case lo:case co:s.add(v.x1,0).add(v.x2,0);break;case id:case Cl:s.add(0,v.y1).add(0,v.y2)}else s.union(v)})}s.union(a).union(l),c&&s.union(Nle(e,c,i,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),Dle(e,t,s,n)}function Dle(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,l=Math.max(0,t.width||0),u=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-l)),h=Math.max(0,Math.ceil(n.y2-c));if(i.contains===ule){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===XT?(u=0,f=0,l=s,c=a):o===Rj?(l=Math.max(0,s-u-d),c=Math.max(0,a-f-h)):o===$j?(l=Math.max(0,s-u-d),a=c+f+h):o===Oj?(s=l+u+d,c=Math.max(0,a-f-h)):o===fle&&(s=l+u+d,a=c+f+h),e._resizeView(s,a,l,c,[u,f],i.resize)}const Ile=Object.freeze(Object.defineProperty({__proto__:null,bound:Nj,identifier:JT,mark:Mj,overlap:Fj,render:Ij,viewlayout:Lj},Symbol.toStringTag,{value:"Module"}));function zj(e){G.call(this,null,e)}oe(zj,G,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=dT(o,s,e.minstep),l=e.format||x9(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?v9(o,e.values,a):hT(o,a);return i&&(r.rem=i),i=u.map((c,f)=>mt({index:f/(u.length-1||1),value:c,label:l(c)})),e.extra&&i.length&&i.push(mt({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function Bj(e){G.call(this,null,e)}function Ple(){return mt({})}function Lle(e){const t=Md().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}oe(Bj,G,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||Ple,o=e.key||Re,s=this.value;return K(r.encode)&&(r.encode=null),s&&(e.modified("key")||t.modified(o))&&Y("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=Lle(o)),t.visit(t.ADD,a=>{const l=o(a);let u=s.get(l);u?u.exit?(s.empty--,r.add.push(u)):r.mod.push(u):(u=i(a),s.set(l,u),r.add.push(u)),u.datum=a,u.exit=!1}),t.visit(t.MOD,a=>{const l=o(a),u=s.get(l);u&&(u.datum=a,r.mod.push(u))}),t.visit(t.REM,a=>{const l=o(a),u=s.get(l);a===u.datum&&!u.exit&&(r.rem.push(u),u.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function jj(e){G.call(this,null,e)}oe(jj,G,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(K(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=i.update||Ta,l=i.enter||Ta,u=i.exit||Ta,c=(o&&!s?i[o]:a)||Ta;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),c!==Ta&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&u!==Ta&&(t.visit(t.REM,f=>{u(f,e)}),n.modifies(u.output)),s||c!==Ta){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=l(d,e)||r;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(c(d,e)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function Uj(e){G.call(this,[],e)}oe(Uj,G,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.type||ry,s=e.scale,a=+e.limit,l=dT(s,e.count==null?5:e.count,e.minstep),u=!!e.values||o===ry,c=e.format||E9(n,s,l,o,e.formatSpecifier,e.formatType,u),f=e.values||_9(s,l),d,h,p,g,m;return i&&(r.rem=i),o===ry?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,Ve(p=e.size)?(!e.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((y,v)=>Math.max(y,p(v,e)),0)):p=lr(g=p||8),i=i.map((y,v)=>mt({index:v,label:c(y,v,i),value:y,offset:g,size:p(y,e)})),m&&(m=f[i.length],i.push(mt({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,e)})))):o===doe?(d=s.domain(),h=g9(s,d[0],it(d)),f.length<3&&!e.values&&d[0]!==it(d)&&(f=[d[0],it(d)]),i=f.map((y,v)=>mt({index:v,label:c(y,v,f),value:y,perc:h(y)}))):(p=f.length-1,h=Eoe(s),i=f.map((y,v)=>mt({index:v,label:c(y,v,f),value:y,perc:v?h(y):0,perc2:v===p?1:h(f[v+1])}))),r.source=i,r.add=i,this.value=i,r}});const zle=e=>e.source.x,Ble=e=>e.source.y,jle=e=>e.target.x,Ule=e=>e.target.y;function QT(e){G.call(this,{},e)}QT.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"}]};oe(QT,G,{transform(e,t){var n=e.sourceX||zle,r=e.sourceY||Ble,i=e.targetX||jle,o=e.targetY||Ule,s=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",u=ZD.get(l+"-"+a)||ZD.get(l);return u||Y("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=u(n(c),r(c),i(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const Hj=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,Hle=(e,t,n,r)=>Hj(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),Gj=(e,t,n,r)=>{var i=n-e,o=r-t,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},Gle=(e,t,n,r)=>Gj(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),Wj=(e,t,n,r)=>{const i=n-e,o=r-t,s=.2*(i+o),a=.2*(o-i);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},Wle=(e,t,n,r)=>Wj(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),Vle=(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,qle=(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,Yle=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*s+","+t*a+"L"+r*s+","+r*a},Xle=(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},Kle=(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},Jle=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=(t+r)/2;return"M"+t*i+","+t*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},ZD=Md({line:Hj,"line-radial":Hle,arc:Gj,"arc-radial":Gle,curve:Wj,"curve-radial":Wle,"orthogonal-horizontal":Vle,"orthogonal-vertical":qle,"orthogonal-radial":Yle,"diagonal-horizontal":Xle,"diagonal-vertical":Kle,"diagonal-radial":Jle});function ZT(e){G.call(this,null,e)}ZT.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"]}]};oe(ZT,G,{transform(e,t){var n=e.as||["startAngle","endAngle"],r=n[0],i=n[1],o=e.field||$d,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,u=l.map(o),c=u.length,f=s,d=(a-s)/dz(u),h=ci(c),p,g,m;for(e.sort&&h.sort((y,v)=>u[y]-u[v]),p=0;p-1)return r;var i=t.domain,o=e.type,s=t.zero||t.zero===void 0&&Zle(e),a,l;if(!i)return 0;if(Vj(o)&&t.padding&&i[0]!==it(i)&&(i=oue(o,i,t.range,t.padding,t.exponent,t.constant)),(s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const u=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==t.length&&n.warn("Log scale domain includes zero: "+ie(t))}return t}function sue(e,t,n){let r=t.bins;if(r&&!K(r)){const i=e.domain(),o=i[0],s=it(i),a=r.step;let l=r.start==null?o:r.start,u=r.stop==null?s:r.stop;a||Y("Scale bins parameter missing step property."),ls&&(u=a*Math.floor(s/a)),r=ci(l,u+a/2,a)}return r?e.bins=r:e.bins&&delete e.bins,e.type===sT&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function aue(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(t.rangeStep!=null)o=lue(r,t,n);else if(t.scheme&&(o=uue(r,t,n),Ve(o))){if(e.interpolator)return e.interpolator(o);Y(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&f9(r))return e.interpolator(Fx(nS(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(cT(t.interpolate,t.interpolateGamma)):Ve(e.round)?e.round(i):Ve(e.rangeRound)&&e.interpolate(i?Vg:jl),o&&e.range(nS(o,t.reverse))}function lue(e,t,n){e!==i9&&e!==jE&&Y("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===jE?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*iT(n,i,r)]}function uue(e,t,n){var r=t.schemeExtent,i,o;return K(t.scheme)?o=Fx(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),o=fT(i),o||Y(`Unrecognized scheme name: ${t.scheme}`)),n=e===Mx?n+1:e===sT?n-1:e===Qf||e===Nx?+t.schemeCount||Qle:n,f9(e)?e3(o,r,t.reverse):Ve(o)?p9(e3(o,r),n):e===oT?o:o.slice(0,n)}function e3(e,t,n){return Ve(e)&&(t||n)?h9(e,nS(t||[0,1],n)):e}function nS(e,t){return t?e.slice().reverse():e}function Xj(e){G.call(this,null,e)}oe(Xj,G,{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(bc(e.sort)),this.modified(n),t}});const t3="zero",Kj="center",Jj="normalize",Qj=["y0","y1"];function eR(e){G.call(this,null,e)}eR.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:t3,values:[t3,Kj,Jj]},{name:"as",type:"string",array:!0,length:2,default:Qj}]};oe(eR,G,{transform(e,t){var n=e.as||Qj,r=n[0],i=n[1],o=bc(e.sort),s=e.field||$d,a=e.offset===Kj?cue:e.offset===Jj?fue:due,l,u,c,f;for(l=hue(t.source,e.groupby,o,s),u=0,c=l.length,f=l.max;ug(c),s,a,l,u,c,f,d,h,p;if(t==null)i.push(e.slice());else for(s={},a=0,l=e.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const pue=Object.freeze(Object.defineProperty({__proto__:null,axisticks:zj,datajoin:Bj,encode:jj,legendentries:Uj,linkpath:QT,pie:ZT,scale:qj,sortitems:Xj,stack:eR},Symbol.toStringTag,{value:"Module"}));var Ne=1e-6,$1=1e-12,Je=Math.PI,Yt=Je/2,O1=Je/4,kr=Je*2,Kt=180/Je,Xe=Je/180,rt=Math.abs,Ud=Math.atan,Ui=Math.atan2,Me=Math.cos,g0=Math.ceil,Zj=Math.exp,rS=Math.hypot,N1=Math.log,m_=Math.pow,$e=Math.sin,Oi=Math.sign||function(e){return e>0?1:e<0?-1:0},Cr=Math.sqrt,tR=Math.tan;function e7(e){return e>1?0:e<-1?Je:Math.acos(e)}function Kr(e){return e>1?Yt:e<-1?-Yt:Math.asin(e)}function In(){}function M1(e,t){e&&r3.hasOwnProperty(e.type)&&r3[e.type](e,t)}var n3={Feature:function(e,t){M1(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Me(t),s=$e(t),a=aS*s,l=sS*o+a*Me(i),u=a*r*$e(i);F1.add(Ui(u,l)),oS=e,sS=o,aS=s}function vue(e){return D1=new _r,Us(e,fs),D1*2}function I1(e){return[Ui(e[1],e[0]),Kr(e[2])]}function Ju(e){var t=e[0],n=e[1],r=Me(n);return[r*Me(t),r*$e(t),$e(n)]}function m0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function od(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 y_(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function y0(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function P1(e){var t=Cr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var zt,Dr,Gt,si,pu,i7,o7,Tf,wp,Da,fa,zs={point:lS,lineStart:o3,lineEnd:s3,polygonStart:function(){zs.point=a7,zs.lineStart=xue,zs.lineEnd=bue,wp=new _r,fs.polygonStart()},polygonEnd:function(){fs.polygonEnd(),zs.point=lS,zs.lineStart=o3,zs.lineEnd=s3,F1<0?(zt=-(Gt=180),Dr=-(si=90)):wp>Ne?si=90:wp<-Ne&&(Dr=-90),fa[0]=zt,fa[1]=Gt},sphere:function(){zt=-(Gt=180),Dr=-(si=90)}};function lS(e,t){Da.push(fa=[zt=e,Gt=e]),tsi&&(si=t)}function s7(e,t){var n=Ju([e*Xe,t*Xe]);if(Tf){var r=od(Tf,n),i=[r[1],-r[0],0],o=od(i,r);P1(o),o=I1(o);var s=e-pu,a=s>0?1:-1,l=o[0]*Kt*a,u,c=rt(s)>180;c^(a*pusi&&(si=u)):(l=(l+360)%360-180,c^(a*pusi&&(si=t))),c?eoi(zt,Gt)&&(Gt=e):oi(e,Gt)>oi(zt,Gt)&&(zt=e):Gt>=zt?(eGt&&(Gt=e)):e>pu?oi(zt,e)>oi(zt,Gt)&&(Gt=e):oi(e,Gt)>oi(zt,Gt)&&(zt=e)}else Da.push(fa=[zt=e,Gt=e]);tsi&&(si=t),Tf=n,pu=e}function o3(){zs.point=s7}function s3(){fa[0]=zt,fa[1]=Gt,zs.point=lS,Tf=null}function a7(e,t){if(Tf){var n=e-pu;wp.add(rt(n)>180?n+(n>0?360:-360):n)}else i7=e,o7=t;fs.point(e,t),s7(e,t)}function xue(){fs.lineStart()}function bue(){a7(i7,o7),fs.lineEnd(),rt(wp)>Ne&&(zt=-(Gt=180)),fa[0]=zt,fa[1]=Gt,Tf=null}function oi(e,t){return(t-=e)<0?t+360:t}function wue(e,t){return e[0]-t[0]}function a3(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:toi(r[0],r[1])&&(r[1]=i[1]),oi(i[0],r[1])>oi(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(a=oi(r[1],i[0]))>s&&(s=a,zt=i[0],Gt=r[1])}return Da=fa=null,zt===1/0||Dr===1/0?[[NaN,NaN],[NaN,NaN]]:[[zt,Dr],[Gt,si]]}var Yh,L1,z1,B1,j1,U1,H1,G1,uS,cS,fS,l7,u7,mr,yr,vr,fo={sphere:In,point:nR,lineStart:l3,lineEnd:u3,polygonStart:function(){fo.lineStart=kue,fo.lineEnd=Cue},polygonEnd:function(){fo.lineStart=l3,fo.lineEnd=u3}};function nR(e,t){e*=Xe,t*=Xe;var n=Me(t);sm(n*Me(e),n*$e(e),$e(t))}function sm(e,t,n){++Yh,z1+=(e-z1)/Yh,B1+=(t-B1)/Yh,j1+=(n-j1)/Yh}function l3(){fo.point=Eue}function Eue(e,t){e*=Xe,t*=Xe;var n=Me(t);mr=n*Me(e),yr=n*$e(e),vr=$e(t),fo.point=Sue,sm(mr,yr,vr)}function Sue(e,t){e*=Xe,t*=Xe;var n=Me(t),r=n*Me(e),i=n*$e(e),o=$e(t),s=Ui(Cr((s=yr*o-vr*i)*s+(s=vr*r-mr*o)*s+(s=mr*i-yr*r)*s),mr*r+yr*i+vr*o);L1+=s,U1+=s*(mr+(mr=r)),H1+=s*(yr+(yr=i)),G1+=s*(vr+(vr=o)),sm(mr,yr,vr)}function u3(){fo.point=nR}function kue(){fo.point=Aue}function Cue(){c7(l7,u7),fo.point=nR}function Aue(e,t){l7=e,u7=t,e*=Xe,t*=Xe,fo.point=c7;var n=Me(t);mr=n*Me(e),yr=n*$e(e),vr=$e(t),sm(mr,yr,vr)}function c7(e,t){e*=Xe,t*=Xe;var n=Me(t),r=n*Me(e),i=n*$e(e),o=$e(t),s=yr*o-vr*i,a=vr*r-mr*o,l=mr*i-yr*r,u=rS(s,a,l),c=Kr(u),f=u&&-c/u;uS.add(f*s),cS.add(f*a),fS.add(f*l),L1+=c,U1+=c*(mr+(mr=r)),H1+=c*(yr+(yr=i)),G1+=c*(vr+(vr=o)),sm(mr,yr,vr)}function Tue(e){Yh=L1=z1=B1=j1=U1=H1=G1=0,uS=new _r,cS=new _r,fS=new _r,Us(e,fo);var t=+uS,n=+cS,r=+fS,i=rS(t,n,r);return i<$1&&(t=U1,n=H1,r=G1,L1Je&&(e-=Math.round(e/kr)*kr),[e,t]}hS.invert=hS;function f7(e,t,n){return(e%=kr)?t||n?dS(f3(e),d3(t,n)):f3(e):t||n?d3(t,n):hS}function c3(e){return function(t,n){return t+=e,rt(t)>Je&&(t-=Math.round(t/kr)*kr),[t,n]}}function f3(e){var t=c3(e);return t.invert=c3(-e),t}function d3(e,t){var n=Me(e),r=$e(e),i=Me(t),o=$e(t);function s(a,l){var u=Me(l),c=Me(a)*u,f=$e(a)*u,d=$e(l),h=d*n+c*r;return[Ui(f*i-h*o,c*n-d*r),Kr(h*i+f*o)]}return s.invert=function(a,l){var u=Me(l),c=Me(a)*u,f=$e(a)*u,d=$e(l),h=d*i-f*o;return[Ui(f*i+d*o,c*n+h*r),Kr(h*n-c*r)]},s}function Rue(e){e=f7(e[0]*Xe,e[1]*Xe,e.length>2?e[2]*Xe:0);function t(n){return n=e(n[0]*Xe,n[1]*Xe),n[0]*=Kt,n[1]*=Kt,n}return t.invert=function(n){return n=e.invert(n[0]*Xe,n[1]*Xe),n[0]*=Kt,n[1]*=Kt,n},t}function $ue(e,t,n,r,i,o){if(n){var s=Me(t),a=$e(t),l=r*n;i==null?(i=t+r*kr,o=t-l/2):(i=h3(s,i),o=h3(s,o),(r>0?io)&&(i+=r*kr));for(var u,c=i;r>0?c>o:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fy(e,t){return rt(e[0]-t[0])=0;--a)i.point((f=c[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);i.lineEnd()}}}function p3(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n=0?1:-1,O=N*A,F=O>Je,U=m*k;if(l.add(Ui(U*N*$e(O),y*E+U*Me(O))),s+=F?A+N*kr:A,F^p>=n^w>=n){var M=od(Ju(h),Ju(b));P1(M);var L=od(o,M);P1(L);var I=(F^A>=0?-1:1)*Kr(L[2]);(r>I||r===I&&(M[0]||M[1]))&&(a+=F^A>=0?1:-1)}}return(s<-Ne||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),k=0;k1&&w&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(Nue))}}return d}}function Nue(e){return e.length>1}function Mue(e,t){return((e=e.x)[0]<0?e[1]-Yt-Ne:Yt-e[1])-((t=t.x)[0]<0?t[1]-Yt-Ne:Yt-t[1])}const g3=p7(function(){return!0},Fue,Iue,[-Je,-Yt]);function Fue(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Je:-Je,l=rt(o-t);rt(l-Je)0?Yt:-Yt),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=Je&&(rt(t-r)Ne?Ud(($e(t)*(o=Me(r))*$e(n)-$e(r)*(i=Me(t))*$e(e))/(i*o*s)):(t+r)/2}function Iue(e,t,n,r){var i;if(e==null)i=n*Yt,r.point(-Je,i),r.point(0,i),r.point(Je,i),r.point(Je,0),r.point(Je,-i),r.point(0,-i),r.point(-Je,-i),r.point(-Je,0),r.point(-Je,i);else if(rt(e[0]-t[0])>Ne){var o=e[0]0,i=rt(t)>Ne;function o(c,f,d,h){$ue(h,e,n,d,c,f)}function s(c,f){return Me(c)*Me(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var v=[m,y],b,w=s(m,y),_=r?w?0:u(m,y):w?u(m+(m<0?Je:-Je),y):0;if(!f&&(p=h=w)&&c.lineStart(),w!==h&&(b=l(f,v),(!b||fy(f,b)||fy(v,b))&&(v[2]=1)),w!==h)g=0,w?(c.lineStart(),b=l(v,f),c.point(b[0],b[1])):(b=l(f,v),c.point(b[0],b[1],2),c.lineEnd()),f=b;else if(i&&f&&r^w){var k;!(_&d)&&(k=l(v,f,!0))&&(g=0,r?(c.lineStart(),c.point(k[0][0],k[0][1]),c.point(k[1][0],k[1][1]),c.lineEnd()):(c.point(k[1][0],k[1][1]),c.lineEnd(),c.lineStart(),c.point(k[0][0],k[0][1],3)))}w&&(!f||!fy(f,v))&&c.point(v[0],v[1]),f=v,h=w,d=_},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(c,f,d){var h=Ju(c),p=Ju(f),g=[1,0,0],m=od(h,p),y=m0(m,m),v=m[0],b=y-v*v;if(!b)return!d&&c;var w=t*y/b,_=-t*v/b,k=od(g,m),E=y0(g,w),A=y0(m,_);y_(E,A);var N=k,O=m0(E,N),F=m0(N,N),U=O*O-F*(m0(E,E)-1);if(!(U<0)){var M=Cr(U),L=y0(N,(-O-M)/F);if(y_(L,E),L=I1(L),!d)return L;var I=c[0],B=f[0],H=c[1],z=f[1],j;B0^L[1]<(rt(L[0]-I)Je^(I<=L[0]&&L[0]<=B)){var Ye=y0(N,(-O+M)/F);return y_(Ye,E),[L,I1(Ye)]}}}function u(c,f){var d=r?e:Je-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return p7(s,a,o,r?[0,-e]:[-Je,e-Je])}function Lue(e,t,n,r,i,o){var s=e[0],a=e[1],l=t[0],u=t[1],c=0,f=1,d=l-s,h=u-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var Xh=1e9,x0=-Xh;function g7(e,t,n,r){function i(u,c){return e<=u&&u<=n&&t<=c&&c<=r}function o(u,c,f,d){var h=0,p=0;if(u==null||(h=s(u,f))!==(p=s(c,f))||l(u,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function s(u,c){return rt(u[0]-e)0?0:3:rt(u[0]-n)0?2:1:rt(u[1]-t)0?1:0:c>0?3:2}function a(u,c){return l(u.x,c.x)}function l(u,c){var f=s(u,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=d7(),d,h,p,g,m,y,v,b,w,_,k,E={point:A,lineStart:U,lineEnd:M,polygonStart:O,polygonEnd:F};function A(I,B){i(I,B)&&c.point(I,B)}function N(){for(var I=0,B=0,H=h.length;Br&&(je-_e)*(r-Ye)>(ft-Ye)*(e-_e)&&++I:ft<=r&&(je-_e)*(r-Ye)<(ft-Ye)*(e-_e)&&--I;return I}function O(){c=f,d=[],h=[],k=!0}function F(){var I=N(),B=k&&I,H=(d=fz(d)).length;(B||H)&&(u.polygonStart(),B&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),H&&h7(d,a,I,o,u),u.polygonEnd()),c=u,d=h=p=null}function U(){E.point=L,h&&h.push(p=[]),_=!0,w=!1,v=b=NaN}function M(){d&&(L(g,m),y&&w&&f.rejoin(),d.push(f.result())),E.point=A,w&&c.lineEnd()}function L(I,B){var H=i(I,B);if(h&&p.push([I,B]),_)g=I,m=B,y=H,_=!1,H&&(c.lineStart(),c.point(I,B));else if(H&&w)c.point(I,B);else{var z=[v=Math.max(x0,Math.min(Xh,v)),b=Math.max(x0,Math.min(Xh,b))],j=[I=Math.max(x0,Math.min(Xh,I)),B=Math.max(x0,Math.min(Xh,B))];Lue(z,j,e,t,n,r)?(w||(c.lineStart(),c.point(z[0],z[1])),c.point(j[0],j[1]),H||c.lineEnd(),k=!1):H&&(c.lineStart(),c.point(I,B),k=!1)}v=I,b=B,w=H}return E}}function m3(e,t,n){var r=ci(e,t-Ne,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function y3(e,t,n){var r=ci(e,t-Ne,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function zue(){var e,t,n,r,i,o,s,a,l=10,u=l,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return ci(g0(r/c)*c,n,c).map(p).concat(ci(g0(a/f)*f,s,f).map(g)).concat(ci(g0(t/l)*l,e,l).filter(function(b){return rt(b%c)>Ne}).map(d)).concat(ci(g0(o/u)*u,i,u).filter(function(b){return rt(b%f)>Ne}).map(h))}return y.lines=function(){return v().map(function(b){return{type:"LineString",coordinates:b}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(b){return arguments.length?y.extentMajor(b).extentMinor(b):y.extentMinor()},y.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),y.precision(m)):[[r,a],[n,s]]},y.extentMinor=function(b){return arguments.length?(t=+b[0][0],e=+b[1][0],o=+b[0][1],i=+b[1][1],t>e&&(b=t,t=e,e=b),o>i&&(b=o,o=i,i=b),y.precision(m)):[[t,o],[e,i]]},y.step=function(b){return arguments.length?y.stepMajor(b).stepMinor(b):y.stepMinor()},y.stepMajor=function(b){return arguments.length?(c=+b[0],f=+b[1],y):[c,f]},y.stepMinor=function(b){return arguments.length?(l=+b[0],u=+b[1],y):[l,u]},y.precision=function(b){return arguments.length?(m=+b,d=m3(o,i,90),h=y3(t,e,m),p=m3(a,s,90),g=y3(r,n,m),y):m},y.extentMajor([[-180,-90+Ne],[180,90-Ne]]).extentMinor([[-180,-80-Ne],[180,80+Ne]])}const cg=e=>e;var x_=new _r,pS=new _r,m7,y7,gS,mS,ja={point:In,lineStart:In,lineEnd:In,polygonStart:function(){ja.lineStart=Bue,ja.lineEnd=Uue},polygonEnd:function(){ja.lineStart=ja.lineEnd=ja.point=In,x_.add(rt(pS)),pS=new _r},result:function(){var e=x_/2;return x_=new _r,e}};function Bue(){ja.point=jue}function jue(e,t){ja.point=v7,m7=gS=e,y7=mS=t}function v7(e,t){pS.add(mS*e-gS*t),gS=e,mS=t}function Uue(){v7(m7,y7)}const v3=ja;var sd=1/0,W1=sd,fg=-sd,V1=fg,Hue={point:Gue,lineStart:In,lineEnd:In,polygonStart:In,polygonEnd:In,result:function(){var e=[[sd,W1],[fg,V1]];return fg=V1=-(W1=sd=1/0),e}};function Gue(e,t){efg&&(fg=e),tV1&&(V1=t)}const q1=Hue;var yS=0,vS=0,Kh=0,Y1=0,X1=0,mf=0,xS=0,bS=0,Jh=0,x7,b7,Ko,Jo,uo={point:Qu,lineStart:x3,lineEnd:b3,polygonStart:function(){uo.lineStart=que,uo.lineEnd=Yue},polygonEnd:function(){uo.point=Qu,uo.lineStart=x3,uo.lineEnd=b3},result:function(){var e=Jh?[xS/Jh,bS/Jh]:mf?[Y1/mf,X1/mf]:Kh?[yS/Kh,vS/Kh]:[NaN,NaN];return yS=vS=Kh=Y1=X1=mf=xS=bS=Jh=0,e}};function Qu(e,t){yS+=e,vS+=t,++Kh}function x3(){uo.point=Wue}function Wue(e,t){uo.point=Vue,Qu(Ko=e,Jo=t)}function Vue(e,t){var n=e-Ko,r=t-Jo,i=Cr(n*n+r*r);Y1+=i*(Ko+e)/2,X1+=i*(Jo+t)/2,mf+=i,Qu(Ko=e,Jo=t)}function b3(){uo.point=Qu}function que(){uo.point=Xue}function Yue(){w7(x7,b7)}function Xue(e,t){uo.point=w7,Qu(x7=Ko=e,b7=Jo=t)}function w7(e,t){var n=e-Ko,r=t-Jo,i=Cr(n*n+r*r);Y1+=i*(Ko+e)/2,X1+=i*(Jo+t)/2,mf+=i,i=Jo*e-Ko*t,xS+=i*(Ko+e),bS+=i*(Jo+t),Jh+=i*3,Qu(Ko=e,Jo=t)}const w3=uo;function _7(e){this._context=e}_7.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,kr);break}}},result:In};var wS=new _r,b_,E7,S7,Qh,Zh,K1={point:In,lineStart:function(){K1.point=Kue},lineEnd:function(){b_&&k7(E7,S7),K1.point=In},polygonStart:function(){b_=!0},polygonEnd:function(){b_=null},result:function(){var e=+wS;return wS=new _r,e}};function Kue(e,t){K1.point=k7,E7=Qh=e,S7=Zh=t}function k7(e,t){Qh-=e,Zh-=t,wS.add(Cr(Qh*Qh+Zh*Zh)),Qh=e,Zh=t}const _3=K1;let E3,J1,S3,k3;class C3{constructor(t){this._append=t==null?C7:Jue(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!==S3||this._append!==J1){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,S3=r,J1=this._append,k3=this._,this._=i}this._+=k3;break}}}result(){const t=this._;return this._="",t.length?t:null}}function C7(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return C7;if(t!==E3){const n=10**t;E3=t,J1=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(o=new C3(n)),s},s.projection(e).digits(n).context(t)}function qx(e){return function(t){var n=new _S;for(var r in e)n[r]=e[r];return n.stream=t,n}}function _S(){}_S.prototype={constructor:_S,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 rR(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Us(n,e.stream(q1)),t(q1.result()),r!=null&&e.clipExtent(r),e}function Yx(e,t,n){return rR(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function iR(e,t,n){return Yx(e,[[0,0],t],n)}function oR(e,t,n){return rR(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function sR(e,t,n){return rR(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var A3=16,Que=Me(30*Xe);function T3(e,t){return+t?ece(e,t):Zue(e)}function Zue(e){return qx({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function ece(e,t){function n(r,i,o,s,a,l,u,c,f,d,h,p,g,m){var y=u-r,v=c-i,b=y*y+v*v;if(b>4*t&&g--){var w=s+d,_=a+h,k=l+p,E=Cr(w*w+_*_+k*k),A=Kr(k/=E),N=rt(rt(k)-1)t||rt((y*M+v*L)/b-.5)>.3||s*d+a*h+l*p2?I[2]%360*Xe:0,M()):[a*Kt,l*Kt,u*Kt]},F.angle=function(I){return arguments.length?(f=I%360*Xe,M()):f*Kt},F.reflectX=function(I){return arguments.length?(d=I?-1:1,M()):d<0},F.reflectY=function(I){return arguments.length?(h=I?-1:1,M()):h<0},F.precision=function(I){return arguments.length?(k=T3(E,_=I*I),L()):Cr(_)},F.fitExtent=function(I,B){return Yx(F,I,B)},F.fitSize=function(I,B){return iR(F,I,B)},F.fitWidth=function(I,B){return oR(F,I,B)},F.fitHeight=function(I,B){return sR(F,I,B)};function M(){var I=R3(n,0,0,d,h,f).apply(null,t(o,s)),B=R3(n,r-I[0],i-I[1],d,h,f);return c=f7(a,l,u),E=dS(t,B),A=dS(c,E),k=T3(E,_),L()}function L(){return N=O=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&U,M()}}function aR(e){var t=0,n=Je/3,r=T7(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*Xe,n=o[1]*Xe):[t*Kt,n*Kt]},i}function ice(e){var t=Me(e);function n(r,i){return[r*t,$e(i)/t]}return n.invert=function(r,i){return[r/t,Kr(i*t)]},n}function oce(e,t){var n=$e(e),r=(n+$e(t))/2;if(rt(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=sce([n.stream(t=d),i.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.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 r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(u),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Ne,g+.12*h+Ne],[p-.214*h-Ne,g+.234*h-Ne]]).stream(u),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Ne,g+.166*h+Ne],[p-.115*h-Ne,g+.234*h-Ne]]).stream(u),f()},c.fitExtent=function(d,h){return Yx(c,d,h)},c.fitSize=function(d,h){return iR(c,d,h)},c.fitWidth=function(d,h){return oR(c,d,h)},c.fitHeight=function(d,h){return sR(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function $7(e){return function(t,n){var r=Me(t),i=Me(n),o=e(r*i);return o===1/0?[2,0]:[o*i*$e(t),o*$e(n)]}}function am(e){return function(t,n){var r=Cr(t*t+n*n),i=e(r),o=$e(i),s=Me(i);return[Ui(t*o,r*s),Kr(r&&n*o/r)]}}var O7=$7(function(e){return Cr(2/(1+e))});O7.invert=am(function(e){return 2*Kr(e/2)});function lce(){return bs(O7).scale(124.75).clipAngle(180-.001)}var N7=$7(function(e){return(e=e7(e))&&e/$e(e)});N7.invert=am(function(e){return e});function uce(){return bs(N7).scale(79.4188).clipAngle(180-.001)}function Xx(e,t){return[e,N1(tR((Yt+t)/2))]}Xx.invert=function(e,t){return[e,2*Ud(Zj(t))-Yt]};function cce(){return M7(Xx).scale(961/kr)}function M7(e){var t=bs(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,l,u;t.scale=function(f){return arguments.length?(r(f),c()):r()},t.translate=function(f){return arguments.length?(i(f),c()):i()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=l=u=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):s==null?null:[[s,a],[l,u]]};function c(){var f=Je*r(),d=t(Rue(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Xx?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),u]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,u)]])}return c()}function b0(e){return tR((Yt+e)/2)}function fce(e,t){var n=Me(e),r=e===t?$e(e):N1(n/Me(t))/N1(b0(t)/b0(e)),i=n*m_(b0(e),r)/r;if(!r)return Xx;function o(s,a){i>0?a<-Yt+Ne&&(a=-Yt+Ne):a>Yt-Ne&&(a=Yt-Ne);var l=i/m_(b0(a),r);return[l*$e(r*s),i-l*Me(r*s)]}return o.invert=function(s,a){var l=i-a,u=Oi(r)*Cr(s*s+l*l),c=Ui(s,rt(l))*Oi(l);return l*r<0&&(c-=Je*Oi(s)*Oi(l)),[c/r,2*Ud(m_(i/u,1/r))-Yt]},o}function dce(){return aR(fce).scale(109.5).parallels([30,30])}function Z1(e,t){return[e,t]}Z1.invert=Z1;function hce(){return bs(Z1).scale(152.63)}function pce(e,t){var n=Me(e),r=e===t?$e(e):(n-Me(t))/(t-e),i=n/r+e;if(rt(r)Ne&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function bce(){return bs(I7).scale(175.295)}function P7(e,t){return[Me(t)*$e(e),$e(t)]}P7.invert=am(Kr);function wce(){return bs(P7).scale(249.5).clipAngle(90+Ne)}function L7(e,t){var n=Me(t),r=1+Me(e)*n;return[n*$e(e)/r,$e(t)/r]}L7.invert=am(function(e){return 2*Ud(e)});function _ce(){return bs(L7).scale(250).clipAngle(142)}function z7(e,t){return[N1(tR((Yt+t)/2)),-e]}z7.invert=function(e,t){return[-t,2*Ud(Zj(e))-Yt]};function Ece(){var e=M7(z7),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var Sce=Math.abs,ES=Math.cos,tv=Math.sin,kce=1e-6,B7=Math.PI,SS=B7/2,$3=Cce(2);function O3(e){return e>1?SS:e<-1?-SS:Math.asin(e)}function Cce(e){return e>0?Math.sqrt(e):0}function Ace(e,t){var n=e*tv(t),r=30,i;do t-=i=(t+tv(t)-n)/(1+ES(t));while(Sce(i)>kce&&--r>0);return t/2}function Tce(e,t,n){function r(i,o){return[e*i*ES(o=Ace(n,o)),t*tv(o)]}return r.invert=function(i,o){return o=O3(o/t),[i/(e*ES(o)),O3((2*o+tv(2*o))/n)]},r}var Rce=Tce($3/SS,$3,B7);function $ce(){return bs(Rce).scale(169.529)}const Oce=A7(),kS=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Nce(e,t){return function n(){const r=t();return r.type=e,r.path=A7().projection(r),r.copy=r.copy||function(){const i=n();return kS.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},l9(r)}}function lR(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(nv[e]=Nce(e,t),this):nv[e]||null}function j7(e){return e&&e.path||Oce}const nv={albers:R7,albersusa:ace,azimuthalequalarea:lce,azimuthalequidistant:uce,conicconformal:dce,conicequalarea:Q1,conicequidistant:gce,equalEarth:yce,equirectangular:hce,gnomonic:vce,identity:xce,mercator:cce,mollweide:$ce,naturalEarth1:bce,orthographic:wce,stereographic:_ce,transversemercator:Ece};for(const e in nv)lR(e,nv[e]);function Mce(){}const Ns=[[],[[[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 U7(){var e=1,t=1,n=a;function r(l,u){return u.map(c=>i(l,c))}function i(l,u){var c=[],f=[];return o(l,u,d=>{n(d,l,u),Fce(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=u,Ns[m<<1].forEach(b);++h=u,Ns[g|m<<1].forEach(b);for(Ns[m<<0].forEach(b);++p=u,y=l[p*e]>=u,Ns[m<<1|y<<2].forEach(b);++h=u,v=y,y=l[p*e+h+1]>=u,Ns[g|m<<1|y<<2|v<<3].forEach(b);Ns[m|y<<3].forEach(b)}for(h=-1,y=l[p*e]>=u,Ns[y<<2].forEach(b);++h=u,Ns[y<<2|v<<3].forEach(b);Ns[y<<3].forEach(b);function b(w){var _=[w[0][0]+h,w[0][1]+p],k=[w[1][0]+h,w[1][1]+p],E=s(_),A=s(k),N,O;(N=d[E])?(O=f[A])?(delete d[N.end],delete f[O.start],N===O?(N.ring.push(k),c(N.ring)):f[N.start]=d[O.end]={start:N.start,end:O.end,ring:N.ring.concat(O.ring)}):(delete d[N.end],N.ring.push(k),d[N.end=A]=N):(N=f[A])?(O=d[E])?(delete f[N.start],delete d[O.end],N===O?(N.ring.push(k),c(N.ring)):f[O.start]=d[N.end]={start:O.start,end:N.end,ring:O.ring.concat(N.ring)}):(delete f[N.start],N.ring.unshift(_),f[N.start=E]=N):f[E]=d[A]={start:E,end:A,ring:[_,k]}}}function s(l){return l[0]*2+l[1]*(e+1)*4}function a(l,u,c){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=u[g*e+p];d>0&&d0&&h=0&&c>=0||Y("invalid size"),e=u,t=c,r},r.smooth=function(l){return arguments.length?(n=l?a:Mce,r):n===a},r}function Fce(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++tr!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(i=-i)}return i}function Pce(e,t,n){var r;return Lce(e,t,n)&&zce(e[r=+(e[0]===t[0])],n[r],t[r])}function Lce(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function zce(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function H7(e,t,n){return function(r){var i=as(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=t?vl(o,s,e):a/(e+1);return ci(o+l,s,l)}}function uR(e){G.call(this,null,e)}uR.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"}]};oe(uR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||ar,o=U7().smooth(e.smooth!==!1),s=e.thresholds||Bce(r,i,e),a=e.as===null?null:e.as||"contour",l=[];return r.forEach(u=>{const c=i(u),f=o.size([c.width,c.height])(c.values,K(s)?s:s(c.values));jce(f,c,u,e),f.forEach(d=>{l.push(dx(u,mt(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function Bce(e,t,n){const r=H7(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(e.map(i=>Mu(t(i).values)))}function jce(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(Ve(i)&&(i=i(n,r)),Ve(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(ct(i)?i:i[0])||1,a=(ct(i)?i:i[1])||1,l=o&&o[0]||0,u=o&&o[1]||0;e.forEach(G7(t,s,a,l,u))}function G7(e,t,n,r,i){const o=e.x1||0,s=e.y1||0,a=t*n<0;function l(f){f.forEach(u)}function u(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function N3(e,t,n){const r=e>=0?e:QC(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function w_(e){return Ve(e)?e:lr(+e)}function W7(){var e=l=>l[0],t=l=>l[1],n=$d,r=[-1,-1],i=960,o=500,s=2;function a(l,u){const c=N3(r[0],l,e)>>s,f=N3(r[1],l,t)>>s,d=c?c+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),y=new Float32Array(p*g);let v=m;l.forEach(w=>{const _=d+(+e(w)>>s),k=h+(+t(w)>>s);_>=0&&_=0&&k0&&f>0?(Bc(p,g,m,y,c),jc(p,g,y,m,f),Bc(p,g,m,y,c),jc(p,g,y,m,f),Bc(p,g,m,y,c),jc(p,g,y,m,f)):c>0?(Bc(p,g,m,y,c),Bc(p,g,y,m,c),Bc(p,g,m,y,c),v=y):f>0&&(jc(p,g,m,y,f),jc(p,g,y,m,f),jc(p,g,m,y,f),v=y);const b=u?Math.pow(2,-2*s):1/dz(v);for(let w=0,_=p*g;w<_;++w)v[w]*=b;return{values:v,scale:1<>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(e=w_(l),a):e},a.y=function(l){return arguments.length?(t=w_(l),a):t},a.weight=function(l){return arguments.length?(n=w_(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var u=+l[0],c=+l[1];return u>=0&&c>=0||Y("invalid size"),i=u,o=c,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||Y("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*e]),r[a-i+s*e]=l/Math.min(a+1,e-1+o-a,o))}function jc(e,t,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*e]),r[s+(a-i)*e]=l/Math.min(a+1,t-1+o-a,o))}function cR(e){G.call(this,null,e)}cR.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 Uce=["x","y","weight","size","cellSize","bandwidth"];function V7(e,t){return Uce.forEach(n=>t[n]!=null?e[n](t[n]):0),e}oe(cR,G,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=Hce(r,e.groupby),o=(e.groupby||[]).map(Xt),s=V7(W7(),e),a=e.as||"grid",l=[];function u(c,f){for(let d=0;dmt(u({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function Hce(e,t){var n=[],r=c=>c(a),i,o,s,a,l,u;if(t==null)n.push(e);else for(i={},o=0,s=e.length;on.push(a(c))),o&&s&&(t.visit(l,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:CS,geometry:{type:Gce,coordinates:r}})),this.value={type:dR,features:n}}});function pR(e){G.call(this,null,e)}pR.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"}]};oe(pR,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||ar,o=e.as||"path",s=n.SOURCE;!r||e.modified()?(this.value=r=j7(e.projection),n.materialize().reflow()):s=i===ar||t.modified(i.fields)?n.ADD_MOD:n.ADD;const a=Wce(r,e.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function Wce(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function gR(e){G.call(this,null,e)}gR.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"]}]};oe(gR,G,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],l;function u(c){const f=n([r(c),i(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(l=t.modified(r.fields)||t.modified(i.fields),t.visit(l?t.ADD_MOD:t.ADD,u)),t.modifies(o)}});function mR(e){G.call(this,null,e)}mR.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"}]};oe(mR,G,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return(!r||e.modified())&&(this.value=r=Vce(j7(e.projection),e.field||qr("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function Vce(e,t,n){const r=n==null?i=>e(t(i)):i=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(i));return e.pointRadius(o),s};return r.context=i=>(e.context(i),r),r}function yR(e){G.call(this,[],e),this.generator=zue()}yR.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}]};oe(yR,G,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(const o in e)Ve(r[o])&&r[o](e[o]);return i=r(),n.length?t.mod.push(a8(n[0],i)):t.add.push(mt(i)),n[0]=i,t}});function vR(e){G.call(this,null,e)}vR.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"}]};oe(vR,G,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve==="shared",i=e.field||ar,o=Yce(e.opacity,e),s=qce(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:r?Mu(n.map(u=>Mu(i(u).values))):0};return n.forEach(u=>{const c=i(u),f=We({},u,l);r||(f.$max=Mu(c.values||[])),u[a]=Xce(c,f,s.dep?s:lr(s(f)),o.dep?o:lr(o(f)))}),t.reflow(!0).modifies(a)}});function qce(e,t){let n;return Ve(e)?(n=r=>wl(e(r,t)),n.dep=q7(e)):n=lr(wl(e||"#888")),n}function Yce(e,t){let n;return Ve(e)?(n=r=>e(r,t),n.dep=q7(e)):e?n=lr(e):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function q7(e){if(!Ve(e))return!1;const t=So(nr(e));return t.$x||t.$y||t.$value||t.$max}function Xce(e,t,n,r){const i=e.width,o=e.height,s=e.x1||0,a=e.y1||0,l=e.x2||i,u=e.y2||o,c=e.values,f=c?m=>c[m]:Ba,d=dl(l-s,u-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,u-a),g=p.data;for(let m=a,y=0;m{e[r]!=null&&M3(n,r,e[r])})):kS.forEach(r=>{e.modified(r)&&M3(n,r,e[r])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&Kce(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Kce(e,t){const n=Qce(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function Jce(e){const t=lR((e||"mercator").toLowerCase());return t||Y("Unrecognized projection type: "+e),t()}function M3(e,t,n){Ve(e[t])&&e[t](n)}function Qce(e){return e=me(e),e.length===1?e[0]:{type:dR,features:e.reduce((t,n)=>t.concat(Zce(n)),[])}}function Zce(e){return e.type===dR?e.features:me(e).filter(t=>t!=null).map(t=>t.type===CS?t:{type:CS,geometry:t})}const efe=Object.freeze(Object.defineProperty({__proto__:null,contour:fR,geojson:hR,geopath:pR,geopoint:gR,geoshape:mR,graticule:yR,heatmap:vR,isocontour:uR,kde2d:cR,projection:Y7},Symbol.toStringTag,{value:"Module"}));function tfe(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,s=n.length,a,l=0,u=0;for(o=0;o=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d,i=o,!(o=o[y=m<<1|g]))return i[y]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,i?i[y]=s:e._root=s,e;do i=i?i[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d;while((y=m<<1|g)===(v=(p>=d)<<1|h>=f));return i[v]=o,i[y]=s,e}function rfe(e){var t,n,r=e.length,i,o,s=new Array(r),a=new Array(r),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=i),of&&(f=o));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(u=(tc||(a=p.y0)>f||(l=p.x1)=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 v=e-+this._x.call(null,h.data),b=t-+this._y.call(null,h.data),w=v*v+b*b;if(w=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+u)/2))?a=h:u=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])&&(r=t,y=m)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function ufe(e){for(var t=0,n=e.length;td.index){var F=h-A.x-A.vx,U=p-A.y-A.vy,M=F*F+U*U;Mh+O||kp+O||Eu.r&&(u.r=u[c].r)}function l(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u[t(_,k,s),_])),w;for(m=0,a=new Array(y);m{}};function K7(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}dy.prototype=K7.prototype={constructor:dy,on:function(e,t){var n=this._,r=Sfe(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&e._call.call(void 0,t),e=e._next;--ad}function P3(){Zu=(iv=dg.now())+Kx,ad=ep=0;try{Afe()}finally{ad=0,Rfe(),Zu=0}}function Tfe(){var e=dg.now(),t=e-iv;t>J7&&(Kx-=t,iv=e)}function Rfe(){for(var e,t=rv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:rv=n);tp=e,AS(r)}function AS(e){if(!ad){ep&&(ep=clearTimeout(ep));var t=e-Zu;t>24?(e<1/0&&(ep=setTimeout(P3,e-dg.now()-Kx)),_h&&(_h=clearInterval(_h))):(_h||(iv=dg.now(),_h=setInterval(Tfe,J7)),ad=1,Q7(P3))}}function $fe(e,t,n){var r=new ov,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?wR():+a,r._restart(function l(u){u+=i,r._restart(l,i+=s,a),o(u)},s,a)},r.restart(e,t,n),r)}const Ofe=1664525,Nfe=1013904223,L3=4294967296;function Mfe(){let e=1;return()=>(e=(Ofe*e+Nfe)%L3)/L3}function Ffe(e){return e.x}function Dfe(e){return e.y}var Ife=10,Pfe=Math.PI*(3-Math.sqrt(5));function Lfe(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=Z7(f),u=K7("tick","end"),c=Mfe();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var v=0,b=e.length,w,_,k,E,A;for(y==null?y=1/0:y*=y,v=0;v1?(u.on(g,m),t):u.on(g)}}}function zfe(){var e,t,n,r,i=br(-30),o,s=1,a=1/0,l=.81;function u(h){var p,g=e.length,m=xR(e,Ffe,Dfe).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=Ja(n),w+=y*y),v===0&&(v=Ja(n),w+=v*v),w=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,u=a.length,c;le.touch(t).run()}function Gfe(e,t){const n=Lfe(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),tU(n,t,!0).on("end",()=>o=!0)}function tU(e,t,n,r){var i=me(t.forces),o,s,a,l;for(o=0,s=TS.length;ot(r,n):t)}const Yfe=Object.freeze(Object.defineProperty({__proto__:null,force:_R},Symbol.toStringTag,{value:"Module"}));function Xfe(e,t){return e.parent===t.parent?1:2}function Kfe(e){return e.reduce(Jfe,0)/e.length}function Jfe(e,t){return e+t.x}function Qfe(e){return 1+e.reduce(Zfe,0)}function Zfe(e,t){return Math.max(e,t.y)}function ede(e){for(var t;t=e.children;)e=t[0];return e}function tde(e){for(var t;t=e.children;)e=t[t.length-1];return e}function nde(){var e=Xfe,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=Kfe(h),d.y=Qfe(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var l=ede(o),u=tde(o),c=l.x-e(l,u)/2,f=u.x+e(u,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function rde(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function ide(){return this.eachAfter(rde)}function ode(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function sde(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function ade(e,t){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;t.value=n})}function cde(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function fde(e){for(var t=this,n=dde(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function dde(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function hde(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function pde(){return Array.from(this)}function gde(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function mde(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*yde(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new ld(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(nU)}function vde(){return ER(this).eachBefore(wde)}function xde(e){return e.children}function bde(e){return Array.isArray(e)?e[1]:null}function wde(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function nU(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ld(e){this.data=e,this.depth=this.height=0,this.parent=null}ld.prototype=ER.prototype={constructor:ld,count:ide,each:ode,eachAfter:ade,eachBefore:sde,find:lde,sum:ude,sort:cde,path:fde,ancestors:hde,descendants:pde,leaves:gde,links:mde,copy:vde,[Symbol.iterator]:yde};function hy(e){return e==null?null:rU(e)}function rU(e){if(typeof e!="function")throw new Error;return e}function xu(){return 0}function Jc(e){return function(){return e}}const _de=1664525,Ede=1013904223,B3=4294967296;function Sde(){let e=1;return()=>(e=(_de*e+Ede)%B3)/B3}function kde(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Cde(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function Ade(e,t){for(var n=0,r=(e=Cde(Array.from(e),t)).length,i=[],o,s;n0&&n*n>r*r+i*i}function __(e,t){for(var n=0;n1e-6?(F+Math.sqrt(F*F-4*O*U))/(2*O):U/F);return{x:r+k+E*M,y:i+A+N*M,r:M}}function j3(e,t,n){var r=e.x-t.x,i,o,s=e.y-t.y,a,l,u=r*r+s*s;u?(o=t.r+n.r,o*=o,l=e.r+n.r,l*=l,o>l?(i=(u+l-o)/(2*u),a=Math.sqrt(Math.max(0,l/u-i*i)),n.x=e.x-i*r-a*s,n.y=e.y-i*s+a*r):(i=(u+o-l)/(2*u),a=Math.sqrt(Math.max(0,o/u-i*i)),n.x=t.x+i*r-a*s,n.y=t.y+i*s+a*r)):(n.x=t.x+n.r,n.y=t.y)}function U3(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function H3(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function _0(e){this._=e,this.next=null,this.previous=null}function Ode(e,t){if(!(o=(e=kde(e)).length))return 0;var n,r,i,o,s,a,l,u,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;j3(r,n,i=e[2]),n=new _0(n),r=new _0(r),i=new _0(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lLde(n(w,_,i))),v=y.map(Y3),b=new Set(y).add("");for(const w of v)b.has(w)||(b.add(w),y.push(w),v.push(Y3(w)),o.push(S_));s=(w,_)=>y[_],a=(w,_)=>v[_]}for(c=0,l=o.length;c=0&&(h=o[y],h.data===S_);--y)h.data=null}if(f.parent=Dde,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(nU),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=hy(i),r):e},r.parentId=function(i){return arguments.length?(t=hy(i),r):t},r.path=function(i){return arguments.length?(n=hy(i),r):n},r}function Lde(e){e=`${e}`;let t=e.length;return RS(e,t-1)&&!RS(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function Y3(e){let t=e.length;if(t<2)return"";for(;--t>1&&!RS(e,t););return e.slice(0,t)}function RS(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function zde(e,t){return e.parent===t.parent?1:2}function k_(e){var t=e.children;return t?t[0]:e.t}function C_(e){var t=e.children;return t?t[t.length-1]:e.t}function Bde(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function jde(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function Ude(e,t,n){return e.a.parent===t.parent?e.a:n}function py(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}py.prototype=Object.create(ld.prototype);function Hde(e){for(var t=new py(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new py(o[s],s)),i.parent=n;return(t.parent=new py(null,0)).children=[t],t}function Gde(){var e=zde,t=1,n=1,r=null;function i(u){var c=Hde(u);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),r)u.eachBefore(l);else{var f=u,d=u,h=u;u.eachBefore(function(v){v.xd.x&&(d=v),v.depth>h.depth&&(h=v)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);u.eachBefore(function(v){v.x=(v.x+g)*m,v.y=v.depth*y})}return u}function o(u){var c=u.children,f=u.parent.children,d=u.i?f[u.i-1]:null;if(c){jde(u);var h=(c[0].z+c[c.length-1].z)/2;d?(u.z=d.z+e(u._,d._),u.m=u.z-h):u.z=h}else d&&(u.z=d.z+e(u._,d._));u.parent.A=a(u,d,u.parent.A||f[0])}function s(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function a(u,c,f){if(c){for(var d=u,h=u,p=c,g=d.parent.children[0],m=d.m,y=h.m,v=p.m,b=g.m,w;p=C_(p),d=k_(d),p&&d;)g=k_(g),h=C_(h),h.a=u,w=p.z+v-d.z-m+e(p._,d._),w>0&&(Bde(Ude(p,u,f),u,w),m+=w,y+=w),v+=p.m,m+=d.m,b+=g.m,y+=h.m;p&&!C_(h)&&(h.t=p,h.m+=v-y),d&&!k_(g)&&(g.t=d,g.m+=m-b,f=u)}return f}function l(u){u.x*=t,u.y=u.depth*n}return i.separation=function(u){return arguments.length?(e=u,i):e},i.size=function(u){return arguments.length?(r=!1,t=+u[0],n=+u[1],i):r?null:[t,n]},i.nodeSize=function(u){return arguments.length?(r=!0,t=+u[0],n=+u[1],i):r?[t,n]:null},i}function Jx(e,t,n,r,i){for(var o=e.children,s,a=-1,l=o.length,u=e.value&&(i-n)/e.value;++av&&(v=u),k=m*m*_,b=Math.max(v/k,k/y),b>w){m-=u;break}w=b}s.push(l={value:m,dice:h1?r:1)},n}(aU);function Wde(){var e=uU,t=!1,n=1,r=1,i=[0],o=xu,s=xu,a=xu,l=xu,u=xu;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],t&&d.eachBefore(sU),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var v=o[f];v.x0=p,v.y0=g,v.x1=m,v.y1=y;return}for(var b=u[f],w=h/2+b,_=f+1,k=d-1;_>>1;u[E]y-g){var O=h?(p*N+m*A)/h:m;c(f,_,A,p,g,O,y),c(_,d,N,O,g,m,y)}else{var F=h?(g*N+y*A)/h:y;c(f,_,A,p,g,m,F),c(_,d,N,p,F,m,y)}}}function qde(e,t,n,r,i){(e.depth&1?Jx:lm)(e,t,n,r,i)}const Yde=function e(t){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===t)for(var l,u,c,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n}(aU);function $S(e,t,n){const r={};return e.each(i=>{const o=i.data;n(o)&&(r[t(o)]=i)}),e.lookup=r,e}function SR(e){G.call(this,null,e)}SR.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Xde=e=>e.values;oe(SR,G,{transform(e,t){t.source||Y("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each(s=>{s.children&&fx(s.data)&&i.rem.push(s.data)}),this.value=o=ER({values:me(e.keys).reduce((s,a)=>(s.key(a),s),Kde()).entries(i.source)},Xde),n&&o.each(s=>{s.children&&(s=mt(s.data),i.add.push(s),i.source.push(s))}),$S(o,Re,Re)),i.source.root=o,i}});function Kde(){const e=[],t={entries:i=>r(n(i,0),0),key:i=>(e.push(i),t)};function n(i,o){if(o>=e.length)return i;const s=i.length,a=e[o++],l={},u={};let c=-1,f,d,h;for(;++ce.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return t}function ma(e){G.call(this,null,e)}const Jde=(e,t)=>e.parent===t.parent?1:2;oe(ma,G,{transform(e,t){(!t.source||!t.source.root)&&Y(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(bc(e.sort,s=>s.data)),Qde(n,this.params,e),n.separation&&n.separation(e.separation!==!1?Jde:$d);try{this.value=n(i)}catch(s){Y(s)}return i.each(s=>Zde(s,r,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function Qde(e,t,n){for(let r,i=0,o=t.length;io[Re(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[Re(a)]&&o[Re(l)]&&i.add.push(mt({source:l,target:a}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[Re(s)]=1),n.forEach(s=>{(o[Re(s.source)]||o[Re(s.target)])&&i.mod.push(s)})),i}});const K3={binary:Vde,dice:lm,slice:Jx,slicedice:qde,squarify:uU,resquarify:Yde},FS=["x0","y0","x1","y1","depth","children"];function $R(e){ma.call(this,e)}$R.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:FS.length,default:FS}]};oe($R,ma,{layout(){const e=Wde();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Oe(K3,t)?e.tile(K3[t]):Y("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:FS});const ehe=Object.freeze(Object.defineProperty({__proto__:null,nest:SR,pack:kR,partition:CR,stratify:AR,tree:TR,treelinks:RR,treemap:$R},Symbol.toStringTag,{value:"Module"})),A_=4278190080;function the(e,t){const n=e.bitmap();return(t||[]).forEach(r=>n.set(e(r.boundary[0]),e(r.boundary[3]))),[n,void 0]}function nhe(e,t,n,r,i){const o=e.width,s=e.height,a=r||i,l=dl(o,s).getContext("2d"),u=dl(o,s).getContext("2d"),c=a&&dl(o,s).getContext("2d");n.forEach(A=>gy(l,A,!1)),gy(u,t,!1),a&&gy(c,t,!0);const f=T_(l,o,s),d=T_(u,o,s),h=a&&T_(c,o,s),p=e.bitmap(),g=a&&e.bitmap();let m,y,v,b,w,_,k,E;for(y=0;y{i.items.forEach(o=>gy(e,o.items,n))}):yi[r].draw(e,{items:n?t.map(rhe):t})}function rhe(e){const t=dx(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Ms=5,fr=31,hg=32,Ia=new Uint32Array(hg+1),oo=new Uint32Array(hg+1);oo[0]=0;Ia[0]=~oo[0];for(let e=1;e<=hg;++e)oo[e]=oo[e-1]<<1|1,Ia[e]=~oo[e];function ihe(e,t){const n=new Uint32Array(~~((e*t+hg)/hg));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>Ms]&1<<(a&fr)},set:(o,s)=>{const a=s*e+o;r(a>>>Ms,1<<(a&fr))},clear:(o,s)=>{const a=s*e+o;i(a>>>Ms,~(1<<(a&fr)))},getRange:(o,s,a,l)=>{let u=l,c,f,d,h;for(;u>=s;--u)if(c=u*e+o,f=u*e+a,d=c>>>Ms,h=f>>>Ms,d===h){if(n[d]&Ia[c&fr]&oo[(f&fr)+1])return!0}else{if(n[d]&Ia[c&fr]||n[h]&oo[(f&fr)+1])return!0;for(let p=d+1;p{let u,c,f,d,h;for(;s<=l;++s)if(u=s*e+o,c=s*e+a,f=u>>>Ms,d=c>>>Ms,f===d)r(f,Ia[u&fr]&oo[(c&fr)+1]);else for(r(f,Ia[u&fr]),r(d,oo[(c&fr)+1]),h=f+1;h{let u,c,f,d,h;for(;s<=l;++s)if(u=s*e+o,c=s*e+a,f=u>>>Ms,d=c>>>Ms,f===d)i(f,oo[u&fr]|Ia[(c&fr)+1]);else for(i(f,oo[u&fr]),i(d,Ia[(c&fr)+1]),h=f+1;ho<0||s<0||l>=t||a>=e}}function ohe(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>ihe(i,o),s.ratio=r,s.padding=n,s.width=e,s.height=t,s}function she(e,t,n,r){const i=e.width,o=e.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,u=s.datum.fontSize,c=xo.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,y,v;for(let b=0;b=f&&(f=v,s.x=m,s.y=y);return m=c/2,y=u/2,d=s.x-m,h=s.x+m,p=s.y-y,g=s.y+y,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||t-(s=r/2)<0||t+s>o}function Qa(e,t,n,r,i,o,s,a){const l=i*o/(r*2),u=e(t-l),c=e(t+l),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(u,f,c,d)||s.getRange(u,f,c,d)||a&&a.getRange(u,f,c,d)}function ahe(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1];function l(u,c,f,d,h){const p=e.invert(u),g=e.invert(c);let m=f,y=o,v;if(!sv(p,g,d,h,i,o)&&!Qa(e,p,g,h,d,m,s,a)&&!Qa(e,p,g,h,d,h,s,null)){for(;y-m>=1;)v=(m+y)/2,Qa(e,p,g,h,d,v,s,a)?y=v:m=v;if(m>f)return[p,g,m,!0]}}return function(u){const c=u.datum.datum.items[r].items,f=c.length,d=u.datum.fontSize,h=xo.width(u.datum,u.datum.text);let p=n?d:0,g=!1,m=!1,y=0,v,b,w,_,k,E,A,N,O,F,U,M,L,I,B,H,z;for(let j=0;jb&&(z=v,v=b,b=z),w>_&&(z=w,w=_,_=z),O=e(v),U=e(b),F=~~((O+U)/2),M=e(w),I=e(_),L=~~((M+I)/2),A=F;A>=O;--A)for(N=L;N>=M;--N)H=l(A,N,p,h,d),H&&([u.x,u.y,p,g]=H);for(A=F;A<=U;++A)for(N=L;N<=I;++N)H=l(A,N,p,h,d),H&&([u.x,u.y,p,g]=H);!g&&!n&&(B=Math.abs(b-v+_-w),k=(v+b)/2,E=(w+_)/2,B>=y&&!sv(k,E,h,d,i,o)&&!Qa(e,k,E,d,h,d,s,null)&&(y=B,u.x=k,u.y=E,m=!0))}return g||m?(k=h/2,E=d/2,s.setRange(e(u.x-k),e(u.y-E),e(u.x+k),e(u.y+E)),u.align="center",u.baseline="middle",!0):!1}}const lhe=[-1,-1,1,1],uhe=[-1,1,-1,1];function che(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=e.bitmap();return function(u){const c=u.datum.datum.items[r].items,f=c.length,d=u.datum.fontSize,h=xo.width(u.datum,u.datum.text),p=[];let g=n?d:0,m=!1,y=!1,v=0,b,w,_,k,E,A,N,O,F,U,M,L;for(let I=0;I=1;)M=(F+U)/2,Qa(e,E,A,d,h,M,s,a)?U=M:F=M;F>g&&(u.x=E,u.y=A,g=F,m=!0)}}!m&&!n&&(L=Math.abs(w-b+k-_),E=(b+w)/2,A=(_+k)/2,L>=v&&!sv(E,A,h,d,i,o)&&!Qa(e,E,A,d,h,d,s,null)&&(v=L,u.x=E,u.y=A,y=!0))}return m||y?(E=h/2,A=d/2,s.setRange(e(u.x-E),e(u.y-A),e(u.x+E),e(u.y+A)),u.align="center",u.baseline="middle",!0):!1}}const fhe=["right","center","left"],dhe=["bottom","middle","top"];function hhe(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=r.length;return function(u){const c=u.boundary,f=u.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>i||c[3]>o)return!1;let d=u.textWidth??0,h,p,g,m,y,v,b,w,_,k,E,A,N,O,F;for(let U=0;U>>2&3)-1,g=h===0&&p===0||r[U]<0,m=h&&p?Math.SQRT1_2:1,y=r[U]<0?-1:1,v=c[1+h]+r[U]*h*m,E=c[4+p]+y*f*p/2+r[U]*p*m,w=E-f/2,_=E+f/2,A=e(v),O=e(w),F=e(_),!d)if(J3(A,A,O,F,s,a,v,v,w,_,c,g))d=xo.width(u.datum,u.datum.text);else continue;if(k=v+y*d*h/2,v=k-d/2,b=k+d/2,A=e(v),N=e(b),J3(A,N,O,F,s,a,v,b,w,_,c,g))return u.x=h?h*y<0?b:v:k,u.y=p?p*y<0?_:w:E,u.align=fhe[h*y+1],u.baseline=dhe[p*y+1],s.setRange(A,O,N,F),!0}return!1}}function J3(e,t,n,r,i,o,s,a,l,u,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const R_=0,$_=4,O_=8,N_=0,M_=1,F_=2,phe={"top-left":R_+N_,top:R_+M_,"top-right":R_+F_,left:$_+N_,middle:$_+M_,right:$_+F_,"bottom-left":O_+N_,bottom:O_+M_,"bottom-right":O_+F_},ghe={naive:she,"reduced-search":ahe,floodfill:che};function mhe(e,t,n,r,i,o,s,a,l,u,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=yhe(r,f),h=vhe(i,f),p=xhe(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,m=g==="area",y=bhe(p,g,a,l),v=u===null||u===1/0,b=m&&c==="naive";let w=-1,_=-1;const k=e.map(O=>{const F=v?xo.width(O,O.text):void 0;return w=Math.max(w,F),_=Math.max(_,O.fontSize),{datum:O,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(O),textWidth:F}});u=u===null||u===1/0?Math.max(w,_)+Math.max(...r):u;const E=ohe(t[0],t[1],u);let A;if(!b){n&&k.sort((U,M)=>n(U.datum,M.datum));let O=!1;for(let U=0;UU.datum);A=o.length||F?nhe(E,F||[],o,O,m):the(E,s&&k)}const N=m?ghe[c](E,A,s,l):hhe(E,A,h,d);return k.forEach(O=>O.opacity=+N(O)),k}function yhe(e,t){const n=new Float64Array(t),r=e.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>i(o.datum):t==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const DS=["x","y","opacity","align","baseline"],cU=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function OR(e){G.call(this,null,e)}OR.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:cU},{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:DS.length,default:DS}]};oe(OR,G,{transform(e,t){function n(o){const s=e[o];return Ve(s)&&t.modified(s.fields)}const r=e.modified();if(!(r||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&Y("Size parameter should be specified as a [width, height] array.");const i=e.as||DS;return mhe(t.materialize(t.SOURCE).source||[],e.size,e.sort,me(e.offset==null?1:e.offset),me(e.anchor||cU),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),t.reflow(r).modifies(i)}});const whe=Object.freeze(Object.defineProperty({__proto__:null,label:OR},Symbol.toStringTag,{value:"Module"}));function fU(e,t){var n=[],r=function(c){return c(a)},i,o,s,a,l,u;if(t==null)n.push(e);else for(i={},o=0,s=e.length;o{k8(u,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function MR(e){G.call(this,null,e)}MR.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(IS)},{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}]};oe(MR,G,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=fU(r,e.groupby),o=(e.groupby||[]).map(Xt),s=e.method||"linear",a=e.order==null?3:e.order,l=_he(s,a),u=e.as||[Xt(e.x),Xt(e.y)],c=IS[s],f=[];let d=e.extent;Oe(IS,s)||Y("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){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(mt({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||as(h,e.x),y=v=>{const b={};for(let w=0;wy([v,g.predict(v)])):xx(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Ehe=Object.freeze(Object.defineProperty({__proto__:null,loess:NR,regression:MR},Symbol.toStringTag,{value:"Module"})),ea=11102230246251565e-32,qn=134217729,She=(3+8*ea)*ea;function D_(e,t,n,r,i){let o,s,a,l,u=t[0],c=r[0],f=0,d=0;c>u==c>-u?(o=u,u=t[++f]):(o=c,c=r[++d]);let h=0;if(fu==c>-u?(s=u+o,a=o-(s-u),u=t[++f]):(s=c+o,a=o-(s-c),c=r[++d]),o=s,a!==0&&(i[h++]=a);fu==c>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=t[++f]):(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=L||-M>=L||(f=e-N,a=e-(N+f)+(f-i),f=n-O,u=n-(O+f)+(f-i),f=t-F,l=t-(F+f)+(f-o),f=r-U,c=r-(U+f)+(f-o),a===0&&l===0&&u===0&&c===0)||(L=The*s+She*Math.abs(M),M+=N*c+U*a-(F*u+O*l),M>=L||-M>=L))return M;w=a*U,d=qn*a,h=d-(d-a),p=a-h,d=qn*U,g=d-(d-U),m=U-g,_=p*m-(w-h*g-p*g-h*m),k=l*O,d=qn*l,h=d-(d-l),p=l-h,d=qn*O,g=d-(d-O),m=O-g,E=p*m-(k-h*g-p*g-h*m),y=_-E,f=_-y,dr[0]=_-(y+f)+(f-E),v=w+y,f=v-w,b=w-(v-f)+(y-f),y=b-k,f=b-y,dr[1]=b-(y+f)+(f-k),A=v+y,f=A-v,dr[2]=v-(A-f)+(y-f),dr[3]=A;const I=D_(4,Uc,4,dr,Q3);w=N*c,d=qn*N,h=d-(d-N),p=N-h,d=qn*c,g=d-(d-c),m=c-g,_=p*m-(w-h*g-p*g-h*m),k=F*u,d=qn*F,h=d-(d-F),p=F-h,d=qn*u,g=d-(d-u),m=u-g,E=p*m-(k-h*g-p*g-h*m),y=_-E,f=_-y,dr[0]=_-(y+f)+(f-E),v=w+y,f=v-w,b=w-(v-f)+(y-f),y=b-k,f=b-y,dr[1]=b-(y+f)+(f-k),A=v+y,f=A-v,dr[2]=v-(A-f)+(y-f),dr[3]=A;const B=D_(I,Q3,4,dr,Z3);w=a*c,d=qn*a,h=d-(d-a),p=a-h,d=qn*c,g=d-(d-c),m=c-g,_=p*m-(w-h*g-p*g-h*m),k=l*u,d=qn*l,h=d-(d-l),p=l-h,d=qn*u,g=d-(d-u),m=u-g,E=p*m-(k-h*g-p*g-h*m),y=_-E,f=_-y,dr[0]=_-(y+f)+(f-E),v=w+y,f=v-w,b=w-(v-f)+(y-f),y=b-k,f=b-y,dr[1]=b-(y+f)+(f-k),A=v+y,f=A-v,dr[2]=v-(A-f)+(y-f),dr[3]=A;const H=D_(B,Z3,4,dr,eI);return eI[H-1]}function E0(e,t,n,r,i,o){const s=(t-o)*(n-i),a=(e-i)*(r-o),l=s-a,u=Math.abs(s+a);return Math.abs(l)>=Che*u?l:-Rhe(e,t,n,r,i,o,u)}const tI=Math.pow(2,-52),S0=new Uint32Array(512);class av{static from(t,n=Fhe,r=Dhe){const i=t.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1;let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let O=0;Ou&&(u=F),U>c&&(c=U),this._ids[O]=O}const f=(a+u)/2,d=(l+c)/2;let h=1/0,p,g,m;for(let O=0;O0&&(g=O,h=F)}let b=t[2*g],w=t[2*g+1],_=1/0;for(let O=0;OM&&(O[F++]=L,M=this._dists[L])}this.hull=O.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(E0(y,v,b,w,k,E)<0){const O=g,F=b,U=w;g=m,b=k,w=E,m=O,k=F,E=U}const A=Mhe(y,v,b,w,k,E);this._cx=A.x,this._cy=A.y;for(let O=0;O0&&Math.abs(L-F)<=tI&&Math.abs(I-U)<=tI||(F=L,U=I,M===p||M===g||M===m))continue;let B=0;for(let ce=0,_e=this._hashKey(L,I);ce=0;)if(H=z,H===B){H=-1;break}if(H===-1)continue;let j=this._addTriangle(H,M,r[H],-1,-1,i[H]);i[M]=this._legalize(j+2),i[H]=j,N++;let J=r[H];for(;z=r[J],E0(L,I,t[2*J],t[2*J+1],t[2*z],t[2*z+1])<0;)j=this._addTriangle(J,M,z,i[M],-1,i[J]),i[M]=this._legalize(j+2),r[J]=J,N--,J=z;if(H===B)for(;z=n[H],E0(L,I,t[2*z],t[2*z+1],t[2*H],t[2*H+1])<0;)j=this._addTriangle(z,M,H,-1,i[H],i[z]),this._legalize(j+2),i[z]=j,r[H]=H,N--,H=z;this._hullStart=n[M]=H,r[H]=n[J]=M,r[M]=J,o[this._hashKey(L,I)]=M,o[this._hashKey(t[2*H],t[2*H+1])]=H}this.hull=new Uint32Array(N);for(let O=0,F=this._hullStart;O0?3-n:1+n)/4}function I_(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function Ohe(e,t,n,r,i,o,s,a){const l=e-s,u=t-a,c=n-s,f=r-a,d=i-s,h=o-a,p=l*l+u*u,g=c*c+f*f,m=d*d+h*h;return l*(f*m-g*h)-u*(c*m-g*d)+p*(c*h-f*d)<0}function Nhe(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,u=o-t,c=s*s+a*a,f=l*l+u*u,d=.5/(s*u-a*l),h=(u*c-a*f)*d,p=(s*f-l*c)*d;return h*h+p*p}function Mhe(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,u=o-t,c=s*s+a*a,f=l*l+u*u,d=.5/(s*u-a*l),h=e+(u*c-a*f)*d,p=t+(s*f-l*c)*d;return{x:h,y:p}}function yf(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],s=t[o];let a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;Eh(e,i,o),t[e[n]]>t[e[r]]&&Eh(e,n,r),t[e[o]]>t[e[r]]&&Eh(e,o,r),t[e[n]]>t[e[o]]&&Eh(e,n,o);const a=e[o],l=t[a];for(;;){do o++;while(t[e[o]]l);if(s=s-n?(yf(e,t,o,r),yf(e,t,n,s-1)):(yf(e,t,n,s-1),yf(e,t,o,r))}}function Eh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Fhe(e){return e[0]}function Dhe(e){return e[1]}const nI=1e-6;class Au{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>nI||Math.abs(this._y1-o)>nI)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class PS{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 Ihe=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,y=r.length,v,b;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function jhe(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class FR{static from(t,n=Lhe,r=zhe,i){return new FR("length"in t?Uhe(t,n,r,i):Float64Array.from(Hhe(t,n,r,i)))}constructor(t){this._delaunator=new av(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&&Bhe(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 l=this.collinear[0],u=this.collinear[this.collinear.length-1],c=[n[2*l],n[2*l+1],n[2*u],n[2*u+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Ihe(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:u}=this;if(i[t]===-1||!u.length)return(t+1)%(u.length>>1);let c=t,f=Hc(n-u[t*2],2)+Hc(r-u[t*2+1],2);const d=i[t];let h=d;do{let p=l[h];const g=Hc(n-u[p*2],2)+Hc(r-u[p*2+1],2);if(g>5)*e[1]),m=null,y=u.length,v=-1,b=[],w=u.map(k=>({text:t(k),font:n(k),style:i(k),weight:o(k),rotate:s(k),size:~~(r(k)+1e-14),padding:a(k),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:k})).sort((k,E)=>E.size-k.size);++v>1,_.y=e[1]*(c()+.5)>>1,Yhe(p,_,w,v),_.hasText&&h(g,_,m)&&(b.push(_),m?Khe(m,_):m=[{x:_.x+_.x0,y:_.y+_.y0},{x:_.x+_.x1,y:_.y+_.y1}],_.x-=e[0]>>1,_.y-=e[1]>>1)}return b};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=(ip<<5)/g,p.height=my/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,v=g.y,b=Math.sqrt(e[0]*e[0]+e[1]*e[1]),w=l(e),_=c()<.5?1:-1,k=-_,E,A,N;(E=w(k+=_))&&(A=~~E[0],N=~~E[1],!(Math.min(Math.abs(A),Math.abs(N))>=b));)if(g.x=y+A,g.y=v+N,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!Xhe(g,p,e[0]))&&(!m||Jhe(g,m))){for(var O=g.sprite,F=g.width>>5,U=e[0]>>5,M=g.x-(F<<4),L=M&127,I=32-L,B=g.y1-g.y0,H=(g.y+g.y0)*U+(M>>5),z,j=0;j>>L:0);H+=U}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(u=p,f):u},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=eu(p),f):n},f.fontStyle=function(p){return arguments.length?(i=eu(p),f):i},f.fontWeight=function(p){return arguments.length?(o=eu(p),f):o},f.rotate=function(p){return arguments.length?(s=eu(p),f):s},f.text=function(p){return arguments.length?(t=eu(p),f):t},f.spiral=function(p){return arguments.length?(l=epe[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=eu(p),f):r},f.padding=function(p){return arguments.length?(a=eu(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function Yhe(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,(ip<<5)/o,my/o);var s=0,a=0,l=0,u=n.length,c,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else c=c+31>>5<<5;if(d>l&&(l=d),s+c>=ip<<5&&(s=0,a+=l,l=0),a+d>=my)break;i.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&i.rotate(t.rotate*P_),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var _=i.getImageData(0,0,(ip<<5)/o,my/o).data,k=[];--r>=0;)if(t=n[r],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),O=_[(a+p)*(ip<<5)+(s+h)<<2]?1<<31-h%32:0;k[N]|=O,E|=O}E?A=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+A,t.sprite=k.slice(0,(t.y1-t.y0)*f)}}}function Xhe(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,o=e.x-(i<<4),s=o&127,a=32-s,l=e.y1-e.y0,u=(e.y+e.y0)*n+(o>>5),c,f=0;f>>s:0))&t[u+d])return!0;u+=n}return!1}function Khe(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function Jhe(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const u=o.words(i).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(ji).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=u.length;for(let p=0,g,m;pnew Uint8Array(e),ipe=e=>new Uint16Array(e),Cp=e=>new Uint32Array(e);function ope(){let e=8,t=[],n=Cp(0),r=k0(0,e),i=k0(0,e);return{data:()=>t,seen:()=>n=spe(n,t.length),add(o){for(let s=0,a=t.length,l=o.length,u;st.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>e)&&(e=Math.max(s,e),r=k0(o,e,r),i=k0(o,e))}}}function spe(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function k0(e,t,n){const r=(t<257?rpe:t<65537?ipe:Cp)(e);return n&&r.set(n),r}function rI(e,t,n){const r=1<0)for(m=0;me,size:()=>n}}function ape(e,t){return e.sort.call(t,(n,r)=>{const i=e[n],o=e[r];return io?1:0}),RZ(e,t)}function lpe(e,t,n,r,i,o,s,a,l){let u=0,c=0,f;for(f=0;ut.modified(r.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,u;for(;a{const o=i.remove(t,n);for(const s in r)r[s].reindex(o)})},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,s=r.length;let a=0,l,u;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(u,d);pd)for(p=Math.max(u,d),g=c;pa[c]&n?null:s[c];return o.filter(o.MOD,u),i&i-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^l[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^l[c]&n))?s[c]:null})):(o.filter(o.ADD,u),o.filter(o.REM,c=>(a[c]&n)===i?s[c]:null)),o.filter(o.SOURCE,c=>u(c._index))}});const upe=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:PR,resolvefilter:LR},Symbol.toStringTag,{value:"Module"})),cpe="RawCode",ec="Literal",fpe="Property",dpe="Identifier",hpe="ArrayExpression",ppe="BinaryExpression",pU="CallExpression",gpe="ConditionalExpression",mpe="LogicalExpression",ype="MemberExpression",vpe="ObjectExpression",xpe="UnaryExpression";function $o(e){this.type=e}$o.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=bpe(this),n=0,r=t.length;n";ws[tc]="Identifier";ws[Hl]="Keyword";ws[Zx]="Null";ws[Sc]="Numeric";ws[Mr]="Punctuator";ws[fm]="String";ws[wpe]="RegularExpression";var _pe="ArrayExpression",Epe="BinaryExpression",Spe="CallExpression",kpe="ConditionalExpression",gU="Identifier",Cpe="Literal",Ape="LogicalExpression",Tpe="MemberExpression",Rpe="ObjectExpression",$pe="Property",Ope="UnaryExpression",kn="Unexpected token %0",Npe="Unexpected number",Mpe="Unexpected string",Fpe="Unexpected identifier",Dpe="Unexpected reserved word",Ipe="Unexpected end of input",LS="Invalid regular expression",L_="Invalid regular expression: missing /",mU="Octal literals are not allowed in strict mode.",Ppe="Duplicate data property in object literal not allowed in strict mode",Pn="ILLEGAL",pg="Disabled.",Lpe=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]"),zpe=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 eb(e,t){if(!e)throw new Error("ASSERT: "+t)}function Bs(e){return e>=48&&e<=57}function zR(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function Ap(e){return"01234567".indexOf(e)>=0}function Bpe(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].indexOf(e)>=0}function gg(e){return e===10||e===13||e===8232||e===8233}function dm(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Lpe.test(String.fromCharCode(e))}function lv(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&zpe.test(String.fromCharCode(e))}const jpe={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 yU(){for(;q1114111||e!=="}")&&dt({},kn,Pn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function vU(){var e,t;for(e=Ee.charCodeAt(q++),t=String.fromCharCode(e),e===92&&(Ee.charCodeAt(q)!==117&&dt({},kn,Pn),++q,e=zS("u"),(!e||e==="\\"||!dm(e.charCodeAt(0)))&&dt({},kn,Pn),t=e);q>>=")return q+=4,{type:Mr,value:s,start:e,end:q};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return q+=3,{type:Mr,value:o,start:e,end:q};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".indexOf(r)>=0||i==="=>")return q+=2,{type:Mr,value:i,start:e,end:q};if(i==="//"&&dt({},kn,Pn),"<>=!+-*%&|^/".indexOf(r)>=0)return++q,{type:Mr,value:r,start:e,end:q};dt({},kn,Pn)}function Wpe(e){let t="";for(;q=0&&q=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(r,i)=>{if(parseInt(i,16)<=1114111)return"x";dt({},LS)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{dt({},LS)}try{return new RegExp(e,t)}catch{return null}}function Xpe(){var e,t,n,r,i;for(e=Ee[q],eb(e==="/","Regular expression literal must start with a slash"),t=Ee[q++],n=!1,r=!1;q=0&&dt({},LS,n),{value:n,literal:t}}function Jpe(){var e,t,n,r;return xt=null,yU(),e=q,t=Xpe(),n=Kpe(),r=Ype(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:q}}function Qpe(e){return e.type===tc||e.type===Hl||e.type===Qx||e.type===Zx}function xU(){if(yU(),q>=ir)return{type:cm,start:q,end:q};const e=Ee.charCodeAt(q);return dm(e)?Gpe():e===40||e===41||e===59?z_():e===39||e===34?qpe():e===46?Bs(Ee.charCodeAt(q+1))?oI():z_():Bs(e)?oI():z_()}function Lr(){const e=xt;return q=e.end,xt=xU(),q=e.end,e}function bU(){const e=q;xt=xU(),q=e}function Zpe(e){const t=new $o(_pe);return t.elements=e,t}function sI(e,t,n){const r=new $o(e==="||"||e==="&&"?Ape:Epe);return r.operator=e,r.left=t,r.right=n,r}function ege(e,t){const n=new $o(Spe);return n.callee=e,n.arguments=t,n}function tge(e,t,n){const r=new $o(kpe);return r.test=e,r.consequent=t,r.alternate=n,r}function BR(e){const t=new $o(gU);return t.name=e,t}function op(e){const t=new $o(Cpe);return t.value=e.value,t.raw=Ee.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function aI(e,t,n){const r=new $o(Tpe);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function nge(e){const t=new $o(Rpe);return t.properties=e,t}function lI(e,t,n){const r=new $o($pe);return r.key=t,r.value=n,r.kind=e,r}function rge(e,t){const n=new $o(Ope);return n.operator=e,n.argument=t,n.prefix=!0,n}function dt(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(o,s)=>(eb(s":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 gge(){var e,t,n,r,i,o,s,a,l,u;if(e=xt,l=yy(),r=xt,i=fI(r),i===0)return l;for(r.prec=i,Lr(),t=[e,xt],s=yy(),o=[l,r,s];(i=fI(xt))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),t.pop(),n=sI(a,l,s),o.push(n);r=Lr(),r.prec=i,o.push(r),t.push(xt),n=yy(),o.push(n)}for(u=o.length-1,n=o[u],t.pop();u>1;)t.pop(),n=sI(o[u-1].value,o[u-2],n),u-=2;return n}function nc(){var e,t,n;return e=gge(),Ot("?")&&(Lr(),t=nc(),or(":"),n=nc(),e=tge(e,t,n)),e}function jR(){const e=nc();if(Ot(","))throw new Error(pg);return e}function UR(e){Ee=e,q=0,ir=Ee.length,xt=null,bU();const t=jR();if(xt.type!==cm)throw new Error("Unexpect token after expression.");return t}var wU={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 _U(e){function t(s,a,l,u){let c=e(a[0]);return l&&(c=l+"("+c+")",l.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+s+(u<0?"":u===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,l){return u=>t(s,u,a,l)}const r="new Date",i="String",o="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(s){s.length<3&&Y("Missing arguments to clamp function."),s.length>3&&Y("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&Y("Missing arguments to if function."),s.length>3&&Y("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function mge(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function EU(e){e=e||{};const t=e.allowed?So(e.allowed):{},n=e.forbidden?So(e.forbidden):{},r=e.constants||wU,i=(e.functions||_U)(f),o=e.globalvar,s=e.fieldvar,a=Ve(o)?o:p=>`${o}["${p}"]`;let l={},u={},c=0;function f(p){if(pe(p))return p;const g=d[p.type];return g==null&&Y("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:Oe(n,g)?Y("Illegal identifier: "+g):Oe(r,g)?r[g]:Oe(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===s&&(u[mge(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&Y("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=Oe(i,g)&&i[g];return y||Y("Unrecognized function: "+g),Ve(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(l),fields:Object.keys(u)};return l={},u={},g}return h.functions=i,h.constants=r,h}function j_(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function yge(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function vge(e){let t,n,r;e.length!==2?(t=j_,n=(a,l)=>j_(e(a),l),r=(a,l)=>e(a)-l):(t=e===j_||e===yge?e:xge,n=e,r=e);function i(a,l,u=0,c=a.length){if(u>>1;n(a[f],l)<0?u=f+1:c=f}while(u>>1;n(a[f],l)<=0?u=f+1:c=f}while(uu&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function xge(){return 0}function bge(e,...t){e=new n1(e),t=t.map(wge);e:for(const n of e)for(const r of t)if(!r.has(n)){e.delete(n);continue e}return e}function wge(e){return e instanceof n1?e:new n1(e)}function _ge(...e){const t=new n1;for(const n of e)for(const r of n)t.add(r);return t}const HR="intersect",dI="union",Ege="vlMulti",Sge="vlPoint",hI="or",kge="and",qo="_vgsid_",mg=qr(qo),Cge="E",Age="R",Tge="R-E",Rge="R-LE",$ge="R-RE",uv="index:unit";function pI(e,t){for(var n=t.fields,r=t.values,i=n.length,o=0,s,a;oWe(t.fields?{values:t.fields.map(r=>(r.getter||(r.getter=qr(r.field)))(n.datum))}:{[qo]:mg(n.datum)},t))}function Ige(e,t,n,r){for(var i=this.context.data[e],o=i?i.values.value:[],s={},a={},l={},u,c,f,d,h,p,g,m,y,v,b=o.length,w=0,_,k;w(E[c[N].field]=A,E),{})))}else h=qo,p=mg(u),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[qo]:p}));if(t=t||dI,s[qo]?s[qo]=U_[`${qo}_${t}`](...Object.values(s[qo])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map(A=>s[E][A]).reduce((A,N)=>A===void 0?N:U_[`${l[E]}_${t}`](A,N))}),o=Object.keys(a),n&&o.length){const E=r?Sge:Ege;s[E]=t===dI?{[hI]:o.reduce((A,N)=>(A.push(...a[N]),A),[])}:{[kge]:o.map(A=>({[hI]:a[A]}))}}return s}var U_={[`${qo}_union`]:_ge,[`${qo}_intersect`]:bge,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;nt.indexOf(n)>=0):t},R_union:function(e,t){var n=Zn(t[0]),r=Zn(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};const Pge=":",Lge="@";function GR(e,t,n,r){t[0].type!==ec&&Y("First argument to selection functions must be a string literal.");const i=t[0].value,o=t.length>=2&&it(t).value,s="unit",a=Lge+s,l=Pge+i;o===HR&&!Oe(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),Oe(r,l)||(r[l]=n.getData(i).tuplesRef())}function kU(e){const t=this.context.data[e];return t?t.values.value:[]}function zge(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count}function Bge(e,t){const n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(zi).insert(t)),1}function jge(e,t,n){if(e){const r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return n!==void 0?n:e}const hm=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},Uge=hm("format"),CU=hm("timeFormat"),Hge=hm("utcFormat"),Gge=hm("timeParse"),Wge=hm("utcParse"),C0=new Date(2e3,0,1);function nb(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(C0.setYear(2e3),C0.setMonth(e),C0.setDate(t),CU.call(this,C0,n))}function Vge(e){return nb.call(this,e,1,"%B")}function qge(e){return nb.call(this,e,1,"%b")}function Yge(e){return nb.call(this,0,2+e,"%A")}function Xge(e){return nb.call(this,0,2+e,"%a")}const Kge=":",Jge="@",BS="%",AU="$";function WR(e,t,n,r){t[0].type!==ec&&Y("First argument to data functions must be a string literal.");const i=t[0].value,o=Kge+i;if(!Oe(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function Qge(e,t,n,r){t[0].type!==ec&&Y("First argument to indata must be a string literal."),t[1].type!==ec&&Y("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,s=Jge+o;Oe(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Gr(e,t,n,r){if(t[0].type===ec)gI(n,r,t[0].value);else for(e in n.scales)gI(n,r,e)}function gI(e,t,n){const r=BS+n;if(!Oe(t,r))try{t[r]=e.scaleRef(n)}catch{}}function ya(e,t){if(Ve(e))return e;if(pe(e)){const n=t.scales[e];return n&&ioe(n.value)?n.value:void 0}}function Zge(e,t,n){t.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Gr,n._range=Gr,n._scale=Gr;const r=i=>"_["+(i.type===ec?ie(BS+i.value):ie(BS)+"+"+e(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${e(i[1])})`}}function VR(e,t){return function(n,r,i){if(n){const o=ya(n,(i||this).context);return o&&o.path[e](r)}else return t(r)}}const eme=VR("area",vue),tme=VR("bounds",_ue),nme=VR("centroid",Tue);function rme(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 qR(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(r){e.warn(r)}return n[n.length-1]}function ime(){return qR(this.context.dataflow,"warn",arguments)}function ome(){return qR(this.context.dataflow,"info",arguments)}function sme(){return qR(this.context.dataflow,"debug",arguments)}function H_(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function jS(e){const t=wl(e),n=H_(t.r),r=H_(t.g),i=H_(t.b);return .2126*n+.7152*r+.0722*i}function ame(e,t){const n=jS(e),r=jS(t),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function lme(){const e=[].slice.call(arguments);return e.unshift({}),We(...e)}function TU(e,t){return e===t||e!==e&&t!==t?!0:K(e)?K(t)&&e.length===t.length?ume(e,t):!1:ye(e)&&ye(t)?RU(e,t):!1}function ume(e,t){for(let n=0,r=e.length;nRU(e,t)}function cme(e,t,n,r,i,o){const s=this.context.dataflow,a=this.context.data[e],l=a.input,u=s.stamp();let c=a.changes,f,d;if(s._trigger===!1||!(l.value.length||t||r))return 0;if((!c||c.stamp{a.modified=!0,s.pulse(l,c).run()},!0,1)),n&&(f=n===!0?zi:K(n)||fx(n)?n:mI(n),c.remove(f)),t&&c.insert(t),r&&(f=mI(r),l.value.some(f)?c.remove(f):c.insert(r)),i)for(d in o)c.modify(i,d,o[d]);return 1}function fme(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function dme(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const yI={};function hme(e,t){const n=yI[t]||(yI[t]=qr(t));return K(e)?e.map(n):n(e)}function YR(e){return K(e)||ArrayBuffer.isView(e)?e:null}function XR(e){return YR(e)||(pe(e)?e:null)}function pme(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;ro.stop(u(c),e(c))),o}function Tme(e,t,n){const r=ya(e,(n||this).context);return function(i){return r?r.path.context(i)(t):""}}function Rme(e){let t=null;return function(n){return n?sg(n,t=t||ed(e)):e}}const $U=e=>e.data;function OU(e,t){const n=kU.call(t,e);return n.root&&n.root.lookup||{}}function $me(e,t,n){const r=OU(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map($U):void 0}function Ome(e,t){const n=OU(e,this)[t];return n?n.ancestors().map($U):void 0}const NU=()=>typeof window<"u"&&window||null;function Nme(){const e=NU();return e?e.screen:{}}function Mme(){const e=NU();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Fme(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function MU(e,t,n){if(!e)return[];const[r,i]=e,o=new sn().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return yB(s,o,Dme(t))}function Dme(e){let t=null;if(e){const n=me(e.marktype),r=me(e.markname);t=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return t}function Ime(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=me(e);const i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function Pme(e){return me(e).reduce((t,n,r)=>{let[i,o]=n;return t+=r==0?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `},"")}function Lme(e,t,n){const{x:r,y:i,mark:o}=n,s=new sn().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,u]of t)ls.x2&&(s.x2=l),us.y2&&(s.y2=u);return s.translate(r,i),MU([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(l=>zme(l.x,l.y,t))}function zme(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=a>t&&e<(s-l)*(t-u)/(a-u)+l&&r++}return r&1}const yg={random(){return ji()},cumulativeNormal:mx,cumulativeLogNormal:iA,cumulativeUniform:lA,densityNormal:ZC,densityLogNormal:rA,densityUniform:aA,quantileNormal:yx,quantileLogNormal:oA,quantileUniform:uA,sampleNormal:gx,sampleLogNormal:nA,sampleUniform:sA,isArray:K,isBoolean:Ll,isDate:ul,isDefined(e){return e!==void 0},isNumber:ct,isObject:ye,isRegExp:Y6,isString:pe,isTuple:fx,isValid(e){return e!=null&&e===e},toBoolean:NC,toDate(e){return MC(e)},toNumber:Zn,toString:FC,indexof:gme,join:pme,lastindexof:mme,replace:vme,reverse:xme,slice:yme,flush:V6,lerp:X6,merge:lme,pad:Q6,peek:it,pluck:hme,span:zg,inrange:hf,truncate:Z6,rgb:wl,lab:m1,hcl:y1,hsl:p1,luminance:jS,contrast:ame,sequence:ci,format:Uge,utcFormat:Hge,utcParse:Wge,utcOffset:Nz,utcSequence:Dz,timeFormat:CU,timeParse:Gge,timeOffset:Oz,timeSequence:Fz,timeUnitSpecifier:bz,monthFormat:Vge,monthAbbrevFormat:qge,dayFormat:Yge,dayAbbrevFormat:Xge,quarter:U6,utcquarter:H6,week:_z,utcweek:kz,dayofyear:wz,utcdayofyear:Sz,warn:ime,info:ome,debug:sme,extent(e){return as(e)},inScope:rme,intersect:MU,clampRange:G6,pinchDistance:fme,pinchAngle:dme,screen:Nme,containerSize:Fme,windowSize:Mme,bandspace:bme,setdata:Bge,pathShape:Rme,panLinear:L6,panLog:z6,panPow:B6,panSymlog:j6,zoomLinear:CC,zoomLog:AC,zoomPow:e1,zoomSymlog:TC,encode:jge,modify:cme,lassoAppend:Ime,lassoPath:Pme,intersectLasso:Lme},Bme=["view","item","group","xy","x","y"],jme="event.vega.",FU="this.",KR={},DU={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${ie(AU+e)}]`,functions:Ume,constants:wU,visitors:KR},US=EU(DU);function Ume(e){const t=_U(e);Bme.forEach(n=>t[n]=jme+n);for(const n in yg)t[n]=FU+n;return We(t,Zge(e,yg,KR)),t}function Zt(e,t,n){return arguments.length===1?yg[e]:(yg[e]=t,n&&(KR[e]=n),US&&(US.functions[e]=FU+e),this)}Zt("bandwidth",wme,Gr);Zt("copy",_me,Gr);Zt("domain",Eme,Gr);Zt("range",kme,Gr);Zt("invert",Sme,Gr);Zt("scale",Cme,Gr);Zt("gradient",Ame,Gr);Zt("geoArea",eme,Gr);Zt("geoBounds",tme,Gr);Zt("geoCentroid",nme,Gr);Zt("geoShape",Tme,Gr);Zt("indata",zge,Qge);Zt("data",kU,WR);Zt("treePath",$me,WR);Zt("treeAncestors",Ome,WR);Zt("vlSelectionTest",Oge,GR);Zt("vlSelectionIdTest",Fge,GR);Zt("vlSelectionResolve",Ige,GR);Zt("vlSelectionTuples",Dge);function ds(e,t){const n={};let r;try{e=pe(e)?e:ie(e)+"",r=UR(e)}catch{Y("Expression parse error: "+e)}r.visit(o=>{if(o.type!==pU)return;const s=o.callee.name,a=DU.visitors[s];a&&a(s,o.arguments,t,n)});const i=US(r);return i.globals.forEach(o=>{const s=AU+o;!Oe(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:We({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function Hme(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(r=>t.parseOperator(r)),n.forEach(r=>t.parseOperatorParameters(r)),(e.streams||[]).forEach(r=>t.parseStream(r)),(e.updates||[]).forEach(r=>t.parseUpdate(r)),t.resolve()}const Gme=So(["rule"]),vI=So(["group","image","rect"]);function Wme(e,t){let n="";return Gme[t]||(e.x2&&(e.x?(vI[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?(vI[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 JR(e){return(e+"").toLowerCase()}function Vme(e){return JR(e)==="operator"}function qme(e){return JR(e)==="collect"}function Sh(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function Yme(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} +`&&++q;else{if(gg(r.charCodeAt(0)))break;e+=r}return t!==""&&dt({},kn,Pn),{type:fm,value:e,octal:o,start:n,end:q}}function Ype(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(r,i)=>{if(parseInt(i,16)<=1114111)return"x";dt({},LS)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{dt({},LS)}try{return new RegExp(e,t)}catch{return null}}function Xpe(){var e,t,n,r,i;for(e=Ee[q],eb(e==="/","Regular expression literal must start with a slash"),t=Ee[q++],n=!1,r=!1;q=0&&dt({},LS,n),{value:n,literal:t}}function Jpe(){var e,t,n,r;return xt=null,yU(),e=q,t=Xpe(),n=Kpe(),r=Ype(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:q}}function Qpe(e){return e.type===tc||e.type===Hl||e.type===Qx||e.type===Zx}function xU(){if(yU(),q>=ir)return{type:cm,start:q,end:q};const e=Ee.charCodeAt(q);return dm(e)?Gpe():e===40||e===41||e===59?z_():e===39||e===34?qpe():e===46?Bs(Ee.charCodeAt(q+1))?oI():z_():Bs(e)?oI():z_()}function Lr(){const e=xt;return q=e.end,xt=xU(),q=e.end,e}function bU(){const e=q;xt=xU(),q=e}function Zpe(e){const t=new $o(_pe);return t.elements=e,t}function sI(e,t,n){const r=new $o(e==="||"||e==="&&"?Ape:Epe);return r.operator=e,r.left=t,r.right=n,r}function ege(e,t){const n=new $o(Spe);return n.callee=e,n.arguments=t,n}function tge(e,t,n){const r=new $o(kpe);return r.test=e,r.consequent=t,r.alternate=n,r}function BR(e){const t=new $o(gU);return t.name=e,t}function op(e){const t=new $o(Cpe);return t.value=e.value,t.raw=Ee.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function aI(e,t,n){const r=new $o(Tpe);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function nge(e){const t=new $o(Rpe);return t.properties=e,t}function lI(e,t,n){const r=new $o($pe);return r.key=t,r.value=n,r.kind=e,r}function rge(e,t){const n=new $o(Ope);return n.operator=e,n.argument=t,n.prefix=!0,n}function dt(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(o,s)=>(eb(s":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 gge(){var e,t,n,r,i,o,s,a,l,u;if(e=xt,l=yy(),r=xt,i=fI(r),i===0)return l;for(r.prec=i,Lr(),t=[e,xt],s=yy(),o=[l,r,s];(i=fI(xt))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),t.pop(),n=sI(a,l,s),o.push(n);r=Lr(),r.prec=i,o.push(r),t.push(xt),n=yy(),o.push(n)}for(u=o.length-1,n=o[u],t.pop();u>1;)t.pop(),n=sI(o[u-1].value,o[u-2],n),u-=2;return n}function nc(){var e,t,n;return e=gge(),Ot("?")&&(Lr(),t=nc(),or(":"),n=nc(),e=tge(e,t,n)),e}function jR(){const e=nc();if(Ot(","))throw new Error(pg);return e}function UR(e){Ee=e,q=0,ir=Ee.length,xt=null,bU();const t=jR();if(xt.type!==cm)throw new Error("Unexpect token after expression.");return t}var wU={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 _U(e){function t(s,a,l,u){let c=e(a[0]);return l&&(c=l+"("+c+")",l.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+s+(u<0?"":u===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,l){return u=>t(s,u,a,l)}const r="new Date",i="String",o="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(s){s.length<3&&Y("Missing arguments to clamp function."),s.length>3&&Y("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&Y("Missing arguments to if function."),s.length>3&&Y("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function mge(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function EU(e){e=e||{};const t=e.allowed?So(e.allowed):{},n=e.forbidden?So(e.forbidden):{},r=e.constants||wU,i=(e.functions||_U)(f),o=e.globalvar,s=e.fieldvar,a=Ve(o)?o:p=>`${o}["${p}"]`;let l={},u={},c=0;function f(p){if(pe(p))return p;const g=d[p.type];return g==null&&Y("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:Oe(n,g)?Y("Illegal identifier: "+g):Oe(r,g)?r[g]:Oe(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===s&&(u[mge(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&Y("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=Oe(i,g)&&i[g];return y||Y("Unrecognized function: "+g),Ve(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(l),fields:Object.keys(u)};return l={},u={},g}return h.functions=i,h.constants=r,h}function j_(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function yge(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function vge(e){let t,n,r;e.length!==2?(t=j_,n=(a,l)=>j_(e(a),l),r=(a,l)=>e(a)-l):(t=e===j_||e===yge?e:xge,n=e,r=e);function i(a,l,u=0,c=a.length){if(u>>1;n(a[f],l)<0?u=f+1:c=f}while(u>>1;n(a[f],l)<=0?u=f+1:c=f}while(uu&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function xge(){return 0}function bge(e,...t){e=new n1(e),t=t.map(wge);e:for(const n of e)for(const r of t)if(!r.has(n)){e.delete(n);continue e}return e}function wge(e){return e instanceof n1?e:new n1(e)}function _ge(...e){const t=new n1;for(const n of e)for(const r of n)t.add(r);return t}const HR="intersect",dI="union",Ege="vlMulti",Sge="vlPoint",hI="or",kge="and",qo="_vgsid_",mg=qr(qo),Cge="E",Age="R",Tge="R-E",Rge="R-LE",$ge="R-RE",uv="index:unit";function pI(e,t){for(var n=t.fields,r=t.values,i=n.length,o=0,s,a;oWe(t.fields?{values:t.fields.map(r=>(r.getter||(r.getter=qr(r.field)))(n.datum))}:{[qo]:mg(n.datum)},t))}function Ige(e,t,n,r){for(var i=this.context.data[e],o=i?i.values.value:[],s={},a={},l={},u,c,f,d,h,p,g,m,y,v,b=o.length,w=0,_,k;w(E[c[N].field]=A,E),{})))}else h=qo,p=mg(u),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[qo]:p}));if(t=t||dI,s[qo]?s[qo]=U_[`${qo}_${t}`](...Object.values(s[qo])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map(A=>s[E][A]).reduce((A,N)=>A===void 0?N:U_[`${l[E]}_${t}`](A,N))}),o=Object.keys(a),n&&o.length){const E=r?Sge:Ege;s[E]=t===dI?{[hI]:o.reduce((A,N)=>(A.push(...a[N]),A),[])}:{[kge]:o.map(A=>({[hI]:a[A]}))}}return s}var U_={[`${qo}_union`]:_ge,[`${qo}_intersect`]:bge,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;nt.indexOf(n)>=0):t},R_union:function(e,t){var n=Zn(t[0]),r=Zn(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};const Pge=":",Lge="@";function GR(e,t,n,r){t[0].type!==ec&&Y("First argument to selection functions must be a string literal.");const i=t[0].value,o=t.length>=2&&it(t).value,s="unit",a=Lge+s,l=Pge+i;o===HR&&!Oe(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),Oe(r,l)||(r[l]=n.getData(i).tuplesRef())}function kU(e){const t=this.context.data[e];return t?t.values.value:[]}function zge(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count}function Bge(e,t){const n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(zi).insert(t)),1}function jge(e,t,n){if(e){const r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return n!==void 0?n:e}const hm=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},Uge=hm("format"),CU=hm("timeFormat"),Hge=hm("utcFormat"),Gge=hm("timeParse"),Wge=hm("utcParse"),C0=new Date(2e3,0,1);function nb(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(C0.setYear(2e3),C0.setMonth(e),C0.setDate(t),CU.call(this,C0,n))}function Vge(e){return nb.call(this,e,1,"%B")}function qge(e){return nb.call(this,e,1,"%b")}function Yge(e){return nb.call(this,0,2+e,"%A")}function Xge(e){return nb.call(this,0,2+e,"%a")}const Kge=":",Jge="@",BS="%",AU="$";function WR(e,t,n,r){t[0].type!==ec&&Y("First argument to data functions must be a string literal.");const i=t[0].value,o=Kge+i;if(!Oe(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function Qge(e,t,n,r){t[0].type!==ec&&Y("First argument to indata must be a string literal."),t[1].type!==ec&&Y("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,s=Jge+o;Oe(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Gr(e,t,n,r){if(t[0].type===ec)gI(n,r,t[0].value);else for(e in n.scales)gI(n,r,e)}function gI(e,t,n){const r=BS+n;if(!Oe(t,r))try{t[r]=e.scaleRef(n)}catch{}}function ya(e,t){if(Ve(e))return e;if(pe(e)){const n=t.scales[e];return n&&ioe(n.value)?n.value:void 0}}function Zge(e,t,n){t.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Gr,n._range=Gr,n._scale=Gr;const r=i=>"_["+(i.type===ec?ie(BS+i.value):ie(BS)+"+"+e(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${e(i[1])})`}}function VR(e,t){return function(n,r,i){if(n){const o=ya(n,(i||this).context);return o&&o.path[e](r)}else return t(r)}}const eme=VR("area",vue),tme=VR("bounds",_ue),nme=VR("centroid",Tue);function rme(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 qR(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(r){e.warn(r)}return n[n.length-1]}function ime(){return qR(this.context.dataflow,"warn",arguments)}function ome(){return qR(this.context.dataflow,"info",arguments)}function sme(){return qR(this.context.dataflow,"debug",arguments)}function H_(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function jS(e){const t=wl(e),n=H_(t.r),r=H_(t.g),i=H_(t.b);return .2126*n+.7152*r+.0722*i}function ame(e,t){const n=jS(e),r=jS(t),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function lme(){const e=[].slice.call(arguments);return e.unshift({}),We(...e)}function TU(e,t){return e===t||e!==e&&t!==t?!0:K(e)?K(t)&&e.length===t.length?ume(e,t):!1:ye(e)&&ye(t)?RU(e,t):!1}function ume(e,t){for(let n=0,r=e.length;nRU(e,t)}function cme(e,t,n,r,i,o){const s=this.context.dataflow,a=this.context.data[e],l=a.input,u=s.stamp();let c=a.changes,f,d;if(s._trigger===!1||!(l.value.length||t||r))return 0;if((!c||c.stamp{a.modified=!0,s.pulse(l,c).run()},!0,1)),n&&(f=n===!0?zi:K(n)||fx(n)?n:mI(n),c.remove(f)),t&&c.insert(t),r&&(f=mI(r),l.value.some(f)?c.remove(f):c.insert(r)),i)for(d in o)c.modify(i,d,o[d]);return 1}function fme(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function dme(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const yI={};function hme(e,t){const n=yI[t]||(yI[t]=qr(t));return K(e)?e.map(n):n(e)}function YR(e){return K(e)||ArrayBuffer.isView(e)?e:null}function XR(e){return YR(e)||(pe(e)?e:null)}function pme(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;ro.stop(u(c),e(c))),o}function Tme(e,t,n){const r=ya(e,(n||this).context);return function(i){return r?r.path.context(i)(t):""}}function Rme(e){let t=null;return function(n){return n?sg(n,t=t||ed(e)):e}}const $U=e=>e.data;function OU(e,t){const n=kU.call(t,e);return n.root&&n.root.lookup||{}}function $me(e,t,n){const r=OU(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map($U):void 0}function Ome(e,t){const n=OU(e,this)[t];return n?n.ancestors().map($U):void 0}const NU=()=>typeof window<"u"&&window||null;function Nme(){const e=NU();return e?e.screen:{}}function Mme(){const e=NU();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Fme(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function MU(e,t,n){if(!e)return[];const[r,i]=e,o=new sn().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return yj(s,o,Dme(t))}function Dme(e){let t=null;if(e){const n=me(e.marktype),r=me(e.markname);t=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return t}function Ime(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=me(e);const i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function Pme(e){return me(e).reduce((t,n,r)=>{let[i,o]=n;return t+=r==0?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `},"")}function Lme(e,t,n){const{x:r,y:i,mark:o}=n,s=new sn().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,u]of t)ls.x2&&(s.x2=l),us.y2&&(s.y2=u);return s.translate(r,i),MU([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(l=>zme(l.x,l.y,t))}function zme(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=a>t&&e<(s-l)*(t-u)/(a-u)+l&&r++}return r&1}const yg={random(){return ji()},cumulativeNormal:mx,cumulativeLogNormal:iA,cumulativeUniform:lA,densityNormal:ZC,densityLogNormal:rA,densityUniform:aA,quantileNormal:yx,quantileLogNormal:oA,quantileUniform:uA,sampleNormal:gx,sampleLogNormal:nA,sampleUniform:sA,isArray:K,isBoolean:Ll,isDate:ul,isDefined(e){return e!==void 0},isNumber:ct,isObject:ye,isRegExp:Y6,isString:pe,isTuple:fx,isValid(e){return e!=null&&e===e},toBoolean:NC,toDate(e){return MC(e)},toNumber:Zn,toString:FC,indexof:gme,join:pme,lastindexof:mme,replace:vme,reverse:xme,slice:yme,flush:V6,lerp:X6,merge:lme,pad:Q6,peek:it,pluck:hme,span:zg,inrange:hf,truncate:Z6,rgb:wl,lab:m1,hcl:y1,hsl:p1,luminance:jS,contrast:ame,sequence:ci,format:Uge,utcFormat:Hge,utcParse:Wge,utcOffset:Nz,utcSequence:Dz,timeFormat:CU,timeParse:Gge,timeOffset:Oz,timeSequence:Fz,timeUnitSpecifier:bz,monthFormat:Vge,monthAbbrevFormat:qge,dayFormat:Yge,dayAbbrevFormat:Xge,quarter:U6,utcquarter:H6,week:_z,utcweek:kz,dayofyear:wz,utcdayofyear:Sz,warn:ime,info:ome,debug:sme,extent(e){return as(e)},inScope:rme,intersect:MU,clampRange:G6,pinchDistance:fme,pinchAngle:dme,screen:Nme,containerSize:Fme,windowSize:Mme,bandspace:bme,setdata:Bge,pathShape:Rme,panLinear:L6,panLog:z6,panPow:B6,panSymlog:j6,zoomLinear:CC,zoomLog:AC,zoomPow:e1,zoomSymlog:TC,encode:jge,modify:cme,lassoAppend:Ime,lassoPath:Pme,intersectLasso:Lme},Bme=["view","item","group","xy","x","y"],jme="event.vega.",FU="this.",KR={},DU={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${ie(AU+e)}]`,functions:Ume,constants:wU,visitors:KR},US=EU(DU);function Ume(e){const t=_U(e);Bme.forEach(n=>t[n]=jme+n);for(const n in yg)t[n]=FU+n;return We(t,Zge(e,yg,KR)),t}function Zt(e,t,n){return arguments.length===1?yg[e]:(yg[e]=t,n&&(KR[e]=n),US&&(US.functions[e]=FU+e),this)}Zt("bandwidth",wme,Gr);Zt("copy",_me,Gr);Zt("domain",Eme,Gr);Zt("range",kme,Gr);Zt("invert",Sme,Gr);Zt("scale",Cme,Gr);Zt("gradient",Ame,Gr);Zt("geoArea",eme,Gr);Zt("geoBounds",tme,Gr);Zt("geoCentroid",nme,Gr);Zt("geoShape",Tme,Gr);Zt("indata",zge,Qge);Zt("data",kU,WR);Zt("treePath",$me,WR);Zt("treeAncestors",Ome,WR);Zt("vlSelectionTest",Oge,GR);Zt("vlSelectionIdTest",Fge,GR);Zt("vlSelectionResolve",Ige,GR);Zt("vlSelectionTuples",Dge);function ds(e,t){const n={};let r;try{e=pe(e)?e:ie(e)+"",r=UR(e)}catch{Y("Expression parse error: "+e)}r.visit(o=>{if(o.type!==pU)return;const s=o.callee.name,a=DU.visitors[s];a&&a(s,o.arguments,t,n)});const i=US(r);return i.globals.forEach(o=>{const s=AU+o;!Oe(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:We({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function Hme(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(r=>t.parseOperator(r)),n.forEach(r=>t.parseOperatorParameters(r)),(e.streams||[]).forEach(r=>t.parseStream(r)),(e.updates||[]).forEach(r=>t.parseUpdate(r)),t.resolve()}const Gme=So(["rule"]),vI=So(["group","image","rect"]);function Wme(e,t){let n="";return Gme[t]||(e.x2&&(e.x?(vI[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?(vI[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 JR(e){return(e+"").toLowerCase()}function Vme(e){return JR(e)==="operator"}function qme(e){return JR(e)==="collect"}function Sh(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function Yme(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${r} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} : v !== v && u === u ? ${r} : `}var Xme={operator:(e,t)=>Sh(e,["_"],t.code),parameter:(e,t)=>Sh(e,["datum","_"],t.code),event:(e,t)=>Sh(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Sh(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+ie(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=Wme(r,n),i+="return m;",Sh(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(ie).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=(o,s)=>{const a=t[s];let l,u;return o.path?(l=`a${o.path}`,u=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,u=`this.f${s}(b)`),Yme(l,u,-a,a)},i=Function("a","b","var u, v; return "+e.map(r).join("")+"0;");return n?i.bind(n):i}}};function Kme(e){const t=this;Vme(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function Jme(e){const t=this;if(e.params){const n=t.get(e.id);n||Y("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function Qme(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=K(i)?i.map(o=>xI(o,n,t)):xI(i,n,t)}return t}function xI(e,t,n){if(!e||!ye(e))return e;for(let r=0,i=bI.length,o;ri&&i.$tupleid?Re:i);return t.fn[n]||(t.fn[n]=RC(r,e.$order,t.expr.codegen))}function i0e(e,t){const n=e.$encode,r={};for(const i in n){const o=n[i];r[i]=ei(t.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function o0e(e,t){return t}function s0e(e,t){const n=e.$subflow;return function(r,i,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>t.detach(s),a}}function a0e(){return Re}function l0e(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,r=e.stream!=null?t.get(e.stream):void 0,i;e.source?r=t.events(e.source,e.type,n):e.merge&&(i=e.merge.map(o=>t.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),e.between&&(i=e.between.map(o=>t.get(o)),r=r.between(i[0],i[1])),e.filter&&(r=r.filter(n)),e.throttle!=null&&(r=r.throttle(+e.throttle)),e.debounce!=null&&(r=r.debounce(+e.debounce)),r==null&&Y("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),t.stream(e,r)}function u0e(e){var t=this,n=ye(n=e.source)?n.$ref:n,r=t.get(n),i=null,o=e.update,s=void 0;r||Y("Source not defined: "+e.source),i=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,r,i,o,s)}const c0e={skip:!0};function f0e(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(r[o]=s.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(i[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function d0e(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(o=>{n.update(t.signals[o],i[o],c0e)}),Object.keys(r||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(zi).insert(r[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function IU(e,t,n,r){return new PU(e,t,n,r)}function PU(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||Xme,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function wI(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)}PU.prototype=wI.prototype={fork(){const e=new wI(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,r=n.dataflow,i=e.value;if(n.set(e.id,t),qme(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(r.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),r.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[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[JR(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,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:Hme,parseOperator:Kme,parseOperatorParameters:Jme,parseParameters:Qme,parseStream:l0e,parseUpdate:u0e,getState:f0e,setState:d0e};function h0e(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),LU(t,e.description()))}function LU(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function p0e(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const G_="default";function g0e(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:G_,item:null}));e.on(e.events("view","mousemove"),t,(n,r)=>{const i=t.value,o=i?pe(i)?i:i.user:G_,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),e.add(null,function(n){let r=n.cursor,i=this.value;return pe(r)||(i=r.item,r=r.user),HS(e,r&&r!==G_?r:i||r),i},{cursor:t})}function HS(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 cv(e,t){var n=e._runtime.data;return Oe(n,t)||Y("Unrecognized data set: "+t),n[t]}function m0e(e,t){return arguments.length<2?cv(this,e).values.value:rb.call(this,e,wc().remove(zi).insert(t))}function rb(e,t){l8(t)||Y("Second argument to changes must be a changeset.");const n=cv(this,e);return n.modified=!0,this.pulse(n.input,t)}function y0e(e,t){return rb.call(this,e,wc().insert(t))}function v0e(e,t){return rb.call(this,e,wc().remove(t))}function zU(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function BU(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function ib(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function x0e(e){var t=ib(e),n=zU(e),r=BU(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){e.error(o)}})}function b0e(e,t,n){var r=e._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=ib(e),s=t.changedTouches?t.changedTouches[0]:t,o=Gx(s,i),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=w0e(e,n,o),t}function w0e(e,t,n){const r=t?t.mark.marktype==="group"?t:t.mark.group:null;function i(s){var a=r,l;if(s){for(l=t;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;pe(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:lr(e),item:lr(t||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const _I="view",_0e="timer",E0e="window",S0e={trap:!1};function k0e(e){const t=We({defaults:{}},e),n=(r,i)=>{i.forEach(o=>{K(r[o])&&(r[o]=So(r[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function jU(e,t,n,r){e._eventListeners.push({type:n,sources:me(t),handler:r})}function C0e(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[t]:i?!i[t]:e.preventDefault()}function A0(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return r===!1||ye(r)&&!r[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function A0e(e,t,n){var r=this,i=new px(n),o=function(u,c){r.runAsync(null,()=>{e===_I&&C0e(r,t)&&u.preventDefault(),i.receive(b0e(r,u,c))})},s;if(e===_0e)A0(r,"timer",t)&&r.timer(o,t);else if(e===_I)A0(r,"view",t)&&r.addEventListener(t,o,S0e);else if(e===E0e?A0(r,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&A0(r,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)r.warn("Can not resolve event source: "+e);else{for(var a=0,l=s.length;a=0;)t[r].stop();for(r=n.length;--r>=0;)for(o=n[r],i=o.sources.length;--i>=0;)o.sources[i].removeEventListener(o.type,o.handler);return e&&e.call(this,this._handler,null,null,null),this}function hi(e,t,n){const r=document.createElement(e);for(const i in t)r.setAttribute(i,t[i]);return n!=null&&(r.textContent=n),r}const $0e="vega-bind",O0e="vega-bind-name",N0e="vega-bind-radio";function M0e(e,t,n){if(!t)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,s)})}},r.debounce&&(i.update=$C(r.debounce,i.update))),(r.input==null&&r.element?F0e:I0e)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function F0e(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),jU(r,t,i,o),e.set=s=>{t.value=s,t.dispatchEvent(D0e(i))}}function D0e(e){return typeof Event<"u"?new Event(e):{type:e}}function I0e(e,t,n,r){const i=r.signal(n.signal),o=hi("div",{class:$0e}),s=n.input==="radio"?o:o.appendChild(hi("label"));s.appendChild(hi("span",{class:O0e},n.name||n.signal)),t.appendChild(o);let a=P0e;switch(n.input){case"checkbox":a=L0e;break;case"select":a=z0e;break;case"radio":a=B0e;break;case"range":a=j0e;break}a(e,s,n,i)}function P0e(e,t,n,r){const i=hi("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=o=>i.value=o}function L0e(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=hi("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function z0e(e,t,n,r){const i=hi("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};fv(s,r)&&(l.selected=!0),i.appendChild(hi("option",l,(o[a]||s)+""))}),t.appendChild(i),i.addEventListener("change",()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=s=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:s};fv(s,r)&&(l.checked=!0);const u=hi("input",l);u.addEventListener("change",()=>e.update(s));const c=hi("label",{},(o[a]||s)+"");return c.prepend(u),i.appendChild(c),u}),e.set=s=>{const a=e.elements,l=a.length;for(let u=0;u{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",u),a.addEventListener("change",u),e.elements=[a],e.set=c=>{a.value=c,l.textContent=c}}function fv(e,t){return e===t||e+""==t+""}function UU(e,t,n,r,i,o){return t=t||new r(e.loader()),t.initialize(n,zU(e),BU(e),ib(e),i,o).background(e.background())}function QR(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function U0e(e,t,n,r){const i=new r(e.loader(),QR(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,ib(e),e);return t&&t.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function H0e(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Wx(r);e=n._el=e?W_(n,e,!0):null,h0e(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||om,a=e?o.renderer:o.headless;return n._renderer=a?UU(n,n._renderer,e,a):null,n._handler=U0e(n,n._handler,e,s),n._redraw=!0,e&&i!=="none"&&(t=t?n._elBind=W_(n,t,!0):e.appendChild(hi("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=W_(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{M0e(n,l.element||t,l)})),n}function W_(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(r){t=null,e.error(r)}return t}const kh=e=>+e||0,G0e=e=>({top:e,bottom:e,left:e,right:e});function CI(e){return ye(e)?{top:kh(e.top),bottom:kh(e.bottom),left:kh(e.left),right:kh(e.right)}:G0e(kh(e))}async function ZR(e,t,n,r){const i=Wx(t),o=i&&i.headless;return o||Y("Unrecognized renderer type: "+t),await e.runAsync(),UU(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}async function W0e(e,t){e!==Ya.Canvas&&e!==Ya.SVG&&e!==Ya.PNG&&Y("Unrecognized image type: "+e);const n=await ZR(this,e,t);return e===Ya.SVG?V0e(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function V0e(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function q0e(e,t){return(await ZR(this,Ya.Canvas,e,t)).canvas()}async function Y0e(e){return(await ZR(this,Ya.SVG,e)).svg()}function X0e(e,t,n){return IU(e,Yf,yg,n).parse(t)}function K0e(e){var t=this._runtime.scales;return Oe(t,e)||Y("Unrecognized scale or projection: "+e),t[e].value}var HU="width",GU="height",e$="padding",AI={skip:!0};function WU(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===e$?r.left+r.right:0)}function VU(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===e$?r.top+r.bottom:0)}function J0e(e){var t=e._signals,n=t[HU],r=t[GU],i=t[e$];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=WU(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=VU(e,a.size),o()},{size:r});const s=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function Q0e(e,t,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(HU,n,AI),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(GU,r,AI),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function Z0e(e){return this._runtime.getState(e||{data:eye,signals:tye,recurse:!0})}function eye(e,t){return t.modified&&K(t.input.value)&&e.indexOf("_:vega:_")}function tye(e,t){return!(e==="parent"||t instanceof Yf.proxy)}function nye(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function rye(e,t){function n(r){e({timestamp:Date.now(),elapsed:r})}this._timers.push($fe(n,t))}function iye(e,t,n,r){const i=e.element();i&&i.setAttribute("title",oye(r))}function oye(e){return e==null?"":K(e)?qU(e):ye(e)&&!ul(e)?sye(e):e+""}function sye(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(K(n)?qU(n):YU(n))}).join(` -`)}function qU(e){return"["+e.map(YU).join(", ")+"]"}function YU(e){return K(e)?"[…]":ye(e)&&!ul(e)?"{…}":e}function XU(e,t){const n=this;if(t=t||{},kf.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=We({},e.locale,t.locale);n.locale(Qz(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Ya.Canvas,n._scenegraph=new FT;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||iye,n._redraw=!0,n._handler=new om().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=k0e(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=X0e(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:We({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=WU(n,n._width),n._viewHeight=VU(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,J0e(n),p0e(n),g0e(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function T0(e,t){return Oe(e._signals,t)?e._signals[t]:Y("Unrecognized signal name: "+ie(t))}function KU(e,t){const n=(e._targets||[]).filter(r=>r._update&&r._update.handler===t);return n.length?n[0]:null}function TI(e,t,n,r){let i=KU(n,r);return i||(i=QR(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function RI(e,t,n){const r=KU(t,n);return r&&t._targets.remove(r),e}oe(XU,kf,{async evaluate(e,t,n){if(await kf.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,x0e(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&ty(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&LU(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=T0(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",CI(e)):CI(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Wx(e)||Y("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(kf.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(T0(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Q0e,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=QR(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,e===o&&(t===i||t===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return TI(this,e,T0(this,e),t)},removeSignalListener(e,t){return RI(this,T0(this,e),t)},addDataListener(e,t){return TI(this,e,cv(this,e).values,t)},removeDataListener(e,t){return RI(this,cv(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=HS(this,null);this._globalCursor=!!e,t&&HS(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:rye,events:A0e,finalize:R0e,hover:T0e,data:m0e,change:rb,insert:y0e,remove:v0e,scale:K0e,initialize:H0e,toImageURL:W0e,toCanvas:q0e,toSVG:Y0e,getState:Z0e,setState:nye});const aye="view",dv="[",hv="]",JU="{",QU="}",lye=":",ZU=",",uye="@",cye=">",fye=/[[\]{}]/,dye={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let eH,tH;function Gl(e,t,n){return eH=t||aye,tH=n||dye,nH(e.trim()).map(GS)}function hye(e){return tH[e]}function Tp(e,t,n,r,i){const o=e.length;let s=0,a;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function nH(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;r=r.map(GS);const i=GS(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function gye(e){const t={source:eH},n=[];let r=[0,0],i=0,o=0,s=e.length,a=0,l,u;if(e[s-1]===QU){if(a=e.lastIndexOf(JU),a>=0){try{r=mye(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===uye&&(i=++a),l=Tp(e,a,lye),l1?(t.type=n[1],i?t.markname=n[0].slice(1):hye(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),u!=null&&(t.filter=u),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function mye(e){const t=e.split(ZU);if(!e.length||t.length>2)throw e;return t.map(n=>{const r=+n;if(r!==r)throw e;return r})}function yye(e){return ye(e)?e:{type:e||"pad"}}const Ch=e=>+e||0,vye=e=>({top:e,bottom:e,left:e,right:e});function xye(e){return ye(e)?e.signal?e:{top:Ch(e.top),bottom:Ch(e.bottom),left:Ch(e.left),right:Ch(e.right)}:vye(Ch(e))}const Cn=e=>ye(e)&&!K(e)?We({},e):{value:e};function $I(e,t,n,r){return n!=null?(ye(n)&&!K(n)||K(n)&&n.length&&ye(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function Un(e,t,n){for(const r in t)$I(e,r,t[r]);for(const r in n)$I(e,r,n[r],"update")}function Hd(e,t,n){for(const r in t)n&&Oe(n,r)||(e[r]=We(e[r]||{},t[r]));return e}function Qc(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const t$="mark",n$="frame",r$="scope",bye="axis",wye="axis-domain",_ye="axis-grid",Eye="axis-label",Sye="axis-tick",kye="axis-title",Cye="legend",Aye="legend-band",Tye="legend-entry",Rye="legend-gradient",rH="legend-label",$ye="legend-symbol",Oye="legend-title",Nye="title",Mye="title-text",Fye="title-subtitle";function Dye(e,t,n,r,i){const o={},s={};let a,l,u,c;l="lineBreak",t==="text"&&i[l]!=null&&!Qc(l,e)&&V_(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===n$?i.group:n===t$?We({},i.mark,i[t]):null;for(l in c)u=Qc(l,e)||(l==="fill"||l==="stroke")&&(Qc("fill",e)||Qc("stroke",e)),u||V_(o,l,c[l]);me(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)Qc(h,e)||V_(o,h,d[h])}),e=We({},e);for(l in o)c=o[l],c.signal?(a=a||{})[l]=c:s[l]=c;return e.enter=We(s,e.enter),a&&(e.update=We(a,e.update)),e}function V_(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const iH=e=>pe(e)?ie(e):e.signal?`(${e.signal})`:oH(e);function ob(e){if(e.gradient!=null)return Pye(e);let t=e.signal?`(${e.signal})`:e.color?Iye(e.color):e.field!=null?oH(e.field):e.value!==void 0?ie(e.value):void 0;return e.scale!=null&&(t=Lye(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${vy(e.exponent)})`),e.mult!=null&&(t+=`*${vy(e.mult)}`),e.offset!=null&&(t+=`+${vy(e.offset)}`),e.round&&(t=`round(${t})`),t}const R0=(e,t,n,r)=>`(${e}(${[t,n,r].map(ob).join(",")})+'')`;function Iye(e){return e.c?R0("hcl",e.h,e.c,e.l):e.h||e.s?R0("hsl",e.h,e.s,e.l):e.l||e.a?R0("lab",e.l,e.a,e.b):e.r||e.g||e.b?R0("rgb",e.r,e.g,e.b):null}function Pye(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:ie(n));for(;t.length&&it(t)==null;)t.pop();return t.unshift(iH(e.gradient)),`gradient(${t.join(",")})`}function vy(e){return ye(e)?"("+ob(e)+")":e}function oH(e){return sH(ye(e)?e:{datum:e})}function sH(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):Y("Invalid field reference: "+ie(e));return e.signal||(r=pe(r)?ms(r).map(ie).join("]["):sH(r)),t+"["+r+"]"}function Lye(e,t){const n=iH(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+vy(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function zye(e){let t="";return e.forEach(n=>{const r=ob(n);t+=n.test?`(${n.test})?${r}:`:r}),it(t)===":"&&(t+="null"),t}function aH(e,t,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},e=Dye(e,t,n,r,i.config);for(const a in e)s[a]=Bye(e[a],t,o,i);return o}function Bye(e,t,n,r){const i={},o={};for(const s in e)e[s]!=null&&(i[s]=Uye(jye(e[s]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function jye(e){return K(e)?zye(e):ob(e)}function Uye(e,t,n,r){const i=ds(e,t);return i.$fields.forEach(o=>r[o]=1),We(n,i.$params),i.$expr}const Hye="outer",Gye=["value","update","init","react","bind"];function OI(e,t){Y(e+' for "outer" push: '+ie(t))}function lH(e,t){const n=e.name;if(e.push===Hye)t.signals[n]||OI("No prior signal definition",n),Gye.forEach(r=>{e[r]!==void 0&&OI("Invalid property ",r)});else{const r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function WS(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function sb(e,t,n,r){return new WS(e,t,n,r)}function pv(e,t){return sb("operator",e,t)}function Te(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function vg(e,t){return t?{$field:e,$name:t}:{$field:e}}const VS=vg("key");function NI(e,t){return{$compare:e,$order:t}}function Wye(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Vye="ascending",qye="descending";function Yye(e){return ye(e)?(e.order===qye?"-":"+")+ab(e.op,e.field):""}function ab(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const i$="scope",qS="view";function pn(e){return e&&e.signal}function Xye(e){return e&&e.expr}function xy(e){if(pn(e))return!0;if(ye(e)){for(const t in e)if(xy(e[t]))return!0}return!1}function no(e,t){return e??t}function Pu(e){return e&&e.signal||e}const MI="timer";function xg(e,t){return(e.merge?Jye:e.stream?Qye:e.type?Zye:Y("Invalid stream specification: "+ie(e)))(e,t)}function Kye(e){return e===i$?qS:e||qS}function Jye(e,t){const n=e.merge.map(i=>xg(i,t)),r=o$({merge:n},e,t);return t.addStream(r).id}function Qye(e,t){const n=xg(e.stream,t),r=o$({stream:n},e,t);return t.addStream(r).id}function Zye(e,t){let n;e.type===MI?(n=t.event(MI,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Kye(e.source),e.type);const r=o$({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function o$(e,t,n){let r=t.between;return r&&(r.length!==2&&Y('Stream "between" parameter must have 2 entries: '+ie(t)),e.between=[xg(r[0],n),xg(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(e1e(t.marktype,t.markname,t.markrole)),t.source===i$&&r.push("inScope(event.item)"),r.length&&(e.filter=ds("("+r.join(")&&(")+")",n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function e1e(e,t,n){const r="event.item";return r+(e&&e!=="*"?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}const t1e={code:"_.$value",ast:{type:"Identifier",value:"value"}};function n1e(e,t,n){const r=e.encode,i={target:n};let o=e.events,s=e.update,a=[];o||Y("Signal update missing events specification."),pe(o)&&(o=Gl(o,t.isSubscope()?i$:qS)),o=me(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[i1e(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&Y("Signal encode and update are mutually exclusive."),s="encode(item(),"+ie(r)+")"),i.update=pe(s)?ds(s,t):s.expr!=null?ds(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:t1e,$params:{$value:t.signalRef(s.signal)}}:Y("Invalid signal update specification."),e.force&&(i.options={force:!0}),a.forEach(l=>t.addUpdate(We(r1e(l,t),i)))}function r1e(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):xg(e,t)}}function i1e(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function o1e(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?Y("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=ds(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(i=>n1e(i,t,n.id))}const kt=e=>(t,n,r)=>sb(e,n,t||void 0,r),uH=kt("aggregate"),s1e=kt("axisticks"),cH=kt("bound"),Oo=kt("collect"),FI=kt("compare"),a1e=kt("datajoin"),fH=kt("encode"),l1e=kt("expression"),u1e=kt("facet"),c1e=kt("field"),f1e=kt("key"),d1e=kt("legendentries"),h1e=kt("load"),p1e=kt("mark"),g1e=kt("multiextent"),m1e=kt("multivalues"),y1e=kt("overlap"),v1e=kt("params"),dH=kt("prefacet"),x1e=kt("projection"),b1e=kt("proxy"),w1e=kt("relay"),hH=kt("render"),_1e=kt("scale"),kc=kt("sieve"),E1e=kt("sortitems"),pH=kt("viewlayout"),S1e=kt("values");let k1e=0;const gH={min:"min",max:"max",count:"sum"};function C1e(e,t){const n=e.type||"linear";u9(n)||Y("Unrecognized scale type: "+ie(n)),t.addScale(e.name,{type:n,domain:void 0})}function A1e(e,t){const n=t.getScale(e.name).params;let r;n.domain=mH(e.domain,e,t),e.range!=null&&(n.range=vH(e,t,n)),e.interpolate!=null&&P1e(e.interpolate,n),e.nice!=null&&(n.nice=I1e(e.nice)),e.bins!=null&&(n.bins=D1e(e.bins,t));for(r in e)Oe(n,r)||r==="name"||(n[r]=Ni(e[r],t))}function Ni(e,t){return ye(e)?e.signal?t.signalRef(e.signal):Y("Unsupported object: "+ie(e)):e}function by(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Ni(n,t))}function lb(e){Y("Can not find data set: "+ie(e))}function mH(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&Y("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(K(e)?T1e:e.fields?$1e:R1e)(e,t,n)}function T1e(e,t,n){return e.map(r=>Ni(r,n))}function R1e(e,t,n){const r=n.getData(e.data);return r||lb(e.data),Zf(t.type)?r.valuesRef(n,e.field,yH(e.sort,!1)):d9(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function $1e(e,t,n){const r=e.data,i=e.fields.reduce((o,s)=>(s=pe(s)?{data:r,field:s}:K(s)||s.signal?O1e(s,n):s,o.push(s),o),[]);return(Zf(t.type)?N1e:d9(t.type)?M1e:F1e)(e,n,i)}function O1e(e,t){const n="_:vega:_"+k1e++,r=Oo({});if(K(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+ie(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,kc({})]),{data:n,field:"data"}}function N1e(e,t,n){const r=yH(e.sort,!0);let i,o;const s=n.map(u=>{const c=t.getData(u.data);return c||lb(u.data),c.countsRef(t,u.field,r)}),a={groupby:VS,pulse:s};r&&(i=r.op||"count",o=r.field?ab(i,r.field):"count",a.ops=[gH[i]],a.fields=[t.fieldRef(o)],a.as=[o]),i=t.add(uH(a));const l=t.add(Oo({pulse:Te(i)}));return o=t.add(S1e({field:VS,sort:t.sortRef(r),pulse:Te(l)})),Te(o)}function yH(e,t){return e&&(!e.field&&!e.op?ye(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?Y("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!gH[e.op]&&Y("Multiple domain scales can not be sorted using "+e.op)),e}function M1e(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||lb(i.data),o.domainRef(t,i.field)});return Te(t.add(m1e({values:r})))}function F1e(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||lb(i.data),o.extentRef(t,i.field)});return Te(t.add(g1e({extents:r})))}function D1e(e,t){return e.signal||K(e)?by(e,t):t.objectProperty(e)}function I1e(e){return ye(e)?{interval:Ni(e.interval),step:Ni(e.step)}:Ni(e)}function P1e(e,t){t.interpolate=Ni(e.type||e),e.gamma!=null&&(t.interpolateGamma=Ni(e.gamma))}function vH(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(pe(i)){if(r&&Oe(r,i))return e=We({},e,{range:r[i]}),vH(e,t,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=Zf(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Y("Unrecognized scale range value: "+ie(i))}else if(i.scheme){n.scheme=K(i.scheme)?by(i.scheme,t):Ni(i.scheme,t),i.extent&&(n.schemeExtent=by(i.extent,t)),i.count&&(n.schemeCount=Ni(i.count,t));return}else if(i.step){n.rangeStep=Ni(i.step,t);return}else{if(Zf(e.type)&&!K(i))return mH(i,e,t);K(i)||Y("Unsupported range type: "+ie(i))}return i.map(o=>(K(o)?by:Ni)(o,t))}function L1e(e,t){const n=t.config.projection||{},r={};for(const i in e)i!=="name"&&(r[i]=YS(e[i],i,t));for(const i in n)r[i]==null&&(r[i]=YS(n[i],i,t));t.addProjection(e.name,r)}function YS(e,t,n){return K(e)?e.map(r=>YS(r,t,n)):ye(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:Y("Unsupported parameter object: "+ie(e)):e}const No="top",Gd="left",Wd="right",Al="bottom",xH="center",z1e="vertical",B1e="start",j1e="middle",U1e="end",XS="index",s$="label",H1e="offset",ud="perc",G1e="perc2",Di="value",pm="guide-label",a$="guide-title",W1e="group-title",V1e="group-subtitle",DI="symbol",wy="gradient",KS="discrete",JS="size",q1e="shape",Y1e="fill",X1e="stroke",K1e="strokeWidth",J1e="strokeDash",Q1e="opacity",l$=[JS,q1e,Y1e,X1e,K1e,J1e,Q1e],gm={name:1,style:1,interactive:1},st={value:0},Ii={value:1},ub="group",bH="rect",u$="rule",Z1e="symbol",Cc="text";function bg(e){return e.type=ub,e.interactive=e.interactive||!1,e}function ti(e,t){const n=(r,i)=>no(e[r],no(t[r],i));return n.isVertical=r=>z1e===no(e.direction,t.direction||(r?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>no(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>no(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>no(e.columns,no(t.columns,+n.isVertical(!0))),n}function wH(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function eve(e,t,n){const r=t.config.style[n];return r&&r[e]}function cb(e,t,n){return`item.anchor === '${B1e}' ? ${e} : item.anchor === '${U1e}' ? ${t} : ${n}`}const c$=cb(ie(Gd),ie(Wd),ie(xH));function tve(e){const t=e("tickBand");let n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},ye(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}function _H(e,t){return t?e?ye(e)?Object.assign({},e,{offset:_H(e.offset,t)}):{value:e,offset:t}:t:e}function vi(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Hd(e.encode,t,gm)):e.interactive=!1,e}function nve(e,t,n,r){const i=ti(e,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,u,c,f,d;o?(u=[0,1],c=[0,0],f=s,d=a):(u=[0,0],c=[1,0],f=a,d=s);const h={enter:l={opacity:st,x:st,y:st,width:Cn(f),height:Cn(d)},update:We({},l,{opacity:Ii,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:st}};return Un(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),vi({type:bH,role:Rye,encode:h},r)}function rve(e,t,n,r,i){const o=ti(e,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let u,c,f,d,h="";s?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:st,fill:{scale:t,field:Di}};p[u]={signal:h+"datum."+ud,mult:l},p[c]=st,p[f]={signal:h+"datum."+G1e,mult:l},p[d]=Cn(a);const g={enter:p,update:We({},p,{opacity:Ii}),exit:{opacity:st}};return Un(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),vi({type:bH,role:Aye,key:Di,from:i,encode:g},r)}const ive=`datum.${ud}<=0?"${Gd}":datum.${ud}>=1?"${Wd}":"${xH}"`,ove=`datum.${ud}<=0?"${Al}":datum.${ud}>=1?"${No}":"${j1e}"`;function II(e,t,n,r){const i=ti(e,t),o=i.isVertical(),s=Cn(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),u,c,f,d,h="";const p={enter:u={opacity:st},update:c={opacity:Ii,text:{field:s$}},exit:{opacity:st}};return Un(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:no(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=c.baseline={signal:ove},f="y",d="x",h="1-"):(u.align=c.align={signal:ive},u.baseline={value:"top"},f="x",d="y"),u[f]=c[f]={signal:h+"datum."+ud,mult:a},u[d]=c[d]=s,s.offset=no(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+XS}:void 0,vi({type:Cc,role:rH,style:pm,key:Di,from:r,encode:p,overlap:l},n)}function sve(e,t,n,r,i){const o=ti(e,t),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,u=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${H1e} : datum.${JS}`,h=u?Cn(u):{field:JS},p=`datum.${XS}`,g=`max(1, ${i})`;let m,y,v,b,w;h.mult=.5,m={enter:y={opacity:st,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:Ii,x:y.x,y:y.y},exit:{opacity:st}};let _=null,k=null;e.fill||(_=t.symbolBaseFillColor,k=t.symbolBaseStrokeColor),Un(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",k),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),l$.forEach(O=>{e[O]&&(v[O]=y[O]={scale:e[O],field:Di})});const E=vi({type:Z1e,role:$ye,key:Di,from:f,clip:u?!0:void 0,encode:m},n.symbols),A=Cn(c);A.offset=o("labelOffset"),m={enter:y={opacity:st,x:{signal:d,offset:A},y:h},update:v={opacity:Ii,text:{field:s$},x:y.x,y:y.y},exit:{opacity:st}},Un(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const N=vi({type:Cc,role:rH,style:pm,key:Di,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!u},width:st,height:u?Cn(u):st,opacity:st},exit:{opacity:st},update:v={opacity:Ii,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,w={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,w={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:XS}},bg({role:r$,from:r,encode:Hd(m,s,gm),marks:[E,N],name:l,interactive:a,sort:w})}function ave(e,t){const n=ti(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const f$='item.orient === "left"',d$='item.orient === "right"',fb=`(${f$} || ${d$})`,lve=`datum.vgrad && ${fb}`,uve=cb('"top"','"bottom"','"middle"'),cve=cb('"right"','"left"','"center"'),fve=`datum.vgrad && ${d$} ? (${cve}) : (${fb} && !(datum.vgrad && ${f$})) ? "left" : ${c$}`,dve=`item._anchor || (${fb} ? "middle" : "start")`,hve=`${lve} ? (${f$} ? -90 : 90) : 0`,pve=`${fb} ? (datum.vgrad ? (${d$} ? "bottom" : "top") : ${uve}) : "top"`;function gve(e,t,n,r){const i=ti(e,t),o={enter:{opacity:st},update:{opacity:Ii,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:st}};return Un(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:dve},angle:{signal:hve},align:{signal:fve},baseline:{signal:pve},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),vi({type:Cc,role:Oye,style:a$,from:r,encode:o},n)}function mve(e,t){let n;return ye(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+PI(e.path)+")":e.sphere&&(n="geoShape("+PI(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function PI(e){return ye(e)&&e.signal?e.signal:ie(e)}function EH(e){const t=e.role||"";return!t.indexOf("axis")||!t.indexOf("legend")||!t.indexOf("title")?t:e.type===ub?r$:t||t$}function yve(e){return{marktype:e.type,name:e.name||void 0,role:e.role||EH(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function vve(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function h$(e,t){const n=f8(e.type);n||Y("Unrecognized transform type: "+ie(e.type));const r=sb(n.type.toLowerCase(),null,SH(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function SH(e,t,n){const r={},i=e.params.length;for(let o=0;oLI(e,o,n)):LI(e,i,n)}function LI(e,t,n){const r=e.type;if(pn(t))return BI(r)?Y("Expression references can not be signals."):q_(r)?n.fieldRef(t):jI(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||q_(r);return i&&_ve(t)?n.exprRef(t.expr,t.as):i&&Eve(t)?vg(t.field,t.as):BI(r)?ds(t,n):Sve(r)?Te(n.getData(t).values):q_(r)?vg(t):jI(r)?n.compareRef(t):t}}function bve(e,t,n){return pe(t.from)||Y('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function wve(e,t,n){const r=t[e.name];return e.array?(K(r)||Y("Expected an array of sub-parameters. Instead: "+ie(r)),r.map(i=>zI(e,i,n))):zI(e,r,n)}function zI(e,t,n){const r=e.params.length;let i;for(let s=0;se&&e.expr,Eve=e=>e&&e.field,Sve=e=>e==="data",BI=e=>e==="expr",q_=e=>e==="field",jI=e=>e==="compare";function kve(e,t,n){let r,i,o,s,a;return e?(r=e.facet)&&(t||Y("Only group marks can be faceted."),r.field!=null?s=a=_y(r,n):(e.data?a=Te(n.getData(e.data).aggregate):(o=h$(We({type:"aggregate",groupby:me(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=_y(r,n),s=a=Te(n.add(o))),i=n.keyRef(r.groupby,!0))):s=Te(n.add(Oo(null,[{}]))),s||(s=_y(e,n)),{key:i,pulse:s,parent:a}}function _y(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Te(t.getData(e.data).output)}function rc(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}rc.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=ds(u,t);l.update=c.$expr,l.params=c.$params}function db(e,t){const n=EH(e),r=e.type===ub,i=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===r$||n===n$,a,l,u,c,f,d,h;const p=n===t$||s||i,g=kve(e.from,r,t);l=t.add(a1e({key:g.key||(e.key?vg(e.key):void 0),pulse:g.pulse,clean:!r}));const m=Te(l);l=u=t.add(Oo({pulse:m})),l=t.add(p1e({markdef:yve(e),interactive:vve(e.interactive,t),clip:mve(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Te(l)}));const y=Te(l);l=c=t.add(fH(aH(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(k=>{const E=h$(k,t),A=E.metadata;(A.generates||A.changes)&&Y("Mark transforms should not generate new data."),A.nomod||(c.params.mod=!0),E.params.pulse=Te(l),t.add(l=E)}),e.sort&&(l=t.add(E1e({sort:t.compareRef(e.sort),pulse:Te(l)})));const v=Te(l);(i||s)&&(s=t.add(pH({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:v})),d=Te(s));const b=t.add(cH({mark:y,pulse:d||v}));h=Te(b),r&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(v,d||h,m),i?Cve(e,t,g):p?Ave(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(b))),o&&(h=Tve(o,h,t));const w=t.add(hH({pulse:h})),_=t.add(kc({pulse:Te(w)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new rc(t,u,w,_)),e.on&&e.on.forEach(k=>{(k.insert||k.remove||k.toggle)&&Y("Marks only support modify triggers."),CH(k,t,f)}))}function Tve(e,t,n){const r=e.method,i=e.bound,o=e.separation,s={separation:pn(o)?n.signalRef(o.signal):o,method:pn(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),i){const a=i.tolerance;s.boundTolerance=pn(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return Te(n.add(y1e(s)))}function Rve(e,t){const n=t.config.legend,r=e.encode||{},i=ti(e,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,u={};let c=0,f,d,h;l$.forEach(b=>e[b]?(u[b]=e[b],c=c||e[b]):0),c||Y("Missing valid scale for legend.");const p=$ve(e,t.scaleType(c)),g={title:e.title!=null,scales:u,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=Te(t.add(Oo(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},v=Te(t.add(d1e(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===wy?(h=[nve(e,c,n,r.gradient),II(e,n,r.labels,v)],d.count=d.count||t.signalRef(`max(2,2*floor((${Pu(i.gradientLength())})/100))`)):p===KS?h=[rve(e,c,n,r.gradient,v),II(e,n,r.labels,v)]:(f=ave(e,n),h=[sve(e,n,r,v,Pu(f.columns))],d.size=Mve(e,t,h[0].marks)),h=[bg({role:Tye,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(gve(e,n,r.title,m)),db(bg({role:Cye,from:m,encode:Hd(Nve(i,e,n),o,gm),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),t)}function $ve(e,t){let n=e.type||DI;return!e.type&&Ove(e)===1&&(e.fill||e.stroke)&&(n=uT(t)?wy:UE(t)?KS:DI),n!==wy?n:UE(t)?KS:wy}function Ove(e){return l$.reduce((t,n)=>t+(e[n]?1:0),0)}function Nve(e,t,n){const r={enter:{},update:{}};return Un(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function Mve(e,t,n){const r=Pu(HI("size",e,n)),i=Pu(HI("strokeWidth",e,n)),o=Pu(Fve(n[1].encode,t,pm));return ds(`max(ceil(sqrt(${r})+${i}),${o})`,t)}function HI(e,t,n){return t[e]?`scale("${t[e]}",datum)`:wH(e,n[0].encode)}function Fve(e,t,n){return wH("fontSize",e)||eve("fontSize",t,n)}const Dve=`item.orient==="${Gd}"?-90:item.orient==="${Wd}"?90:0`;function Ive(e,t){e=pe(e)?{text:e}:e;const n=ti(e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],u={},c=Te(t.add(Oo(null,[u])));return l.push(zve(e,n,Pve(e),c)),e.subtitle&&l.push(Bve(e,n,r.subtitle,c)),db(bg({role:Nye,from:c,encode:Lve(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Pve(e){const t=e.encode;return t&&t.title||We({name:e.name,interactive:e.interactive,style:e.style},t)}function Lve(e,t){const n={enter:{},update:{}};return Un(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:c$},angle:{signal:Dve},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Hd(n,t,gm)}function zve(e,t,n,r){const i={value:0},o=e.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Un(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),vi({type:Cc,role:Mye,style:W1e,from:r,encode:s},n)}function Bve(e,t,n,r){const i={value:0},o=e.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Un(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),vi({type:Cc,role:Fye,style:V1e,from:r,encode:s},n)}function jve(e,t){const n=[];e.transform&&e.transform.forEach(r=>{n.push(h$(r,t))}),e.on&&e.on.forEach(r=>{CH(r,t,e.name)}),t.addDataPipeline(e.name,Uve(e,t,n))}function Uve(e,t,n){const r=[];let i=null,o=!1,s=!1,a,l,u,c,f;for(e.values?pn(e.values)||xy(e.format)?(r.push(GI(t,e)),r.push(i=tu())):r.push(i=tu({$ingest:e.values,$format:e.format})):e.url?xy(e.url)||xy(e.format)?(r.push(GI(t,e)),r.push(i=tu())):r.push(i=tu({$request:e.url,$format:e.format})):e.source&&(i=a=me(e.source).map(d=>Te(t.getData(d).output)),r.push(null)),l=0,u=n.length;le===Al||e===No,hb=(e,t,n)=>pn(e)?Vve(e.signal,t,n):e===Gd||e===No?t:n,An=(e,t,n)=>pn(e)?Gve(e.signal,t,n):AH(e)?t:n,bo=(e,t,n)=>pn(e)?Wve(e.signal,t,n):AH(e)?n:t,TH=(e,t,n)=>pn(e)?qve(e.signal,t,n):e===No?{value:t}:{value:n},Hve=(e,t,n)=>pn(e)?Yve(e.signal,t,n):e===Wd?{value:t}:{value:n},Gve=(e,t,n)=>RH(`${e} === '${No}' || ${e} === '${Al}'`,t,n),Wve=(e,t,n)=>RH(`${e} !== '${No}' && ${e} !== '${Al}'`,t,n),Vve=(e,t,n)=>p$(`${e} === '${Gd}' || ${e} === '${No}'`,t,n),qve=(e,t,n)=>p$(`${e} === '${No}'`,t,n),Yve=(e,t,n)=>p$(`${e} === '${Wd}'`,t,n),RH=(e,t,n)=>(t=t!=null?Cn(t):t,n=n!=null?Cn(n):n,WI(t)&&WI(n)?(t=t?t.signal||ie(t.value):null,n=n?n.signal||ie(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[We({test:e},t)].concat(n||[])),WI=e=>e==null||Object.keys(e).length===1,p$=(e,t,n)=>({signal:`${e} ? (${vf(t)}) : (${vf(n)})`}),Xve=(e,t,n,r,i)=>({signal:(r!=null?`${e} === '${Gd}' ? (${vf(r)}) : `:"")+(n!=null?`${e} === '${Al}' ? (${vf(n)}) : `:"")+(i!=null?`${e} === '${Wd}' ? (${vf(i)}) : `:"")+(t!=null?`${e} === '${No}' ? (${vf(t)}) : `:"")+"(null)"}),vf=e=>pn(e)?e.signal:e==null?null:ie(e),Kve=(e,t)=>t===0?0:pn(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Rf=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Gc(e,t,n,r){let i;if(t&&Oe(t,e))return t[e];if(Oe(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[a$][i]}else if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[pm][i]}return null}function VI(e){const t={};for(const n of e)if(n)for(const r in n)t[r]=1;return Object.keys(t)}function Jve(e,t){var n=t.config,r=n.style,i=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,l,u;if(pn(s)){const f=VI([n.axisX,n.axisY]),d=VI([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(u of f)a[u]=An(s,Gc(u,n.axisX,i,r),Gc(u,n.axisY,i,r));l={};for(u of d)l[u]=Xve(s.signal,Gc(u,n.axisTop,i,r),Gc(u,n.axisBottom,i,r),Gc(u,n.axisLeft,i,r),Gc(u,n.axisRight,i,r))}else a=s===No||s===Al?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?We({},i,a,l,o):i}function Qve(e,t,n,r){const i=ti(e,t),o=e.orient;let s,a;const l={enter:s={opacity:st},update:a={opacity:Ii},exit:{opacity:st}};Un(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const u=qI(e,0),c=qI(e,1);return s.x=a.x=An(o,u,st),s.x2=a.x2=An(o,c),s.y=a.y=bo(o,u,st),s.y2=a.y2=bo(o,c),vi({type:u$,role:wye,from:r,encode:l},n)}function qI(e,t){return{scale:e.scale,range:t}}function Zve(e,t,n,r,i){const o=ti(e,t),s=e.orient,a=e.gridScale,l=hb(s,1,-1),u=exe(e.offset,l);let c,f,d;const h={enter:c={opacity:st},update:d={opacity:Ii},exit:f={opacity:st}};Un(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:Di,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=An(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:u}:{value:0,offset:u},y=a?{scale:a,range:1,mult:l,offset:u}:We(g,{mult:l,offset:u});return c.x=d.x=An(s,p,m),c.y=d.y=bo(s,p,m),c.x2=d.x2=bo(s,y),c.y2=d.y2=An(s,y),f.x=An(s,p),f.y=bo(s,p),vi({type:u$,role:_ye,key:Di,from:r,encode:h},n)}function exe(e,t){if(t!==1)if(!ye(e))e=pn(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=We({},e);for(;n.mult!=null;)if(ye(n.mult))n=n.mult=We({},n.mult);else return n.mult=pn(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function txe(e,t,n,r,i,o){const s=ti(e,t),a=e.orient,l=hb(a,-1,1);let u,c,f;const d={enter:u={opacity:st},update:f={opacity:Ii},exit:c={opacity:st}};Un(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=Cn(i);h.mult=l;const p={scale:e.scale,field:Di,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=u.y=An(a,st,p),f.y2=u.y2=An(a,h),c.x=An(a,p),f.x=u.x=bo(a,st,p),f.x2=u.x2=bo(a,h),c.y=bo(a,p),vi({type:u$,role:Sye,key:Di,from:r,encode:d},n)}function Y_(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function nxe(e,t,n,r,i,o){const s=ti(e,t),a=e.orient,l=e.scale,u=hb(a,-1,1),c=Pu(s("labelFlush")),f=Pu(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=c===0||!!c,g;const m=Cn(i);m.mult=u,m.offset=Cn(s("labelPadding")||0),m.offset.mult=u;const y={scale:l,field:Di,band:.5,offset:_H(o.offset,s("labelOffset"))},v=An(a,p?Y_(l,c,'"left"','"right"','"center"'):{value:"center"},Hve(a,"left","right")),b=An(a,TH(a,"bottom","top"),p?Y_(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),w=Y_(l,c,`-(${f})`,f,0);p=p&&f;const _={opacity:st,x:An(a,y,m),y:bo(a,y,m)},k={enter:_,update:g={opacity:Ii,text:{field:s$},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:st,x:_.x,y:_.y}};Un(k,{dx:!d&&p?An(a,w):null,dy:!h&&p?bo(a,w):null}),Un(k,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const E=s("labelBound");let A=s("labelOverlap");return A=A||E?{separation:s("labelSeparation"),method:A,order:"datum.index",bound:E?{scale:l,orient:a,tolerance:E}:null}:void 0,g.align!==v&&(g.align=Rf(g.align,v)),g.baseline!==b&&(g.baseline=Rf(g.baseline,b)),vi({type:Cc,role:Eye,style:pm,key:Di,from:r,encode:k,overlap:A},n)}function rxe(e,t,n,r){const i=ti(e,t),o=e.orient,s=hb(o,-1,1);let a,l;const u={enter:a={opacity:st,anchor:Cn(i("titleAnchor",null)),align:{signal:c$}},update:l=We({},a,{opacity:Ii,text:Cn(e.title)}),exit:{opacity:st}},c={signal:`lerp(range("${e.scale}"), ${cb(0,1,.5)})`};return l.x=An(o,c),l.y=bo(o,c),a.angle=An(o,st,Kve(s,90)),a.baseline=An(o,TH(o,Al,No),{value:Al}),l.angle=a.angle,l.baseline=a.baseline,Un(u,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),ixe(i,o,u,n),u.update.align=Rf(u.update.align,a.align),u.update.angle=Rf(u.update.angle,a.angle),u.update.baseline=Rf(u.update.baseline,a.baseline),vi({type:Cc,role:kye,style:a$,from:r,encode:u},n)}function ixe(e,t,n,r){const i=(a,l)=>a!=null?(n.update[l]=Rf(Cn(a),n.update[l]),!1):!Qc(l,r),o=i(e("titleX"),"x"),s=i(e("titleY"),"y");n.enter.auto=s===o?Cn(s):An(t,Cn(s),Cn(o))}function oxe(e,t){const n=Jve(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=ti(e,n),u=tve(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=Te(t.add(Oo({},[c]))),d=Te(t.add(s1e({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(Zve(e,n,r.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(txe(e,n,r.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(nxe(e,n,r.labels,d,p,u))),c.domain&&h.push(Qve(e,n,r.domain,f)),c.title&&h.push(rxe(e,n,r.title,f)),db(bg({role:bye,from:f,encode:Hd(sxe(l,e),i,gm),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),t)}function sxe(e,t){const n={enter:{},update:{}};return Un(n,{orient:e("orient"),offset:e("offset")||0,position:no(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function $H(e,t,n){const r=me(e.signals),i=me(e.scales);return n||r.forEach(o=>lH(o,t)),me(e.projections).forEach(o=>L1e(o,t)),i.forEach(o=>C1e(o,t)),me(e.data).forEach(o=>jve(o,t)),i.forEach(o=>A1e(o,t)),(n||r).forEach(o=>o1e(o,t)),me(e.axes).forEach(o=>oxe(o,t)),me(e.marks).forEach(o=>db(o,t)),me(e.legends).forEach(o=>Rve(o,t)),e.title&&Ive(e.title,t),t.parseLambdas(),t}const axe=e=>Hd({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function lxe(e,t){const n=t.config,r=Te(t.root=t.add(pv())),i=uxe(e,n);i.forEach(u=>lH(u,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Oo()),s=t.add(fH(aH(axe(e.encode),ub,n$,e.style,t,{pulse:Te(o)}))),a=t.add(pH({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:Te(s)}));t.operators.pop(),t.pushState(Te(s),Te(a),null),$H(e,t,i),t.operators.push(a);let l=t.add(cH({mark:r,pulse:Te(a)}));return l=t.add(hH({pulse:Te(l)})),l=t.add(kc({pulse:Te(l)})),t.addData("root",new rc(t,o,o,l)),t}function Th(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function uxe(e,t){const n=s=>no(e[s],t[s]),r=[Th("background",n("background")),Th("autosize",yye(n("autosize"))),Th("padding",xye(n("padding"))),Th("width",n("width")||0),Th("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return me(e.signals).forEach(s=>{Oe(i,s.name)?s=We(i[s.name],s):r.push(s),o[s.name]=s}),me(t.signals).forEach(s=>{!Oe(o,s.name)&&!Oe(i,s.name)&&r.push(s)}),r}function OH(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function YI(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}OH.prototype=YI.prototype={parse(e){return $H(e,this)},fork(){return new YI(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof WS?Te(e):e;return this.add(b1e({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(Te(this.add(kc({pulse:e})))),this._parent.push(t),this._lookup.push(n?Te(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return it(this._parent)},encode(){return it(this._encode)},lookup(){return it(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(pe(e))return vg(e,t);e.signal||Y("Unsupported field reference: "+ie(e));const n=e.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};t&&(i.as=t),this.field[n]=r=Te(this.add(c1e(i)))}return r},compareRef(e){let t=!1;const n=o=>pn(o)?(t=!0,this.signalRef(o.signal)):Xye(o)?(t=!0,this.exprRef(o.expr)):o,r=me(e.field).map(n),i=me(e.order).map(n);return t?Te(this.add(FI({fields:r,orders:i}))):NI(r,i)},keyRef(e,t){let n=!1;const r=o=>pn(o)?(n=!0,Te(i[o.signal])):o,i=this.signals;return e=me(e).map(r),n?Te(this.add(f1e({fields:e,flat:t}))):Wye(e,t)},sortRef(e){if(!e)return e;const t=ab(e.op,e.field),n=e.order||Vye;return n.signal?Te(this.add(FI({fields:t,orders:this.signalRef(n.signal)}))):NI(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return Oe(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&Y("Duplicate signal name: "+ie(e));const n=t instanceof WS?t:this.add(pv(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||Y("Unrecognized signal name: "+ie(e)),this.signals[e]},signalRef(e){return this.signals[e]?Te(this.signals[e]):(Oe(this.lambdas,e)||(this.lambdas[e]=this.add(pv(null))),Te(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(ye(i)?i.signal||g$(i):ie(i))}return n+"]"}function fxe(e){let t="{",n=0,r,i;for(r in e)i=e[r],t+=(++n>1?",":"")+ie(r)+":"+(ye(i)?i.signal||g$(i):ie(i));return t+"}"}function dxe(){const e="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:e,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:e,fontSize:10},"guide-title":{fill:i,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function hxe(e,t,n){return ye(e)||Y("Input Vega specification must be an object."),t=Od(dxe(),t,e.config),lxe(e,new OH(t,n)).toRuntime()}var pxe="5.25.0";We(Yf,mre,Ile,pue,efe,Yfe,whe,ehe,Ehe,Vhe,npe,upe);const gxe=Object.freeze(Object.defineProperty({__proto__:null,Bounds:sn,CanvasHandler:om,CanvasRenderer:A1,DATE:Xr,DAY:Qn,DAYOFYEAR:cs,Dataflow:kf,Debug:M6,Error:EC,EventStream:px,Gradient:A9,GroupItem:Px,HOURS:gi,Handler:kl,Info:N6,Item:Ix,MILLISECONDS:ko,MINUTES:mi,MONTH:rr,Marks:yi,MultiPulse:YC,None:O6,Operator:Ct,Parameters:hx,Pulse:fl,QUARTER:Yr,RenderType:Ya,Renderer:xs,ResourceLoader:vT,SECONDS:Bi,SVGHandler:IT,SVGRenderer:UT,SVGStringRenderer:HT,Scenegraph:FT,TIME_UNITS:LC,Transform:G,View:XU,WEEK:dn,Warn:SC,YEAR:zn,accessor:ei,accessorFields:nr,accessorName:Xt,array:me,ascending:nx,bandwidthNRD:QC,bin:p8,bootstrapCI:g8,boundClip:wB,boundContext:tm,boundItem:XE,boundMark:V9,boundStroke:ga,changeset:wc,clampRange:G6,codegenExpression:EU,compare:RC,constant:lr,cumulativeLogNormal:iA,cumulativeNormal:mx,cumulativeUniform:lA,dayofyear:wz,debounce:$C,defaultLocale:HC,definition:f8,densityLogNormal:rA,densityNormal:ZC,densityUniform:aA,domChild:Pr,domClear:ao,domCreate:Va,domFind:DT,dotbin:m8,error:Y,expressionFunction:Zt,extend:We,extent:as,extentIndex:W6,falsy:Ta,fastmap:Md,field:qr,flush:V6,font:Ux,fontFamily:im,fontSize:vs,format:ey,formatLocale:a1,formats:VC,hasOwnProperty:Oe,id:Lg,identity:ar,inferType:e8,inferTypes:t8,ingest:mt,inherits:oe,inrange:hf,interpolate:cT,interpolateColors:Fx,interpolateRange:h9,intersect:yB,intersectBoxLine:pf,intersectPath:xT,intersectPoint:bT,intersectRule:D9,isArray:K,isBoolean:Ll,isDate:ul,isFunction:Ve,isIterable:q6,isNumber:ct,isObject:ye,isRegExp:Y6,isString:pe,isTuple:fx,key:OC,lerp:X6,lineHeight:El,loader:ux,locale:Qz,logger:kC,lruCache:K6,markup:jT,merge:J6,mergeConfig:Od,multiLineOffset:OT,one:$d,pad:Q6,panLinear:L6,panLog:z6,panPow:B6,panSymlog:j6,parse:hxe,parseExpression:UR,parseSelector:Gl,path:wx,pathCurves:gT,pathEqual:_B,pathParse:ed,pathRectangle:$9,pathRender:sg,pathSymbols:R9,pathTrail:O9,peek:it,point:Gx,projection:lR,quantileLogNormal:oA,quantileNormal:yx,quantileUniform:uA,quantiles:KC,quantizeInterpolator:p9,quarter:U6,quartiles:JC,get random(){return ji},randomInteger:bne,randomKDE:tA,randomLCG:xne,randomLogNormal:v8,randomMixture:x8,randomNormal:eA,randomUniform:b8,read:i8,regressionConstant:cA,regressionExp:_8,regressionLinear:fA,regressionLoess:k8,regressionLog:w8,regressionPoly:S8,regressionPow:E8,regressionQuad:dA,renderModule:Wx,repeat:Bh,resetDefaultLocale:mte,resetSVGClipId:M9,resetSVGDefIds:ele,responseType:r8,runtimeContext:IU,sampleCurve:xx,sampleLogNormal:nA,sampleNormal:gx,sampleUniform:sA,scale:pt,sceneEqual:GT,sceneFromJSON:Y9,scenePickVisit:w1,sceneToJSON:q9,sceneVisit:Co,sceneZOrder:wT,scheme:fT,serializeXML:uB,setRandom:yne,span:zg,splitAccessPath:ms,stringValue:ie,textMetrics:xo,timeBin:Lz,timeFloor:Tz,timeFormatLocale:eg,timeInterval:Id,timeOffset:Oz,timeSequence:Fz,timeUnitSpecifier:bz,timeUnits:zC,toBoolean:NC,toDate:MC,toNumber:Zn,toSet:So,toString:FC,transform:d8,transforms:Yf,truncate:Z6,truthy:zi,tupleid:Re,typeParsers:$E,utcFloor:Rz,utcInterval:Pd,utcOffset:Nz,utcSequence:Dz,utcdayofyear:Sz,utcquarter:H6,utcweek:kz,version:pxe,visitArray:Ma,week:_z,writeConfig:Nd,zero:Ba,zoomLinear:CC,zoomLog:AC,zoomPow:e1,zoomSymlog:TC},Symbol.toStringTag,{value:"Module"}));function mxe(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var yxe={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},vxe={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},xxe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const bxe=Array.prototype.slice,nu=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,bxe.call(t,1))},wxe=(e,t,n,r,i,o,s)=>new Date(e,t||0,n??1,r||0,i||0,o||0,s||0);var _xe={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,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:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:wxe,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return nu("join",arguments)},indexof:function(){return nu("indexOf",arguments)},lastindexof:function(){return nu("lastIndexOf",arguments)},slice:function(){return nu("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return nu("substring",arguments,String)},split:function(){return nu("split",arguments,String)},replace:function(){return nu("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Exe=["view","item","group","xy","x","y"],QS=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&QS.add(setImmediate);const Sxe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:yxe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),QS.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||_xe[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>vxe[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>xxe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,r)=>{e.memberDepth+=1;const i=e(r.key);return e.memberDepth-=1,QS.has(e(r.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):n[i]=e(r.value),n},{})};function Rh(e,t,n,r,i,o){const s=a=>Sxe[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=r,s.event=i,s.item=o,Exe.forEach(a=>s.fn[a]=function(){return i.vega[a](...arguments)}),s(e)}var kxe={operator(e,t){const n=t.ast,r=e.functions;return i=>Rh(n,r,i)},parameter(e,t){const n=t.ast,r=e.functions;return(i,o)=>Rh(n,r,o,i)},event(e,t){const n=t.ast,r=e.functions;return i=>Rh(n,r,void 0,void 0,i)},handler(e,t){const n=t.ast,r=e.functions;return(i,o)=>{const s=o.item&&o.item.datum;return Rh(n,r,i,s,o)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let u=0,c;for(const f in r)c=Rh(r[f].ast,i,a,l,void 0,s),s[f]!==c&&(s[f]=c,u=1);return n!=="rule"&&mxe(s,r,o),u}}};const Cxe="vega-lite",Axe='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',Txe="5.16.1",Rxe=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],$xe="https://vega.github.io/vega-lite/",Oxe="Vega-Lite is a concise high-level language for interactive visualization.",Nxe=["vega","chart","visualization"],Mxe="build/vega-lite.js",Fxe="build/vega-lite.min.js",Dxe="build/vega-lite.min.js",Ixe="build/src/index",Pxe="build/src/index.d.ts",Lxe={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},zxe=["bin","build","src","vega-lite*","tsconfig.json"],Bxe={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},jxe={type:"git",url:"https://github.com/vega/vega-lite.git"},Uxe="BSD-3-Clause",Hxe={url:"https://github.com/vega/vega-lite/issues"},Gxe={"@babel/core":"^7.22.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/preset-env":"^7.22.10","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-terser":"^0.4.3","@types/chai":"^4.3.5","@types/d3":"^7.4.0","@types/jest":"^29.5.4","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1",ajv:"^8.12.0","ajv-formats":"^2.1.1",chai:"^4.3.7",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.0.0",d3:"^7.8.5","del-cli":"^5.0.0",eslint:"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jest":"^27.2.3","eslint-plugin-prettier":"^5.0.0","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.8.0",jest:"^29.6.3","jest-dev-server":"^9.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.0.2",puppeteer:"^15.0.0","release-it":"^16.1.5",rollup:"^3.28.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3",serve:"^14.2.1",terser:"^5.19.2","ts-jest":"^29.1.1","ts-json-schema-generator":"^1.3.0",typescript:"~5.2.2","vega-cli":"^5.25.0","vega-datasets":"^2.7.0","vega-embed":"^6.22.2","vega-tooltip":"^0.33.0","yaml-front-matter":"^4.1.1"},Wxe={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.2","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},Vxe={vega:"^5.24.0"},qxe={node:">=18"},Yxe={name:Cxe,author:Axe,version:Txe,collaborators:Rxe,homepage:$xe,description:Oxe,keywords:Nxe,main:Mxe,unpkg:Fxe,jsdelivr:Dxe,module:Ixe,types:Pxe,bin:Lxe,files:zxe,scripts:Bxe,repository:jxe,license:Uxe,bugs:Hxe,devDependencies:Gxe,dependencies:Wxe,peerDependencies:Vxe,engines:qxe};function m$(e){return!!e.or}function y$(e){return!!e.and}function v$(e){return!!e.not}function Ey(e,t){if(v$(e))Ey(e.not,t);else if(y$(e))for(const n of e.and)Ey(n,t);else if(m$(e))for(const n of e.or)Ey(n,t);else t(e)}function $f(e,t){return v$(e)?{not:$f(e.not,t)}:y$(e)?{and:e.and.map(n=>$f(n,t))}:m$(e)?{or:e.or.map(n=>$f(n,t))}:t(e)}const Be=structuredClone;function NH(e){throw new Error(e)}function cd(e,t){const n={};for(const r of t)Oe(e,r)&&(n[r]=e[r]);return n}function Wr(e,t){const n={...e};for(const r of t)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>St(e)).join(",")})`};function et(e){if(ct(e))return e;const t=pe(e)?e:St(e);if(t.length<250)return t;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function w$(e,t){return e===void 0||t===void 0?!0:b$(ek(e),ek(t))}function Et(e){return Z(e).length===0}const Z=Object.keys,Bn=Object.values,Tl=Object.entries;function wg(e){return e===!0||e===!1}function Pt(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Rp(e,t){return v$(e)?`!(${Rp(e.not,t)})`:y$(e)?`(${e.and.map(n=>Rp(n,t)).join(") && (")})`:m$(e)?`(${e.or.map(n=>Rp(n,t)).join(") || (")})`:t(e)}function gv(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&gv(e[n],t)&&delete e[n],Et(e)}function mm(e){return e.charAt(0).toUpperCase()+e.substr(1)}function _$(e,t="datum"){const n=ms(e),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(ie).join("][")}]`;r.push(`${t}${o}`)}return r.join(" && ")}function DH(e,t="datum"){return`${t}[${ie(ms(e).join("."))}]`}function Jxe(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Hi(e){return`${ms(e).map(Jxe).join("\\.")}`}function oc(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function E$(e){return`${ms(e).join(".")}`}function fd(e){return e?ms(e).length:0}function Qt(...e){for(const t of e)if(t!==void 0)return t}let IH=42;function PH(e){const t=++IH;return e?String(e)+t:t}function Qxe(){IH=42}function LH(e){return zH(e)?e:`__${e}`}function zH(e){return e.startsWith("__")}function _g(e){if(e!==void 0)return(e%360+360)%360}function pb(e){return ct(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const XI=Object.getPrototypeOf(structuredClone({}));function fi(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!fi(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!fi(r[1],t.get(r[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==XI.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==XI.toString)return e.toString()===t.toString();const i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!fi(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function St(e){const t=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;i_b(e[t])?Pt(`_${t}_${Tl(e[t])}`):Pt(`_${t}_${e[t]}`)).join("")}function Rt(e){return e===!0||Rc(e)&&!e.binned}function Dn(e){return e==="binned"||Rc(e)&&e.binned===!0}function Rc(e){return ye(e)}function _b(e){return e==null?void 0:e.param}function KI(e){switch(e){case ta:case na:case ba:case Jr:case Es:case Ss:case Yl:case wa:case Vl:case ql:case Qr:return 6;case Xl:return 4;default:return 10}}function bm(e){return!!(e!=null&&e.expr)}function Ir(e){const t=Z(e||{}),n={};for(const r of t)n[r]=ai(e[r]);return n}function eG(e){const{anchor:t,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},v={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},b=cd(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:b,nonMarkTitleProperties:y,subtitle:v}}function Pa(e){return pe(e)||K(e)&&pe(e[0])}function Se(e){return!!(e!=null&&e.signal)}function Jl(e){return!!e.step}function _be(e){return K(e)?!1:"fields"in e&&!("data"in e)}function Ebe(e){return K(e)?!1:"fields"in e&&"data"in e}function Ks(e){return K(e)?!1:"field"in e&&"data"in e}const Sbe={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},kbe=Z(Sbe),Cbe={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},tk=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function tG(e){const t=K(e.condition)?e.condition.map(JI):JI(e.condition);return{...ai(e),condition:t}}function ai(e){if(bm(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function JI(e){if(bm(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Nt(e){if(bm(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Se(e)?e:e!==void 0?{value:e}:void 0}function Abe(e){return Se(e)?e.signal:ie(e)}function QI(e){return Se(e)?e.signal:ie(e.value)}function ho(e){return Se(e)?e.signal:e==null?null:ie(e)}function Tbe(e,t,n){for(const r of n){const i=ha(r,t.markDef,t.config);i!==void 0&&(e[r]=Nt(i))}return e}function nG(e){return[].concat(e.type,e.style??[])}function vt(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&t[i]!==void 0?t[i]:t[e]!==void 0?t[e]:o&&(!i||i===e)?void 0:ha(e,t,n,r)}function ha(e,t,n,{vgChannel:r}={}){return Qt(r?mv(e,t,n.style):void 0,mv(e,t,n.style),r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function mv(e,t,n){return rG(e,nG(t),n)}function rG(e,t,n){t=me(t);let r;for(const i of t){const o=n[i];o&&o[e]!==void 0&&(r=o[e])}return r}function iG(e,t){return me(e).reduce((n,r)=>(n.field.push(ue(r,t)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function oG(e,t){const n=[...e];return t.forEach(r=>{for(const i of n)if(fi(i,r))return;n.push(r)}),n}function sG(e,t){return fi(e,t)||!t?e:e?[...me(e),...me(t)].join(", "):t}function aG(e,t){const n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((Pa(n)||Se(n))&&(Pa(r)||Se(r)))return{explicit:e.explicit,value:sG(n,r)};if(Pa(n)||Se(n))return{explicit:e.explicit,value:n};if(Pa(r)||Se(r))return{explicit:e.explicit,value:r};if(!Pa(n)&&!Se(n)&&!Pa(r)&&!Se(r))return{explicit:e.explicit,value:oG(n,r)};throw new Error("It should never reach here")}function N$(e){return`Invalid specification ${St(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Rbe='Autosize "fit" only works for single views and layered views.';function ZI(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function eP(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function tP(e){return e?`Dropping "fit-${e}" because spec has discrete ${Zr(e)}.`:'Dropping "fit" because spec has discrete size.'}function M$(e){return`Unknown field for ${e}. Cannot calculate view size.`}function nP(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function $be(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Obe(e){return`The "nearest" transform is not supported for ${e} marks.`}function lG(e){return`Selection not supported for ${e} yet.`}function Nbe(e){return`Cannot find a selection named "${e}".`}const Mbe="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Fbe="Legend bindings are only supported for selections over an individual field or encoding channel.";function Dbe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Ibe(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Pbe="The same selection must be used to override scale domains in a layered view.",Lbe='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function zbe(e){return`Unknown repeated value "${e}".`}function rP(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Bbe="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function jbe(e){return`Unrecognized parse "${e}".`}function iP(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Ube="Attempt to add the same child twice.";function Hbe(e){return`Ignoring an invalid transform: ${St(e)}.`}const Gbe='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function oP(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Wbe(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${St(t)} is overridden by a child projection ${St(n)}.`}const Vbe="Arc marks uses theta channel rather than angle, replacing angle with theta.";function qbe(e){return`${e}Offset dropped because ${e} is continuous`}function Ybe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${St(n)}}.`}function uG(e){return`Invalid field type "${e}".`}function Xbe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Kbe(e){return`Invalid aggregation operator "${e}".`}function cG(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function Jbe(e){return`Position range does not support relative band size for ${e}.`}function nk(e,t){return`Dropping ${St(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Qbe="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Eb(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function Zbe(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function ewe(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function twe(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function nwe(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function K_(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function rwe(e){return`The ${e} for range marks cannot be an expression`}function iwe(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function owe(e,t){return`Specified orient "${e}" overridden with "${t}".`}function swe(e){return`Cannot use the scale property "${e}" with non-color channel.`}function awe(e){return`Cannot use the relative band size with ${e} scale.`}function lwe(e){return`Using unaggregated domain with raw field has no effect (${St(e)}).`}function uwe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function cwe(e){return`Unaggregated domain is currently unsupported for log scale (${St(e)}).`}function fwe(e){return`Cannot apply size to non-oriented mark "${e}".`}function dwe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function hwe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function fG(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function dG(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function pwe(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${St(n)} and ${St(r)}). Using ${St(n)}.`}function gwe(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${St(n)} and ${St(r)}). Using the union of the two domains.`}function mwe(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function ywe(e){return`Dropping sort property ${St(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const sP="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",vwe="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",xwe="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",bwe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function wwe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function _we(e){return`Cannot stack non-linear scale (${e}).`}function Ewe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function yv(e,t){return`Invalid ${e}: ${St(t)}.`}function Swe(e){return`Dropping day from datetime ${St(e)} as day cannot be combined with other units.`}function kwe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Cwe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Awe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function aP(e){return`1D error band does not support ${e}.`}function hG(e){return`Channel ${e} is required for "binned" bin.`}function Twe(e){return`Channel ${e} should not be used with "binned" bin.`}function Rwe(e){return`Domain for ${e} is required for threshold scale.`}globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;const pG=kC(SC);let hd=pG;function $we(e){return hd=e,hd}function Owe(){return hd=pG,hd}function ne(...e){hd.warn(...e)}function Nwe(...e){hd.debug(...e)}function $c(e){if(e&&ye(e)){for(const t of D$)if(t in e)return!0}return!1}const gG=["january","february","march","april","may","june","july","august","september","october","november","december"],Mwe=gG.map(e=>e.substr(0,3)),mG=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Fwe=mG.map(e=>e.substr(0,3));function Dwe(e){if(pb(e)&&(e=+e),ct(e))return e>4&&ne(yv("quarter",e)),e-1;throw new Error(yv("quarter",e))}function Iwe(e){if(pb(e)&&(e=+e),ct(e))return e-1;{const t=e.toLowerCase(),n=gG.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Mwe.indexOf(r);if(i!==-1)return i;throw new Error(yv("month",e))}}function Pwe(e){if(pb(e)&&(e=+e),ct(e))return e%7;{const t=e.toLowerCase(),n=mG.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Fwe.indexOf(r);if(i!==-1)return i;throw new Error(yv("day",e))}}function F$(e,t){const n=[];if(t&&e.day!==void 0&&Z(e).length>1&&(ne(Swe(e)),e=Be(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const r=t?Iwe(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){const r=t?Dwe(e.quarter):e.quarter;n.push(ct(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const r=t?Pwe(e.day):e.day;n.push(ct(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=e[r];n.push(typeof i>"u"?0:i)}return n}function ac(e){const n=F$(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Lwe(e){const n=F$(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function zwe(e){const t=F$(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const yG={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},D$=Z(yG);function Bwe(e){return!!yG[e]}function Oc(e){return ye(e)?e.binned:vG(e)}function vG(e){return e&&e.startsWith("binned")}function I$(e){return e.startsWith("utc")}function jwe(e){return e.substring(3)}const Uwe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Sb(e){return D$.filter(t=>bG(e,t))}function xG(e){const t=Sb(e);return t[t.length-1]}function bG(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Hwe(e,t,{end:n}={end:!1}){const r=_$(t),i=I$(e)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of D$)bG(e,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),Lwe(a)}function wG(e){if(!e)return;const t=Sb(e);return`timeUnitSpecifier(${St(t)}, ${St(Uwe)})`}function Gwe(e,t,n){if(!e)return;const r=wG(e);return`${n||I$(e)?"utc":"time"}Format(${t}, ${r})`}function Rn(e){if(!e)return;let t;return pe(e)?vG(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:ye(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),I$(t.unit)&&(t.utc=!0,t.unit=jwe(t.unit)),t}function Wwe(e){const{utc:t,...n}=Rn(e);return n.unit?(t?"utc":"")+Z(n).map(r=>Pt(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):(t?"utc":"")+"timeunit"+Z(n).map(r=>Pt(`_${r}_${n[r]}`)).join("")}function _G(e,t=n=>n){const n=Rn(e),r=xG(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=EG(r,n.step),a={...i,[s]:+i[s]+o};return`${t(ac(a))} - ${t(ac(i))}`}}const Vwe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function qwe(e){return!!Vwe[e]}function EG(e,t=1){if(qwe(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Ywe(e){return e==null?void 0:e.param}function P$(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function L$(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function z$(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function B$(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function j$(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function U$(e){if(e!=null&&e.field){if(K(e.range)&&e.range.length===2)return!0;if(Se(e.range))return!0}return!1}function H$(e){return!!(e!=null&&e.field)&&(K(e.oneOf)||K(e.in))}function Xwe(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function SG(e){return H$(e)||P$(e)||U$(e)||L$(e)||B$(e)||z$(e)||j$(e)}function jo(e,t){return Fb(e,{timeUnit:t,wrapTime:!0})}function Kwe(e,t){return e.map(n=>jo(n,t))}function kG(e,t=!0){const{field:n}=e,r=Rn(e.timeUnit),{unit:i,binned:o}=r||{},s=ue(e,{expr:"datum"}),a=i?`time(${o?s:Hwe(i,n)})`:s;if(P$(e))return`${a}===${jo(e.equal,i)}`;if(L$(e)){const l=e.lt;return`${a}<${jo(l,i)}`}else if(B$(e)){const l=e.gt;return`${a}>${jo(l,i)}`}else if(z$(e)){const l=e.lte;return`${a}<=${jo(l,i)}`}else if(j$(e)){const l=e.gte;return`${a}>=${jo(l,i)}`}else{if(H$(e))return`indexof([${Kwe(e.oneOf,i).join(",")}], ${a}) !== -1`;if(Xwe(e))return G$(a,e.valid);if(U$(e)){const{range:l}=e,u=Se(l)?{signal:`${l.signal}[0]`}:l[0],c=Se(l)?{signal:`${l.signal}[1]`}:l[1];if(u!==null&&c!==null&&t)return"inrange("+a+", ["+jo(u,i)+", "+jo(c,i)+"])";const f=[];return u!==null&&f.push(`${a} >= ${jo(u,i)}`),c!==null&&f.push(`${a} <= ${jo(c,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${St(e)}`)}function G$(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Jwe(e){return SG(e)&&e.timeUnit?{...e,timeUnit:Rn(e.timeUnit)}:e}const wm={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Qwe(e){return e==="quantitative"||e==="temporal"}function CG(e){return e==="ordinal"||e==="nominal"}const lc=wm.quantitative,W$=wm.ordinal,pd=wm.temporal,V$=wm.nominal,qd=wm.geojson;function Zwe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case lc:return"quantitative";case"t":case pd:return"temporal";case"o":case W$:return"ordinal";case"n":case V$:return"nominal";case qd:return"geojson"}}const Vr={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},rk={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function e_e(e,t){const n=rk[e],r=rk[t];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const t_e={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function lP(e){return t_e[e]}const AG=new Set(["linear","log","pow","sqrt","symlog"]),TG=new Set([...AG,"time","utc"]);function RG(e){return AG.has(e)}const $G=new Set(["quantile","quantize","threshold"]),n_e=new Set([...TG,...$G,"sequential","identity"]),r_e=new Set(["ordinal","bin-ordinal","point","band"]);function $n(e){return r_e.has(e)}function xi(e){return n_e.has(e)}function po(e){return TG.has(e)}function gd(e){return $G.has(e)}const i_e={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function o_e(e){return!pe(e)&&!!e.name}function OG(e){return e==null?void 0:e.param}function s_e(e){return e==null?void 0:e.unionWith}function a_e(e){return ye(e)&&"field"in e}const l_e={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:ROe,domain:$Oe,range:OOe,rangeMax:NOe,rangeMin:MOe,scheme:FOe,...u_e}=l_e,c_e=Z(u_e);function ik(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return po(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return po(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return po(e);case"nice":return po(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return xi(e)&&!tt(["log","time","utc","threshold","quantile"],e)}}function NG(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Of(e)?void 0:swe(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function f_e(e,t){return tt([W$,V$],t)?e===void 0||$n(e):t===pd?tt([Vr.TIME,Vr.UTC,void 0],e):t===lc?RG(e)||gd(e)||e===void 0:!0}function d_e(e,t,n=!1){if(!_a(e))return!1;switch(e){case Lt:case Nn:case Wl:case Vd:case qi:case Fo:return po(t)||t==="band"?!0:t==="point"?!n:!1;case ba:case Yl:case wa:case Vl:case ql:case Ac:return po(t)||gd(t)||tt(["band","point","ordinal"],t);case Jr:case Es:case Ss:return t!=="band";case Xl:case Qr:return t==="ordinal"||gd(t)}}const Or={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},MG=Or.arc,kb=Or.area,Cb=Or.bar,h_e=Or.image,Ab=Or.line,Tb=Or.point,p_e=Or.rect,vv=Or.rule,FG=Or.text,q$=Or.tick,g_e=Or.trail,Y$=Or.circle,X$=Or.square,DG=Or.geoshape;function Ql(e){return["line","area","trail"].includes(e)}function Eg(e){return["rect","bar","image","arc"].includes(e)}const m_e=new Set(Z(Or));function hs(e){return e.type}const y_e=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],v_e=["fill","fillOpacity"],x_e=[...y_e,...v_e],b_e={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},uP=Z(b_e),w_e={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},__e={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},E_e={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},IG=Z(E_e);function uc(e){return e&&e.band!=null}const S_e={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},PG=5,k_e={binSpacing:1,continuousBandSize:PG,minBandSize:.25,timeUnitBandPosition:.5},C_e={binSpacing:0,continuousBandSize:PG,minBandSize:.25,timeUnitBandPosition:.5},A_e={thickness:1};function T_e(e){return hs(e)?e.type:e}function K$(e){const{channel:t,channelDef:n,markDef:r,scale:i,config:o}=e,s=Q$(e);return te(n)&&!QH(n.aggregate)&&i&&po(i.get("type"))?R_e({fieldDef:n,channel:t,markDef:r,ref:s,config:o}):s}function R_e({fieldDef:e,channel:t,markDef:n,ref:r,config:i}){return Ql(n.type)?r:vt("invalid",n,i)===null?[$_e(e,t),r]:r}function $_e(e,t){const n=J$(e,!0),i=Tc(t)==="y"?{field:{group:"height"}}:{value:0};return{test:n,...i}}function J$(e,t=!0){return G$(pe(e)?e:ue(e,{expr:"datum"}),!t)}function O_e(e){const{datum:t}=e;return $c(t)?ac(t):`${St(t)}`}function Lu(e,t,n,r){const i={};if(t&&(i.scale=t),As(e)){const{datum:o}=e;$c(o)?i.signal=ac(o):Se(o)?i.signal=o.signal:bm(o)?i.signal=o.expr:i.value=o}else i.field=ue(e,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function xv({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!Se(s)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return W_e(e);default:return G_e(e,t)}};let JG=KG;function QG(e){JG=e}function V_e(){QG(KG)}function Nf(e,t,{allowDisabling:n,includeDefault:r=!0}){var a;const i=(a=nO(e))==null?void 0:a.title;if(!te(e))return i??e.title;const o=e,s=r?rO(o,t):void 0;return n?Qt(i,o.title,s):i??o.title??s}function nO(e){if(yd(e)&&e.axis)return e.axis;if(YG(e)&&e.legend)return e.legend;if(eO(e)&&e.header)return e.header}function rO(e,t){return JG(e,t)}function _v(e){if(XG(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=nO(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function q_e(e,t){var o;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(tO(e)&&K(e.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=e;if(i)return"temporal";if(r||n&&!Kl(n)&&!da(n))return"quantitative";if(Nc(e)&&((o=e.scale)!=null&&o.type))switch(rk[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function ps(e){if(te(e))return e;if(Nb(e))return e.condition}function hn(e){if(Ue(e))return e;if(Sm(e))return e.condition}function ZG(e,t,n,r={}){if(pe(e)||ct(e)||Ll(e)){const i=pe(e)?"string":ct(e)?"number":"boolean";return ne(Ybe(t,i,e)),{value:e}}return Ue(e)?Ev(e,t,n,r):Sm(e)?{...e,condition:Ev(e.condition,t,n,r)}:e}function Ev(e,t,n,r){if(XG(e)){const{format:i,formatType:o,...s}=e;if(cc(o)&&!n.customFormatTypes)return ne(oP(t)),Ev(s,t,n,r)}else{const i=yd(e)?"axis":YG(e)?"legend":eO(e)?"header":null;if(i&&e[i]){const{format:o,formatType:s,...a}=e[i];if(cc(s)&&!n.customFormatTypes)return ne(oP(t)),Ev({...e,[i]:a},t,n,r)}}return te(e)?iO(e,t,r):Y_e(e)}function Y_e(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=ct(n)?"quantitative":pe(n)?"nominal":$c(n)?"temporal":void 0,{...e,type:t}}function iO(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=e,a={...e};if(!n&&r&&!O$(r)&&!Kl(r)&&!da(r)&&(ne(Kbe(r)),delete a.aggregate),i&&(a.timeUnit=Rn(i)),s&&(a.field=`${s}`),Rt(o)&&(a.bin=Mb(o,t)),Dn(o)&&!an(t)&&ne(Twe(t)),Ar(a)){const{type:l}=a,u=Zwe(l);l!==u&&(a.type=u),l!=="quantitative"&&QH(r)&&(ne(Xbe(l,r)),a.type="quantitative")}else if(!VH(t)){const l=q_e(a,t);a.type=l}if(Ar(a)){const{compatible:l,warning:u}=X_e(a,t)||{};l===!1&&ne(u)}if(tO(a)&&pe(a.sort)){const{sort:l}=a;if(fP(l))return{...a,sort:{encoding:l}};const u=l.substr(1);if(l.charAt(0)==="-"&&fP(u))return{...a,sort:{encoding:u,order:"descending"}}}if(eO(a)){const{header:l}=a;if(l){const{orient:u,...c}=l;if(u)return{...a,header:{...c,labelOrient:l.labelOrient||u,titleOrient:l.titleOrient||u}}}}return a}function Mb(e,t){return Ll(e)?{maxbins:KI(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:KI(t)}:e}const Wc={compatible:!0};function X_e(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case ta:case na:case gb:return wv(e)?Wc:{compatible:!1,warning:ewe(t)};case Lt:case Nn:case Wl:case Vd:case Jr:case Es:case Ss:case ym:case vm:case mb:case sc:case yb:case vb:case Ac:case qi:case Fo:case xb:return Wc;case Io:case Gi:case Do:case Po:return n!==lc?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Wc;case wa:case Vl:case ql:case Yl:case ba:case xa:case va:case Mo:case _s:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Wc;case Qr:case Xl:return!wv(e)&&!U_e(e)?{compatible:!1,warning:twe(t)}:Wc;case dd:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Wc}}function vd(e){const{formatType:t}=_v(e);return t==="time"||!t&&K_e(e)}function K_e(e){return e&&(e.type==="temporal"||te(e)&&!!e.timeUnit)}function Fb(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var l;const o=t&&((l=Rn(t))==null?void 0:l.unit);let s=o||n==="temporal",a;return bm(e)?a=e.expr:Se(e)?a=e.signal:$c(e)?(s=!0,a=ac(e)):(pe(e)||ct(e))&&s&&(a=`datetime(${St(e)})`,Bwe(o)&&(ct(e)&&e<1e4||pe(e)&&isNaN(Date.parse(e)))&&(a=ac({[o]:e}))),a?r&&s?`time(${a})`:a:i?void 0:St(e)}function eW(e,t){const{type:n}=e;return t.map(r=>{const i=te(e)&&!Oc(e.timeUnit)?e.timeUnit:void 0,o=Fb(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function km(e,t){return Rt(e.bin)?_a(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const pP={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Cm(e){return e==null?void 0:e.condition}const tW=["domain","grid","labels","ticks","title"],J_e={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},nW={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Q_e={...nW,style:1,labelExpr:1,encoding:1};function gP(e){return!!Q_e[e]}const Z_e={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},rW=Z(Z_e);function Ea(e){return"mark"in e}class Db{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Ea(t)?T_e(t.mark)===this.name:!1}}function zu(e,t){const n=e&&e[t];return n?K(n)?ic(n,r=>!!r.field):te(n)||Nb(n):!1}function iW(e,t){const n=e&&e[t];return n?K(n)?ic(n,r=>!!r.field):te(n)||As(n)||Sm(n):!1}function oW(e,t){if(an(t)){const n=e[t];if((te(n)||As(n))&&(CG(n.type)||te(n)&&n.timeUnit)){const r=A$(t);return iW(e,r)}}return!1}function oO(e){return ic(tbe,t=>{if(zu(e,t)){const n=e[t];if(K(n))return ic(n,r=>!!r.aggregate);{const r=ps(n);return r&&!!r.aggregate}}return!1})}function sW(e,t){const n=[],r=[],i=[],o=[],s={};return sO(e,(a,l)=>{if(te(a)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=nO(a),g=p==null?void 0:p.title;let m=ue(a,{forAs:!0});const y={...g?[]:{title:Nf(a,t,{allowDisabling:!0})},...h,field:m};if(c){let v;if(Kl(c)?(v="argmax",m=ue({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${u}`):da(c)?(v="argmin",m=ue({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${u}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(v=c),v){const b={op:v,as:m};u&&(b.field=u),o.push(b)}}else if(n.push(m),Ar(a)&&Rt(f)){if(r.push({bin:f,field:u,as:m}),n.push(ue(a,{binSuffix:"end"})),km(a,l)&&n.push(ue(a,{binSuffix:"range"})),an(l)){const v={field:`${m}_end`};s[`${l}2`]=v}y.bin="binned",VH(l)||(y.type=lc)}else if(d&&!Oc(d)){i.push({timeUnit:d,field:u,as:m});const v=Ar(a)&&a.type!==pd&&"time";v&&(l===ym||l===sc?y.formatType=v:fbe(l)?y.legend={formatType:v,...y.legend}:an(l)&&(y.axis={formatType:v,...y.axis}))}s[l]=y}else n.push(u),s[l]=e[l]}else s[l]=e[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function e2e(e,t,n){const r=hbe(t,n);if(r){if(r==="binned"){const i=e[t===Mo?Lt:Nn];return!!(te(i)&&te(e[t])&&Dn(i.bin))}}else return!1;return!0}function t2e(e,t,n,r){const i={};for(const o of Z(e))WH(o)||ne(Zbe(o));for(let o of abe){if(!e[o])continue;const s=e[o];if(xm(o)){const a=sbe(o),l=i[a];if(te(l)&&Qwe(l.type)&&te(s)&&!l.timeUnit){ne(qbe(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(ne(Vbe),o=qi),!e2e(e,o,t)){ne(Eb(o,t));continue}if(o===ba&&t==="line"){const a=ps(e[o]);if(a!=null&&a.aggregate){ne(Qbe);continue}}if(o===Jr&&(n?"fill"in e:"stroke"in e)){ne(cG("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===vm||o===dd&&!K(s)&&!Ao(s)||o===sc&&K(s)){if(s){if(o===dd){const a=e[o];if(qG(a)){i[o]=a;continue}}i[o]=me(s).reduce((a,l)=>(te(l)?a.push(iO(l,o)):ne(nk(l,o)),a),[])}}else{if(o===sc&&s===null)i[o]=null;else if(!te(s)&&!As(s)&&!Ao(s)&&!Ob(s)&&!Se(s)){ne(nk(s,o));continue}i[o]=ZG(s,o,r)}}return i}function Ib(e,t){const n={};for(const r of Z(e)){const i=ZG(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function n2e(e){const t=[];for(const n of Z(e))if(zu(e,n)){const r=e[n],i=me(r);for(const o of i)te(o)?t.push(o):Nb(o)&&t.push(o.condition)}return t}function sO(e,t,n){if(e)for(const r of Z(e)){const i=e[r];if(K(i))for(const o of i)t.call(n,o,r);else t.call(n,i,r)}}function r2e(e,t,n,r){return e?Z(e).reduce((i,o)=>{const s=e[o];return K(s)?s.reduce((a,l)=>t.call(r,a,l,o),i):t.call(r,i,s,o)},n):n}function aW(e,t){return Z(t).reduce((n,r)=>{switch(r){case Lt:case Nn:case yb:case xb:case vb:case Mo:case _s:case Wl:case Vd:case qi:case xa:case Fo:case va:case Do:case Io:case Po:case Gi:case ym:case Qr:case Ac:case sc:return n;case dd:if(e==="line"||e==="trail")return n;case vm:case mb:{const i=t[r];if(K(i)||te(i))for(const o of me(i))o.aggregate||n.push(ue(o,{}));return n}case ba:if(e==="trail")return n;case Jr:case Es:case Ss:case wa:case Vl:case ql:case Xl:case Yl:{const i=ps(t[r]);return i&&!i.aggregate&&n.push(ue(i,{})),n}}},[])}function i2e(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(K(t)){for(const o of t)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return K(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function sk(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=e.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${aO(t)}`:"";return{field:s+t.field,type:t.type,title:Se(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=n2e(n).map(B_e);return{tooltip:[...i,...Qo(o,et)]}}function aO(e){const{title:t,field:n}=e;return Qt(t,n)}function lO(e,t,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:u,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=aO(n);return lW(e,a,i,{mark:l,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...pe(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...r,...f}})}}function lW(e,t,n,r){const{clip:i,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...hs(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(t)}`,...Ll(e[t])?{}:e[t]}}]:[]}function uW(e,t,n){const{encoding:r}=e,i=t==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:$0(o,n),continuousAxisChannelDef2:$0(s,n),continuousAxisChannelDefError:$0(a,n),continuousAxisChannelDefError2:$0(l,n),continuousAxis:i}}function $0(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...r}=e;return n!==t&&ne(Awe(n,t)),r}else return e}function cW(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(hs(n)&&n.orient)return n.orient;if(Za(i)){if(Za(o)){const s=te(i)&&i.aggregate,a=te(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return vd(o)&&!vd(i)?"horizontal":"vertical"}return"horizontal"}else{if(Za(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Sv="boxplot",o2e=["box","median","outliers","rule","ticks"],s2e=new Db(Sv,dW);function fW(e){return ct(e)?"tukey":e}function dW(e,{config:t}){e={...e,encoding:Ib(e.encoding,t)};const{mark:n,encoding:r,params:i,projection:o,...s}=e,a=hs(n)?n:{type:n};i&&ne(lG("boxplot"));const l=a.extent??t.boxplot.extent,u=vt("size",a,t),c=a.invalid,f=fW(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:v,encodingWithoutContinuousAxis:b,ticksOrient:w,boxOrient:_,customTooltipWithoutAggregatedField:k}=a2e(e,l,t),{color:E,size:A,...N}=b,O=Mn=>lO(a,m,g,Mn,t.boxplot),F=O(N),U=O(b),M=O({...N,...A?{size:A}:{}}),L=sk([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,b),I={type:"tick",color:"black",opacity:1,orient:w,invalid:c,aria:!1},B=f==="min-max"?L:sk([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),H=[...F({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:B}),...F({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:B}),...F({partName:"ticks",mark:I,positionPrefix:"lower_whisker",extraEncoding:B}),...F({partName:"ticks",mark:I,positionPrefix:"upper_whisker",extraEncoding:B})],z=[...f!=="tukey"?H:[],...U({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:L}),...M({partName:"median",mark:{type:"tick",invalid:c,...ye(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:L})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:z};const j=`datum["lower_box_${g.field}"]`,J=`datum["upper_box_${g.field}"]`,ce=`(${J} - ${j})`,_e=`${j} - ${l} * ${ce}`,Ye=`${J} + ${l} * ${ce}`,je=`datum["${g.field}"]`,ft={joinaggregate:hW(g.field),groupby:y},ln={transform:[{filter:`(${_e} <= ${je}) && (${je} <= ${Ye})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${g.field}`},{op:"max",field:g.field,as:`upper_whisker_${g.field}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${g.field}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${g.field}`},...v],groupby:y}],layer:H},{tooltip:ni,...Ts}=N,{scale:xe,axis:He}=g,qe=aO(g),ee=Wr(He,["title"]),en=lW(a,"outliers",t.boxplot,{transform:[{filter:`(${je} < ${_e}) || (${je} > ${Ye})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...qe!==void 0?{title:qe}:{},...xe!==void 0?{scale:xe}:{},...Et(ee)?{}:{axis:ee}},...Ts,...E?{color:E}:{},...k?{tooltip:k}:{}}})[0];let at;const yn=[...d,...h,ft];return en?at={transform:yn,layer:[en,ln]}:(at=ln,at.transform.unshift(...yn)),{...s,layer:[at,{transform:p,layer:z}]}}function hW(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}function a2e(e,t,n){const r=cW(e,Sv),{continuousAxisChannelDef:i,continuousAxis:o}=uW(e,r,Sv),s=i.field,a=fW(t),l=[...hW(s),{op:"median",field:s,as:`mid_box_${s}`},{op:"min",field:s,as:(a==="min-max"?"lower_whisker_":"min_")+s},{op:"max",field:s,as:(a==="min-max"?"upper_whisker_":"max_")+s}],u=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${s}"] - datum["lower_box_${s}"]`,as:`iqr_${s}`},{calculate:`min(datum["upper_box_${s}"] + datum["iqr_${s}"] * ${t}, datum["max_${s}"])`,as:`upper_whisker_${s}`},{calculate:`max(datum["lower_box_${s}"] - datum["iqr_${s}"] * ${t}, datum["min_${s}"])`,as:`lower_whisker_${s}`}],{[o]:c,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=i2e(f),{bins:p,timeUnits:g,aggregate:m,groupby:y,encoding:v}=sW(h,n),b=r==="vertical"?"horizontal":"vertical",w=r,_=[...p,...g,{aggregate:[...m,...l],groupby:y},...u];return{bins:p,timeUnits:g,transform:_,groupby:y,aggregate:m,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:d}}const uO="errorbar",l2e=["ticks","rule"],u2e=new Db(uO,pW);function pW(e,{config:t}){e={...e,encoding:Ib(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:u}=gW(e,uO,t);delete o.size;const c=lO(a,i,r,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function c2e(e,t){const{encoding:n}=e;if(f2e(n))return{orient:cW(e,t),inputType:"raw"};const r=d2e(n),i=h2e(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Ue(a)&&Ue(l))throw new Error(`${t} cannot have both x2 and y2`);if(Ue(a)){if(Za(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Ue(l)){if(Za(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,u=n.yError,c=n.yError2;if(Ue(l)&&!Ue(a))throw new Error(`${t} cannot have xError2 without xError`);if(Ue(c)&&!Ue(u))throw new Error(`${t} cannot have yError2 without yError`);if(Ue(a)&&Ue(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Ue(a)){if(Za(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Ue(u)){if(Za(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function f2e(e){return(Ue(e.x)||Ue(e.y))&&!Ue(e.x2)&&!Ue(e.y2)&&!Ue(e.xError)&&!Ue(e.xError2)&&!Ue(e.yError)&&!Ue(e.yError2)}function d2e(e){return Ue(e.x2)||Ue(e.y2)}function h2e(e){return Ue(e.xError)||Ue(e.xError2)||Ue(e.yError)||Ue(e.yError2)}function gW(e,t,n){const{mark:r,encoding:i,params:o,projection:s,...a}=e,l=hs(r)?r:{type:r};o&&ne(lG(t));const{orient:u,inputType:c}=c2e(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=uW(e,u,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=p2e(l,f,d,h,p,c,t,n),{[g]:w,[g==="x"?"x2":"y2"]:_,[g==="x"?"xError":"yError"]:k,[g==="x"?"xError2":"yError2"]:E,...A}=i,{bins:N,timeUnits:O,aggregate:F,groupby:U,encoding:M}=sW(A,n),L=[...F,...m],I=c!=="raw"?[]:U,B=sk(v,f,M,b);return{transform:[...a.transform??[],...N,...O,...L.length===0?[]:[{aggregate:L,groupby:I}],...y],groupby:I,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:M,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:B}}function p2e(e,t,n,r,i,o,s,a){let l=[],u=[];const c=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&ne(Cwe(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:mm(h)},{fieldPrefix:"upper_",titlePrefix:mP(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:mP(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),l=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:Nf({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Nf({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Nf({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&ne(kwe(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:`upper_${c}`}],i?u.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:`lower_${c}`}):u.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:`lower_${c}`}));for(const h of u)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:oc(oc(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function mP(e,t,n){return`${mm(e)} ${n} ${t}`}const cO="errorband",g2e=["band","borders"],m2e=new Db(cO,mW);function mW(e,{config:t}){e={...e,encoding:Ib(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=gW(e,cO,t),u=s,c=lO(u,i,r,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):u.interpolate?ne(aP("interpolate")):u.tension&&ne(aP("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const yW={};function fO(e,t,n){const r=new Db(e,t);yW[e]={normalizer:r,parts:n}}function y2e(){return Z(yW)}fO(Sv,dW,o2e);fO(uO,pW,l2e);fO(cO,mW,g2e);const v2e=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],vW={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},xW={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},x2e=Z(vW),b2e=Z(xW),w2e={header:1,headerRow:1,headerColumn:1,headerFacet:1},bW=Z(w2e),wW=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],_2e={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},E2e={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},To="_vgsid_",S2e={point:{on:"click",fields:[To],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function dO(e){return e==="legend"||!!(e!=null&&e.legend)}function J_(e){return dO(e)&&ye(e)}function hO(e){return!!(e!=null&&e.select)}function _W(e){const t=[];for(const n of e||[]){if(hO(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};t.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};t.push(s)}}return t}function k2e(e){return Pb(e)||gO(e)||pO(e)}function pO(e){return"concat"in e}function Pb(e){return"vconcat"in e}function gO(e){return"hconcat"in e}function EW({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function gs(e){return ye(e)&&e.step!==void 0}function yP(e){return e.view||e.width||e.height}const vP=20,C2e={align:1,bounds:1,center:1,columns:1,spacing:1},A2e=Z(C2e);function T2e(e,t,n){const r=n[t],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&($b(e)&&!Em(e.facet)||pO(e))&&(i.columns=s),Pb(e)&&(i.columns=1);for(const a of A2e)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];i[a]=ct(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=e[a];return i}function ak(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function kv(e,t){const n=Cv(e,t);return gs(n)?n.step:SW}function Cv(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Qt(n,{step:e.step})}const SW=20,R2e={continuousWidth:200,continuousHeight:200,step:SW},$2e={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:R2e,mark:__e,arc:{},area:{},bar:k_e,circle:{},geoshape:{},image:{},line:{},point:{},rect:C_e,rule:{color:"black"},square:{},text:{color:"black"},tick:A_e,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:i_e,projection:{},legend:_2e,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:S2e,style:{},title:{},facet:{spacing:vP},concat:{spacing:vP},normalizedNumberFormat:".0%"},Fs=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],xP={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},bP={blue:Fs[0],orange:Fs[1],red:Fs[2],teal:Fs[3],green:Fs[4],yellow:Fs[5],purple:Fs[6],pink:Fs[7],brown:Fs[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function O2e(e={}){return{signals:[{name:"color",value:ye(e)?{...bP,...e}:bP}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function N2e(e){return{signals:[{name:"fontSize",value:ye(e)?{...xP,...e}:xP}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function M2e(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function kW(e){const t=Z(e||{}),n={};for(const r of t){const i=e[r];n[r]=Cm(i)?tG(i):ai(i)}return n}function F2e(e){const t=Z(e),n={};for(const r of t)n[r]=kW(e[r]);return n}const D2e=[...IG,...rW,...bW,"background","padding","legend","lineBreak","scale","style","title","view"];function CW(e={}){const{color:t,font:n,fontSize:r,selection:i,...o}=e,s=Od({},Be($2e),n?M2e(n):{},t?O2e(t):{},r?N2e(r):{},o||{});i&&Nd(s,"selection",i,!0);const a=Wr(s,D2e);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=ai(s[l]));for(const l of IG)s[l]&&(a[l]=Ir(s[l]));for(const l of rW)s[l]&&(a[l]=kW(s[l]));for(const l of bW)s[l]&&(a[l]=Ir(s[l]));return s.legend&&(a.legend=Ir(s.legend)),s.scale&&(a.scale=Ir(s.scale)),s.style&&(a.style=F2e(s.style)),s.title&&(a.title=Ir(s.title)),s.view&&(a.view=Ir(s.view)),a}const I2e=new Set(["view",...m_e]),P2e=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],L2e={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...w_e};function z2e(e){e=Be(e);for(const t of P2e)delete e[t];if(e.axis)for(const t in e.axis)Cm(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of v2e)delete e.legend[t];if(e.mark){for(const t of uP)delete e.mark[t];e.mark.tooltip&&ye(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(_W(e.params)),delete e.params);for(const t of I2e){for(const r of uP)delete e[t][r];const n=L2e[t];if(n)for(const r of n)delete e[t][r];j2e(e,t)}for(const t of y2e())delete e[t];B2e(e);for(const t in e)ye(e[t])&&Et(e[t])&&delete e[t];return Et(e)?void 0:e}function B2e(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=eG(e.title);Et(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Et(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Et(r)?delete e.title:e.title=r}function j2e(e,t,n,r){const i=r?e[t][r]:e[t];t==="view"&&(n="cell");const o={...i,...e.style[n??t]};Et(o)||(e.style[n??t]=o),r||delete e[t]}function Lb(e){return"layer"in e}function U2e(e){return"repeat"in e}function H2e(e){return!K(e.repeat)&&e.repeat.layer}class mO{map(t,n){return $b(t)?this.mapFacet(t,n):U2e(t)?this.mapRepeat(t,n):gO(t)?this.mapHConcat(t,n):Pb(t)?this.mapVConcat(t,n):pO(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Lb(t))return this.mapLayer(t,n);if(Ea(t))return this.mapUnit(t,n);throw new Error(N$(t))}mapLayer(t,n){return{...t,layer:t.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(r=>this.map(r,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(r=>this.map(r,n))}}mapConcat(t,n){const{concat:r,...i}=t;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const G2e={zero:1,center:1,normalize:1};function W2e(e){return e in G2e}const V2e=new Set([MG,Cb,kb,vv,Tb,Y$,X$,Ab,FG,q$]),q2e=new Set([Cb,kb,MG]);function Vc(e){return te(e)&&md(e)==="quantitative"&&!e.bin}function wP(e,t,{orient:n,type:r}){const i=t==="x"?"y":"radius",o=t==="x",s=e[t],a=e[i];if(te(s)&&te(a))if(Vc(s)&&Vc(a)){if(s.stack)return t;if(a.stack)return i;const l=te(s)&&!!s.aggregate,u=te(a)&&!!a.aggregate;if(l!==u)return l?t:i;if(o&&["bar","area"].includes(r)){if(n==="vertical")return i;if(n==="horizontal")return t}}else{if(Vc(s))return t;if(Vc(a))return i}else{if(Vc(s))return t;if(Vc(a))return i}}function Y2e(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function AW(e,t){var g,m;const n=hs(e)?e:{type:e},r=n.type;if(!V2e.has(r))return null;const i=wP(t,"x",n)||wP(t,"theta",n);if(!i)return null;const o=t[i],s=te(o)?ue(o,{}):void 0,a=Y2e(i),l=[],u=new Set;if(t[a]){const y=t[a],v=te(y)?ue(y,{}):void 0;v&&v!==s&&(l.push(a),u.add(v))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=te(f)?ue(f,{}):void 0;d&&d!==s&&(l.push(c),u.add(d));const h=lbe.reduce((y,v)=>{if(v!=="tooltip"&&zu(t,v)){const b=t[v];for(const w of me(b)){const _=ps(w);if(_.aggregate)continue;const k=ue(_,{});(!k||!u.has(k))&&y.push({channel:v,fieldDef:_})}}return y},[]);let p;return o.stack!==void 0?Ll(o.stack)?p=o.stack?"zero":null:p=o.stack:q2e.has(r)&&(p="zero"),!p||!W2e(p)||oO(t)&&h.length===0?null:(g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==Vr.LINEAR?(o!=null&&o.stack&&ne(_we(o.scale.type)),null):Ue(t[ks(i)])?(o.stack!==void 0&&ne(wwe(i)),null):(te(o)&&o.aggregate&&!bbe.has(o.aggregate)&&ne(Ewe(o.aggregate)),{groupbyChannels:l,groupbyFields:u,fieldChannel:i,impute:o.impute===null?!1:Ql(r),stackBy:h,offset:p})}function TW(e,t,n){const r=Ir(e),i=vt("orient",r,n);if(r.orient=Q2e(r.type,t,i),i!==void 0&&i!==r.orient&&ne(owe(r.orient,i)),r.type==="bar"&&r.orient){const a=vt("cornerRadiusEnd",r,n);if(a!==void 0){const l=r.orient==="horizontal"&&t.x2||r.orient==="vertical"&&t.y2?["cornerRadius"]:S_e[r.orient];for(const u of l)r[u]=a;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}return vt("opacity",r,n)===void 0&&(r.opacity=K2e(r.type,t)),vt("cursor",r,n)===void 0&&(r.cursor=X2e(r,t,n)),r}function X2e(e,t,n){return t.href||e.href||vt("href",e,n)?"pointer":e.cursor}function K2e(e,t){if(tt([Tb,q$,Y$,X$],e)&&!oO(t))return .7}function J2e(e,t,{graticule:n}){if(n)return!1;const r=ha("filled",e,t),i=e.type;return Qt(r,i!==Tb&&i!==Ab&&i!==vv)}function Q2e(e,t,n){switch(e){case Tb:case Y$:case X$:case FG:case p_e:case h_e:return}const{x:r,y:i,x2:o,y2:s}=t;switch(e){case Cb:if(te(r)&&(Dn(r.bin)||te(i)&&i.aggregate&&!r.aggregate))return"vertical";if(te(i)&&(Dn(i.bin)||te(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(te(r)&&r.type===lc&&!Rt(r.bin)||bv(r))&&te(i)&&Dn(i.bin)?"horizontal":"vertical";if(!s)return(te(i)&&i.type===lc&&!Rt(i.bin)||bv(i))&&te(r)&&Dn(r.bin)?"vertical":"horizontal"}case vv:if(o&&!(te(r)&&Dn(r.bin))&&s&&!(te(i)&&Dn(i.bin)))return;case kb:if(s)return te(i)&&Dn(i.bin)?"horizontal":"vertical";if(o)return te(r)&&Dn(r.bin)?"vertical":"horizontal";if(e===vv){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case Ab:case q$:{const a=hP(r),l=hP(i);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const u=Ar(r)&&r.type===pd,c=Ar(i)&&i.type===pd;if(u&&!c)return"vertical";if(!u&&c)return"horizontal"}return}}return"vertical"}function Z2e(e){const{point:t,line:n,...r}=e;return Z(r).length>1?r:r.type}function eEe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Wr(e[t],["point","line"])});return e}function Q_(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?ye(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?ye(t.point)?t.point:{}:void 0}function _P(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class tEe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Ea(t)){const{mark:r,encoding:i}=t,o=hs(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!Q_(o,n[o.type],i);case"area":return!!Q_(o,n[o.type],i)||!!_P(o,n[o.type])}}return!1}run(t,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:u,...c}=t,f=Ib(u,i),d=hs(a)?a:{type:a},h=Q_(d,i[d.type],f),p=d.type==="area"&&_P(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:Z2e({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:Wr(f,["shape"])}],m=AW(TW(d,f,i),f);let y=f;if(m){const{fieldChannel:v,offset:b}=m;y={...f,[v]:{...f[v],...b?{stack:b}:{}}}}return y=Wr(y,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...cd(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...cd(d,["clip","tooltip"]),...h},encoding:y}),r({...c,layer:g},{...n,config:eEe(i)})}}function nEe(e,t){return t?Em(e)?$W(e,t):RW(e,t):e}function Z_(e,t){return t?$W(e,t):e}function lk(e,t,n){const r=t[e];if(L_e(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};ne(zbe(r.repeat));return}return t}function RW(e,t){if(e=lk("field",e,t),e!==void 0){if(e===null)return null;if(tO(e)&&is(e.sort)){const n=lk("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function EP(e,t){if(te(e))return RW(e,t);{const n=lk("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function SP(e,t){if(Ue(e)){const n=EP(e,t);if(n)return n;if(Ob(e))return{condition:e.condition}}else{if(Sm(e)){const n=EP(e.condition,t);if(n)return{...e,condition:n};{const{condition:r,...i}=e;return i}}return e}}function $W(e,t){const n={};for(const r in e)if(Oe(e,r)){const i=e[r];if(K(i))n[r]=i.map(o=>SP(o,t)).filter(o=>o);else{const o=SP(i,t);o!==void 0&&(n[r]=o)}}return n}class rEe{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Ea(t)){const{encoding:n,mark:r}=t;if(r==="line"||hs(r)&&r.type==="line")for(const i of obe){const o=Tc(i),s=n[o];if(n[i]&&(te(s)&&!Dn(s.bin)||As(s)))return!0}}return!1}run(t,n,r){const{encoding:i,mark:o}=t;return ne(iwe(!!i.x2,!!i.y2)),r({...t,mark:ye(o)?{...o,type:"rule"}:"rule"},n)}}class iEe extends mO{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[s2e,u2e,m2e,new tEe,new rEe]}map(t,n){if(Ea(t)){const r=zu(t.encoding,ta),i=zu(t.encoding,na),o=zu(t.encoding,gb);if(r||i||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:r,parentProjection:i}=n,o=Z_(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(t,n){return H2e(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:r,spec:i,...o}=t,{row:s,column:a,layer:l}=r,{repeater:u={},repeaterPrefix:c=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...u,layer:f},h=`${(i.name?`${i.name}_`:"")+c}child__layer_${Pt(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:r,spec:i,data:o,...s}=t;!K(r)&&t.columns&&(t=Wr(t,["columns"]),ne(rP("repeat")));const a=[],{repeater:l={},repeaterPrefix:u=""}=n,c=!K(r)&&r.row||[l?l.row:null],f=!K(r)&&r.column||[l?l.column:null],d=K(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:l.layer},v=(i.name?`${i.name}_`:"")+u+"child__"+(K(r)?`${Pt(p)}`:(r.row?`row_${Pt(g)}`:"")+(r.column?`column_${Pt(m)}`:"")),b=this.map(i,{...n,repeater:y,repeaterPrefix:v});b.name=v,a.push(Wr(b,["data"]))}const h=K(r)?t.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:r}=t;return Em(r)&&t.columns&&(t=Wr(t,["columns"]),ne(rP("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:r,projection:i}=t,{parentEncoding:o,parentProjection:s,config:a}=n,l=CP({parentProjection:s,projection:i}),u=kP({parentEncoding:o,encoding:Z_(r,n.repeater)});return this.mapUnit({...t,...l?{projection:l}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,n){const{row:r,column:i,facet:o,...s}=t.encoding,{mark:a,width:l,projection:u,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),y=Z_(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...c?{height:c}:{},...f?{view:f}:{},...u?{projection:u}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:r,column:i,facet:o}=t;if(r||i){o&&ne(nwe([...r?[ta]:[],...i?[na]:[]]));const s={},a={};for(const l of[ta,na]){const u=t[l];if(u){const{align:c,center:f,spacing:d,columns:h,...p}=u;s[l]=p;for(const g of["align","center","spacing"])u[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=u[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:u,...c}=o;return{facetMapping:nEe(c,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...u?{columns:u}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=t,l={...i,parentEncoding:kP({parentEncoding:n,encoding:o,layer:!0}),parentProjection:CP({parentProjection:r,projection:s})};return super.mapLayer({...a,...t.name?{name:[l.repeaterPrefix,t.name].filter(u=>u).join("_")}:{}},l)}}function kP({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){const i=new Set([...Z(e),...Z(t)]);for(const o of i){const s=t[o],a=e[o];if(Ue(s)){const l={...a,...s};r[o]=l}else Sm(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||Ao(a)||Se(a)||Ue(a)||K(a))&&(r[o]=a)}}else r=t;return!r||Et(r)?void 0:r}function CP(e){const{parentProjection:t,projection:n}=e;return t&&n&&ne(Wbe({parentProjection:t,projection:n})),n??t}function yO(e){return"filter"in e}function oEe(e){return(e==null?void 0:e.stop)!==void 0}function OW(e){return"lookup"in e}function sEe(e){return"data"in e}function aEe(e){return"param"in e}function lEe(e){return"pivot"in e}function uEe(e){return"density"in e}function cEe(e){return"quantile"in e}function fEe(e){return"regression"in e}function dEe(e){return"loess"in e}function hEe(e){return"sample"in e}function pEe(e){return"window"in e}function gEe(e){return"joinaggregate"in e}function mEe(e){return"flatten"in e}function yEe(e){return"calculate"in e}function NW(e){return"bin"in e}function vEe(e){return"impute"in e}function xEe(e){return"timeUnit"in e}function bEe(e){return"aggregate"in e}function wEe(e){return"stack"in e}function _Ee(e){return"fold"in e}function EEe(e){return"extent"in e&&!("density"in e)}function SEe(e){return e.map(t=>yO(t)?{filter:$f(t.filter,Jwe)}:t)}class kEe extends mO{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=AP(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=AP(t,n),t.encoding){const r={};for(const[i,o]of Tl(t.encoding))r[i]=MW(o,n);t={...t,encoding:r}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:r,...i}=t;return r?{...i,params:Tl(r).map(([o,s])=>{const{init:a,bind:l,empty:u,...c}=s;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[o]=u!=="none";for(const f of Bn(n.selectionPredicates[o]??{}))f.empty=u!=="none";return{name:o,value:a,select:c,bind:l}})}:t}}function AP(e,t){const{transform:n,...r}=e;if(n){const i=n.map(o=>{if(yO(o))return{filter:uk(o,t)};if(NW(o)&&Rc(o.bin))return{...o,bin:FW(o.bin)};if(OW(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return e}function MW(e,t){var r,i;const n=Be(e);if(te(n)&&Rc(n.bin)&&(n.bin=FW(n.bin)),Nc(n)&&((i=(r=n.scale)==null?void 0:r.domain)!=null&&i.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(Ob(n))if(K(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:l,...u}=o;return a?o:{...u,test:uk(o,t)}});else{const{selection:o,param:s,test:a,...l}=MW(n.condition,t);n.condition=s?n.condition:{...l,test:uk(n.condition,t)}}return n}function FW(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function uk(e,t){const n=r=>$f(r,i=>{var o;const s=t.emptySelections[i]??!0,a={param:i,empty:s};return(o=t.selectionPredicates)[i]??(o[i]=[]),t.selectionPredicates[i].push(a),a});return e.selection?n(e.selection):$f(e.test||e.filter,r=>r.selection?n(r.selection):r)}class ck extends mO{map(t,n){const r=n.selections??[];if(t.params&&!Ea(t)){const i=[];for(const o of t.params)hO(o)?r.push(o):i.push(o);t.params=i}return n.selections=r,super.map(t,n)}mapUnit(t,n){const r=n.selections;if(!r||!r.length)return t;const i=(n.path??[]).concat(t.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(pe(a)&&(a===t.name||i.includes(a))||K(a)&&a.map(l=>i.indexOf(l)).every((l,u,c)=>l!==-1&&(u===0||l>c[u-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=ck.prototype[e];ck.prototype[e]=function(n,r){return t.call(this,n,CEe(n,r))}}function CEe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function DW(e,t){t===void 0&&(t=CW(e.config));const n=$Ee(e,t),{width:r,height:i}=e,o=OEe(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const AEe=new iEe,TEe=new kEe,REe=new ck;function $Ee(e,t={}){const n={config:t};return REe.map(AEe.map(TEe.map(e,n),n),n)}function TP(e){return pe(e)?{type:e}:e??{}}function OEe(e,t,n){let{width:r,height:i}=t;const o=Ea(e)||Lb(e),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(ne(ZI("width")),r=void 0),i=="container"&&(ne(ZI("height")),i=void 0));const a={type:"pad",...s,...n?TP(n.autosize):{},...TP(e.autosize)};if(a.type==="fit"&&!o&&(ne(Rbe),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&ne(eP("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&ne(eP("height")),!fi(a,{type:"pad"}))return a}function NEe(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function MEe(e){return e?`fit-${bb(e)}`:"fit"}const FEe=["background","padding"];function RP(e,t){const n={};for(const r of FEe)e&&e[r]!==void 0&&(n[r]=ai(e[r]));return t&&(n.params=e.params),n}class Sa{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Sa(Be(this.explicit),Be(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Qt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:r}){n!==void 0&&this.set(t,n,r)}set(t,n,r){return delete this[r?"implicit":"explicit"][t],this[r?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:r}){n[t]!==void 0?this.set(t,n[t],!0):r[t]!==void 0&&this.set(t,r[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of Z(t.combine())){const r=t.getWithExplicit(n);this.setWithExplicit(n,r)}}}function Vo(e){return{explicit:!0,value:e}}function ri(e){return{explicit:!1,value:e}}function IW(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:zb(t,n,r,i)}}function zb(e,t,n,r){return e.explicit&&t.explicit&&ne(pwe(n,r,e.value,t.value)),e}function Ol(e,t,n,r,i=zb){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:fi(e.value,t.value)?e:i(e,t,n,r)}class DEe extends Sa{constructor(t={},n={},r=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=r}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function xd(e){return"url"in e}function Sg(e){return"values"in e}function PW(e){return"name"in e&&!xd(e)&&!Sg(e)&&!pl(e)}function pl(e){return e&&(LW(e)||zW(e)||vO(e))}function LW(e){return"sequence"in e}function zW(e){return"sphere"in e}function vO(e){return"graticule"in e}var At;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(At||(At={}));function BW(e){const{signals:t,hasLegend:n,index:r,...i}=e;return i.field=Hi(i.field),i}function fc(e,t=!0,n=ar){if(K(e)){const r=e.map(i=>fc(i,t,n));return t?`[${r.join(", ")}]`:r}else if($c(e))return n(t?ac(e):zwe(e));return t?n(St(e)):e}function IEe(e,t){for(const n of Bn(e.component.selection??{})){const r=n.name;let i=`${r}${Ml}, ${n.resolve==="global"?"true":`{unit: ${Bu(e)}}`}`;for(const o of Hb)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(i=o.modifyExpr(e,n,i)));t.push({name:r+pSe,on:[{events:{signal:n.name+Ml},update:`modify(${ie(n.name+dc)}, ${i})`}]})}return xO(t)}function PEe(e,t){if(e.component.selection&&Z(e.component.selection).length){const n=ie(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Gl("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return xO(t)}function LEe(e,t){let n=!1;for(const r of Bn(e.component.selection??{})){const i=r.name,o=ie(i+dc);if(t.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";t.push({name:r.name,update:`${iV}(${o}, ${ie(a)}${l}`})}n=!0;for(const a of Hb)a.defined(r)&&a.topLevelSignals&&(t=a.topLevelSignals(e,r,t))}return n&&t.filter(i=>i.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),xO(t)}function zEe(e,t){const n=[...t],r=Bu(e,{escape:!1});for(const i of Bn(e.component.selection??{})){const o={name:i.name+dc};if(i.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:To}}]),i.init){const a=i.project.items.map(BW);o.values=i.project.hasSelectionId?i.init.map(l=>({unit:r,[To]:fc(l,!1)[0]})):i.init.map(l=>({unit:r,fields:a,values:fc(l,!1)}))}n.filter(a=>a.name===i.name+dc).length||n.push(o)}return n}function jW(e,t){for(const n of Bn(e.component.selection??{}))for(const r of Hb)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function BEe(e,t){for(const n of e.children)qt(n)&&(t=jW(n,t));return t}function jEe(e,t,n,r){const i=uV(e,t.param,t);return{signal:xi(n.get("type"))&&K(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function xO(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class wt{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){ne(Ube);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this);const r=t.parent.removeChild(t);this._parent=n,n.addChild(this,r),t.parent=this}}class Er extends wt{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,r,i){super(t,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${PH()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function e2(e){return e.as!==void 0}function $P(e){return`${e}_end`}class os extends wt{clone(){return new os(null,Be(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let u;if(Oc(l)){if(qt(n)){const{mark:c,markDef:f,config:d}=n,h=$l({fieldDef:o,markDef:f,config:d});(Eg(c)||h)&&(u={timeUnit:Rn(l),field:a})}}else u={as:ue(o,{forAs:!0}),field:a,timeUnit:l};if(qt(n)){const{mark:c,markDef:f,config:d}=n,h=$l({fieldDef:o,markDef:f,config:d});Eg(c)&&an(s)&&h!==.5&&(u.rectBandPosition=h)}u&&(i[et(u)]=u)}return i},{});return Et(r)?null:new os(t,r)}static makeFromTransform(t,n){const{timeUnit:r,...i}={...n},o=Rn(r),s={...i,timeUnit:o};return new os(t,{[et(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[r,i]of Tl(this.timeUnits)){const o=e2(i)?i.as:`${i.field}_end`;t.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(Bn(this.timeUnits).map(t=>e2(t)?t.as:$P(t.field)))}dependentFields(){return new Set(Bn(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${et(this.timeUnits)}`}assemble(){const t=[];for(const n of Bn(this.timeUnits)){const{rectBandPosition:r}=n,i=Rn(n.timeUnit);if(e2(n)){const{field:o,as:s}=n,{unit:a,utc:l,...u}=i,c=[s,`${s}_end`];t.push({field:Hi(o),type:"timeunit",...a?{units:Sb(a)}:{},...l?{timezone:"utc"}:{},...u,as:c}),t.push(...OP(c,r,i))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=UW({timeUnit:i,field:s}),l=$P(s);t.push({type:"formula",expr:a,as:l}),t.push(...OP([s,l],r,i))}}return t}}const Bb="offsetted_rect_start",jb="offsetted_rect_end";function UW({timeUnit:e,field:t,reverse:n}){const{unit:r,utc:i}=e,o=xG(r),{part:s,step:a}=EG(o,e.step);return`${i?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-a:a})`}function OP([e,t],n,r){if(n!==void 0&&n!==.5){const i=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:NP([UW({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${Bb}`},{type:"formula",expr:NP([i,o],n+.5),as:`${e}_${jb}`}]}return[]}function NP([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Am="_tuple_fields";class UEe{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const HEe={defined:()=>!0,parse:(e,t,n)=>{const r=t.name,i=t.project??(t.project=new UEe),o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=Pt(`${r}_${m}`);for(let v=1;a.has(y);v++)y=Pt(`${r}_${m}_${v}`);return a.add(y),{[g]:y}},u=t.type,c=e.config.selection[u],f=n.value!==void 0?me(n.value):null;let{fields:d,encodings:h}=ye(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ye(p))for(const g of Z(p))ibe(g)?(h||(h=[])).push(g):u==="interval"?(ne(Lbe),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){ne($be(p,g.aggregate));continue}else if(!m){ne(nP(p));continue}if(g.timeUnit&&!Oc(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};s[et(y)]=y}if(!o[m]){const y=u==="interval"&&_a(p)&&xi(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",v={field:m,channel:p,type:y,index:i.items.length};v.signals={...l(v,"data"),...l(v,"visual")},i.items.push(o[m]=v),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===To,HH(p)?(v.geoChannel=p,v.channel=UH(p),i.hasChannel[v.channel]=o[m]):i.hasChannel[p]=o[m]}}else ne(nP(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===To}f&&(t.init=f.map(p=>i.items.map(g=>ye(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Et(s)||(i.timeUnit=new os(null,s))},signals:(e,t,n)=>{const r=t.name+Am;return n.filter(o=>o.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(BW)})}},ra={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!_a(i))continue;const o=e.getScaleComponent(i),s=o?o.get("type"):void 0;if(!o||!xi(s)){ne(Mbe);continue}o.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||MP(e)||r.length===0)return n;const i=n.filter(s=>s.name===t.name)[0];let o=i.update;if(o.indexOf(iV)>=0)i.update=`{${r.map(s=>`${ie(Hi(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${ie(Hi(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!MP(e))for(const r of t.scales){const i=n.filter(o=>o.name===r.signals.data)[0];i.push="outer",delete i.value,delete i.update}return n}};function fk(e,t){return`domain(${ie(e.scaleName(t))})`}function MP(e){return e.parent&&Qd(e.parent)&&!e.parent.parent}const Mf="_brush",HW="_scale_trigger",$h="geo_interval_init_tick",GW="_init",GEe="_center",WEe={defined:e=>e.type==="interval",parse:(e,t,n)=>{var r;if(e.hasProjection){const i={...ye(n.select)?n.select:{}};i.fields=[To],i.encodings||(i.encodings=n.value?Z(n.value):[Io,Do]),n.select={type:"interval",...i}}if(t.translate&&!ra.defined(t)){const i=`!event.item || event.item.mark.name !== ${ie(t.name+Mf)}`;for(const o of t.events){if(!o.between){ne(`${o} is not an ordered event stream for interval selections.`);continue}const s=me((r=o.between[0]).filter??(r.filter=[]));s.indexOf(i)<0&&s.push(i)}}},signals:(e,t,n)=>{const r=t.name,i=r+Ml,o=Bn(t.project.hasChannel).filter(a=>a.channel===Lt||a.channel===Nn),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(VEe(e,t,l,s&&s[l.index])),[])),e.hasProjection){const a=ie(e.projectionName()),l=e.projectionName()+GEe,{x:u,y:c}=t.project.hasChannel,f=u&&u.signals.visual,d=c&&c.signals.visual,h=u?s&&s[u.index]:`${l}[0]`,p=c?s&&s[c.index]:`${l}[1]`,g=_=>e.getSizeSignalRef(_).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:r+GW,init:`[scale(${a}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),(!u||!c)&&(n.find(k=>k.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${ie(e.getName("marks"))}}, unit.mark)`,v=`{unit: ${Bu(e)}}`,b=`vlSelectionTuples(${y}, ${v})`,w=o.map(_=>_.signals.visual);return n.concat({name:i,on:[{events:[...w.length?[{signal:w.join(" || ")}]:[],...s?[{signal:$h}]:[]],update:b}]})}else{if(!ra.defined(t)){const u=r+HW,c=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=ie(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=xi(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:u,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${u} : {}`}]})}const a=o.map(u=>u.signals.data),l=`unit: ${Bu(e)}, fields: ${r+Am}, values`;return n.concat({name:i,...s?{init:`{${l}: ${fc(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(qt(e)&&e.hasProjection&&t.init&&(n.filter(i=>i.name===$h).length||n.unshift({name:$h,value:null,on:[{events:"timer{1}",update:`${$h} === null ? {} : ${$h}`}]})),n),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,s=i==null?void 0:i.signals.visual,a=o==null?void 0:o.signals.visual,l=`data(${ie(t.name+dc)})`;if(ra.defined(t)||!i&&!o)return n;const u={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const g of Z(u))u[g]=[{test:`${l}.length && ${l}[0].unit === ${Bu(e)}`,...u[g]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=Z(h).reduce((g,m)=>(g[m]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[m]},{value:null}],g),{});return[{name:`${r+Mf}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:r+Mf,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}};function VEe(e,t,n,r){const i=!e.hasProjection,o=n.channel,s=n.signals.visual,a=ie(i?e.scaleName(o):e.projectionName()),l=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(o===Lt?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${s}[0], clamp(${c}, 0, ${u})]`}],[]);if(i){const d=n.signals.data,h=ra.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:fc(r,!0,l)}:{value:[]};return f.push({events:{signal:t.name+HW},update:xi(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:fc(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===Lt?0:1,h=t.name+GW,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const qEe={defined:e=>e.type==="point",signals:(e,t,n)=>{const r=t.name,i=r+Am,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=Bn(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Mf):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${Bu(e)}, `;if(t.project.hasSelectionId)u+=`${To}: ${s}[${ie(To)}]`;else{const f=o.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${ie(e.vgField(d.channel,{}))}], ${s}[${ie(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${ie(d.field)}]`}).join(", ");u+=`fields: ${i}, values: [${f}]`}const c=t.events;return n.concat([{name:r+Ml,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}};function Yd(e,t,n,r){const i=Ob(t)&&t.condition,o=r(t);if(i){const a=me(i).map(l=>{const u=r(l);if(P_e(l)){const{param:c,empty:f}=l;return{test:lV(e,{param:c,empty:f}),...u}}else return{test:Rv(e,l.test),...u}});return{[n]:[...a,...o!==void 0?[o]:[]]}}else return o!==void 0?{[n]:o}:{}}function bO(e,t="text"){const n=e.encoding[t];return Yd(e,n,t,r=>Ub(r,e.config))}function Ub(e,t,n="datum"){if(e){if(Ao(e))return Nt(e.value);if(Ue(e)){const{format:r,formatType:i}=_v(e);return Z$({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function WW(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,s=n.tooltip;if(K(s))return{tooltip:FP({tooltip:s},o,i,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Yd(e,s,"tooltip",l=>{const u=Ub(l,i,a);if(u)return u;if(l===null)return;let c=vt("tooltip",r,i);if(c===!0&&(c={content:"encoding"}),pe(c))return{value:c};if(ye(c))return Se(c)?c:c.content==="encoding"?FP(n,o,i,t):{signal:a}})}}function VW(e,t,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o={},s=r?"datum.datum":"datum",a=[];function l(c,f){const d=Tc(f),h=Ar(c)?c:{...c,type:e[d].type},p=h.title||rO(h,i),g=me(p).join(", ").replaceAll(/"/g,'\\"');let m;if(an(f)){const y=f==="x"?"x2":"y2",v=ps(e[y]);if(Dn(h.bin)&&v){const b=ue(h,{expr:s}),w=ue(v,{expr:s}),{format:_,formatType:k}=_v(h);m=_m(b,w,_,k,i),o[y]=!0}}if((an(f)||f===qi||f===Fo)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:v}=_v(h);m=Z$({fieldOrDatumDef:h,format:y,formatType:v,expr:s,config:i,normalizeStack:!0}).signal}m??(m=Ub(h,i,s).signal),a.push({channel:f,key:g,value:m})}sO(e,(c,f)=>{te(c)?l(c,f):Nb(c)&&l(c.condition,f)});const u={};for(const{channel:c,key:f,value:d}of a)!o[c]&&!u[f]&&(u[f]=d);return u}function FP(e,t,n,{reactiveGeom:r}={}){const i=VW(e,t,n,{reactiveGeom:r}),o=Tl(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function YEe(e){const{markDef:t,config:n}=e,r=vt("aria",t,n);return r===!1?{}:{...r?{aria:r}:{},...XEe(e),...KEe(e)}}function XEe(e){const{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};const i=vt("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:t in Cbe?{}:{ariaRoleDescription:{value:t}}}function KEe(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return Yd(e,o,"description",l=>Ub(l,e.config));const s=vt("description",n,r);if(s!=null)return{description:Nt(s)};if(r.aria===!1)return{};const a=VW(t,i,r);if(!Et(a))return{description:{signal:Tl(a).map(([l,u],c)=>`"${c>0?"; ":""}${l}: " + (${u})`).join(" + ")}}}function _n(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;a===void 0&&(l??(l=vt(e,r,o,{vgChannel:s,ignoreVgConfig:!0})),l!==void 0&&(a=Nt(l)));const u=i[e];return Yd(t,u,s??e,c=>Q$({channel:e,channelDef:c,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function qW(e,t={filled:void 0}){const{markDef:n,encoding:r,config:i}=e,{type:o}=n,s=t.filled??vt("filled",n,i),a=tt(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=vt(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,u=vt(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...l?{fill:Nt(l)}:{},...u?{stroke:Nt(u)}:{}};return n.color&&(s?n.fill:n.stroke)&&ne(cG("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,..._n("color",e,{vgChannel:c,defaultValue:s?l:u}),..._n("fill",e,{defaultValue:r.fill?l:void 0}),..._n("stroke",e,{defaultValue:r.stroke?u:void 0})}}function JEe(e){const{encoding:t,mark:n}=e,r=t.order;return!Ql(n)&&Ao(r)?Yd(e,r,"zindex",i=>Nt(i.value)):{}}function bd({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:Q$({channel:o,channelDef:a,markDef:t,config:r==null?void 0:r.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:Nt(s),bandPosition:i})};const l=t[o];return l?{offsetType:"visual",offset:l}:{}}function er(e,t,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=t,l=i[e],u=i[ks(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=bd({channel:e,markDef:o,encoding:i,model:t,bandPosition:.5}),p=wO({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!l&&an(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:QEe({channel:e,channelDef:l,channel2Def:u,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||e]:g}:void 0}function QEe(e){const{channel:t,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=e;if(Ue(n)&&i&&t===i.fieldChannel){if(te(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return xv({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Lu(n,r,{suffix:"end"},{offset:o})}return K$(e)}function wO({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=e;return()=>{const a=Tc(n),l=Rl(n),u=vt(n,o,s,{vgChannel:l});if(u!==void 0)return $p(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const c=i.get("type");if(!tt([Vr.LOG,Vr.TIME,Vr.UTC],c)){if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[Zr(n)],mult:.5}}}}const ZEe={left:"x",center:"xc",right:"x2"},eSe={top:"y",middle:"yc",bottom:"y2"};function YW(e,t,n,r="middle"){if(e==="radius"||e==="theta")return Rl(e);const i=e==="x"?"align":"baseline",o=vt(i,t,n);let s;return Se(o)?(ne(rwe(i)),s=void 0):s=o,e==="x"?ZEe[s||(r==="top"?"left":"center")]:eSe[s||r]}function Av(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?XW(e,t,{defaultPos:n,defaultPos2:r}):er(e,t,{defaultPos:n})}function XW(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,s=ks(e),a=Zr(e),l=tSe(t,r,s),u=l[a]?YW(e,i,o):Rl(e);return{...er(e,t,{defaultPos:n,vgChannel:u}),...l}}function tSe(e,t,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=e,l=Tc(n),u=Zr(n),c=Rl(n),f=r[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in r||n in o?bd({channel:n,markDef:o,encoding:r,model:e}):bd({channel:l,markDef:o,encoding:r,model:e});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=Zr(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=nSe({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:O0(n,o)||O0(n,{[n]:mv(n,o,a.style),[u]:mv(u,o,a.style)})||O0(n,a[i])||O0(n,a.mark)||{[c]:wO({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function nSe({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:u}){return Ue(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Lu(t,o,{suffix:"start"},{offset:l}):K$({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:u})}function O0(e,t){const n=Zr(e),r=Rl(e);if(t[r]!==void 0)return{[r]:$p(e,t[r])};if(t[e]!==void 0)return{[r]:$p(e,t[e])};if(t[n]){const i=t[n];if(uc(i))ne(Jbe(n));else return{[n]:$p(e,i)}}}function Nl(e,t){const{config:n,encoding:r,markDef:i}=e,o=i.type,s=ks(t),a=Zr(t),l=r[t],u=r[s],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=i.orient,h=r[a]??r.size??vt("size",i,n,{vgChannel:a}),p=qH(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return te(l)&&(Rt(l.bin)||Dn(l.bin)||l.timeUnit&&!u)&&!(h&&!uc(h))&&!r[p]&&!$n(f)?oSe({fieldDef:l,fieldDef2:u,channel:t,model:e}):(Ue(l)&&$n(f)||g)&&!u?iSe(l,t,e):XW(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function rSe(e,t,n,r,i,o,s){if(uc(i))if(n){const l=n.get("type");if(l==="band"){let u=`bandwidth('${t}')`;i.band!==1&&(u=`${i.band} * ${u}`);const c=ha("minBandSize",{type:s},r);return{signal:c?`max(${ho(c)}, ${u})`:u}}else i.band!==1&&(ne(awe(l)),i=void 0)}else return{mult:i.band,field:{group:e}};else{if(Se(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(Jl(l)&&ct(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:u,rectBandPaddingInner:c}=r.scale,f=Qt(l,s==="bar"?u:c);if(Se(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(ct(f))return{signal:`${1-f} * ${e}`}}return{value:kv(r.view,e)-2}}function iSe(e,t,n){var N,O;const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=Zr(t),f=ks(t),d=qH(t),h=n.scaleName(d),p=n.getScaleComponent(A$(t)),g=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(i.size||r.size)&&(g?m=_n("size",n,{vgChannel:c,defaultRef:Nt(r.size)}):ne(fwe(r.type)));const y=!!m,v=WG({channel:t,fieldDef:e,markDef:r,config:o,scaleType:(N=u||p)==null?void 0:N.get("type"),useVlSizeChannel:g});m=m||{[c]:rSe(c,h||l,p||u,o,v,!!e,r.type)};const b=((O=u||p)==null?void 0:O.get("type"))==="band"&&uc(v)&&!y?"top":"middle",w=YW(t,r,o,b),_=w==="xc"||w==="yc",{offset:k,offsetType:E}=bd({channel:t,markDef:r,encoding:i,model:n,bandPosition:_?.5:0}),A=K$({channel:t,channelDef:e,markDef:r,config:o,scaleName:l,scale:u,stack:s,offset:k,defaultRef:wO({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:_?E==="encoding"?0:.5:Se(v)?{signal:`(1-${v})/2`}:uc(v)?(1-v.band)/2:0});if(c)return{[w]:A,...m};{const F=Rl(f),U=m[c],M=k?{...U,offset:k}:U;return{[w]:A,[F]:K(A)?[A[0],{...A[1],offset:M}]:{...A,offset:M}}}}function DP(e,t,n,r,i,o,s){if(jH(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(Se(n)||Se(i)||Se(r)||o){const u=ho(n),c=ho(i),f=ho(r),d=ho(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=u?`(${u} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return i=i||0,r+(n?-i-l:+i+l)}function oSe({fieldDef:e,fieldDef2:t,channel:n,model:r}){var O;const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),u=a?a.get("type"):void 0,c=a.get("reverse"),f=WG({channel:n,fieldDef:e,markDef:o,config:i,scaleType:u}),d=(O=r.component.axes[n])==null?void 0:O[0],h=(d==null?void 0:d.get("translate"))??.5,p=an(n)?vt("binSpacing",o,i)??0:0,g=ks(n),m=Rl(n),y=Rl(g),v=ha("minBandSize",o,i),{offset:b}=bd({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:w}=bd({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),_=N_e({fieldDef:e,scaleName:l}),k=DP(n,p,c,h,b,v,_),E=DP(g,p,c,h,w??b,v,_),A=Se(f)?{signal:`(1-${f.signal})/2`}:uc(f)?(1-f.band)/2:.5,N=$l({fieldDef:e,fieldDef2:t,markDef:o,config:i});if(Rt(e.bin)||e.timeUnit){const F=e.timeUnit&&N!==.5;return{[y]:IP({fieldDef:e,scaleName:l,bandPosition:A,offset:E,useRectOffsetField:F}),[m]:IP({fieldDef:e,scaleName:l,bandPosition:Se(A)?{signal:`1-${A.signal}`}:1-A,offset:k,useRectOffsetField:F})}}else if(Dn(e.bin)){const F=Lu(e,l,{},{offset:E});if(te(t))return{[y]:F,[m]:Lu(t,l,{},{offset:k})};if(Rc(e.bin)&&e.bin.step)return{[y]:F,[m]:{signal:`scale("${l}", ${ue(e,{expr:"datum"})} + ${e.bin.step})`,offset:k}}}ne(hG(g))}function IP({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return xv({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:Bb,endSuffix:jb}:{}})}const sSe=new Set(["aria","width","height"]);function Yi(e,t){const{fill:n=void 0,stroke:r=void 0}=t.color==="include"?qW(e):{};return{...aSe(e.markDef,t),...PP(e,"fill",n),...PP(e,"stroke",r),..._n("opacity",e),..._n("fillOpacity",e),..._n("strokeOpacity",e),..._n("strokeWidth",e),..._n("strokeDash",e),...JEe(e),...WW(e),...bO(e,"href"),...YEe(e)}}function PP(e,t,n){const{config:r,mark:i,markDef:o}=e;if(vt("invalid",o,r)==="hide"&&n&&!Ql(i)){const a=lSe(e,{invalid:!0,channels:wb});if(a)return{[t]:[{test:a,value:null},...me(n)]}}return n?{[t]:n}:{}}function aSe(e,t){return kbe.reduce((n,r)=>(!sSe.has(r)&&e[r]!==void 0&&t[r]!=="ignore"&&(n[r]=Nt(e[r])),n),{})}function lSe(e,{invalid:t=!1,channels:n}){const r=n.reduce((o,s)=>{const a=e.getScaleComponent(s);if(a){const l=a.get("type"),u=e.vgField(s,{expr:"datum"});u&&xi(l)&&(o[u]=!0)}return o},{}),i=Z(r);if(i.length>0){const o=t?"||":"&&";return i.map(s=>J$(s,t)).join(` ${o} `)}}function _O(e){const{config:t,markDef:n}=e;if(vt("invalid",n,t)){const i=uSe(e,{channels:Cs});if(i)return{defined:{signal:i}}}return{}}function uSe(e,{invalid:t=!1,channels:n}){const r=n.reduce((o,s)=>{var l;const a=e.getScaleComponent(s);if(a){const u=a.get("type"),c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&xi(u)&&(o[c]=!0)}return o},{}),i=Z(r);if(i.length>0){const o=t?"||":"&&";return i.map(s=>J$(s,t)).join(` ${o} `)}}function LP(e,t){if(t!==void 0)return{[e]:Nt(t)}}const t2="voronoi",KW={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(t2)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(Ql(o))return ne(Obe(o)),n;const s={name:e.getName(t2),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...WW(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((u,c)=>{const f=u.name??"";f===e.component.mark[0].name?a=c:f.indexOf(t2)>=0&&(l=!0)}),l||n.splice(a+1,0,s),n}},JW={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!dO(e.bind),parse:(e,t,n)=>oV(t,n),topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,s=t.init&&t.init[0],a=KW.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,u)=>{const c=Pt(`${r}_${l.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...s?{init:fc(s[u])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${ie(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter(u=>u.name===r+Ml)[0],s=r+Am,a=i.items.map(u=>Pt(`${r}_${u.field}`)),l=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},Tv="_toggle",QW={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Tv,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Ml,r=t.name+Tv;return`${r} ? null : ${n}, `+(t.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${Bu(e)}}, `)+`${r} ? ${n} : null`}},cSe={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=pe(t.clear)?Gl(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(JW.defined(t))for(const r of t.project.items){const i=n.findIndex(o=>o.name===Pt(`${t.name}_${r.field}`));i!==-1&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const i of t.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===t.name+Ml);r(i,"null"),QW.defined(t)&&(i=n.findIndex(o=>o.name===t.name+Tv),r(i,"false"))}return n}},ZW={defined:e=>{const t=e.resolve==="global"&&e.bind&&dO(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==To;return t&&!n&&ne(Fbe),t&&n},parse:(e,t,n)=>{const r=Be(n);if(r.select=pe(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},oV(t,r),ye(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=me(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=J_(t.bind)?t.bind.legend:"click",o=pe(i)?Gl(i,"view"):me(i);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=J_(t.bind)&&t.bind.legend,o=s=>a=>{const l=Be(a);return l.markname=s,l};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${Pt(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(c=>c.name===l).length===0){const c=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(d=>d.name===r+Ml),s=r+Am,a=i.items.filter(d=>d.hasLegend).map(d=>Pt(`${r}_${Pt(d.field)}_legend`)),u=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(o.update=u,delete o.value,delete o.on);const c=n.find(d=>d.name===r+Tv),f=J_(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function fSe(e,t,n){var i;const r=(i=e.fieldDef(t))==null?void 0:i.field;for(const o of Bn(e.component.selection??{})){const s=o.project.hasField[r]??o.project.hasChannel[t];if(s&&ZW.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const eV="_translate_anchor",tV="_translate_delta",dSe={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const r=t.name,i=ra.defined(t),o=r+eV,{x:s,y:a}=t.project.hasChannel;let l=Gl(t.translate,"scope");return i||(l=l.map(u=>(u.between[0].markname=r+Mf,u))),n.push({name:o,value:{},on:[{events:l.map(u=>u.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${i?fk(e,Lt):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${i?fk(e,Nn):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:r+tV,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&zP(e,t,s,"width",n),a!==void 0&&zP(e,t,a,"height",n),n}};function zP(e,t,n,r,i){const o=t.name,s=o+eV,a=o+tV,l=n.channel,u=ra.defined(t),c=i.filter(_=>_.name===n.signals[u?"data":"visual"])[0],f=e.getSizeSignalRef(r).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=u?l===Lt?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,y=`${g}${a}.${l} / ${u?`${f}`:`span(${m})`}`,v=!u||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",b=u?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",w=`${v}(${m}, ${y}${b})`;c.on.push({events:{signal:a},update:u?w:`clampRange(${w}, 0, ${f})`})}const nV="_zoom_anchor",rV="_zoom_delta",hSe={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=ra.defined(t),o=r+rV,{x:s,y:a}=t.project.hasChannel,l=ie(e.scaleName(Lt)),u=ie(e.scaleName(Nn));let c=Gl(t.zoom,"scope");return i||(c=c.map(f=>(f.markname=r+Mf,f))),n.push({name:r+nV,on:[{events:c,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&BP(e,t,s,"width",n),a!==void 0&&BP(e,t,a,"height",n),n}};function BP(e,t,n,r,i){const o=t.name,s=n.channel,a=ra.defined(t),l=i.filter(v=>v.name===n.signals[a?"data":"visual"])[0],u=e.getSizeSignalRef(r).signal,c=e.getScaleComponent(s),f=c&&c.get("type"),d=a?fk(e,s):l.name,h=o+rV,p=`${o}${nV}.${s}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${u})`})}const dc="_store",Ml="_tuple",pSe="_modify",iV="vlSelectionResolve",Hb=[qEe,WEe,HEe,QW,JW,ra,ZW,cSe,dSe,hSe,KW];function gSe(e){let t=e.parent;for(;t&&!_o(t);)t=t.parent;return t}function Bu(e,{escape:t}={escape:!0}){let n=t?ie(e.name):e.name;const r=gSe(e);if(r){const{facet:i}=r;for(const o of Mi)i[o]&&(n+=` + '__facet_${o}_' + (facet[${ie(r.vgField(o))}])`)}return n}function EO(e){return Bn(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function oV(e,t){(pe(t.select)||!t.select.on)&&delete e.events,(pe(t.select)||!t.select.clear)&&delete e.clear,(pe(t.select)||!t.select.toggle)&&delete e.toggle}function dk(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...dk(e.object)),t.push(...dk(e.property))),t)}function sV(e){return e.object.type==="MemberExpression"?sV(e.object):e.object.name==="datum"}function aV(e){const t=UR(e),n=new Set;return t.visit(r=>{r.type==="MemberExpression"&&sV(r)&&n.add(dk(r).slice(1).join("."))}),n}class Xd extends wt{clone(){return new Xd(null,this.model,Be(this.filter))}constructor(t,n,r){super(t),this.model=n,this.filter=r,this.expr=Rv(this.model,this.filter,this),this._dependentFields=aV(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function mSe(e,t){const n={},r=e.config.selection;if(!t||!t.length)return n;for(const i of t){const o=Pt(i.name),s=i.select,a=pe(s)?s:s.type,l=ye(s)?Be(s):{type:a},u=r[a];for(const d in u)d==="fields"||d==="encodings"||(d==="mark"&&(l[d]={...u[d],...l[d]}),(l[d]===void 0||l[d]===!0)&&(l[d]=Be(u[d]??l[d])));const c=n[o]={...l,name:o,type:a,init:i.value,bind:i.bind,events:pe(l.on)?Gl(l.on,"scope"):me(Be(l.on))},f=Be(i);for(const d of Hb)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function lV(e,t,n,r="datum"){const i=pe(t)?t:t.param,o=Pt(i),s=ie(o+dc);let a;try{a=e.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${ie(a.resolve)})`,c=`${l}${s}, ${r}${u}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function uV(e,t,n){const r=Pt(t),i=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&ne(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${ie(o)}.`);else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,ne((a.length?"Multiple ":"No ")+`matching ${ie(i)} encoding found for selection ${ie(n.param)}. Using "field": ${ie(o)}.`)):o=a[0].field}return`${s.name}[${ie(Hi(o))}]`}function ySe(e,t){for(const[n,r]of Tl(e.component.selection??{})){const i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new Er(new Xd(t,e,{param:n}),i,At.Lookup,e.component.data.outputNodeRefCounts)}}function Rv(e,t,n){return Rp(t,r=>pe(r)?r:Ywe(r)?lV(e,r,n):kG(r))}function vSe(e,t){if(e)return K(e)&&!Pa(e)?e.map(n=>rO(n,t)).join(", "):e}function n2(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}function sp(e,t,n,r={header:!1}){var f,d;const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:u,...c}=e.combine();if(!i){for(const h in c){const p=J_e[h],g=c[h];if(p&&p!==t&&p!=="both")delete c[h];else if(Cm(g)){const{condition:m,...y}=g,v=me(m),b=pP[h];if(b){const{vgProp:w,part:_}=b,k=[...v.map(E=>{const{test:A,...N}=E;return{test:Rv(null,A),...N}}),y];n2(c,_,w,k),delete c[h]}else if(b===null){const w={signal:v.map(_=>{const{test:k,...E}=_;return`${Rv(null,k)} ? ${QI(E)} : `}).join("")+QI(y)};c[h]=w}}else if(Se(g)){const m=pP[h];if(m){const{vgProp:y,part:v}=m;n2(c,v,y,g),delete c[h]}}tt(["labelAlign","labelBaseline"],h)&&c[h]===null&&delete c[h]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Et(c.encode)&&delete c.encode}return{scale:s,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Qt(u,0)}}else{if(!r.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&Se(c.encode.labels.update.text)&&(p=oc(a,"datum.label",c.encode.labels.update.text.signal)),n2(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of tW)e.hasAxisPart(p)||delete c.encode[p];Et(c.encode)&&delete c.encode}const h=vSe(l,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Qt(u,0)}}}}function cV(e){const{axes:t}=e.component,n=[];for(const r of Cs)if(t[r]){for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function xSe(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(i=>sp(i,"grid",t)),...r.map(i=>sp(i,"grid",t)),...n.map(i=>sp(i,"main",t)),...r.map(i=>sp(i,"main",t))].filter(i=>i)}function jP(e,t,n,r){return Object.assign.apply(null,[{},...e.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...Z(s),...Z(a)]),u={};for(const c of l.values())u[c]={signal:`${r.signal} === "${o}" ? ${ho(s[c])} : ${ho(a[c])}`};return u}return t[i]})])}function bSe(e,t,n,r){const i=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:RG(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=Se(n)?"axisOrient":`axis${mm(n)}`,a=[...i,...i.map(u=>o+u.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:jP(a,r,e,n),vgAxisConfig:jP(l,r,e,n),axisConfigStyle:wSe([...l,...a],r)}}function wSe(e,t){var r;const n=[{}];for(const i of e){let o=(r=t[i])==null?void 0:r.style;if(o){o=me(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function hk(e,t,n,r={}){var o;const i=rG(e,n,t);if(i!==void 0)return{configFrom:"style",configValue:i};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=r[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:r[s][e]};return{}}const UP={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??_Se(n,e),gridScale:({model:e,channel:t})=>ESe(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||dV(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||fV(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??kSe(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??CSe(t.type,n,te(t)&&!!t.timeUnit,te(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??TSe({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:RSe,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const r=hV(t,n);if(r!==void 0)return r;const i=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return oG(i?[dP(i)]:[],te(s)?[dP(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>$Se(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??OSe(n,t)};function _Se(e,t){return!$n(e)&&te(t)&&!Rt(t==null?void 0:t.bin)&&!Dn(t==null?void 0:t.bin)}function ESe(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function SSe(e,t,n,r,i){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return Se(o)?o:_g(o);{const{configValue:s}=hk("labelAngle",r,t==null?void 0:t.style,i);return s!==void 0?_g(s):n===Lt&&tt([V$,W$],e.type)&&!(te(e)&&e.timeUnit)?270:void 0}}function pk(e){return`(((${e.signal} % 360) + 360) % 360)`}function fV(e,t,n,r){if(e!==void 0)if(n==="x"){if(Se(e)){const i=pk(e),o=Se(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(Nc(r)&&GG(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((u,c)=>`${kG({field:o,timeUnit:s,equal:u})} ? ${c} : `).join("")+a.length;t=new wd(t,{calculate:l,as:_d(r,i,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${et(this.transform)}`}}function _d(e,t,n){return ue(e,{prefix:t,suffix:"sort_index",...n??{}})}function Gb(e,t){return tt(["top","bottom"],t)?"column":tt(["left","right"],t)||e==="row"?"row":"column"}function Ed(e,t,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return Qt((t||{})[e],i[e],n.header[e])}function Wb(e,t,n,r){const i={};for(const o of e){const s=Ed(o,t||{},n,r);s!==void 0&&(i[o]=s)}return i}const SO=["row","column"],kO=["header","footer"];function NSe(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=Wb(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),l=Gb(t,a),u=_g(s);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...gV(u,l),...pV(l,u,o),...mV(r,i,t,x2e,vW)}}}function pV(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=dV(t,e==="row"?"left":"top",e==="row"?"y":"x");return r?{align:r}:{}}function gV(e,t){const n=fV(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function MSe(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of kO)if(n[i])for(const o of n[i]){const s=DSe(e,t,i,n,o);s!=null&&r.push(s)}return r}function FSe(e,t){const{sort:n}=e;return is(n)?{field:ue(n,{expr:"datum"}),order:n.order??"ascending"}:K(n)?{field:_d(e,t,{expr:"datum"}),order:"ascending"}:{field:ue(e,{expr:"datum"}),order:n??"ascending"}}function gk(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=Wb(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=Z$({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=Gb(t,a);return{text:{signal:l?oc(oc(l,"datum.label",u),"datum.value",ue(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...gV(o,c),...pV(c,o,s),...mV(n,e,t,b2e,xW)}}function DSe(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=e.config?e.config:void 0;if(s&&i.labels){const{labelOrient:f}=Wb(["labelOrient"],s.header,a,t);(t==="row"&&!tt(["top","bottom"],f)||t==="column"&&!tt(["left","right"],f))&&(o=gk(s,t,a))}const l=_o(e)&&!Em(e.facet),u=i.axes,c=(u==null?void 0:u.length)>0;if(o||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:FSe(s,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const ISe={column:{start:0,end:1},row:{start:1,end:0}};function PSe(e,t){return ISe[t][e]}function LSe(e,t){const n={};for(const r of Mi){const i=e[r];if(i!=null&&i.facetFieldDef){const{titleAnchor:o,titleOrient:s}=Wb(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=Gb(r,s),l=PSe(o,a);l!==void 0&&(n[a]=l)}}return Et(n)?void 0:n}function mV(e,t,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=Ed(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[i[s]]=a)}return o}function CO(e){return[...N0(e,"width"),...N0(e,"height"),...N0(e,"childWidth"),...N0(e,"childHeight")]}function N0(e,t){const n=t==="width"?"x":"y",r=e.component.layoutSize.get(t);if(!r||r==="merged")return[];const i=e.getSizeSignalRef(t).signal;if(r==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if($n(s)&&Jl(a)){const l=e.scaleName(n);return _o(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[HP(l,a)]:[HP(l,a),{name:i,update:yV(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=ak(e.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function HP(e,t){const n=`${e}_step`;return Se(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function yV(e,t,n){const r=t.get("type"),i=t.get("padding"),o=Qt(t.get("paddingOuter"),i);let s=t.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${ho(s)}, ${ho(o)}) * ${e}_step`}function vV(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function xV(e,t){return Z(e).reduce((n,r)=>{const i=e[r];return{...n,...Yd(t,i,r,o=>Nt(o.value))}},{})}function bV(e,t){if(_o(t))return e==="theta"?"independent":"shared";if(Qd(t))return"shared";if(MO(t))return an(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function AO(e,t){const n=e.scale[t],r=an(t)?"axis":"legend";return n==="independent"?(e[r][t]==="shared"&&ne(mwe(t)),"independent"):e[r][t]||"shared"}const zSe={...E2e,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},wV=Z(zSe);class BSe extends Sa{}const GP={symbols:jSe,gradient:USe,labels:HSe,entries:GSe};function jSe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:u}=n,c=s.filled&&u!=="trail";let f={...Tbe({},n,x_e),...qW(n,{filled:c})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?_V(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||c&&r===Jr)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=Nt(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=Nt(g??1));else if(K(f.fill)){const m=mk(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Nt(m))}}if(f.stroke){if(r==="stroke"||!c&&r===Jr)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(K(f.stroke)){const m=Qt(mk(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==wa){const m=te(t)&&SV(n,i,t);m?f.opacity=[{test:m,...Nt(g??1)},Nt(l.legend.unselectedOpacity)]:g&&(f.opacity=Nt(g))}return f={...f,...e},Et(f)?void 0:f}function USe(e,{model:t,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=t;let a={};const u=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?_V(s.opacity)||o.opacity:void 0;return u&&(a.opacity=Nt(u)),a={...a,...e},Et(a)?void 0:a}function HSe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=te(t)?SV(n,i,t):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=o;let f;cc(c)?f=go({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:s}):u===void 0&&c===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=go({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&te(t)&&t.timeUnit===void 0&&(f=go({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return Et(d)?void 0:d}function GSe(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function _V(e){return EV(e,(t,n)=>Math.max(t,n.value))}function mk(e){return EV(e,(t,n)=>Qt(t,n.value))}function EV(e,t){if(z_e(e))return me(e.condition).reduce(t,e.value);if(Ao(e))return e.value}function SV(e,t,n){const r=t.get("selections");if(!(r!=null&&r.length))return;const i=ie(n.field);return r.map(o=>`(!length(data(${ie(Pt(o)+dc)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const WP={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return BG(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return jG(r,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??JSe(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??QSe(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??VSe(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>Nf(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Of(n)&&po(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>WSe(t,e)};function WSe(e,t){const n=e.values;if(K(n))return eW(t,n);if(Se(n))return n}function VSe(e,t,n,r){if(t!=="shape"){const i=mk(n)??r;if(i)return i}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function qSe(e){const{legend:t}=e;return Qt(t.type,YSe(e))}function YSe({channel:e,timeUnit:t,scaleType:n}){if(Of(e)){if(tt(["quarter","month","day"],t))return"symbol";if(po(n))return"gradient"}return"symbol"}function XSe({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??KSe(n,t)}function KSe(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function JSe({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(po(i))return n==="horizontal"?r==="top"||r==="bottom"?VP(t,"width",s,o):s:VP(t,"height",l,a)}function VP(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function QSe(e){if(tt(["quantile","threshold","log","symlog"],e))return"greedy"}function kV(e){const t=qt(e)?ZSe(e):rke(e);return e.component.legends=t,t}function ZSe(e){const{encoding:t}=e,n={};for(const r of[Jr,...wW]){const i=hn(t[r]);!i||!e.getScaleComponent(r)||r===Qr&&te(i)&&i.type===qd||(n[r]=nke(e,r))}return n}function eke(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function tke(e,t,n,r){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(r==null?void 0:r.title))return!0}return e===(n||{})[t]}function nke(e,t){var w;let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,s=o.legend,a=new BSe({},eke(e,t));fSe(e,t,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),c=hn(i[t]),f=te(c)?(w=Rn(c.timeUnit))==null?void 0:w.unit:void 0,d=n.orient||o.legend.orient||"right",h=qSe({legend:n,channel:t,timeUnit:f,scaleType:u}),p=XSe({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:u,orient:d,legendType:h,direction:p};for(const _ of wV){if(h==="gradient"&&_.startsWith("symbol")||h==="symbol"&&_.startsWith("gradient"))continue;const k=_ in WP?WP[_](g):n[_];if(k!==void 0){const E=tke(k,_,n,e.fieldDef(t));(E||o.legend[_]===void 0)&&a.set(_,k,E)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),v={},b={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const k=xV(m[_]??{},e),E=_ in GP?GP[_](k,b):k;E!==void 0&&!Et(E)&&(v[_]={...y!=null&&y.length&&te(c)?{name:`${Pt(c.field)}_legend_${_}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:E})}return Et(v)||a.set("encode",v,!!(n!=null&&n.encoding)),a}function rke(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){kV(r);for(const i of Z(r.component.legends))n.legend[i]=AO(e.component.resolve,i),n.legend[i]==="shared"&&(t[i]=CV(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of Z(t))for(const i of e.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return t}function CV(e,t){var o,s,a,l;if(!e)return t.clone();const n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const u of wV){const c=Ol(e.getWithExplicit(u),t.getWithExplicit(u),u,"legend",(f,d)=>{switch(u){case"symbolType":return ike(f,d);case"title":return aG(f,d);case"type":return i=!0,ri("symbol")}return zb(f,d,u,"legend")});e.setWithExplicit(u,c)}return i&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&gv(e.implicit,["encode","gradient"]),(l=(a=e.explicit)==null?void 0:a.encode)!=null&&l.gradient&&gv(e.explicit,["encode","gradient"])),e}function ike(e,t){return t.value==="circle"?t:e}function oke(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}function AV(e){const t=e.component.legends,n={};for(const i of Z(t)){const o=e.getScaleComponent(i),s=St(o.get("domains"));if(n[s])for(const a of n[s])CV(a,t[i])||n[s].push(t[i]);else n[s]=[t[i].clone()]}return Bn(n).flat().map(i=>ske(i,e.config)).filter(i=>i!==void 0)}function ske(e,t){var s,a,l;const{disable:n,labelExpr:r,selections:i,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const u=o.encode.symbols.update;u.fill&&u.fill.value!=="transparent"&&!u.stroke&&!o.stroke&&(u.stroke={value:"transparent"});for(const c of wW)o[c]&&delete u[c]}if(o.title||delete o.title,r!==void 0){let u=r;(l=(a=o.encode)==null?void 0:a.labels)!=null&&l.update&&Se(o.encode.labels.update.text)&&(u=oc(r,"datum.label",o.encode.labels.update.text.signal)),oke(o,"labels","text",{signal:u})}return o}}function ake(e){return Qd(e)||MO(e)?lke(e):TV(e)}function lke(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),TV(e))}function TV(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const l=Se(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return tt(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const uke=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class RV extends Sa{constructor(t,n,r,i){super({...n},{name:t}),this.specifiedProjection=n,this.size=r,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function $V(e){e.component.projection=qt(e)?cke(e):hke(e)}function cke(e){if(e.hasProjection){const t=Ir(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=n?fke(e):void 0,o=new RV(e.projectionName(!0),{...Ir(e.config.projection)??{},...t??{}},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function fke(e){const t=[],{encoding:n}=e;for(const r of[[Io,Do],[Gi,Po]])(hn(n[r[0]])||hn(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Qr)&&e.typedFieldDef(Qr).type===qd&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(At.Main)),t}function dke(e,t){const n=x$(uke,i=>!!(!Oe(e.explicit,i)&&!Oe(t.explicit,i)||Oe(e.explicit,i)&&Oe(t.explicit,i)&&fi(e.get(i),t.get(i))));if(fi(e.size,t.size)){if(n)return e;if(fi(e.explicit,{}))return t;if(fi(t.explicit,{}))return e}return null}function hke(e){if(e.children.length===0)return;let t;for(const r of e.children)$V(r);const n=x$(e.children,r=>{const i=r.component.projection;if(i)if(t){const o=dke(t,i);return o&&(t=o),!!o}else return t=i,!0;else return!0});if(t&&n){const r=e.projectionName(!0),i=new RV(r,t.specifiedProjection,t.size,Be(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function pke(e,t,n,r){if(km(t,n)){const i=qt(e)?e.axis(n)??e.legend(n)??{}:{},o=ue(t,{expr:"datum"}),s=ue(t,{expr:"datum",binSuffix:"end"});return{formulaAs:ue(t,{binSuffix:"range",forAs:!0}),formula:_m(o,s,i.format,i.formatType,r)}}return{}}function OV(e,t){return`${ZH(e)}_${t}`}function gke(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function TO(e,t,n){const r=Mb(n,void 0)??{},i=OV(r,t);return e.getName(`${i}_bins`)}function mke(e){return"as"in e}function qP(e,t,n){let r,i;mke(e)?r=pe(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:r=[ue(e,{forAs:!0}),ue(e,{binSuffix:"end",forAs:!0})];const o={...Mb(t,void 0)},s=OV(o,e.field),{signal:a,extentSignal:l}=gke(n,s);if(_b(o.extent)){const c=o.extent;i=uV(n,c.param,c),delete o.extent}const u={bin:o,field:e.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:u}}class ss extends wt{clone(){return new ss(null,Be(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{if(Ar(o)&&Rt(o.bin)){const{key:a,binComponent:l}=qP(o,o.bin,n);i[a]={...l,...i[a],...pke(n,o,s,n.config)}}return i},{});return Et(r)?null:new ss(t,r)}static makeFromTransform(t,n,r){const{key:i,binComponent:o}=qP(n,n.bin,r);return new ss(t,{[i]:o})}merge(t,n){for(const r of Z(t.bins))r in this.bins?(n(t.bins[r].signal,this.bins[r].signal),this.bins[r].as=Qo([...this.bins[r].as,...t.bins[r].as],et)):this.bins[r]=t.bins[r];for(const r of t.children)t.removeChild(r),r.parent=this;t.remove()}producedFields(){return new Set(Bn(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(Bn(this.bins).map(t=>t.field))}hash(){return`Bin ${et(this.bins)}`}assemble(){return Bn(this.bins).flatMap(t=>{const n=[],[r,...i]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:Hi(t.field),as:r,signal:t.signal,..._b(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:Hi(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const l of i)for(let u=0;u<2;u++)n.push({type:"formula",expr:ue({field:r[u]},{expr:"datum"}),as:l[u]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function yke(e,t,n,r){var o;const i=qt(r)?r.encoding[ks(t)]:void 0;if(Ar(n)&&qt(r)&&VG(n,i,r.markDef,r.config)){e.add(ue(n,{})),e.add(ue(n,{suffix:"end"}));const{mark:s,markDef:a,config:l}=r,u=$l({fieldDef:n,markDef:a,config:l});Eg(s)&&u!==.5&&an(t)&&(e.add(ue(n,{suffix:Bb})),e.add(ue(n,{suffix:jb}))),n.bin&&km(n,t)&&e.add(ue(n,{binSuffix:"range"}))}else if(HH(t)){const s=UH(t);e.add(r.getName(s))}else e.add(ue(n));return Nc(n)&&a_e((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function vke(e,t){for(const n of Z(t)){const r=t[n];for(const i of Z(r))n in e?e[n][i]=new Set([...e[n][i]??[],...r[i]]):e[n]={[i]:r[i]}}}class wo extends wt{clone(){return new wo(null,new Set(this.dimensions),Be(this.measures))}constructor(t,n,r){super(t),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:u}=s;if(l)if(l==="count")i["*"]??(i["*"]={}),i["*"].count=new Set([ue(s,{forAs:!0})]);else{if(da(l)||Kl(l)){const c=da(l)?"argmin":"argmax",f=l[c];i[f]??(i[f]={}),i[f][c]=new Set([ue({op:c,field:f},{forAs:!0})])}else i[u]??(i[u]={}),i[u][l]=new Set([ue(s,{forAs:!0})]);_a(a)&&n.scaleDomain(a)==="unaggregated"&&(i[u]??(i[u]={}),i[u].min=new Set([ue({field:u,aggregate:"min"},{forAs:!0})]),i[u].max=new Set([ue({field:u,aggregate:"max"},{forAs:!0})]))}else yke(o,a,s,n)}),o.size+Z(i).length===0)?null:new wo(t,o,i)}static makeFromTransform(t,n){const r=new Set,i={};for(const o of n.aggregate){const{op:s,field:a,as:l}=o;s&&(s==="count"?(i["*"]??(i["*"]={}),i["*"].count=new Set([l||ue(o,{forAs:!0})])):(i[a]??(i[a]={}),i[a][s]=new Set([l||ue(o,{forAs:!0})])))}for(const o of n.groupby??[])r.add(o);return r.size+Z(i).length===0?null:new wo(t,r,i)}merge(t){return FH(this.dimensions,t.dimensions)?(vke(this.measures,t.measures),!0):(Nwe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Z(this.measures)])}producedFields(){const t=new Set;for(const n of Z(this.measures))for(const r of Z(this.measures[n])){const i=this.measures[n][r];i.size===0?t.add(`${r}_${n}`):i.forEach(t.add,t)}return t}hash(){return`Aggregate ${et({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],r=[];for(const o of Z(this.measures))for(const s of Z(this.measures[o]))for(const a of this.measures[o][s])r.push(a),t.push(s),n.push(o==="*"?null:Hi(o));return{type:"aggregate",groupby:[...this.dimensions].map(Hi),ops:t,fields:n,as:r}}}class Kd extends wt{constructor(t,n,r,i){super(t),this.model=n,this.name=r,this.data=i;for(const o of Mi){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[ue(s),...Rt(a)?[ue(s,{binSuffix:"end"})]:[]],...is(l)?{sortField:l}:K(l)?{sortIndexField:_d(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Mi)this[n]&&(t+=` ${n.charAt(0)}:${et(this[n])}`);return t}get fields(){var n;const t=[];for(const r of Mi)(n=this[r])!=null&&n.fields&&t.push(...this[r].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Mi)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Cs){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if($n(i)&&Jl(o)){const s=Vb(this.childModel,n),a=NO(s);a?t[n]=a:ne(M$(n))}}}return t}assembleRowColumnHeaderData(t,n,r){const i={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:u}=this[t];if(l){const{op:c=Rb,field:f}=l;o.push(f),s.push(c),a.push(ue(l,{forAs:!0}))}else u&&(o.push(u),s.push("max"),a.push(u));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){var l;const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const u of SO){for(const c of kO){const f=(r[u]&&r[u][c])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){o[u]=!0;break}}if(o[u]){const c=`length(data("${this.facet.name}"))`,f=u==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};i.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[na,ta])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&t.push(...a)}return t}}function YP(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function xke(e,t){const n=_$(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const r=YP(t.slice(5,t.length));return`timeParse(${n},'${r}')`}else if(t.startsWith("utc:")){const r=YP(t.slice(4,t.length));return`utcParse(${n},'${r}')`}else return ne(jbe(t)),null}function bke(e){const t={};return Ey(e.filter,n=>{if(SG(n)){let r=null;P$(n)?r=ai(n.equal):z$(n)?r=ai(n.lte):L$(n)?r=ai(n.lt):B$(n)?r=ai(n.gt):j$(n)?r=ai(n.gte):U$(n)?r=n.range[0]:H$(n)&&(r=(n.oneOf??n.in)[0]),r&&($c(r)?t[n.field]="date":ct(r)?t[n.field]="number":pe(r)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function wke(e){const t={};function n(r){vd(r)?t[r.field]="date":r.type==="quantitative"&&xbe(r.aggregate)?t[r.field]="number":fd(r.field)>1?r.field in t||(t[r.field]="flatten"):Nc(r)&&is(r.sort)&&fd(r.sort.field)>1&&(r.sort.field in t||(t[r.sort.field]="flatten"))}if((qt(e)||_o(e))&&e.forEachFieldDef((r,i)=>{if(Ar(r))n(r);else{const o=Tc(i),s=e.fieldDef(o);n({...r,type:s.type})}}),qt(e)){const{mark:r,markDef:i,encoding:o}=e;if(Ql(r)&&!e.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];te(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function _ke(e){const t={};if(qt(e)&&e.component.selection)for(const n of Z(e.component.selection)){const r=e.component.selection[n];for(const i of r.project.items)!i.channel&&fd(i.field)>1&&(t[i.field]="flatten")}return t}class tr extends wt{clone(){return new tr(null,Be(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${et(this._parse)}`}static makeExplicit(t,n,r){var s;let i={};const o=n.data;return!pl(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(i=o.format.parse),this.makeWithAncestors(t,i,{},r)}static makeWithAncestors(t,n,r,i){for(const a of Z(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:ne(iP(a,r[a],l.value)))}for(const a of Z(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:ne(iP(a,n[a],l)))}const o=new Sa(n,r);i.copyAll(o);const s={};for(const a of Z(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return Z(s).length===0||i.parseNothing?null:new tr(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of Z(this._parse)){const r=this._parse[n];fd(n)===1&&(t[n]=r)}return t}producedFields(){return new Set(Z(this._parse))}dependentFields(){return new Set(Z(this._parse))}assembleTransforms(t=!1){return Z(this._parse).filter(n=>t?fd(n)>1:!0).map(n=>{const r=xke(n,this._parse[n]);return r?{type:"formula",expr:r,as:E$(n)}:null}).filter(n=>n!==null)}}class Fl extends wt{clone(){return new Fl(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([To])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:To}}}class Tm extends wt{clone(){return new Tm(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${et(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class Rm extends wt{clone(){return new Rm(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${et(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class hc extends wt{constructor(t){super(null),t??(t={name:"source"});let n;if(pl(t)||(n=t.format?{...Wr(t.format,["parse"])}:{}),Sg(t))this._data={values:t.values};else if(xd(t)){if(this._data={url:t.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(t.url)[1];tt(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else zW(t)?this._data={values:[{type:"Sphere"}]}:(PW(t)||pl(t))&&(this._data={});this._generator=pl(t),t.name&&(this._name=t.name),n&&!Et(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var XP=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},Eke=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ap;function RO(e){return e instanceof hc||e instanceof Tm||e instanceof Rm}class $O{constructor(){ap.set(this,void 0),XP(this,ap,!1,"f")}setModified(){XP(this,ap,!0,"f")}get modifiedFlag(){return Eke(this,ap,"f")}}ap=new WeakMap;class Mc extends $O{getNodeDepths(t,n,r){r.set(t,n);for(const i of t.children)this.getNodeDepths(i,n+1,r);return r}optimize(t){const r=[...this.getNodeDepths(t,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class OO extends $O{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Ske extends OO{mergeNodes(t,n){const r=n.shift();for(const i of n)t.removeChild(i),i.parent=r,i.remove()}run(t){const n=t.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(t,r[i]))}}class kke extends OO{constructor(t){super(),this.requiresSelectionId=t&&EO(t)}run(t){t instanceof Fl&&(this.requiresSelectionId&&(RO(t.parent)||t.parent instanceof wo||t.parent instanceof tr)||(this.setModified(),t.remove()))}}class Cke extends $O{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let r=new Set;t instanceof os&&(r=t.producedFields(),b$(r,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const i of t.children)this.run(i,new Set([...n,...r]))}}class Ake extends OO{constructor(){super()}run(t){t instanceof Er&&!t.isRequired()&&(this.setModified(),t.remove())}}class Tke extends Mc{run(t){if(!RO(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof tr)if(t instanceof tr)this.setModified(),t.merge(n);else{if(w$(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Rke extends Mc{run(t){const n=[...t.children],r=t.children.filter(i=>i instanceof tr);if(t.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of Z(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Et(i)){this.setModified();const s=new tr(t,i);for(const a of n){if(a instanceof tr)for(const l of Z(i))delete a.parse[l];t.removeChild(a),a.parent=s,a instanceof tr&&Z(a.parse).length===0&&a.remove()}}}}}class $ke extends Mc{run(t){t instanceof Er||t.numChildren()>0||t instanceof Kd||t instanceof hc||(this.setModified(),t.remove())}}class Oke extends Mc{run(t){const n=t.children.filter(i=>i instanceof os),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class Nke extends Mc{run(t){const n=t.children.filter(i=>i instanceof wo),r={};for(const i of n){const o=et(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of Z(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class Mke extends Mc{constructor(t){super(),this.model=t}run(t){const n=!(RO(t)||t instanceof Xd||t instanceof tr||t instanceof Fl),r=[],i=[];for(const o of t.children)o instanceof ss&&(n&&!w$(t.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof ss?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class Fke extends Mc{run(t){const n=[...t.children];if(!ic(n,s=>s instanceof Er)||t.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof Er){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof Er)a=l;else break}i.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class Fc extends wt{clone(){return new Fc(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Qo(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??ue(t)}hash(){return`JoinAggregateTransform ${et(this.transform)}`}assemble(){const t=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:t,...i!==void 0?{groupby:i}:{}}}}function Dke(e){return e.stack.stackBy.reduce((t,n)=>{const r=n.fieldDef,i=ue(r);return i&&t.push(i),t},[])}function Ike(e){return K(e)&&e.every(t=>pe(t))&&e.length>1}class ia extends wt{clone(){return new ia(null,Be(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(Qt(f.order,"ascending"));const u={field:a,order:l};let c;return Ike(o)?c=o:pe(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new ia(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:u,facetby:[],as:c})}static makeFromEncoding(t,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,u=o.map(h=>{const p=i[h];return ps(p)}).filter(h=>!!h),c=Dke(n),f=n.encoding.order;let d;if(K(f)||te(f))d=iG(f);else{const h=qG(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.push(g),p.order.push(h),p),{field:[],order:[]})}return new ia(t,{dimensionFieldDefs:u,stackField:n.vgField(s),facetby:[],stackby:c,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${et(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:r}=this._stack;return t.length>0?t.map(i=>i.bin?n?[ue(i,{binSuffix:"mid"})]:[ue(i,{}),ue(i,{binSuffix:"end"})]:[ue(i)]).flat():r??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:u}=this._stack;if(l)for(const c of r){const{bandPosition:f=.5,bin:d}=c;if(d){const h=ue(c,{expr:"datum"}),p=ue(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${f}*${h}+${1-f}*${p}`,as:ue(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...o,...n],key:ue(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:u,offset:a}),t}}class Jd extends wt{clone(){return new Jd(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Qo(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??ue(t)}hash(){return`WindowTransform ${et(this.transform)}`}assemble(){const t=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>O$(f)))return{type:"joinaggregate",as:r,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const u={field:a,order:l},c=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:t,sort:u,...c!==void 0?{ignorePeers:c}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function Pke(e){function t(n){if(!(n instanceof Kd)){const r=n.clone();if(r instanceof Er){const i=vk+r.getSource();r.setSource(i),e.model.component.data.outputNodes[i]=r}else(r instanceof wo||r instanceof ia||r instanceof Jd||r instanceof Fc)&&r.addDimensions(e.fields);for(const i of n.children.flatMap(t))i.parent=r;return[r]}return n.children.flatMap(t)}return t}function yk(e){if(e instanceof Kd)if(e.numChildren()===1&&!(e.children[0]instanceof Er)){const t=e.children[0];(t instanceof wo||t instanceof ia||t instanceof Jd||t instanceof Fc)&&t.addDimensions(e.fields),t.swapWithParent(),yk(e)}else{const t=e.model.component.data.main;NV(t);const n=Pke(e),r=e.children.map(n).flat();for(const i of r)i.parent=t}else e.children.map(yk)}function NV(e){if(e instanceof Er&&e.type===At.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Kd||(t.swapWithParent(),NV(e))}}const vk="scale_",M0=5;function xk(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!xk(t.children))return!1}return!0}function Ki(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function KP(e,t,n){let r=e.sources,i=!1;return i=Ki(new Ake,r)||i,i=Ki(new kke(t),r)||i,r=r.filter(o=>o.numChildren()>0),i=Ki(new $ke,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Ki(new Tke,r)||i,i=Ki(new Mke(t),r)||i,i=Ki(new Cke,r)||i,i=Ki(new Rke,r)||i,i=Ki(new Nke,r)||i,i=Ki(new Oke,r)||i,i=Ki(new Ske,r)||i,i=Ki(new Fke,r)||i),e.sources=r,i}function Lke(e,t){xk(e.sources);let n=0,r=0;for(let i=0;it(n))}}function MV(e){qt(e)?zke(e):Bke(e)}function zke(e){const t=e.component.scales;for(const n of Z(t)){const r=Uke(e,n);if(t[n].setWithExplicit("domains",r),Gke(e,n),e.component.data.isFaceted){let o=e;for(;!_o(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)Ks(a)&&(a.data=vk+a.data.replace(vk,""))}}}function Bke(e){for(const n of e.children)MV(n);const t=e.component.scales;for(const n of Z(t)){let r,i=null;for(const o of e.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=Ol(r,s.getWithExplicit("domains"),"domains","scale",bk);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&ne(Pbe),i=a}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}function jke(e,t,n,r){if(e==="unaggregated"){const{valid:i,reason:o}=JP(t,n);if(!i){ne(o);return}}else if(e===void 0&&r.useUnaggregatedDomain){const{valid:i}=JP(t,n);if(i)return"unaggregated"}return e}function Uke(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=jke(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),t==="x"&&hn(r.x2)?hn(r.x)?Ol($a(n,i,e,"x"),$a(n,i,e,"x2"),"domain","scale",bk):$a(n,i,e,"x2"):t==="y"&&hn(r.y2)?hn(r.y)?Ol($a(n,i,e,"y"),$a(n,i,e,"y2"),"domain","scale",bk):$a(n,i,e,"y2"):$a(n,i,e,t)}function Hke(e,t,n){return e.map(r=>({signal:`{data: ${Fb(r,{timeUnit:n,type:t})}}`}))}function r2(e,t,n){var i;const r=(i=Rn(n))==null?void 0:i.unit;return t==="temporal"||r?Hke(e,t,r):[e]}function $a(e,t,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,u=hn(i[r]),{type:c}=u,f=u.timeUnit;if(s_e(t)){const p=$a(e,void 0,n,r),g=r2(t.unionWith,c,f);return Vo([...g,...p.value])}else{if(Se(t))return Vo([t]);if(t&&t!=="unaggregated"&&!OG(t))return Vo(r2(t,c,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return ri([[0,1]]);const p=n.requestDataName(At.Main);return ri([{data:p,field:n.vgField(r,{suffix:"start"})},{data:p,field:n.vgField(r,{suffix:"end"})}])}const d=_a(r)&&te(u)?Wke(n,r,e):void 0;if(As(u)){const p=r2([u.datum],c,f);return ri(p)}const h=u;if(t==="unaggregated"){const p=n.requestDataName(At.Main),{field:g}=u;return ri([{data:p,field:ue({field:g,aggregate:"min"})},{data:p,field:ue({field:g,aggregate:"max"})}])}else if(Rt(h.bin)){if($n(e))return ri(e==="bin-ordinal"?[]:[{data:wg(d)?n.requestDataName(At.Main):n.requestDataName(At.Raw),field:n.vgField(r,km(h,r)?{binSuffix:"range"}:{}),sort:d===!0||!ye(d)?{field:n.vgField(r,{}),op:"min"}:d}]);{const{bin:p}=h;if(Rt(p)){const g=TO(n,h.field,p);return ri([new wn(()=>{const m=n.getSignalName(g);return`[${m}.start, ${m}.stop]`})])}else return ri([{data:n.requestDataName(At.Main),field:n.vgField(r,{})}])}}else if(h.timeUnit&&tt(["time","utc"],e)){const p=i[ks(r)];if(VG(h,p,o,a)){const g=n.requestDataName(At.Main),m=$l({fieldDef:h,fieldDef2:p,markDef:o,config:a}),y=Eg(s)&&m!==.5;return ri([{data:g,field:n.vgField(r,y?{suffix:Bb}:{})},{data:g,field:n.vgField(r,{suffix:y?jb:"end"})}])}}return ri(d?[{data:wg(d)?n.requestDataName(At.Main):n.requestDataName(At.Raw),field:n.vgField(r),sort:d}]:[{data:n.requestDataName(At.Main),field:n.vgField(r)}])}function i2(e,t){const{op:n,field:r,order:i}=e;return{op:n??(t?"sum":Rb),...r?{field:Hi(r)}:{},...i?{order:i}:{}}}function Gke(e,t){var a;const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=(a=e.fieldDef(t))==null?void 0:a.bin,o=OG(r)&&r,s=Rc(i)&&_b(i.extent)&&i.extent;(o||s)&&n.set("selectionExtent",o??s,!0)}function Wke(e,t,n){if(!$n(n))return;const r=e.fieldDef(t),i=r.sort;if(GG(i))return{op:"min",field:_d(r,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(is(i)){const a=o&&!s.has(i.field);return i2(i,a)}else if(HG(i)){const{encoding:a,order:l}=i,u=e.fieldDef(a),{aggregate:c,field:f}=u,d=o&&!s.has(f);if(da(c)||Kl(c))return i2({field:ue(u),order:l},d);if(O$(c)||!c)return i2({op:c,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(tt(["ascending",void 0],i))return!0}}function JP(e,t){const{aggregate:n,type:r}=e;return n?pe(n)&&!wbe.has(n)?{valid:!1,reason:uwe(n)}:r==="quantitative"&&t==="log"?{valid:!1,reason:cwe(e)}:{valid:!0}:{valid:!1,reason:lwe(e)}}function bk(e,t,n,r){return e.explicit&&t.explicit&&ne(gwe(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Vke(e){const t=Qo(e.map(s=>{if(Ks(s)){const{sort:a,...l}=s;return l}return s}),et),n=Qo(e.map(s=>{if(Ks(s)){const a=s.sort;return a!==void 0&&!wg(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),et);if(t.length===0)return;if(t.length===1){const s=e[0];if(Ks(s)&&n.length>0){let a=n[0];if(n.length>1){ne(sP);const l=n.filter(u=>ye(u)&&"op"in u&&u.op!=="min");n.every(u=>ye(u)&&"op"in u)&&l.length===1?a=l[0]:a=!0}else if(ye(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Qo(n.map(s=>wg(s)||!("op"in s)||pe(s.op)&&s.op in ybe?s:(ne(ywe(s)),!0)),et);let i;r.length===1?i=r[0]:r.length>1&&(ne(sP),i=!0);const o=Qo(e.map(s=>Ks(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function NO(e){if(Ks(e)&&pe(e.field))return e.field;if(_be(e)){let t;for(const n of e.fields)if(Ks(n)&&pe(n.field)){if(!t)t=n.field;else if(t!==n.field)return ne(vwe),t}return ne(xwe),t}else if(Ebe(e)){ne(bwe);const t=e.fields[0];return pe(t)?t:void 0}}function Vb(e,t){const r=e.component.scales[t].get("domains").map(i=>(Ks(i)&&(i.data=e.lookupDataSource(i.data)),i));return Vke(r)}function FV(e){return Qd(e)||MO(e)?e.children.reduce((t,n)=>t.concat(FV(n)),QP(e)):QP(e)}function QP(e){return Z(e.component.scales).reduce((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:u,reverse:c,...f}=i,d=qke(i.range,o,n,e),h=Vb(e,n),p=a?jEe(e,a,r,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function qke(e,t,n,r){if(an(n)){if(Jl(e))return{step:{signal:`${t}_step`}}}else if(ye(e)&&Ks(e))return{...e,data:r.lookupDataSource(e.data)};return e}class DV extends Sa{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:ic(this.get("domains"),t=>K(t)&&t.length===2&&ct(t[0])&&t[0]<=0&&ct(t[1])&&t[1]>=0)}}const Yke=["range","scheme"];function Xke(e){const t=e.component.scales;for(const n of wb){const r=t[n];if(!r)continue;const i=Kke(n,e);r.setWithExplicit("range",i)}}function ZP(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:r,field:i}=n,o=Zr(t),s=e.getName(o);if(ye(r)&&r.binned&&r.step!==void 0)return new wn(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${e.getSignalName(s)} / (${l})`});if(Rt(r)){const a=TO(e,i,r);return new wn(()=>{const l=e.getSignalName(a),u=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(s)} / (${u})`})}}}function Kke(e,t){const n=t.specifiedScales[e],{size:r}=t,o=t.getScaleComponent(e).get("type");for(const f of Yke)if(n[f]!==void 0){const d=ik(o,f),h=NG(e,f);if(!d)ne(fG(o,f,e));else if(h)ne(h);else switch(f){case"range":{const p=n.range;if(K(p)){if(an(e))return Vo(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return wn.fromName(y,m)}return g}))}else if(ye(p))return Vo({data:t.requestDataName(At.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return Vo(p)}case"scheme":return Vo(Jke(n[f]))}}const s=e===Lt||e==="xOffset"?"width":"height",a=r[s];if(gs(a)){if(an(e))if($n(o)){const f=PV(a,t,e);if(f)return Vo({step:f})}else ne(dG(s));else if(xm(e)){const f=e===Wl?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=LV(a,o);if(p)return Vo(p)}}}const{rangeMin:l,rangeMax:u}=n,c=Qke(e,t);return(l!==void 0||u!==void 0)&&ik(o,"rangeMin")&&K(c)&&c.length===2?Vo([l??c[0],u??c[1]]):ri(c)}function Jke(e){return o_e(e)?{scheme:e.name,...Wr(e,["name"])}:{scheme:e}}function IV(e,t,n,{center:r}={}){const i=Zr(e),o=t.getName(i),s=t.getSignalName.bind(t);return e===Nn&&xi(n)?r?[wn.fromName(a=>`${s(a)}/2`,o),wn.fromName(a=>`-${s(a)}/2`,o)]:[wn.fromName(s,o),0]:r?[wn.fromName(a=>`-${s(a)}/2`,o),wn.fromName(a=>`${s(a)}/2`,o)]:[0,wn.fromName(s,o)]}function Qke(e,t){const{size:n,config:r,mark:i,encoding:o}=t,{type:s}=hn(o[e]),l=t.getScaleComponent(e).get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case Lt:case Nn:{if(tt(["point","band"],l)){const f=zV(e,n,r.view);if(gs(f))return{step:PV(f,t,e)}}return IV(e,t,l)}case Wl:case Vd:return Zke(e,t,l);case ba:{const f=t.component.scales[e].get("zero"),d=BV(i,f,r),h=nCe(i,n,t,r);return gd(l)?tCe(d,h,eCe(l,r,u,e)):[d,h]}case qi:return[0,Math.PI*2];case Ac:return[0,360];case Fo:return[0,new wn(()=>{const f=t.getSignalName("width"),d=t.getSignalName("height");return`min(${f},${d})/2`})];case Yl:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case Xl:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Qr:return"symbol";case Jr:case Es:case Ss:return l==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case wa:case Vl:case ql:return[r.scale.minOpacity,r.scale.maxOpacity]}}function PV(e,t,n){const{encoding:r}=t,i=t.getScaleComponent(n),o=A$(n),s=r[o];if(EW({step:e,offsetIsDiscrete:Ue(s)&&CG(s.type)})==="offset"&&iW(r,o)){const l=t.getScaleComponent(o);let c=`domain('${t.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${c} / (1-${Abe(f)})`}}else return e.step}function LV(e,t){if(EW({step:e,offsetIsDiscrete:$n(t)})==="offset")return{step:e.step}}function Zke(e,t,n){const r=e===Wl?"x":"y",i=t.getScaleComponent(r);if(!i)return IV(r,t,n,{center:!0});const o=i.get("type"),s=t.scaleName(r),{markDef:a,config:l}=t;if(o==="band"){const u=zV(r,t.size,t.config.view);if(gs(u)){const c=LV(u,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const u=t.encoding[r];if(te(u)&&u.timeUnit){const c=_G(u.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=$l({fieldDef:u,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Se(f)?`${f.signal}/2`+h:`${f/2+d}`,g=Se(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return NH(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function zV(e,t,n){const r=e===Lt?"width":"height",i=t[r];return i||Cv(n,r)}function eCe(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&K(n)?n.length+1:(ne(Rwe(r)),3)}}function tCe(e,t,n){const r=()=>{const i=ho(t),o=ho(e),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return Se(t)?new wn(r):{signal:r()}}function BV(e,t,n){if(t)return Se(t)?{signal:`${t.signal} ? 0 : ${BV(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Eb("size",e))}const e5=.95;function nCe(e,t,n,r){const i={x:ZP(n,"x"),y:ZP(n,"y")};switch(e){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=t5(t,i,r.view);return ct(o)?o-1:new wn(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=t5(t,i,r.view);return ct(o)?Math.pow(e5*o,2):new wn(()=>`pow(${e5} * ${o.signal}, 2)`)}}throw new Error(Eb("size",e))}function t5(e,t,n){const r=gs(e.width)?e.width.step:kv(n,"width"),i=gs(e.height)?e.height.step:kv(n,"height");return t.x||t.y?new wn(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function jV(e,t){qt(e)?rCe(e,t):HV(e,t)}function rCe(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=e;for(const a of Z(n)){const l=s[a],u=n[a],c=e.getScaleComponent(a),f=hn(i[a]),d=l[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=ik(h,t),y=NG(a,t);if(d!==void 0&&(m?y&&ne(y):ne(fG(h,t,a))),m&&y===void 0)if(d!==void 0){const v=f.timeUnit,b=f.type;switch(t){case"domainMax":case"domainMin":$c(l[t])||b==="temporal"||v?u.set(t,{signal:Fb(l[t],{type:b,timeUnit:v})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const v=t in n5?n5[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:oW(i,a),hasSecondaryRangeChannel:!!i[ks(a)]}):r.scale[t];v!==void 0&&u.set(t,v,!1)}}}const n5={bins:({model:e,fieldOrDatumDef:t})=>te(t)?iCe(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>oCe(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>sCe(e,t,n,r,i,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>aCe(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>lCe(e,t,n.type,r,i.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>uCe(e,t,n,r,i.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{const i=te(e)?e.sort:void 0;return cCe(t,i,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>fCe(e,t,n,r,i,o.scale,s)};function UV(e){qt(e)?Xke(e):HV(e,"range")}function HV(e,t){const n=e.component.scales;for(const r of e.children)t==="range"?UV(r):jV(r,t);for(const r of Z(n)){let i;for(const o of e.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(t);i=Ol(i,a,t,"scale",IW((l,u)=>{switch(t){case"range":return l.step&&u.step?l.step-u.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function iCe(e,t){const n=t.bin;if(Rt(n)){const r=TO(e,t.field,n);return new wn(()=>e.getSignalName(r))}else if(Dn(n)&&Rc(n)&&n.step!==void 0)return{step:n.step}}function oCe(e,t){if(tt([Jr,Es,Ss],e)&&t!=="nominal")return"hcl"}function sCe(e,t,n,r,i,o){var s;if(!((s=ps(o))!=null&&s.bin||K(n)||i!=null||r!=null||tt([Vr.TIME,Vr.UTC],e)))return an(t)?!0:void 0}function aCe(e,t,n,r,i,o){if(an(e)){if(po(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(te(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===Vr.POINT)return n.pointPadding}}function lCe(e,t,n,r,i,o=!1){if(e===void 0){if(an(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,bandWithNestedOffsetPaddingInner:u}=i;return o?u:Qt(s,n==="bar"?a:l)}else if(xm(t)&&r===Vr.BAND)return i.offsetBandPaddingInner}}function uCe(e,t,n,r,i,o=!1){if(e===void 0){if(an(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===Vr.BAND)return Qt(s,Se(r)?{signal:`${r.signal}/2`}:r/2)}else if(xm(t)){if(n===Vr.POINT)return .5;if(n===Vr.BAND)return i.offsetBandPaddingOuter}}}function cCe(e,t,n,r){if(n==="x"&&r.xReverse!==void 0)return xi(e)&&t==="descending"?Se(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(xi(e)&&t==="descending")return!0}function fCe(e,t,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&xi(i)){if(K(n)){const l=n[0],u=n[n.length-1];if(ct(l)&&l<=0&&ct(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!gd(i))return!0;if(!(te(t)&&t.bin)&&tt([...Cs,...ube],e)){const{orient:l,type:u}=r;return tt(["bar","area","line","trail"],u)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:tt(["bar","area"],u)&&!s?!0:o==null?void 0:o.zero}return!1}function dCe(e,t,n,r,i=!1){const o=hCe(t,n,r,i),{type:s}=e;return _a(t)?s!==void 0?d_e(t,s)?te(n)&&!f_e(s,n.type)?(ne(hwe(s,o)),o):s:(ne(dwe(t,s,o)),o):o:null}function hCe(e,t,n,r){var i;switch(t.type){case"nominal":case"ordinal":{if(Of(e)||X_(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&ne(K_(e,"ordinal")),"ordinal";if(an(e)||xm(e)){if(tt(["rect","bar","image","rule"],n.type)||r)return"band"}else if(n.type==="arc"&&e in $$)return"band";const o=n[Zr(e)];return uc(o)||yd(t)&&((i=t.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return Of(e)?"time":X_(e)==="discrete"?(ne(K_(e,"temporal")),"ordinal"):te(t)&&t.timeUnit&&Rn(t.timeUnit).utc?"utc":"time";case"quantitative":return Of(e)?te(t)&&Rt(t.bin)?"bin-ordinal":"linear":X_(e)==="discrete"?(ne(K_(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(uG(t.type))}function pCe(e,{ignoreRange:t}={}){GV(e),MV(e);for(const n of c_e)jV(e,n);t||UV(e)}function GV(e){qt(e)?e.component.scales=gCe(e):e.component.scales=yCe(e)}function gCe(e){const{encoding:t,mark:n,markDef:r}=e,i={};for(const o of wb){const s=hn(t[o]);if(s&&n===DG&&o===Qr&&s.type===qd)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const l=oW(t,o),u=dCe(a,o,s,r,l);i[o]=new DV(e.scaleName(`${o}`,!0),{value:u,explicit:a.type===u})}}return i}const mCe=IW((e,t)=>lP(e)-lP(t));function yCe(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const o of e.children){GV(o);for(const s of Z(o.component.scales))if((t=i.scale)[s]??(t[s]=bV(s,e)),i.scale[s]==="shared"){const a=r[s],l=o.component.scales[s].getWithExplicit("type");a?e_e(a.value,l.value)?r[s]=Ol(a,l,"type","scale",mCe):(i.scale[s]="independent",delete r[s]):r[s]=l}}for(const o of Z(r)){const s=e.scaleName(o,!0),a=r[o];n[o]=new DV(s,a);for(const l of e.children){const u=l.component.scales[o];u&&(l.renameScale(u.get("name"),s),u.merged=!0)}}return n}class o2{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function qt(e){return(e==null?void 0:e.type)==="unit"}function _o(e){return(e==null?void 0:e.type)==="facet"}function MO(e){return(e==null?void 0:e.type)==="concat"}function Qd(e){return(e==null?void 0:e.type)==="layer"}class FO{constructor(t,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.correctDataNames=l=>{var u,c,f;return(u=l.from)!=null&&u.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(c=l.from)==null?void 0:c.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=r,this.config=o,this.view=Ir(a),this.name=t.name??i,this.title=Pa(t.title)?{text:t.title}:t.title?Ir(t.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new o2,this.projectionNameMap=r?r.projectionNameMap:new o2,this.signalNameMap=r?r.signalNameMap:new o2,this.data=t.data,this.description=t.description,this.transforms=SEe(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:T2e(t,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:$b(t)||(r==null?void 0:r.component.data.isFaceted)&&t.data===void 0},layoutSize:new Sa,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Be(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){pCe(this)}parseProjection(){$V(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){kV(this)}assembleEncodeFromView(t){const{style:n,...r}=t,i={};for(const o of Z(r)){const s=r[o];s!==void 0&&(i[o]=Nt(s))}return i}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Nt(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n??{}}:Et(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:r,config:i}=this,o=LSe(r.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const r of Mi)t[r].title&&n.push(NSe(this,r));for(const r of SO)n=n.concat(MSe(this,r));return n}assembleAxes(){return xSe(this.component.axes,this.config)}assembleLegends(){return AV(this)}assembleProjections(){return ake(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},r={...eG(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(r.text)return tt(["unit","layer"],this.type)?tt(["middle",void 0],r.anchor)&&(r.frame??(r.frame="group")):r.anchor??(r.anchor="start"),Et(r)?void 0:r}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||_o(this.parent)?FV(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return Pt((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(At[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(t){if(_o(this.parent)){const n=vV(t),r=bb(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if($n(o)&&Jl(s)){const a=i.get("name"),l=Vb(this,r),u=NO(l);if(u){const c=ue({aggregate:"distinct",field:u},{expr:"datum"});return{signal:yV(a,i,c)}}else return ne(M$(r)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(WH(t)&&_a(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let r=this.component.selection[t];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(t,n)),!r)throw new Error(Nbe(n));return r}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(r=>r.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(r=>r.hasOrientSignalRef()))}}class WV extends FO{vgField(t,n={}){const r=this.fieldDef(t);if(r)return ue(r,n)}reduceFieldDef(t,n){return r2e(this.getMapping(),(r,i,o)=>{const s=ps(i);return s?t(r,s,o):r},n)}forEachFieldDef(t,n){sO(this.getMapping(),(r,i)=>{const o=ps(r);o&&t(o,i)},n)}}class qb extends wt{clone(){return new qb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${et(this.transform)}`}assemble(){const{density:t,...n}=this.transform,r={type:"kde",field:t,...n};return this.transform.groupby&&(r.resolve="shared"),r}}class Yb extends wt{clone(){return new Yb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${et(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class kg extends wt{clone(){return new kg(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n){const{config:r,mark:i,markDef:o}=n;if(vt("invalid",o,r)!=="filter")return null;const a=n.reduceFieldDef((l,u,c)=>{const f=_a(c)&&n.getScaleComponent(c);if(f){const d=f.get("type");xi(d)&&u.aggregate!=="count"&&!Ql(i)&&(l[u.field]=u)}return l},{});return Z(a).length?new kg(t,a):null}dependentFields(){return new Set(Z(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${et(this.filter)}`}assemble(){const t=Z(this.filter).reduce((n,r)=>{const i=this.filter[r],o=ue(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (isValid(${o}) && isFinite(+${o})))`):i.type==="quantitative"&&(n.push(`isValid(${o})`),n.push(`isFinite(+${o})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class Xb extends wt{clone(){return new Xb(this.parent,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${et(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Kb extends wt{clone(){return new Kb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${et(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Ff extends wt{clone(){return new Ff(null,Be(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(const i of[[Io,Do],[Gi,Po]]){const o=i.map(s=>{const a=hn(n.encoding[s]);return te(a)?a.field:As(a)?{expr:`${a.datum}`}:Ao(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new Ff(t,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(Qr)){const i=n.typedFieldDef(Qr);i.type===qd&&(t=new Ff(t,null,i.field,n.getName(`geojson_${r++}`)))}return t}constructor(t,n,r,i){super(t),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const t=(this.fields??[]).filter(pe);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${et(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Cg extends wt{clone(){return new Cg(null,this.projection,Be(this.fields),Be(this.as))}constructor(t,n,r,i){super(t),this.projection=n,this.fields=r,this.as=i}static parseAll(t,n){if(!n.projectionName())return t;for(const r of[[Io,Do],[Gi,Po]]){const i=r.map(s=>{const a=hn(n.encoding[s]);return te(a)?a.field:As(a)?{expr:`${a.datum}`}:Ao(a)?{expr:`${a.value}`}:void 0}),o=r[0]===Gi?"2":"";(i[0]||i[1])&&(t=new Cg(t,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(pe))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${et(this.fields)} ${et(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class ju extends wt{clone(){return new ju(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:r,step:i}=t;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(t,n){return new ju(t,n)}static makeFromEncoding(t,n){const r=n.encoding,i=r.x,o=r.y;if(te(i)&&te(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:u,frame:c,keyvals:f}=s.impute,d=aW(n.mark,r);return new ju(t,{impute:s.field,key:a.field,...l?{method:l}:{},...u!==void 0?{value:u}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${et(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:t,key:n,...r?{keyvals:oEe(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const u={type:"window",as:[`imputed_${t}_value`],ops:[i],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[l,u,c]}else return[l]}}class Jb extends wt{clone(){return new Jb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${et(this.transform)}`}assemble(){const{loess:t,on:n,...r}=this.transform;return{type:"loess",x:n,y:t,...r}}}class Ag extends wt{clone(){return new Ag(null,Be(this.transform),this.secondary)}constructor(t,n,r){super(t),this.transform=n,this.secondary=r}static make(t,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(sEe(s)){let l=YV(s.data,o);l||(l=new hc(s.data),o.push(l));const u=n.getName(`lookup_${i}`);a=new Er(l,u,At.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[u]=a}else if(aEe(s)){const l=s.param;r={as:l,...r};let u;try{u=n.getSelectionComponent(Pt(l),l)}catch{throw new Error(Dbe(l))}if(a=u.materialized,!a)throw new Error(Ibe(l))}return new Ag(t,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?me(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${et({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:me(this.transform.as)}:{}};else{let n=this.transform.as;pe(n)||(ne(Gbe),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Qb extends wt{clone(){return new Qb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${et(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Zb extends wt{clone(){return new Zb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${et(this.transform)}`}assemble(){const{regression:t,on:n,...r}=this.transform;return{type:"regression",x:n,y:t,...r}}}class ew extends wt{clone(){return new ew(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Qo((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${et(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:t,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class tw extends wt{clone(){return new tw(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${et(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function VV(e){let t=0;function n(r,i){if(r instanceof hc&&!r.isGenerator&&!xd(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof tr&&(r.parent instanceof hc&&!i.source?(i.format={...i.format??{},parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof Kd){i.name||(i.name=`data_${t++}`),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof Tm||r instanceof Rm||r instanceof kg||r instanceof Xd||r instanceof wd||r instanceof Cg||r instanceof wo||r instanceof Ag||r instanceof Jd||r instanceof Fc||r instanceof Kb||r instanceof Xb||r instanceof qb||r instanceof Jb||r instanceof Qb||r instanceof Zb||r instanceof Fl||r instanceof tw||r instanceof ew||r instanceof Yb)&&i.transform.push(r.assemble()),(r instanceof ss||r instanceof os||r instanceof ju||r instanceof ia||r instanceof Ff)&&i.transform.push(...r.assemble()),r instanceof Er&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof Er?r.setSource(i.name):(i.name||(i.name=`data_${t++}`),r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof Er&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${t++}`);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function vCe(e){const t=[],n=VV(t);for(const r of e.children)n(r,{source:e.name,name:null,transform:[]});return t}function xCe(e,t){const n=[],r=VV(n);let i=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function bCe(e){return e==="top"||e==="left"||Se(e)?"header":"footer"}function wCe(e){for(const t of Mi)_Ce(e,t);r5(e,"x"),r5(e,"y")}function _Ce(e,t){var s;const{facet:n,config:r,child:i,component:o}=e;if(e.channelHasField(t)){const a=n[t],l=Ed("title",null,r,t);let u=Nf(a,r,{allowDisabling:!0,includeDefault:l===void 0||!!l});i.component.layoutHeaders[t].title&&(u=K(u)?u.join(", "):u,u+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);const c=Ed("labelOrient",a.header,r,t),f=a.header!==null?Qt((s=a.header)==null?void 0:s.labels,r.header.labels,!0):!1,d=tt(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[d]:t==="facet"?[]:[qV(e,t,f)]}}}function qV(e,t,n){const r=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function r5(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=AO(i,t),i.axis[t]==="shared"){const o=t==="x"?"column":"row",s=r[o];for(const a of n.component.axes[t]){const l=bCe(a.get("orient"));s[l]??(s[l]=[qV(e,o,!1)]);const u=sp(a,"main",e.config,{header:!0});u&&s[l][0].axes.push(u),a.mainExtracted=!0}}}}function ECe(e){DO(e),$v(e,"width"),$v(e,"height")}function SCe(e){DO(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";$v(e,t),$v(e,n)}function DO(e){for(const t of e.children)t.parseLayoutSize()}function $v(e,t){const n=vV(t),r=bb(n),i=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),u=i.scale[r]??bV(r,e);if(u==="independent"&&l.value==="step"){s=void 0;break}if(s){if(u==="independent"&&s.value!==l.value){s=void 0;break}s=Ol(s,l,n,"")}else s=l}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function kCe(e){const{size:t,component:n}=e;for(const r of Cs){const i=Zr(r);if(t[i]){const o=t[i];n.layoutSize.set(i,gs(o)?"step":o,!0)}else{const o=CCe(e,i);n.layoutSize.set(i,o,!1)}}}function CCe(e,t){const n=t==="width"?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if($n(o)){const a=Cv(r.view,t);return Jl(s)||gs(a)?"step":a}else return ak(r.view,t)}else{if(e.hasProjection||e.mark==="arc")return ak(r.view,t);{const o=Cv(r.view,t);return gs(o)?o.step:o}}}function wk(e,t,n){return ue(t,{suffix:`by_${ue(e)}`,...n??{}})}class Op extends WV{constructor(t,n,r,i){super(t,"facet",n,r,i,t.resolve),this.child=BO(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Em(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=Z(t),r={};for(const i of n){if(![ta,na].includes(i)){ne(Eb(i,"facet"));break}const o=t[i];if(o.field===void 0){ne(nk(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(t,n){const r=iO(t,n);return r.header?r.header=Ir(r.header):r.header===null&&(r.header=null),r}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=nw(this),this.child.parseData()}parseLayoutSize(){DO(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),wCe(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Mi)for(const r of kO){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=Ed("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=Gb(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[l]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[l]??(t[l]={}),t[l][n]=.5),i.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,r=t?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Op))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Op?{...this.channelHasField("column")?{encode:{update:{columns:{field:ue(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],r=[];if(this.child instanceof Op){if(this.child.channelHasField("column")){const i=ue(this.child.facet.column);t.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of Cs){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if($n(s)&&Jl(a)){const l=Vb(this.child,i),u=NO(l);u?(t.push(u),n.push("distinct"),r.push(`distinct_${u}`)):ne(M$(i))}}}return{fields:t,ops:n,as:r}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const c of Mi){const f=this.facet[c];if(f){l.push(ue(f));const{bin:d,sort:h}=f;if(Rt(d)&&l.push(ue(f,{binSuffix:"end"})),is(h)){const{field:p,op:g=Rb}=h,m=wk(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(K(h)){const p=_d(f,c);o.push(p),s.push("max"),a.push(p)}}}const u=!!r&&!!i;return{name:t,data:n,groupby:l,...u||o.length>0?{aggregate:{...u?{cross:u}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,r=n[t];return r?is(r.sort)?[wk(r,r.sort,{expr:"datum"})]:K(r.sort)?[_d(r,t,{expr:"datum"})]:[ue(r,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,r=n[t];if(r){const{sort:i}=r;return[(is(i)?i.order:!K(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){var i;const{facet:t,config:n}=this;if(t.facet)return gk(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const o of SO)if(t[o]){const s=Ed("labelOrient",(i=t[o])==null?void 0:i.header,n,o);if(r[o].includes(s))return gk(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,r=vCe(n),i=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:Mi.map(l=>this.facetSortFields(l)).flat(),order:Mi.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup(PEe(this,[]))}]}getMapping(){return this.facet}}function ACe(e,t){const{row:n,column:r}=t;if(n&&r){let i=null;for(const o of[n,r])if(is(o.sort)){const{field:s,op:a=Rb}=o.sort;e=i=new Fc(e,{joinaggregate:[{op:a,field:s,as:wk(o,o.sort,{forAs:!0})}],groupby:[ue(o)]})}return i}return null}function YV(e,t){var n,r,i,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const l=(n=e.format)==null?void 0:n.mesh,u=(r=a.format)==null?void 0:r.feature;if(l&&u)continue;const c=(i=e.format)==null?void 0:i.feature;if((c||u)&&c!==u)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((l||f)&&l!==f)){if(Sg(e)&&Sg(a)){if(fi(e.values,a.values))return s}else if(xd(e)&&xd(a)){if(e.url===a.url)return s}else if(PW(e)&&e.name===s.dataName)return s}}return null}function TCe(e,t){if(e.data||!e.parent){if(e.data===null){const r=new hc({values:[]});return t.push(r),r}const n=YV(e.data,t);if(n)return pl(e.data)||(n.data.format=MH({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const r=new hc(e.data);return t.push(r),r}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function RCe(e,t,n){let r=0;for(const i of t.transforms){let o,s;if(yEe(i))s=e=new wd(e,i),o="derived";else if(yO(i)){const a=bke(i);s=e=tr.makeWithAncestors(e,{},a,n)??e,e=new Xd(e,t,i.filter)}else if(NW(i))s=e=ss.makeFromTransform(e,i,t),o="number";else if(xEe(i))o="date",n.getWithExplicit(i.field).value===void 0&&(e=new tr(e,{[i.field]:o}),n.set(i.field,o,!1)),s=e=os.makeFromTransform(e,i);else if(bEe(i))s=e=wo.makeFromTransform(e,i),o="number",EO(t)&&(e=new Fl(e));else if(OW(i))s=e=Ag.make(e,t,i,r++),o="derived";else if(pEe(i))s=e=new Jd(e,i),o="number";else if(gEe(i))s=e=new Fc(e,i),o="number";else if(wEe(i))s=e=ia.makeFromTransform(e,i),o="derived";else if(_Ee(i))s=e=new Kb(e,i),o="derived";else if(EEe(i))s=e=new Yb(e,i),o="derived";else if(mEe(i))s=e=new Xb(e,i),o="derived";else if(lEe(i))s=e=new ew(e,i),o="derived";else if(hEe(i))e=new tw(e,i);else if(vEe(i))s=e=ju.makeFromTransform(e,i),o="derived";else if(uEe(i))s=e=new qb(e,i),o="derived";else if(cEe(i))s=e=new Qb(e,i),o="derived";else if(fEe(i))s=e=new Zb(e,i),o="derived";else if(dEe(i))s=e=new Jb(e,i),o="derived";else{ne(Hbe(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function nw(e){var g;let t=TCe(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,s=!(i&&(pl(i)||xd(i)||Sg(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new DEe;pl(i)?(LW(i)?t=new Rm(t,i.sequence):vO(i)&&(t=new Tm(t,i.graticule)),s.parseNothing=!0):((g=i==null?void 0:i.format)==null?void 0:g.parse)===null&&(s.parseNothing=!0),t=tr.makeExplicit(t,e,s)??t,t=new Fl(t);const a=e.parent&&Qd(e.parent);(qt(e)||_o(e))&&a&&(t=ss.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=RCe(t,e,s));const l=_ke(e),u=wke(e);t=tr.makeWithAncestors(t,{},{...l,...u},s)??t,qt(e)&&(t=Ff.parseAll(t,e),t=Cg.parseAll(t,e)),(qt(e)||_o(e))&&(a||(t=ss.makeFromEncoding(t,e)??t),t=os.makeFromEncoding(t,e)??t,t=wd.parseAllForSortIndex(t,e));const c=e.getDataName(At.Raw),f=new Er(t,c,At.Raw,r);if(n[c]=f,t=f,qt(e)){const m=wo.makeFromEncoding(t,e);m&&(t=m,EO(e)&&(t=new Fl(t))),t=ju.makeFromEncoding(t,e)??t,t=ia.makeFromEncoding(t,e)??t}qt(e)&&(t=kg.make(t,e)??t);const d=e.getDataName(At.Main),h=new Er(t,d,At.Main,r);n[d]=h,t=h,qt(e)&&ySe(e,h);let p=null;if(_o(e)){const m=e.getName("facet");t=ACe(t,e.facet)??t,p=new Kd(t,e,m,h.getSource()),n[m]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:f,main:h,facetRoot:p,ancestorParse:s}}class $Ce extends FO{constructor(t,n,r,i){var o,s,a,l;super(t,"concat",n,r,i,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((l=(a=t.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&ne(Bbe),this.children=this.getChildren(t).map((u,c)=>BO(u,this,this.getName(`concat_${c}`),void 0,i))}parseData(){this.component.data=nw(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Z(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Pb(t)?t.vconcat:gO(t)?t.hconcat:t.concat}parseLayoutSize(){SCe(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=CO(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),r=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function OCe(e){return e===!1||e===null}const NCe={disable:1,gridScale:1,scale:1,...nW,labelExpr:1,encode:1},XV=Z(NCe);class IO extends Sa{constructor(t={},n={},r=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=r}clone(){return new IO(Be(this.explicit),Be(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!OCe(this.get(t))}hasOrientSignalRef(){return Se(this.explicit.orient)}}function MCe(e,t,n){const{encoding:r,config:i}=e,o=hn(r[t])??hn(r[ks(t)]),s=e.axis(t)||{},{format:a,formatType:l}=s;if(cc(l))return{text:go({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(md(o)==="quantitative"){if(yd(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:go({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:go({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(md(o)==="temporal"&&i.timeFormatType&&te(o)&&!o.timeUnit)return{text:go({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function FCe(e){return Cs.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[jCe(n,e)]),t),{})}const DCe={bottom:"top",top:"bottom",left:"right",right:"left"};function ICe(e){const{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(const i of e.children){i.parseAxesAndHeaders();for(const o of Z(i.component.axes))n.axis[o]=AO(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=PCe(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const i of Cs){for(const o of e.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){t[i]=(t[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!Se(a)){if(r[a]>0&&!l){const u=DCe[a];r[a]>r[u]&&s.set("orient",u,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&t[i]&&t[i].length>1)for(const[o,s]of(t[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function PCe(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let r=0;rn.clone());return e}function LCe(e,t){for(const n of XV){const r=Ol(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return aG(i,o);case"gridScale":return{explicit:i.explicit,value:Qt(i.value,o.value)}}return zb(i,o,n,"axis")});e.setWithExplicit(n,r)}return e}function zCe(e,t,n,r,i){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Se(n.labelAngle)?n.labelAngle:_g(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===hV(r,i))return!0}return e===n[t]}const BCe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function jCe(e,t){var y,v;let n=t.axis(e);const r=new IO,i=hn(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((v=s.axis)==null?void 0:v.orient)||ASe(e),l=t.getScaleComponent(e).get("type"),u=bSe(e,l,a,t.config),c=n!==void 0?!n:hk("disable",s.style,n==null?void 0:n.style,u).configValue;if(r.set("disable",c,n!==void 0),c)return r;n=n||{};const f=SSe(i,n,e,s.style,u),d=jG(n.formatType,i,l),h=BG(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const b of XV){const w=b in UP?UP[b](p):gP(b)?n[b]:void 0,_=w!==void 0,k=zCe(w,b,n,t,e);if(_&&k)r.set(b,w,k);else{const{configValue:E=void 0,configFrom:A=void 0}=gP(b)&&b!=="values"?hk(b,s.style,n.style,u):{},N=E!==void 0;_&&!N?r.set(b,w,k):(A!=="vgAxisConfig"||BCe.has(b)&&N||Cm(E)||Se(E))&&r.set(b,E,!1)}}const g=n.encoding??{},m=tW.reduce((b,w)=>{if(!r.hasAxisPart(w))return b;const _=xV(g[w]??{},t),k=w==="labels"?MCe(t,e,_):_;return k!==void 0&&!Et(k)&&(b[w]={update:k}),b},{});return Et(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function UCe({encoding:e,size:t}){for(const n of Cs){const r=Zr(n);gs(t[r])&&Za(e[n])&&(delete t[r],ne(dG(r)))}return t}const HCe={vgMark:"arc",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),...Nl(e,"radius"),...Nl(e,"theta")})},GCe={vgMark:"area",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Av("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Av("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),..._O(e)})},WCe={vgMark:"rect",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Nl(e,"x"),...Nl(e,"y")})},VCe={vgMark:"shape",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&te(n)&&n.type===qd?{field:ue(n,{expr:"datum"})}:{}}]}},qCe={vgMark:"image",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Nl(e,"x"),...Nl(e,"y"),...bO(e,"url")})},YCe={vgMark:"line",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),..._n("size",e,{vgChannel:"strokeWidth"}),..._O(e)})},XCe={vgMark:"trail",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),..._n("size",e),..._O(e)})};function PO(e,t){const{config:n}=e;return{...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),..._n("size",e),..._n("angle",e),...KCe(e,n,t)}}function KCe(e,t,n){return n?{shape:{value:n}}:_n("shape",e)}const JCe={vgMark:"symbol",encodeEntry:e=>PO(e)},QCe={vgMark:"symbol",encodeEntry:e=>PO(e,"circle")},ZCe={vgMark:"symbol",encodeEntry:e=>PO(e,"square")},eAe={vgMark:"rect",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Nl(e,"x"),...Nl(e,"y")})},tAe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Av("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Av("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),..._n("size",e,{vgChannel:"strokeWidth"})}}},nAe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Yi(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),...bO(e),..._n("size",e,{vgChannel:"fontSize"}),..._n("angle",e),...LP("align",rAe(e.markDef,n,t)),...LP("baseline",iAe(e.markDef,n,t)),...er("radius",e,{defaultPos:null}),...er("theta",e,{defaultPos:null})}}};function rAe(e,t,n){if(vt("align",e,n)===void 0)return"center"}function iAe(e,t,n){if(vt("baseline",e,n)===void 0)return"middle"}const oAe={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i=r==="horizontal"?"width":"height",o=r==="horizontal"?"height":"width";return{...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid",vgChannel:"xc"}),...er("y",e,{defaultPos:"mid",vgChannel:"yc"}),..._n("size",e,{defaultValue:sAe(e),vgChannel:i}),[o]:Nt(vt("thickness",n,t))}}};function sAe(e){const{config:t,markDef:n}=e,{orient:r}=n,i=r==="horizontal"?"width":"height",o=e.getScaleComponent(r==="horizontal"?"x":"y"),s=vt("size",n,t,{vgChannel:i})??t.tick.bandSize;if(s!==void 0)return s;{const a=o?o.get("range"):void 0;return a&&Jl(a)&&ct(a.step)?a.step*3/4:kv(t.view,i)*3/4}}const F0={arc:HCe,area:GCe,bar:WCe,circle:QCe,geoshape:VCe,image:qCe,line:YCe,point:JCe,rect:eAe,rule:tAe,square:ZCe,text:nAe,tick:oAe,trail:XCe};function aAe(e){if(tt([Ab,kb,g_e],e.mark)){const t=aW(e.mark,e.encoding);if(t.length>0)return lAe(e,t)}else if(e.mark===Cb){const t=tk.some(n=>vt(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return uAe(e)}return LO(e)}const i5="faceted_path_";function lAe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:i5+e.requestDataName(At.Main),data:e.requestDataName(At.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:LO(e,{fromPrefix:i5})}]}const o5="stack_group_";function uAe(e){var u;const[t]=LO(e,{fromPrefix:o5}),n=e.scaleName(e.stack.fieldChannel),r=(c={})=>e.vgField(e.stack.fieldChannel,c),i=(c,f)=>{const d=[r({prefix:"min",suffix:"start",expr:f}),r({prefix:"max",suffix:"start",expr:f}),r({prefix:"min",suffix:"end",expr:f}),r({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...cd(t.encode.update,["y","yc","y2","height",...tk]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Wr(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...cd(t.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Wr(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of tk){const f=ha(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):f&&(o[c]=Nt(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((u=e.stack.groupbyChannels)==null?void 0:u.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=ue(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ue(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=ha(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Nt(d)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(At.Main),name:o5+e.requestDataName(At.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function cAe(e){var a;const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,s=t.order;if(!(!K(s)&&Ao(s)&&ZS(s.value)||!s&&ZS(vt("order",i,o)))){if((K(s)||te(s))&&!n)return iG(s,{expr:"datum"});if(Ql(r)){const l=i.orient==="horizontal"?"y":"x",u=t[l];if(te(u)){const c=u.sort;if(K(c))return{field:ue(u,{prefix:l,suffix:"sort_index",expr:"datum"})};if(is(c))return{field:ue({aggregate:oO(e.encoding)?c.op:void 0,field:c.field},{expr:"datum"})};if(HG(c)){const f=e.fieldDef(c.encoding);return{field:ue(f,{expr:"datum"}),order:c.order}}else return c===null?void 0:{field:ue(u,{binSuffix:(a=e.stack)!=null&&a.impute?"mid":void 0,expr:"datum"})}}return}}}function LO(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,s=Qt(r.clip,fAe(e),dAe(e)),a=nG(r),l=i.key,u=cAe(e),c=hAe(e),f=vt("aria",r,o),d=F0[n].postEncodingTransform?F0[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:F0[n].vgMark,...s?{clip:!0}:{},...a?{style:a}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(At.Main)},encode:{update:F0[n].encodeEntry(e)},...d?{transform:d}:{}}]}function fAe(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function dAe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function hAe(e){if(!e.component.selection)return null;const t=Z(e.component.selection).length;let n=t,r=e.parent;for(;r&&n===0;)n=Z(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip}:null}class KV extends WV{constructor(t,n,r,i={},o){super(t,"unit",n,r,o,void 0,yP(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=hs(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=J2e(s,o,{graticule:t.data&&vO(t.data)}));const l=this.encoding=t2e(t.encoding||{},a,s.filled,o);this.markDef=TW(s,l,o),this.size=UCe({encoding:l,size:yP(t)?{...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:i}),this.stack=AW(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(u=>hO(u))}get hasProjection(){const{encoding:t}=this,n=this.mark===DG,r=t&&ebe.some(i=>Ue(t[i]));return n||r}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return wb.reduce((r,i)=>{const o=hn(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(t){const{domain:n,range:r}=t,i=Ir(t);return K(n)&&(i.domain=n.map(ai)),K(r)&&(i.range=r.map(ai)),i}initAxes(t){return Cs.reduce((n,r)=>{const i=t[r];if(Ue(i)||r===Lt&&Ue(t.x2)||r===Nn&&Ue(t.y2)){const o=Ue(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=Z(t),r={};for(const i of n){const o=t[i];r[i]=Cm(o)?tG(o):ai(o)}return r}initLegends(t){return cbe.reduce((n,r)=>{const i=hn(t[r]);if(i&&dbe(r)){const o=i.legend;n[r]=o&&Ir(o)}return n},{})}parseData(){this.component.data=nw(this)}parseLayoutSize(){kCe(this)}parseSelections(){this.component.selection=mSe(this,this.selection)}parseMarkGroup(){this.component.mark=aAe(this)}parseAxesAndHeaders(){this.component.axes=FCe(this)}assembleSelectionTopLevelSignals(t){return LEe(this,t)}assembleSignals(){return[...cV(this),...IEe(this,[])]}assembleSelectionData(t){return zEe(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return CO(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Qd(this.parent))&&(t=jW(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return zu(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return ps(n)}typedFieldDef(t){const n=this.fieldDef(t);return Ar(n)?n:null}}class zO extends FO{constructor(t,n,r,i,o){super(t,"layer",n,r,o,t.resolve,t.view);const s={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,l)=>{if(Lb(a))return new zO(a,this,this.getName(`layer_${l}`),s,o);if(Ea(a))return new KV(a,this,this.getName(`layer_${l}`),s,o);throw new Error(N$(a))})}parseData(){this.component.data=nw(this);for(const t of this.children)t.parseData()}parseLayoutSize(){ECe(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Z(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){ICe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),cV(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),CO(this))}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const r of this.children)for(const i of me(r.assembleGroupStyle()))t.add(i);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return BEe(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),AV(this))}}function BO(e,t,n,r,i){if($b(e))return new Op(e,t,n,i);if(Lb(e))return new zO(e,t,n,r,i);if(Ea(e))return new KV(e,t,n,r,i);if(k2e(e))return new $Ce(e,t,n,i);throw new Error(N$(e))}function pAe(e,t={}){t.logger&&$we(t.logger),t.fieldTitle&&QG(t.fieldTitle);try{const n=CW(Od(t.config,e.config)),r=DW(e,n),i=BO(r,null,"",void 0,n);return i.parse(),Lke(i.component.data,i),{spec:mAe(i,gAe(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&Owe(),t.fieldTitle&&V_e()}}function gAe(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):pe(t)&&(t={type:t}),i&&o&&NEe(t.type)){if(i==="step"&&o==="step")ne(tP()),t.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";ne(tP(bb(s)));const a=s==="width"?"height":"width";t.type=MEe(a)}}return{...Z(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...RP(n,!1),...RP(e,!0)}}function mAe(e,t,n={},r){const i=e.config?z2e(e.config):void 0,o=[].concat(e.assembleSelectionData([]),xCe(e.component.data,n)),s=e.assembleProjections(),a=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),..._W(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const yAe=Yxe.version,vAe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:fd,accessPathWithDatum:_$,compile:pAe,contains:tt,deepEqual:fi,deleteNestedProperty:gv,duplicate:Be,entries:Tl,every:x$,fieldIntersection:w$,flatAccessWithDatum:DH,getFirstDefined:Qt,hasIntersection:b$,hash:et,internalField:LH,isBoolean:wg,isEmpty:Et,isEqual:Kxe,isInternalField:zH,isNullOrFalse:ZS,isNumeric:pb,keys:Z,logicalExpr:Rp,mergeDeep:MH,never:NH,normalize:DW,normalizeAngle:_g,omit:Wr,pick:cd,prefixGenerator:ek,removePathFromField:E$,replaceAll:oc,replacePathInField:Hi,resetIdCounter:Qxe,setEqual:FH,some:ic,stringify:St,titleCase:mm,unique:Qo,uniqueId:PH,vals:Bn,varName:Pt,version:yAe},Symbol.toStringTag,{value:"Module"}));function JV(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var xAe="vega-themes",bAe="2.14.0",wAe="Themes for stylized Vega and Vega-Lite visualizations.",_Ae=["vega","vega-lite","themes","style"],EAe="BSD-3-Clause",SAe={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},kAe=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],CAe="build/vega-themes.js",AAe="build/vega-themes.module.js",TAe="build/vega-themes.min.js",RAe="build/vega-themes.min.js",$Ae="build/vega-themes.module.d.ts",OAe={type:"git",url:"https://github.com/vega/vega-themes.git"},NAe=["src","build"],MAe={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},FAe={"@babel/core":"^7.22.9","@babel/plugin-proposal-async-generator-functions":"^7.20.7","@babel/plugin-proposal-json-strings":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/plugin-proposal-optional-catch-binding":"^7.18.6","@babel/plugin-transform-runtime":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","browser-sync":"^2.29.3",concurrently:"^8.2.0",eslint:"^8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","gh-pages":"^5.0.0",prettier:"^3.0.0","release-it":"^16.1.0",rollup:"^3.26.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.1.6",vega:"^5.25.0","vega-lite":"^5.9.3"},DAe={vega:"*","vega-lite":"*"},IAe={},PAe={name:xAe,version:bAe,description:wAe,keywords:_Ae,license:EAe,author:SAe,contributors:kAe,main:CAe,module:AAe,unpkg:TAe,jsdelivr:RAe,types:$Ae,repository:OAe,files:NAe,scripts:MAe,devDependencies:FAe,peerDependencies:DAe,dependencies:IAe};const qc="#fff",s5="#888",LAe={background:"#333",view:{stroke:s5},title:{color:qc,subtitleColor:qc},style:{"guide-label":{fill:qc},"guide-title":{fill:qc}},axis:{domainColor:qc,gridColor:s5,tickColor:qc}},ru="#4572a7",zAe={background:"#fff",arc:{fill:ru},area:{fill:ru},line:{stroke:ru,strokeWidth:2},path:{stroke:ru},rect:{fill:ru},shape:{stroke:ru},symbol:{fill:ru,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},iu="#30a2da",s2="#cbcbcb",BAe="#999",jAe="#333",a5="#f0f0f0",l5="#333",UAe={arc:{fill:iu},area:{fill:iu},axis:{domainColor:s2,grid:!0,gridColor:s2,gridWidth:1,labelColor:BAe,labelFontSize:10,titleColor:jAe,tickColor:s2,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:a5,group:{fill:a5},legend:{labelColor:l5,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:l5,titleFontSize:14,titlePadding:10},line:{stroke:iu,strokeWidth:2},path:{stroke:iu,strokeWidth:.5},rect:{fill:iu},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:iu},bar:{binSpacing:2,fill:iu,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},ou="#000",HAe={group:{fill:"#e5e5e5"},arc:{fill:ou},area:{fill:ou},line:{stroke:ou},path:{stroke:ou},rect:{fill:ou},shape:{stroke:ou},symbol:{fill:ou,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},GAe=22,WAe="normal",u5="Benton Gothic, sans-serif",c5=11.5,VAe="normal",su="#82c6df",a2="Benton Gothic Bold, sans-serif",f5="normal",d5=13,Oh={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},qAe={background:"#ffffff",title:{anchor:"start",color:"#000000",font:a2,fontSize:GAe,fontWeight:WAe},arc:{fill:su},area:{fill:su},line:{stroke:su,strokeWidth:2},path:{stroke:su},rect:{fill:su},shape:{stroke:su},symbol:{fill:su,size:30},axis:{labelFont:u5,labelFontSize:c5,labelFontWeight:VAe,titleFont:a2,titleFontSize:d5,titleFontWeight:f5},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:u5,labelFontSize:c5,symbolType:"square",titleFont:a2,titleFontSize:d5,titleFontWeight:f5},range:{category:Oh["category-6"],diverging:Oh["fireandice-6"],heatmap:Oh["fire-7"],ordinal:Oh["fire-7"],ramp:Oh["fire-7"]}},au="#ab5787",D0="#979797",YAe={background:"#f9f9f9",arc:{fill:au},area:{fill:au},line:{stroke:au},path:{stroke:au},rect:{fill:au},shape:{stroke:au},symbol:{fill:au,size:30},axis:{domainColor:D0,domainWidth:.5,gridWidth:.2,labelColor:D0,tickColor:D0,tickWidth:.2,titleColor:D0},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},lu="#3e5c69",XAe={background:"#fff",arc:{fill:lu},area:{fill:lu},line:{stroke:lu},path:{stroke:lu},rect:{fill:lu},shape:{stroke:lu},symbol:{fill:lu},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Ci="#1696d2",h5="#000000",KAe="#FFFFFF",I0="Lato",l2="Lato",JAe="Lato",QAe="#DEDDDD",ZAe=18,Nh={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},eTe={background:KAe,title:{anchor:"start",fontSize:ZAe,font:I0},axisX:{domain:!0,domainColor:h5,domainWidth:1,grid:!1,labelFontSize:12,labelFont:l2,labelAngle:0,tickColor:h5,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:I0},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:QAe,gridWidth:1,labelFontSize:12,labelFont:l2,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:I0,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:l2,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:I0,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Nh["six-groups-cat-1"],diverging:Nh["diverging-colors"],heatmap:Nh["diverging-colors"],ordinal:Nh["six-groups-seq"],ramp:Nh["shades-blue"]},area:{fill:Ci},rect:{fill:Ci},line:{color:Ci,stroke:Ci,strokeWidth:5},trail:{color:Ci,stroke:Ci,strokeWidth:0,size:1},path:{stroke:Ci,strokeWidth:.5},point:{filled:!0},text:{font:JAe,color:Ci,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Ci,stroke:null}},arc:{fill:Ci},shape:{stroke:Ci},symbol:{fill:Ci,size:30}},uu="#3366CC",p5="#ccc",P0="Arial, sans-serif",tTe={arc:{fill:uu},area:{fill:uu},path:{stroke:uu},rect:{fill:uu},shape:{stroke:uu},symbol:{stroke:uu},circle:{fill:uu},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:P0,fontSize:12},"guide-title":{font:P0,fontSize:12},"group-title":{font:P0,fontSize:12}},title:{font:P0,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:p5,tickColor:p5,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},jO=e=>e*(1/3+1),g5=jO(9),m5=jO(10),y5=jO(12),Mh="Segoe UI",v5="wf_standard-font, helvetica, arial, sans-serif",x5="#252423",Fh="#605E5C",b5="transparent",nTe="#C8C6C4",Qi="#118DFF",rTe="#12239E",iTe="#E66C37",oTe="#6B007B",sTe="#E044A7",aTe="#744EC2",lTe="#D9B300",uTe="#D64550",QV=Qi,ZV="#DEEFFF",w5=[ZV,QV],cTe=[ZV,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",QV],fTe={view:{stroke:b5},background:b5,font:Mh,header:{titleFont:v5,titleFontSize:y5,titleColor:x5,labelFont:Mh,labelFontSize:m5,labelColor:Fh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Fh,labelFontSize:g5,titleFont:v5,titleColor:x5,titleFontSize:y5,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:nTe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Qi},line:{stroke:Qi,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Mh,fontSize:g5,fill:Fh},arc:{fill:Qi},area:{fill:Qi,line:!0,opacity:.6},path:{stroke:Qi},rect:{fill:Qi},point:{fill:Qi,filled:!0,size:75},shape:{stroke:Qi},symbol:{fill:Qi,strokeWidth:1.5,size:50},legend:{titleFont:Mh,titleFontWeight:"bold",titleColor:Fh,labelFont:Mh,labelFontSize:m5,labelColor:Fh,symbolType:"circle",symbolSize:75},range:{category:[Qi,rTe,iTe,oTe,sTe,aTe,lTe,uTe],diverging:w5,heatmap:w5,ordinal:cTe}},u2='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',_5=400,dTe=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],hTe=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function rw({type:e,background:t}){const n=e==="dark"?"#161616":"#ffffff",r=e==="dark"?"#f4f4f4":"#161616",i=e==="dark"?dTe:hTe,o=e==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:n,stroke:n},group:{fill:n},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:u2,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:u2,fill:r,fontWeight:_5},"guide-title":{font:u2,fill:r,fontWeight:_5}},range:{category:i,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const pTe=rw({type:"light",background:"#ffffff"}),gTe=rw({type:"light",background:"#f4f4f4"}),mTe=rw({type:"dark",background:"#262626"}),yTe=rw({type:"dark",background:"#161616"}),vTe=PAe.version,xTe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:gTe,carbong100:yTe,carbong90:mTe,carbonwhite:pTe,dark:LAe,excel:zAe,fivethirtyeight:UAe,ggplot2:HAe,googlecharts:tTe,latimes:qAe,powerbi:fTe,quartz:YAe,urbaninstitute:eTe,version:vTe,vox:XAe},Symbol.toStringTag,{value:"Module"}));function bTe(e,t,n){if(K(e))return`[${e.map(r=>t(pe(r)?r:E5(r,n))).join(", ")}]`;if(ye(e)){let r="";const{title:i,image:o,...s}=e;i&&(r+=`

${t(i)}

`),o&&(r+=``);const a=Object.keys(s);if(a.length>0){r+="";for(const l of a){let u=s[l];u!==void 0&&(ye(u)&&(u=E5(u,n)),r+=``)}r+="
${t(l)}${t(u)}
"}return r||"{}"}return t(e)}function wTe(e){const t=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}function E5(e,t){return JSON.stringify(e,wTe(t))}var _Te=`#vg-tooltip-element { +`)}function qU(e){return"["+e.map(YU).join(", ")+"]"}function YU(e){return K(e)?"[…]":ye(e)&&!ul(e)?"{…}":e}function XU(e,t){const n=this;if(t=t||{},kf.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=We({},e.locale,t.locale);n.locale(Qz(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Ya.Canvas,n._scenegraph=new FT;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||iye,n._redraw=!0,n._handler=new om().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=k0e(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=X0e(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:We({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=WU(n,n._width),n._viewHeight=VU(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,J0e(n),p0e(n),g0e(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function T0(e,t){return Oe(e._signals,t)?e._signals[t]:Y("Unrecognized signal name: "+ie(t))}function KU(e,t){const n=(e._targets||[]).filter(r=>r._update&&r._update.handler===t);return n.length?n[0]:null}function TI(e,t,n,r){let i=KU(n,r);return i||(i=QR(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function RI(e,t,n){const r=KU(t,n);return r&&t._targets.remove(r),e}oe(XU,kf,{async evaluate(e,t,n){if(await kf.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,x0e(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&ty(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&LU(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=T0(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",CI(e)):CI(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Wx(e)||Y("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(kf.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(T0(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Q0e,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=QR(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,e===o&&(t===i||t===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return TI(this,e,T0(this,e),t)},removeSignalListener(e,t){return RI(this,T0(this,e),t)},addDataListener(e,t){return TI(this,e,cv(this,e).values,t)},removeDataListener(e,t){return RI(this,cv(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=HS(this,null);this._globalCursor=!!e,t&&HS(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:rye,events:A0e,finalize:R0e,hover:T0e,data:m0e,change:rb,insert:y0e,remove:v0e,scale:K0e,initialize:H0e,toImageURL:W0e,toCanvas:q0e,toSVG:Y0e,getState:Z0e,setState:nye});const aye="view",dv="[",hv="]",JU="{",QU="}",lye=":",ZU=",",uye="@",cye=">",fye=/[[\]{}]/,dye={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let eH,tH;function Gl(e,t,n){return eH=t||aye,tH=n||dye,nH(e.trim()).map(GS)}function hye(e){return tH[e]}function Tp(e,t,n,r,i){const o=e.length;let s=0,a;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function nH(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;r=r.map(GS);const i=GS(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function gye(e){const t={source:eH},n=[];let r=[0,0],i=0,o=0,s=e.length,a=0,l,u;if(e[s-1]===QU){if(a=e.lastIndexOf(JU),a>=0){try{r=mye(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===uye&&(i=++a),l=Tp(e,a,lye),l1?(t.type=n[1],i?t.markname=n[0].slice(1):hye(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),u!=null&&(t.filter=u),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function mye(e){const t=e.split(ZU);if(!e.length||t.length>2)throw e;return t.map(n=>{const r=+n;if(r!==r)throw e;return r})}function yye(e){return ye(e)?e:{type:e||"pad"}}const Ch=e=>+e||0,vye=e=>({top:e,bottom:e,left:e,right:e});function xye(e){return ye(e)?e.signal?e:{top:Ch(e.top),bottom:Ch(e.bottom),left:Ch(e.left),right:Ch(e.right)}:vye(Ch(e))}const Cn=e=>ye(e)&&!K(e)?We({},e):{value:e};function $I(e,t,n,r){return n!=null?(ye(n)&&!K(n)||K(n)&&n.length&&ye(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function Un(e,t,n){for(const r in t)$I(e,r,t[r]);for(const r in n)$I(e,r,n[r],"update")}function Hd(e,t,n){for(const r in t)n&&Oe(n,r)||(e[r]=We(e[r]||{},t[r]));return e}function Qc(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const t$="mark",n$="frame",r$="scope",bye="axis",wye="axis-domain",_ye="axis-grid",Eye="axis-label",Sye="axis-tick",kye="axis-title",Cye="legend",Aye="legend-band",Tye="legend-entry",Rye="legend-gradient",rH="legend-label",$ye="legend-symbol",Oye="legend-title",Nye="title",Mye="title-text",Fye="title-subtitle";function Dye(e,t,n,r,i){const o={},s={};let a,l,u,c;l="lineBreak",t==="text"&&i[l]!=null&&!Qc(l,e)&&V_(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===n$?i.group:n===t$?We({},i.mark,i[t]):null;for(l in c)u=Qc(l,e)||(l==="fill"||l==="stroke")&&(Qc("fill",e)||Qc("stroke",e)),u||V_(o,l,c[l]);me(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)Qc(h,e)||V_(o,h,d[h])}),e=We({},e);for(l in o)c=o[l],c.signal?(a=a||{})[l]=c:s[l]=c;return e.enter=We(s,e.enter),a&&(e.update=We(a,e.update)),e}function V_(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const iH=e=>pe(e)?ie(e):e.signal?`(${e.signal})`:oH(e);function ob(e){if(e.gradient!=null)return Pye(e);let t=e.signal?`(${e.signal})`:e.color?Iye(e.color):e.field!=null?oH(e.field):e.value!==void 0?ie(e.value):void 0;return e.scale!=null&&(t=Lye(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${vy(e.exponent)})`),e.mult!=null&&(t+=`*${vy(e.mult)}`),e.offset!=null&&(t+=`+${vy(e.offset)}`),e.round&&(t=`round(${t})`),t}const R0=(e,t,n,r)=>`(${e}(${[t,n,r].map(ob).join(",")})+'')`;function Iye(e){return e.c?R0("hcl",e.h,e.c,e.l):e.h||e.s?R0("hsl",e.h,e.s,e.l):e.l||e.a?R0("lab",e.l,e.a,e.b):e.r||e.g||e.b?R0("rgb",e.r,e.g,e.b):null}function Pye(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:ie(n));for(;t.length&&it(t)==null;)t.pop();return t.unshift(iH(e.gradient)),`gradient(${t.join(",")})`}function vy(e){return ye(e)?"("+ob(e)+")":e}function oH(e){return sH(ye(e)?e:{datum:e})}function sH(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):Y("Invalid field reference: "+ie(e));return e.signal||(r=pe(r)?ms(r).map(ie).join("]["):sH(r)),t+"["+r+"]"}function Lye(e,t){const n=iH(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+vy(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function zye(e){let t="";return e.forEach(n=>{const r=ob(n);t+=n.test?`(${n.test})?${r}:`:r}),it(t)===":"&&(t+="null"),t}function aH(e,t,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},e=Dye(e,t,n,r,i.config);for(const a in e)s[a]=Bye(e[a],t,o,i);return o}function Bye(e,t,n,r){const i={},o={};for(const s in e)e[s]!=null&&(i[s]=Uye(jye(e[s]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function jye(e){return K(e)?zye(e):ob(e)}function Uye(e,t,n,r){const i=ds(e,t);return i.$fields.forEach(o=>r[o]=1),We(n,i.$params),i.$expr}const Hye="outer",Gye=["value","update","init","react","bind"];function OI(e,t){Y(e+' for "outer" push: '+ie(t))}function lH(e,t){const n=e.name;if(e.push===Hye)t.signals[n]||OI("No prior signal definition",n),Gye.forEach(r=>{e[r]!==void 0&&OI("Invalid property ",r)});else{const r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function WS(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function sb(e,t,n,r){return new WS(e,t,n,r)}function pv(e,t){return sb("operator",e,t)}function Te(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function vg(e,t){return t?{$field:e,$name:t}:{$field:e}}const VS=vg("key");function NI(e,t){return{$compare:e,$order:t}}function Wye(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Vye="ascending",qye="descending";function Yye(e){return ye(e)?(e.order===qye?"-":"+")+ab(e.op,e.field):""}function ab(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const i$="scope",qS="view";function pn(e){return e&&e.signal}function Xye(e){return e&&e.expr}function xy(e){if(pn(e))return!0;if(ye(e)){for(const t in e)if(xy(e[t]))return!0}return!1}function no(e,t){return e??t}function Pu(e){return e&&e.signal||e}const MI="timer";function xg(e,t){return(e.merge?Jye:e.stream?Qye:e.type?Zye:Y("Invalid stream specification: "+ie(e)))(e,t)}function Kye(e){return e===i$?qS:e||qS}function Jye(e,t){const n=e.merge.map(i=>xg(i,t)),r=o$({merge:n},e,t);return t.addStream(r).id}function Qye(e,t){const n=xg(e.stream,t),r=o$({stream:n},e,t);return t.addStream(r).id}function Zye(e,t){let n;e.type===MI?(n=t.event(MI,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Kye(e.source),e.type);const r=o$({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function o$(e,t,n){let r=t.between;return r&&(r.length!==2&&Y('Stream "between" parameter must have 2 entries: '+ie(t)),e.between=[xg(r[0],n),xg(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(e1e(t.marktype,t.markname,t.markrole)),t.source===i$&&r.push("inScope(event.item)"),r.length&&(e.filter=ds("("+r.join(")&&(")+")",n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function e1e(e,t,n){const r="event.item";return r+(e&&e!=="*"?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}const t1e={code:"_.$value",ast:{type:"Identifier",value:"value"}};function n1e(e,t,n){const r=e.encode,i={target:n};let o=e.events,s=e.update,a=[];o||Y("Signal update missing events specification."),pe(o)&&(o=Gl(o,t.isSubscope()?i$:qS)),o=me(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[i1e(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&Y("Signal encode and update are mutually exclusive."),s="encode(item(),"+ie(r)+")"),i.update=pe(s)?ds(s,t):s.expr!=null?ds(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:t1e,$params:{$value:t.signalRef(s.signal)}}:Y("Invalid signal update specification."),e.force&&(i.options={force:!0}),a.forEach(l=>t.addUpdate(We(r1e(l,t),i)))}function r1e(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):xg(e,t)}}function i1e(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function o1e(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?Y("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=ds(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(i=>n1e(i,t,n.id))}const kt=e=>(t,n,r)=>sb(e,n,t||void 0,r),uH=kt("aggregate"),s1e=kt("axisticks"),cH=kt("bound"),Oo=kt("collect"),FI=kt("compare"),a1e=kt("datajoin"),fH=kt("encode"),l1e=kt("expression"),u1e=kt("facet"),c1e=kt("field"),f1e=kt("key"),d1e=kt("legendentries"),h1e=kt("load"),p1e=kt("mark"),g1e=kt("multiextent"),m1e=kt("multivalues"),y1e=kt("overlap"),v1e=kt("params"),dH=kt("prefacet"),x1e=kt("projection"),b1e=kt("proxy"),w1e=kt("relay"),hH=kt("render"),_1e=kt("scale"),kc=kt("sieve"),E1e=kt("sortitems"),pH=kt("viewlayout"),S1e=kt("values");let k1e=0;const gH={min:"min",max:"max",count:"sum"};function C1e(e,t){const n=e.type||"linear";u9(n)||Y("Unrecognized scale type: "+ie(n)),t.addScale(e.name,{type:n,domain:void 0})}function A1e(e,t){const n=t.getScale(e.name).params;let r;n.domain=mH(e.domain,e,t),e.range!=null&&(n.range=vH(e,t,n)),e.interpolate!=null&&P1e(e.interpolate,n),e.nice!=null&&(n.nice=I1e(e.nice)),e.bins!=null&&(n.bins=D1e(e.bins,t));for(r in e)Oe(n,r)||r==="name"||(n[r]=Ni(e[r],t))}function Ni(e,t){return ye(e)?e.signal?t.signalRef(e.signal):Y("Unsupported object: "+ie(e)):e}function by(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Ni(n,t))}function lb(e){Y("Can not find data set: "+ie(e))}function mH(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&Y("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(K(e)?T1e:e.fields?$1e:R1e)(e,t,n)}function T1e(e,t,n){return e.map(r=>Ni(r,n))}function R1e(e,t,n){const r=n.getData(e.data);return r||lb(e.data),Zf(t.type)?r.valuesRef(n,e.field,yH(e.sort,!1)):d9(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function $1e(e,t,n){const r=e.data,i=e.fields.reduce((o,s)=>(s=pe(s)?{data:r,field:s}:K(s)||s.signal?O1e(s,n):s,o.push(s),o),[]);return(Zf(t.type)?N1e:d9(t.type)?M1e:F1e)(e,n,i)}function O1e(e,t){const n="_:vega:_"+k1e++,r=Oo({});if(K(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+ie(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,kc({})]),{data:n,field:"data"}}function N1e(e,t,n){const r=yH(e.sort,!0);let i,o;const s=n.map(u=>{const c=t.getData(u.data);return c||lb(u.data),c.countsRef(t,u.field,r)}),a={groupby:VS,pulse:s};r&&(i=r.op||"count",o=r.field?ab(i,r.field):"count",a.ops=[gH[i]],a.fields=[t.fieldRef(o)],a.as=[o]),i=t.add(uH(a));const l=t.add(Oo({pulse:Te(i)}));return o=t.add(S1e({field:VS,sort:t.sortRef(r),pulse:Te(l)})),Te(o)}function yH(e,t){return e&&(!e.field&&!e.op?ye(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?Y("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!gH[e.op]&&Y("Multiple domain scales can not be sorted using "+e.op)),e}function M1e(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||lb(i.data),o.domainRef(t,i.field)});return Te(t.add(m1e({values:r})))}function F1e(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||lb(i.data),o.extentRef(t,i.field)});return Te(t.add(g1e({extents:r})))}function D1e(e,t){return e.signal||K(e)?by(e,t):t.objectProperty(e)}function I1e(e){return ye(e)?{interval:Ni(e.interval),step:Ni(e.step)}:Ni(e)}function P1e(e,t){t.interpolate=Ni(e.type||e),e.gamma!=null&&(t.interpolateGamma=Ni(e.gamma))}function vH(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(pe(i)){if(r&&Oe(r,i))return e=We({},e,{range:r[i]}),vH(e,t,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=Zf(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Y("Unrecognized scale range value: "+ie(i))}else if(i.scheme){n.scheme=K(i.scheme)?by(i.scheme,t):Ni(i.scheme,t),i.extent&&(n.schemeExtent=by(i.extent,t)),i.count&&(n.schemeCount=Ni(i.count,t));return}else if(i.step){n.rangeStep=Ni(i.step,t);return}else{if(Zf(e.type)&&!K(i))return mH(i,e,t);K(i)||Y("Unsupported range type: "+ie(i))}return i.map(o=>(K(o)?by:Ni)(o,t))}function L1e(e,t){const n=t.config.projection||{},r={};for(const i in e)i!=="name"&&(r[i]=YS(e[i],i,t));for(const i in n)r[i]==null&&(r[i]=YS(n[i],i,t));t.addProjection(e.name,r)}function YS(e,t,n){return K(e)?e.map(r=>YS(r,t,n)):ye(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:Y("Unsupported parameter object: "+ie(e)):e}const No="top",Gd="left",Wd="right",Al="bottom",xH="center",z1e="vertical",B1e="start",j1e="middle",U1e="end",XS="index",s$="label",H1e="offset",ud="perc",G1e="perc2",Di="value",pm="guide-label",a$="guide-title",W1e="group-title",V1e="group-subtitle",DI="symbol",wy="gradient",KS="discrete",JS="size",q1e="shape",Y1e="fill",X1e="stroke",K1e="strokeWidth",J1e="strokeDash",Q1e="opacity",l$=[JS,q1e,Y1e,X1e,K1e,J1e,Q1e],gm={name:1,style:1,interactive:1},st={value:0},Ii={value:1},ub="group",bH="rect",u$="rule",Z1e="symbol",Cc="text";function bg(e){return e.type=ub,e.interactive=e.interactive||!1,e}function ti(e,t){const n=(r,i)=>no(e[r],no(t[r],i));return n.isVertical=r=>z1e===no(e.direction,t.direction||(r?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>no(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>no(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>no(e.columns,no(t.columns,+n.isVertical(!0))),n}function wH(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function eve(e,t,n){const r=t.config.style[n];return r&&r[e]}function cb(e,t,n){return`item.anchor === '${B1e}' ? ${e} : item.anchor === '${U1e}' ? ${t} : ${n}`}const c$=cb(ie(Gd),ie(Wd),ie(xH));function tve(e){const t=e("tickBand");let n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},ye(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}function _H(e,t){return t?e?ye(e)?Object.assign({},e,{offset:_H(e.offset,t)}):{value:e,offset:t}:t:e}function vi(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Hd(e.encode,t,gm)):e.interactive=!1,e}function nve(e,t,n,r){const i=ti(e,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,u,c,f,d;o?(u=[0,1],c=[0,0],f=s,d=a):(u=[0,0],c=[1,0],f=a,d=s);const h={enter:l={opacity:st,x:st,y:st,width:Cn(f),height:Cn(d)},update:We({},l,{opacity:Ii,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:st}};return Un(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),vi({type:bH,role:Rye,encode:h},r)}function rve(e,t,n,r,i){const o=ti(e,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let u,c,f,d,h="";s?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:st,fill:{scale:t,field:Di}};p[u]={signal:h+"datum."+ud,mult:l},p[c]=st,p[f]={signal:h+"datum."+G1e,mult:l},p[d]=Cn(a);const g={enter:p,update:We({},p,{opacity:Ii}),exit:{opacity:st}};return Un(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),vi({type:bH,role:Aye,key:Di,from:i,encode:g},r)}const ive=`datum.${ud}<=0?"${Gd}":datum.${ud}>=1?"${Wd}":"${xH}"`,ove=`datum.${ud}<=0?"${Al}":datum.${ud}>=1?"${No}":"${j1e}"`;function II(e,t,n,r){const i=ti(e,t),o=i.isVertical(),s=Cn(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),u,c,f,d,h="";const p={enter:u={opacity:st},update:c={opacity:Ii,text:{field:s$}},exit:{opacity:st}};return Un(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:no(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=c.baseline={signal:ove},f="y",d="x",h="1-"):(u.align=c.align={signal:ive},u.baseline={value:"top"},f="x",d="y"),u[f]=c[f]={signal:h+"datum."+ud,mult:a},u[d]=c[d]=s,s.offset=no(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+XS}:void 0,vi({type:Cc,role:rH,style:pm,key:Di,from:r,encode:p,overlap:l},n)}function sve(e,t,n,r,i){const o=ti(e,t),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,u=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${H1e} : datum.${JS}`,h=u?Cn(u):{field:JS},p=`datum.${XS}`,g=`max(1, ${i})`;let m,y,v,b,w;h.mult=.5,m={enter:y={opacity:st,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:Ii,x:y.x,y:y.y},exit:{opacity:st}};let _=null,k=null;e.fill||(_=t.symbolBaseFillColor,k=t.symbolBaseStrokeColor),Un(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",k),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),l$.forEach(O=>{e[O]&&(v[O]=y[O]={scale:e[O],field:Di})});const E=vi({type:Z1e,role:$ye,key:Di,from:f,clip:u?!0:void 0,encode:m},n.symbols),A=Cn(c);A.offset=o("labelOffset"),m={enter:y={opacity:st,x:{signal:d,offset:A},y:h},update:v={opacity:Ii,text:{field:s$},x:y.x,y:y.y},exit:{opacity:st}},Un(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const N=vi({type:Cc,role:rH,style:pm,key:Di,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!u},width:st,height:u?Cn(u):st,opacity:st},exit:{opacity:st},update:v={opacity:Ii,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,w={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,w={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:XS}},bg({role:r$,from:r,encode:Hd(m,s,gm),marks:[E,N],name:l,interactive:a,sort:w})}function ave(e,t){const n=ti(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const f$='item.orient === "left"',d$='item.orient === "right"',fb=`(${f$} || ${d$})`,lve=`datum.vgrad && ${fb}`,uve=cb('"top"','"bottom"','"middle"'),cve=cb('"right"','"left"','"center"'),fve=`datum.vgrad && ${d$} ? (${cve}) : (${fb} && !(datum.vgrad && ${f$})) ? "left" : ${c$}`,dve=`item._anchor || (${fb} ? "middle" : "start")`,hve=`${lve} ? (${f$} ? -90 : 90) : 0`,pve=`${fb} ? (datum.vgrad ? (${d$} ? "bottom" : "top") : ${uve}) : "top"`;function gve(e,t,n,r){const i=ti(e,t),o={enter:{opacity:st},update:{opacity:Ii,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:st}};return Un(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:dve},angle:{signal:hve},align:{signal:fve},baseline:{signal:pve},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),vi({type:Cc,role:Oye,style:a$,from:r,encode:o},n)}function mve(e,t){let n;return ye(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+PI(e.path)+")":e.sphere&&(n="geoShape("+PI(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function PI(e){return ye(e)&&e.signal?e.signal:ie(e)}function EH(e){const t=e.role||"";return!t.indexOf("axis")||!t.indexOf("legend")||!t.indexOf("title")?t:e.type===ub?r$:t||t$}function yve(e){return{marktype:e.type,name:e.name||void 0,role:e.role||EH(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function vve(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function h$(e,t){const n=f8(e.type);n||Y("Unrecognized transform type: "+ie(e.type));const r=sb(n.type.toLowerCase(),null,SH(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function SH(e,t,n){const r={},i=e.params.length;for(let o=0;oLI(e,o,n)):LI(e,i,n)}function LI(e,t,n){const r=e.type;if(pn(t))return BI(r)?Y("Expression references can not be signals."):q_(r)?n.fieldRef(t):jI(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||q_(r);return i&&_ve(t)?n.exprRef(t.expr,t.as):i&&Eve(t)?vg(t.field,t.as):BI(r)?ds(t,n):Sve(r)?Te(n.getData(t).values):q_(r)?vg(t):jI(r)?n.compareRef(t):t}}function bve(e,t,n){return pe(t.from)||Y('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function wve(e,t,n){const r=t[e.name];return e.array?(K(r)||Y("Expected an array of sub-parameters. Instead: "+ie(r)),r.map(i=>zI(e,i,n))):zI(e,r,n)}function zI(e,t,n){const r=e.params.length;let i;for(let s=0;se&&e.expr,Eve=e=>e&&e.field,Sve=e=>e==="data",BI=e=>e==="expr",q_=e=>e==="field",jI=e=>e==="compare";function kve(e,t,n){let r,i,o,s,a;return e?(r=e.facet)&&(t||Y("Only group marks can be faceted."),r.field!=null?s=a=_y(r,n):(e.data?a=Te(n.getData(e.data).aggregate):(o=h$(We({type:"aggregate",groupby:me(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=_y(r,n),s=a=Te(n.add(o))),i=n.keyRef(r.groupby,!0))):s=Te(n.add(Oo(null,[{}]))),s||(s=_y(e,n)),{key:i,pulse:s,parent:a}}function _y(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Te(t.getData(e.data).output)}function rc(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}rc.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=ds(u,t);l.update=c.$expr,l.params=c.$params}function db(e,t){const n=EH(e),r=e.type===ub,i=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===r$||n===n$,a,l,u,c,f,d,h;const p=n===t$||s||i,g=kve(e.from,r,t);l=t.add(a1e({key:g.key||(e.key?vg(e.key):void 0),pulse:g.pulse,clean:!r}));const m=Te(l);l=u=t.add(Oo({pulse:m})),l=t.add(p1e({markdef:yve(e),interactive:vve(e.interactive,t),clip:mve(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Te(l)}));const y=Te(l);l=c=t.add(fH(aH(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(k=>{const E=h$(k,t),A=E.metadata;(A.generates||A.changes)&&Y("Mark transforms should not generate new data."),A.nomod||(c.params.mod=!0),E.params.pulse=Te(l),t.add(l=E)}),e.sort&&(l=t.add(E1e({sort:t.compareRef(e.sort),pulse:Te(l)})));const v=Te(l);(i||s)&&(s=t.add(pH({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:v})),d=Te(s));const b=t.add(cH({mark:y,pulse:d||v}));h=Te(b),r&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(v,d||h,m),i?Cve(e,t,g):p?Ave(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(b))),o&&(h=Tve(o,h,t));const w=t.add(hH({pulse:h})),_=t.add(kc({pulse:Te(w)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new rc(t,u,w,_)),e.on&&e.on.forEach(k=>{(k.insert||k.remove||k.toggle)&&Y("Marks only support modify triggers."),CH(k,t,f)}))}function Tve(e,t,n){const r=e.method,i=e.bound,o=e.separation,s={separation:pn(o)?n.signalRef(o.signal):o,method:pn(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),i){const a=i.tolerance;s.boundTolerance=pn(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return Te(n.add(y1e(s)))}function Rve(e,t){const n=t.config.legend,r=e.encode||{},i=ti(e,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,u={};let c=0,f,d,h;l$.forEach(b=>e[b]?(u[b]=e[b],c=c||e[b]):0),c||Y("Missing valid scale for legend.");const p=$ve(e,t.scaleType(c)),g={title:e.title!=null,scales:u,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=Te(t.add(Oo(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},v=Te(t.add(d1e(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===wy?(h=[nve(e,c,n,r.gradient),II(e,n,r.labels,v)],d.count=d.count||t.signalRef(`max(2,2*floor((${Pu(i.gradientLength())})/100))`)):p===KS?h=[rve(e,c,n,r.gradient,v),II(e,n,r.labels,v)]:(f=ave(e,n),h=[sve(e,n,r,v,Pu(f.columns))],d.size=Mve(e,t,h[0].marks)),h=[bg({role:Tye,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(gve(e,n,r.title,m)),db(bg({role:Cye,from:m,encode:Hd(Nve(i,e,n),o,gm),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),t)}function $ve(e,t){let n=e.type||DI;return!e.type&&Ove(e)===1&&(e.fill||e.stroke)&&(n=uT(t)?wy:UE(t)?KS:DI),n!==wy?n:UE(t)?KS:wy}function Ove(e){return l$.reduce((t,n)=>t+(e[n]?1:0),0)}function Nve(e,t,n){const r={enter:{},update:{}};return Un(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function Mve(e,t,n){const r=Pu(HI("size",e,n)),i=Pu(HI("strokeWidth",e,n)),o=Pu(Fve(n[1].encode,t,pm));return ds(`max(ceil(sqrt(${r})+${i}),${o})`,t)}function HI(e,t,n){return t[e]?`scale("${t[e]}",datum)`:wH(e,n[0].encode)}function Fve(e,t,n){return wH("fontSize",e)||eve("fontSize",t,n)}const Dve=`item.orient==="${Gd}"?-90:item.orient==="${Wd}"?90:0`;function Ive(e,t){e=pe(e)?{text:e}:e;const n=ti(e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],u={},c=Te(t.add(Oo(null,[u])));return l.push(zve(e,n,Pve(e),c)),e.subtitle&&l.push(Bve(e,n,r.subtitle,c)),db(bg({role:Nye,from:c,encode:Lve(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Pve(e){const t=e.encode;return t&&t.title||We({name:e.name,interactive:e.interactive,style:e.style},t)}function Lve(e,t){const n={enter:{},update:{}};return Un(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:c$},angle:{signal:Dve},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Hd(n,t,gm)}function zve(e,t,n,r){const i={value:0},o=e.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Un(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),vi({type:Cc,role:Mye,style:W1e,from:r,encode:s},n)}function Bve(e,t,n,r){const i={value:0},o=e.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Un(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),vi({type:Cc,role:Fye,style:V1e,from:r,encode:s},n)}function jve(e,t){const n=[];e.transform&&e.transform.forEach(r=>{n.push(h$(r,t))}),e.on&&e.on.forEach(r=>{CH(r,t,e.name)}),t.addDataPipeline(e.name,Uve(e,t,n))}function Uve(e,t,n){const r=[];let i=null,o=!1,s=!1,a,l,u,c,f;for(e.values?pn(e.values)||xy(e.format)?(r.push(GI(t,e)),r.push(i=tu())):r.push(i=tu({$ingest:e.values,$format:e.format})):e.url?xy(e.url)||xy(e.format)?(r.push(GI(t,e)),r.push(i=tu())):r.push(i=tu({$request:e.url,$format:e.format})):e.source&&(i=a=me(e.source).map(d=>Te(t.getData(d).output)),r.push(null)),l=0,u=n.length;le===Al||e===No,hb=(e,t,n)=>pn(e)?Vve(e.signal,t,n):e===Gd||e===No?t:n,An=(e,t,n)=>pn(e)?Gve(e.signal,t,n):AH(e)?t:n,bo=(e,t,n)=>pn(e)?Wve(e.signal,t,n):AH(e)?n:t,TH=(e,t,n)=>pn(e)?qve(e.signal,t,n):e===No?{value:t}:{value:n},Hve=(e,t,n)=>pn(e)?Yve(e.signal,t,n):e===Wd?{value:t}:{value:n},Gve=(e,t,n)=>RH(`${e} === '${No}' || ${e} === '${Al}'`,t,n),Wve=(e,t,n)=>RH(`${e} !== '${No}' && ${e} !== '${Al}'`,t,n),Vve=(e,t,n)=>p$(`${e} === '${Gd}' || ${e} === '${No}'`,t,n),qve=(e,t,n)=>p$(`${e} === '${No}'`,t,n),Yve=(e,t,n)=>p$(`${e} === '${Wd}'`,t,n),RH=(e,t,n)=>(t=t!=null?Cn(t):t,n=n!=null?Cn(n):n,WI(t)&&WI(n)?(t=t?t.signal||ie(t.value):null,n=n?n.signal||ie(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[We({test:e},t)].concat(n||[])),WI=e=>e==null||Object.keys(e).length===1,p$=(e,t,n)=>({signal:`${e} ? (${vf(t)}) : (${vf(n)})`}),Xve=(e,t,n,r,i)=>({signal:(r!=null?`${e} === '${Gd}' ? (${vf(r)}) : `:"")+(n!=null?`${e} === '${Al}' ? (${vf(n)}) : `:"")+(i!=null?`${e} === '${Wd}' ? (${vf(i)}) : `:"")+(t!=null?`${e} === '${No}' ? (${vf(t)}) : `:"")+"(null)"}),vf=e=>pn(e)?e.signal:e==null?null:ie(e),Kve=(e,t)=>t===0?0:pn(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Rf=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Gc(e,t,n,r){let i;if(t&&Oe(t,e))return t[e];if(Oe(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[a$][i]}else if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[pm][i]}return null}function VI(e){const t={};for(const n of e)if(n)for(const r in n)t[r]=1;return Object.keys(t)}function Jve(e,t){var n=t.config,r=n.style,i=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,l,u;if(pn(s)){const f=VI([n.axisX,n.axisY]),d=VI([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(u of f)a[u]=An(s,Gc(u,n.axisX,i,r),Gc(u,n.axisY,i,r));l={};for(u of d)l[u]=Xve(s.signal,Gc(u,n.axisTop,i,r),Gc(u,n.axisBottom,i,r),Gc(u,n.axisLeft,i,r),Gc(u,n.axisRight,i,r))}else a=s===No||s===Al?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?We({},i,a,l,o):i}function Qve(e,t,n,r){const i=ti(e,t),o=e.orient;let s,a;const l={enter:s={opacity:st},update:a={opacity:Ii},exit:{opacity:st}};Un(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const u=qI(e,0),c=qI(e,1);return s.x=a.x=An(o,u,st),s.x2=a.x2=An(o,c),s.y=a.y=bo(o,u,st),s.y2=a.y2=bo(o,c),vi({type:u$,role:wye,from:r,encode:l},n)}function qI(e,t){return{scale:e.scale,range:t}}function Zve(e,t,n,r,i){const o=ti(e,t),s=e.orient,a=e.gridScale,l=hb(s,1,-1),u=exe(e.offset,l);let c,f,d;const h={enter:c={opacity:st},update:d={opacity:Ii},exit:f={opacity:st}};Un(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:Di,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=An(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:u}:{value:0,offset:u},y=a?{scale:a,range:1,mult:l,offset:u}:We(g,{mult:l,offset:u});return c.x=d.x=An(s,p,m),c.y=d.y=bo(s,p,m),c.x2=d.x2=bo(s,y),c.y2=d.y2=An(s,y),f.x=An(s,p),f.y=bo(s,p),vi({type:u$,role:_ye,key:Di,from:r,encode:h},n)}function exe(e,t){if(t!==1)if(!ye(e))e=pn(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=We({},e);for(;n.mult!=null;)if(ye(n.mult))n=n.mult=We({},n.mult);else return n.mult=pn(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function txe(e,t,n,r,i,o){const s=ti(e,t),a=e.orient,l=hb(a,-1,1);let u,c,f;const d={enter:u={opacity:st},update:f={opacity:Ii},exit:c={opacity:st}};Un(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=Cn(i);h.mult=l;const p={scale:e.scale,field:Di,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=u.y=An(a,st,p),f.y2=u.y2=An(a,h),c.x=An(a,p),f.x=u.x=bo(a,st,p),f.x2=u.x2=bo(a,h),c.y=bo(a,p),vi({type:u$,role:Sye,key:Di,from:r,encode:d},n)}function Y_(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function nxe(e,t,n,r,i,o){const s=ti(e,t),a=e.orient,l=e.scale,u=hb(a,-1,1),c=Pu(s("labelFlush")),f=Pu(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=c===0||!!c,g;const m=Cn(i);m.mult=u,m.offset=Cn(s("labelPadding")||0),m.offset.mult=u;const y={scale:l,field:Di,band:.5,offset:_H(o.offset,s("labelOffset"))},v=An(a,p?Y_(l,c,'"left"','"right"','"center"'):{value:"center"},Hve(a,"left","right")),b=An(a,TH(a,"bottom","top"),p?Y_(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),w=Y_(l,c,`-(${f})`,f,0);p=p&&f;const _={opacity:st,x:An(a,y,m),y:bo(a,y,m)},k={enter:_,update:g={opacity:Ii,text:{field:s$},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:st,x:_.x,y:_.y}};Un(k,{dx:!d&&p?An(a,w):null,dy:!h&&p?bo(a,w):null}),Un(k,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const E=s("labelBound");let A=s("labelOverlap");return A=A||E?{separation:s("labelSeparation"),method:A,order:"datum.index",bound:E?{scale:l,orient:a,tolerance:E}:null}:void 0,g.align!==v&&(g.align=Rf(g.align,v)),g.baseline!==b&&(g.baseline=Rf(g.baseline,b)),vi({type:Cc,role:Eye,style:pm,key:Di,from:r,encode:k,overlap:A},n)}function rxe(e,t,n,r){const i=ti(e,t),o=e.orient,s=hb(o,-1,1);let a,l;const u={enter:a={opacity:st,anchor:Cn(i("titleAnchor",null)),align:{signal:c$}},update:l=We({},a,{opacity:Ii,text:Cn(e.title)}),exit:{opacity:st}},c={signal:`lerp(range("${e.scale}"), ${cb(0,1,.5)})`};return l.x=An(o,c),l.y=bo(o,c),a.angle=An(o,st,Kve(s,90)),a.baseline=An(o,TH(o,Al,No),{value:Al}),l.angle=a.angle,l.baseline=a.baseline,Un(u,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),ixe(i,o,u,n),u.update.align=Rf(u.update.align,a.align),u.update.angle=Rf(u.update.angle,a.angle),u.update.baseline=Rf(u.update.baseline,a.baseline),vi({type:Cc,role:kye,style:a$,from:r,encode:u},n)}function ixe(e,t,n,r){const i=(a,l)=>a!=null?(n.update[l]=Rf(Cn(a),n.update[l]),!1):!Qc(l,r),o=i(e("titleX"),"x"),s=i(e("titleY"),"y");n.enter.auto=s===o?Cn(s):An(t,Cn(s),Cn(o))}function oxe(e,t){const n=Jve(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=ti(e,n),u=tve(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=Te(t.add(Oo({},[c]))),d=Te(t.add(s1e({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(Zve(e,n,r.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(txe(e,n,r.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(nxe(e,n,r.labels,d,p,u))),c.domain&&h.push(Qve(e,n,r.domain,f)),c.title&&h.push(rxe(e,n,r.title,f)),db(bg({role:bye,from:f,encode:Hd(sxe(l,e),i,gm),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),t)}function sxe(e,t){const n={enter:{},update:{}};return Un(n,{orient:e("orient"),offset:e("offset")||0,position:no(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function $H(e,t,n){const r=me(e.signals),i=me(e.scales);return n||r.forEach(o=>lH(o,t)),me(e.projections).forEach(o=>L1e(o,t)),i.forEach(o=>C1e(o,t)),me(e.data).forEach(o=>jve(o,t)),i.forEach(o=>A1e(o,t)),(n||r).forEach(o=>o1e(o,t)),me(e.axes).forEach(o=>oxe(o,t)),me(e.marks).forEach(o=>db(o,t)),me(e.legends).forEach(o=>Rve(o,t)),e.title&&Ive(e.title,t),t.parseLambdas(),t}const axe=e=>Hd({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function lxe(e,t){const n=t.config,r=Te(t.root=t.add(pv())),i=uxe(e,n);i.forEach(u=>lH(u,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Oo()),s=t.add(fH(aH(axe(e.encode),ub,n$,e.style,t,{pulse:Te(o)}))),a=t.add(pH({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:Te(s)}));t.operators.pop(),t.pushState(Te(s),Te(a),null),$H(e,t,i),t.operators.push(a);let l=t.add(cH({mark:r,pulse:Te(a)}));return l=t.add(hH({pulse:Te(l)})),l=t.add(kc({pulse:Te(l)})),t.addData("root",new rc(t,o,o,l)),t}function Th(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function uxe(e,t){const n=s=>no(e[s],t[s]),r=[Th("background",n("background")),Th("autosize",yye(n("autosize"))),Th("padding",xye(n("padding"))),Th("width",n("width")||0),Th("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return me(e.signals).forEach(s=>{Oe(i,s.name)?s=We(i[s.name],s):r.push(s),o[s.name]=s}),me(t.signals).forEach(s=>{!Oe(o,s.name)&&!Oe(i,s.name)&&r.push(s)}),r}function OH(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function YI(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}OH.prototype=YI.prototype={parse(e){return $H(e,this)},fork(){return new YI(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof WS?Te(e):e;return this.add(b1e({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(Te(this.add(kc({pulse:e})))),this._parent.push(t),this._lookup.push(n?Te(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return it(this._parent)},encode(){return it(this._encode)},lookup(){return it(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(pe(e))return vg(e,t);e.signal||Y("Unsupported field reference: "+ie(e));const n=e.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};t&&(i.as=t),this.field[n]=r=Te(this.add(c1e(i)))}return r},compareRef(e){let t=!1;const n=o=>pn(o)?(t=!0,this.signalRef(o.signal)):Xye(o)?(t=!0,this.exprRef(o.expr)):o,r=me(e.field).map(n),i=me(e.order).map(n);return t?Te(this.add(FI({fields:r,orders:i}))):NI(r,i)},keyRef(e,t){let n=!1;const r=o=>pn(o)?(n=!0,Te(i[o.signal])):o,i=this.signals;return e=me(e).map(r),n?Te(this.add(f1e({fields:e,flat:t}))):Wye(e,t)},sortRef(e){if(!e)return e;const t=ab(e.op,e.field),n=e.order||Vye;return n.signal?Te(this.add(FI({fields:t,orders:this.signalRef(n.signal)}))):NI(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return Oe(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&Y("Duplicate signal name: "+ie(e));const n=t instanceof WS?t:this.add(pv(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||Y("Unrecognized signal name: "+ie(e)),this.signals[e]},signalRef(e){return this.signals[e]?Te(this.signals[e]):(Oe(this.lambdas,e)||(this.lambdas[e]=this.add(pv(null))),Te(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(ye(i)?i.signal||g$(i):ie(i))}return n+"]"}function fxe(e){let t="{",n=0,r,i;for(r in e)i=e[r],t+=(++n>1?",":"")+ie(r)+":"+(ye(i)?i.signal||g$(i):ie(i));return t+"}"}function dxe(){const e="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:e,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:e,fontSize:10},"guide-title":{fill:i,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function hxe(e,t,n){return ye(e)||Y("Input Vega specification must be an object."),t=Od(dxe(),t,e.config),lxe(e,new OH(t,n)).toRuntime()}var pxe="5.25.0";We(Yf,mre,Ile,pue,efe,Yfe,whe,ehe,Ehe,Vhe,npe,upe);const gxe=Object.freeze(Object.defineProperty({__proto__:null,Bounds:sn,CanvasHandler:om,CanvasRenderer:A1,DATE:Xr,DAY:Qn,DAYOFYEAR:cs,Dataflow:kf,Debug:M6,Error:EC,EventStream:px,Gradient:A9,GroupItem:Px,HOURS:gi,Handler:kl,Info:N6,Item:Ix,MILLISECONDS:ko,MINUTES:mi,MONTH:rr,Marks:yi,MultiPulse:YC,None:O6,Operator:Ct,Parameters:hx,Pulse:fl,QUARTER:Yr,RenderType:Ya,Renderer:xs,ResourceLoader:vT,SECONDS:Bi,SVGHandler:IT,SVGRenderer:UT,SVGStringRenderer:HT,Scenegraph:FT,TIME_UNITS:LC,Transform:G,View:XU,WEEK:dn,Warn:SC,YEAR:zn,accessor:ei,accessorFields:nr,accessorName:Xt,array:me,ascending:nx,bandwidthNRD:QC,bin:p8,bootstrapCI:g8,boundClip:wj,boundContext:tm,boundItem:XE,boundMark:V9,boundStroke:ga,changeset:wc,clampRange:G6,codegenExpression:EU,compare:RC,constant:lr,cumulativeLogNormal:iA,cumulativeNormal:mx,cumulativeUniform:lA,dayofyear:wz,debounce:$C,defaultLocale:HC,definition:f8,densityLogNormal:rA,densityNormal:ZC,densityUniform:aA,domChild:Pr,domClear:ao,domCreate:Va,domFind:DT,dotbin:m8,error:Y,expressionFunction:Zt,extend:We,extent:as,extentIndex:W6,falsy:Ta,fastmap:Md,field:qr,flush:V6,font:Ux,fontFamily:im,fontSize:vs,format:ey,formatLocale:a1,formats:VC,hasOwnProperty:Oe,id:Lg,identity:ar,inferType:e8,inferTypes:t8,ingest:mt,inherits:oe,inrange:hf,interpolate:cT,interpolateColors:Fx,interpolateRange:h9,intersect:yj,intersectBoxLine:pf,intersectPath:xT,intersectPoint:bT,intersectRule:D9,isArray:K,isBoolean:Ll,isDate:ul,isFunction:Ve,isIterable:q6,isNumber:ct,isObject:ye,isRegExp:Y6,isString:pe,isTuple:fx,key:OC,lerp:X6,lineHeight:El,loader:ux,locale:Qz,logger:kC,lruCache:K6,markup:jT,merge:J6,mergeConfig:Od,multiLineOffset:OT,one:$d,pad:Q6,panLinear:L6,panLog:z6,panPow:B6,panSymlog:j6,parse:hxe,parseExpression:UR,parseSelector:Gl,path:wx,pathCurves:gT,pathEqual:_j,pathParse:ed,pathRectangle:$9,pathRender:sg,pathSymbols:R9,pathTrail:O9,peek:it,point:Gx,projection:lR,quantileLogNormal:oA,quantileNormal:yx,quantileUniform:uA,quantiles:KC,quantizeInterpolator:p9,quarter:U6,quartiles:JC,get random(){return ji},randomInteger:bne,randomKDE:tA,randomLCG:xne,randomLogNormal:v8,randomMixture:x8,randomNormal:eA,randomUniform:b8,read:i8,regressionConstant:cA,regressionExp:_8,regressionLinear:fA,regressionLoess:k8,regressionLog:w8,regressionPoly:S8,regressionPow:E8,regressionQuad:dA,renderModule:Wx,repeat:Bh,resetDefaultLocale:mte,resetSVGClipId:M9,resetSVGDefIds:ele,responseType:r8,runtimeContext:IU,sampleCurve:xx,sampleLogNormal:nA,sampleNormal:gx,sampleUniform:sA,scale:pt,sceneEqual:GT,sceneFromJSON:Y9,scenePickVisit:w1,sceneToJSON:q9,sceneVisit:Co,sceneZOrder:wT,scheme:fT,serializeXML:uj,setRandom:yne,span:zg,splitAccessPath:ms,stringValue:ie,textMetrics:xo,timeBin:Lz,timeFloor:Tz,timeFormatLocale:eg,timeInterval:Id,timeOffset:Oz,timeSequence:Fz,timeUnitSpecifier:bz,timeUnits:zC,toBoolean:NC,toDate:MC,toNumber:Zn,toSet:So,toString:FC,transform:d8,transforms:Yf,truncate:Z6,truthy:zi,tupleid:Re,typeParsers:$E,utcFloor:Rz,utcInterval:Pd,utcOffset:Nz,utcSequence:Dz,utcdayofyear:Sz,utcquarter:H6,utcweek:kz,version:pxe,visitArray:Ma,week:_z,writeConfig:Nd,zero:Ba,zoomLinear:CC,zoomLog:AC,zoomPow:e1,zoomSymlog:TC},Symbol.toStringTag,{value:"Module"}));function mxe(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var yxe={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},vxe={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},xxe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const bxe=Array.prototype.slice,nu=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,bxe.call(t,1))},wxe=(e,t,n,r,i,o,s)=>new Date(e,t||0,n??1,r||0,i||0,o||0,s||0);var _xe={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,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:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:wxe,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return nu("join",arguments)},indexof:function(){return nu("indexOf",arguments)},lastindexof:function(){return nu("lastIndexOf",arguments)},slice:function(){return nu("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return nu("substring",arguments,String)},split:function(){return nu("split",arguments,String)},replace:function(){return nu("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Exe=["view","item","group","xy","x","y"],QS=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&QS.add(setImmediate);const Sxe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:yxe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),QS.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||_xe[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>vxe[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>xxe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,r)=>{e.memberDepth+=1;const i=e(r.key);return e.memberDepth-=1,QS.has(e(r.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):n[i]=e(r.value),n},{})};function Rh(e,t,n,r,i,o){const s=a=>Sxe[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=r,s.event=i,s.item=o,Exe.forEach(a=>s.fn[a]=function(){return i.vega[a](...arguments)}),s(e)}var kxe={operator(e,t){const n=t.ast,r=e.functions;return i=>Rh(n,r,i)},parameter(e,t){const n=t.ast,r=e.functions;return(i,o)=>Rh(n,r,o,i)},event(e,t){const n=t.ast,r=e.functions;return i=>Rh(n,r,void 0,void 0,i)},handler(e,t){const n=t.ast,r=e.functions;return(i,o)=>{const s=o.item&&o.item.datum;return Rh(n,r,i,s,o)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let u=0,c;for(const f in r)c=Rh(r[f].ast,i,a,l,void 0,s),s[f]!==c&&(s[f]=c,u=1);return n!=="rule"&&mxe(s,r,o),u}}};const Cxe="vega-lite",Axe='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',Txe="5.16.1",Rxe=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],$xe="https://vega.github.io/vega-lite/",Oxe="Vega-Lite is a concise high-level language for interactive visualization.",Nxe=["vega","chart","visualization"],Mxe="build/vega-lite.js",Fxe="build/vega-lite.min.js",Dxe="build/vega-lite.min.js",Ixe="build/src/index",Pxe="build/src/index.d.ts",Lxe={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},zxe=["bin","build","src","vega-lite*","tsconfig.json"],Bxe={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},jxe={type:"git",url:"https://github.com/vega/vega-lite.git"},Uxe="BSD-3-Clause",Hxe={url:"https://github.com/vega/vega-lite/issues"},Gxe={"@babel/core":"^7.22.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/preset-env":"^7.22.10","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-terser":"^0.4.3","@types/chai":"^4.3.5","@types/d3":"^7.4.0","@types/jest":"^29.5.4","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1",ajv:"^8.12.0","ajv-formats":"^2.1.1",chai:"^4.3.7",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.0.0",d3:"^7.8.5","del-cli":"^5.0.0",eslint:"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jest":"^27.2.3","eslint-plugin-prettier":"^5.0.0","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.8.0",jest:"^29.6.3","jest-dev-server":"^9.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.0.2",puppeteer:"^15.0.0","release-it":"^16.1.5",rollup:"^3.28.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3",serve:"^14.2.1",terser:"^5.19.2","ts-jest":"^29.1.1","ts-json-schema-generator":"^1.3.0",typescript:"~5.2.2","vega-cli":"^5.25.0","vega-datasets":"^2.7.0","vega-embed":"^6.22.2","vega-tooltip":"^0.33.0","yaml-front-matter":"^4.1.1"},Wxe={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.2","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},Vxe={vega:"^5.24.0"},qxe={node:">=18"},Yxe={name:Cxe,author:Axe,version:Txe,collaborators:Rxe,homepage:$xe,description:Oxe,keywords:Nxe,main:Mxe,unpkg:Fxe,jsdelivr:Dxe,module:Ixe,types:Pxe,bin:Lxe,files:zxe,scripts:Bxe,repository:jxe,license:Uxe,bugs:Hxe,devDependencies:Gxe,dependencies:Wxe,peerDependencies:Vxe,engines:qxe};function m$(e){return!!e.or}function y$(e){return!!e.and}function v$(e){return!!e.not}function Ey(e,t){if(v$(e))Ey(e.not,t);else if(y$(e))for(const n of e.and)Ey(n,t);else if(m$(e))for(const n of e.or)Ey(n,t);else t(e)}function $f(e,t){return v$(e)?{not:$f(e.not,t)}:y$(e)?{and:e.and.map(n=>$f(n,t))}:m$(e)?{or:e.or.map(n=>$f(n,t))}:t(e)}const Be=structuredClone;function NH(e){throw new Error(e)}function cd(e,t){const n={};for(const r of t)Oe(e,r)&&(n[r]=e[r]);return n}function Wr(e,t){const n={...e};for(const r of t)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>St(e)).join(",")})`};function et(e){if(ct(e))return e;const t=pe(e)?e:St(e);if(t.length<250)return t;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function w$(e,t){return e===void 0||t===void 0?!0:b$(ek(e),ek(t))}function Et(e){return Z(e).length===0}const Z=Object.keys,Bn=Object.values,Tl=Object.entries;function wg(e){return e===!0||e===!1}function Pt(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Rp(e,t){return v$(e)?`!(${Rp(e.not,t)})`:y$(e)?`(${e.and.map(n=>Rp(n,t)).join(") && (")})`:m$(e)?`(${e.or.map(n=>Rp(n,t)).join(") || (")})`:t(e)}function gv(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&gv(e[n],t)&&delete e[n],Et(e)}function mm(e){return e.charAt(0).toUpperCase()+e.substr(1)}function _$(e,t="datum"){const n=ms(e),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(ie).join("][")}]`;r.push(`${t}${o}`)}return r.join(" && ")}function DH(e,t="datum"){return`${t}[${ie(ms(e).join("."))}]`}function Jxe(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Hi(e){return`${ms(e).map(Jxe).join("\\.")}`}function oc(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function E$(e){return`${ms(e).join(".")}`}function fd(e){return e?ms(e).length:0}function Qt(...e){for(const t of e)if(t!==void 0)return t}let IH=42;function PH(e){const t=++IH;return e?String(e)+t:t}function Qxe(){IH=42}function LH(e){return zH(e)?e:`__${e}`}function zH(e){return e.startsWith("__")}function _g(e){if(e!==void 0)return(e%360+360)%360}function pb(e){return ct(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const XI=Object.getPrototypeOf(structuredClone({}));function fi(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!fi(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!fi(r[1],t.get(r[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==XI.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==XI.toString)return e.toString()===t.toString();const i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!fi(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function St(e){const t=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;i_b(e[t])?Pt(`_${t}_${Tl(e[t])}`):Pt(`_${t}_${e[t]}`)).join("")}function Rt(e){return e===!0||Rc(e)&&!e.binned}function Dn(e){return e==="binned"||Rc(e)&&e.binned===!0}function Rc(e){return ye(e)}function _b(e){return e==null?void 0:e.param}function KI(e){switch(e){case ta:case na:case ba:case Jr:case Es:case Ss:case Yl:case wa:case Vl:case ql:case Qr:return 6;case Xl:return 4;default:return 10}}function bm(e){return!!(e!=null&&e.expr)}function Ir(e){const t=Z(e||{}),n={};for(const r of t)n[r]=ai(e[r]);return n}function eG(e){const{anchor:t,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},v={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},b=cd(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:b,nonMarkTitleProperties:y,subtitle:v}}function Pa(e){return pe(e)||K(e)&&pe(e[0])}function Se(e){return!!(e!=null&&e.signal)}function Jl(e){return!!e.step}function _be(e){return K(e)?!1:"fields"in e&&!("data"in e)}function Ebe(e){return K(e)?!1:"fields"in e&&"data"in e}function Ks(e){return K(e)?!1:"field"in e&&"data"in e}const Sbe={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},kbe=Z(Sbe),Cbe={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},tk=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function tG(e){const t=K(e.condition)?e.condition.map(JI):JI(e.condition);return{...ai(e),condition:t}}function ai(e){if(bm(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function JI(e){if(bm(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Nt(e){if(bm(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Se(e)?e:e!==void 0?{value:e}:void 0}function Abe(e){return Se(e)?e.signal:ie(e)}function QI(e){return Se(e)?e.signal:ie(e.value)}function ho(e){return Se(e)?e.signal:e==null?null:ie(e)}function Tbe(e,t,n){for(const r of n){const i=ha(r,t.markDef,t.config);i!==void 0&&(e[r]=Nt(i))}return e}function nG(e){return[].concat(e.type,e.style??[])}function vt(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&t[i]!==void 0?t[i]:t[e]!==void 0?t[e]:o&&(!i||i===e)?void 0:ha(e,t,n,r)}function ha(e,t,n,{vgChannel:r}={}){return Qt(r?mv(e,t,n.style):void 0,mv(e,t,n.style),r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function mv(e,t,n){return rG(e,nG(t),n)}function rG(e,t,n){t=me(t);let r;for(const i of t){const o=n[i];o&&o[e]!==void 0&&(r=o[e])}return r}function iG(e,t){return me(e).reduce((n,r)=>(n.field.push(ue(r,t)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function oG(e,t){const n=[...e];return t.forEach(r=>{for(const i of n)if(fi(i,r))return;n.push(r)}),n}function sG(e,t){return fi(e,t)||!t?e:e?[...me(e),...me(t)].join(", "):t}function aG(e,t){const n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((Pa(n)||Se(n))&&(Pa(r)||Se(r)))return{explicit:e.explicit,value:sG(n,r)};if(Pa(n)||Se(n))return{explicit:e.explicit,value:n};if(Pa(r)||Se(r))return{explicit:e.explicit,value:r};if(!Pa(n)&&!Se(n)&&!Pa(r)&&!Se(r))return{explicit:e.explicit,value:oG(n,r)};throw new Error("It should never reach here")}function N$(e){return`Invalid specification ${St(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Rbe='Autosize "fit" only works for single views and layered views.';function ZI(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function eP(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function tP(e){return e?`Dropping "fit-${e}" because spec has discrete ${Zr(e)}.`:'Dropping "fit" because spec has discrete size.'}function M$(e){return`Unknown field for ${e}. Cannot calculate view size.`}function nP(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function $be(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Obe(e){return`The "nearest" transform is not supported for ${e} marks.`}function lG(e){return`Selection not supported for ${e} yet.`}function Nbe(e){return`Cannot find a selection named "${e}".`}const Mbe="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Fbe="Legend bindings are only supported for selections over an individual field or encoding channel.";function Dbe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Ibe(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Pbe="The same selection must be used to override scale domains in a layered view.",Lbe='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function zbe(e){return`Unknown repeated value "${e}".`}function rP(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Bbe="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function jbe(e){return`Unrecognized parse "${e}".`}function iP(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Ube="Attempt to add the same child twice.";function Hbe(e){return`Ignoring an invalid transform: ${St(e)}.`}const Gbe='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function oP(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Wbe(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${St(t)} is overridden by a child projection ${St(n)}.`}const Vbe="Arc marks uses theta channel rather than angle, replacing angle with theta.";function qbe(e){return`${e}Offset dropped because ${e} is continuous`}function Ybe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${St(n)}}.`}function uG(e){return`Invalid field type "${e}".`}function Xbe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Kbe(e){return`Invalid aggregation operator "${e}".`}function cG(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function Jbe(e){return`Position range does not support relative band size for ${e}.`}function nk(e,t){return`Dropping ${St(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Qbe="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Eb(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function Zbe(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function ewe(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function twe(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function nwe(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function K_(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function rwe(e){return`The ${e} for range marks cannot be an expression`}function iwe(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function owe(e,t){return`Specified orient "${e}" overridden with "${t}".`}function swe(e){return`Cannot use the scale property "${e}" with non-color channel.`}function awe(e){return`Cannot use the relative band size with ${e} scale.`}function lwe(e){return`Using unaggregated domain with raw field has no effect (${St(e)}).`}function uwe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function cwe(e){return`Unaggregated domain is currently unsupported for log scale (${St(e)}).`}function fwe(e){return`Cannot apply size to non-oriented mark "${e}".`}function dwe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function hwe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function fG(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function dG(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function pwe(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${St(n)} and ${St(r)}). Using ${St(n)}.`}function gwe(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${St(n)} and ${St(r)}). Using the union of the two domains.`}function mwe(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function ywe(e){return`Dropping sort property ${St(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const sP="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",vwe="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",xwe="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",bwe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function wwe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function _we(e){return`Cannot stack non-linear scale (${e}).`}function Ewe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function yv(e,t){return`Invalid ${e}: ${St(t)}.`}function Swe(e){return`Dropping day from datetime ${St(e)} as day cannot be combined with other units.`}function kwe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Cwe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Awe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function aP(e){return`1D error band does not support ${e}.`}function hG(e){return`Channel ${e} is required for "binned" bin.`}function Twe(e){return`Channel ${e} should not be used with "binned" bin.`}function Rwe(e){return`Domain for ${e} is required for threshold scale.`}globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;const pG=kC(SC);let hd=pG;function $we(e){return hd=e,hd}function Owe(){return hd=pG,hd}function ne(...e){hd.warn(...e)}function Nwe(...e){hd.debug(...e)}function $c(e){if(e&&ye(e)){for(const t of D$)if(t in e)return!0}return!1}const gG=["january","february","march","april","may","june","july","august","september","october","november","december"],Mwe=gG.map(e=>e.substr(0,3)),mG=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Fwe=mG.map(e=>e.substr(0,3));function Dwe(e){if(pb(e)&&(e=+e),ct(e))return e>4&&ne(yv("quarter",e)),e-1;throw new Error(yv("quarter",e))}function Iwe(e){if(pb(e)&&(e=+e),ct(e))return e-1;{const t=e.toLowerCase(),n=gG.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Mwe.indexOf(r);if(i!==-1)return i;throw new Error(yv("month",e))}}function Pwe(e){if(pb(e)&&(e=+e),ct(e))return e%7;{const t=e.toLowerCase(),n=mG.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Fwe.indexOf(r);if(i!==-1)return i;throw new Error(yv("day",e))}}function F$(e,t){const n=[];if(t&&e.day!==void 0&&Z(e).length>1&&(ne(Swe(e)),e=Be(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const r=t?Iwe(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){const r=t?Dwe(e.quarter):e.quarter;n.push(ct(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const r=t?Pwe(e.day):e.day;n.push(ct(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=e[r];n.push(typeof i>"u"?0:i)}return n}function ac(e){const n=F$(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Lwe(e){const n=F$(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function zwe(e){const t=F$(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const yG={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},D$=Z(yG);function Bwe(e){return!!yG[e]}function Oc(e){return ye(e)?e.binned:vG(e)}function vG(e){return e&&e.startsWith("binned")}function I$(e){return e.startsWith("utc")}function jwe(e){return e.substring(3)}const Uwe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Sb(e){return D$.filter(t=>bG(e,t))}function xG(e){const t=Sb(e);return t[t.length-1]}function bG(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Hwe(e,t,{end:n}={end:!1}){const r=_$(t),i=I$(e)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of D$)bG(e,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),Lwe(a)}function wG(e){if(!e)return;const t=Sb(e);return`timeUnitSpecifier(${St(t)}, ${St(Uwe)})`}function Gwe(e,t,n){if(!e)return;const r=wG(e);return`${n||I$(e)?"utc":"time"}Format(${t}, ${r})`}function Rn(e){if(!e)return;let t;return pe(e)?vG(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:ye(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),I$(t.unit)&&(t.utc=!0,t.unit=jwe(t.unit)),t}function Wwe(e){const{utc:t,...n}=Rn(e);return n.unit?(t?"utc":"")+Z(n).map(r=>Pt(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):(t?"utc":"")+"timeunit"+Z(n).map(r=>Pt(`_${r}_${n[r]}`)).join("")}function _G(e,t=n=>n){const n=Rn(e),r=xG(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=EG(r,n.step),a={...i,[s]:+i[s]+o};return`${t(ac(a))} - ${t(ac(i))}`}}const Vwe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function qwe(e){return!!Vwe[e]}function EG(e,t=1){if(qwe(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Ywe(e){return e==null?void 0:e.param}function P$(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function L$(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function z$(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function B$(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function j$(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function U$(e){if(e!=null&&e.field){if(K(e.range)&&e.range.length===2)return!0;if(Se(e.range))return!0}return!1}function H$(e){return!!(e!=null&&e.field)&&(K(e.oneOf)||K(e.in))}function Xwe(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function SG(e){return H$(e)||P$(e)||U$(e)||L$(e)||B$(e)||z$(e)||j$(e)}function jo(e,t){return Fb(e,{timeUnit:t,wrapTime:!0})}function Kwe(e,t){return e.map(n=>jo(n,t))}function kG(e,t=!0){const{field:n}=e,r=Rn(e.timeUnit),{unit:i,binned:o}=r||{},s=ue(e,{expr:"datum"}),a=i?`time(${o?s:Hwe(i,n)})`:s;if(P$(e))return`${a}===${jo(e.equal,i)}`;if(L$(e)){const l=e.lt;return`${a}<${jo(l,i)}`}else if(B$(e)){const l=e.gt;return`${a}>${jo(l,i)}`}else if(z$(e)){const l=e.lte;return`${a}<=${jo(l,i)}`}else if(j$(e)){const l=e.gte;return`${a}>=${jo(l,i)}`}else{if(H$(e))return`indexof([${Kwe(e.oneOf,i).join(",")}], ${a}) !== -1`;if(Xwe(e))return G$(a,e.valid);if(U$(e)){const{range:l}=e,u=Se(l)?{signal:`${l.signal}[0]`}:l[0],c=Se(l)?{signal:`${l.signal}[1]`}:l[1];if(u!==null&&c!==null&&t)return"inrange("+a+", ["+jo(u,i)+", "+jo(c,i)+"])";const f=[];return u!==null&&f.push(`${a} >= ${jo(u,i)}`),c!==null&&f.push(`${a} <= ${jo(c,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${St(e)}`)}function G$(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Jwe(e){return SG(e)&&e.timeUnit?{...e,timeUnit:Rn(e.timeUnit)}:e}const wm={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Qwe(e){return e==="quantitative"||e==="temporal"}function CG(e){return e==="ordinal"||e==="nominal"}const lc=wm.quantitative,W$=wm.ordinal,pd=wm.temporal,V$=wm.nominal,qd=wm.geojson;function Zwe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case lc:return"quantitative";case"t":case pd:return"temporal";case"o":case W$:return"ordinal";case"n":case V$:return"nominal";case qd:return"geojson"}}const Vr={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},rk={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function e_e(e,t){const n=rk[e],r=rk[t];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const t_e={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function lP(e){return t_e[e]}const AG=new Set(["linear","log","pow","sqrt","symlog"]),TG=new Set([...AG,"time","utc"]);function RG(e){return AG.has(e)}const $G=new Set(["quantile","quantize","threshold"]),n_e=new Set([...TG,...$G,"sequential","identity"]),r_e=new Set(["ordinal","bin-ordinal","point","band"]);function $n(e){return r_e.has(e)}function xi(e){return n_e.has(e)}function po(e){return TG.has(e)}function gd(e){return $G.has(e)}const i_e={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function o_e(e){return!pe(e)&&!!e.name}function OG(e){return e==null?void 0:e.param}function s_e(e){return e==null?void 0:e.unionWith}function a_e(e){return ye(e)&&"field"in e}const l_e={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:ROe,domain:$Oe,range:OOe,rangeMax:NOe,rangeMin:MOe,scheme:FOe,...u_e}=l_e,c_e=Z(u_e);function ik(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return po(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return po(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return po(e);case"nice":return po(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return xi(e)&&!tt(["log","time","utc","threshold","quantile"],e)}}function NG(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Of(e)?void 0:swe(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function f_e(e,t){return tt([W$,V$],t)?e===void 0||$n(e):t===pd?tt([Vr.TIME,Vr.UTC,void 0],e):t===lc?RG(e)||gd(e)||e===void 0:!0}function d_e(e,t,n=!1){if(!_a(e))return!1;switch(e){case Lt:case Nn:case Wl:case Vd:case qi:case Fo:return po(t)||t==="band"?!0:t==="point"?!n:!1;case ba:case Yl:case wa:case Vl:case ql:case Ac:return po(t)||gd(t)||tt(["band","point","ordinal"],t);case Jr:case Es:case Ss:return t!=="band";case Xl:case Qr:return t==="ordinal"||gd(t)}}const Or={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},MG=Or.arc,kb=Or.area,Cb=Or.bar,h_e=Or.image,Ab=Or.line,Tb=Or.point,p_e=Or.rect,vv=Or.rule,FG=Or.text,q$=Or.tick,g_e=Or.trail,Y$=Or.circle,X$=Or.square,DG=Or.geoshape;function Ql(e){return["line","area","trail"].includes(e)}function Eg(e){return["rect","bar","image","arc"].includes(e)}const m_e=new Set(Z(Or));function hs(e){return e.type}const y_e=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],v_e=["fill","fillOpacity"],x_e=[...y_e,...v_e],b_e={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},uP=Z(b_e),w_e={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},__e={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},E_e={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},IG=Z(E_e);function uc(e){return e&&e.band!=null}const S_e={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},PG=5,k_e={binSpacing:1,continuousBandSize:PG,minBandSize:.25,timeUnitBandPosition:.5},C_e={binSpacing:0,continuousBandSize:PG,minBandSize:.25,timeUnitBandPosition:.5},A_e={thickness:1};function T_e(e){return hs(e)?e.type:e}function K$(e){const{channel:t,channelDef:n,markDef:r,scale:i,config:o}=e,s=Q$(e);return te(n)&&!QH(n.aggregate)&&i&&po(i.get("type"))?R_e({fieldDef:n,channel:t,markDef:r,ref:s,config:o}):s}function R_e({fieldDef:e,channel:t,markDef:n,ref:r,config:i}){return Ql(n.type)?r:vt("invalid",n,i)===null?[$_e(e,t),r]:r}function $_e(e,t){const n=J$(e,!0),i=Tc(t)==="y"?{field:{group:"height"}}:{value:0};return{test:n,...i}}function J$(e,t=!0){return G$(pe(e)?e:ue(e,{expr:"datum"}),!t)}function O_e(e){const{datum:t}=e;return $c(t)?ac(t):`${St(t)}`}function Lu(e,t,n,r){const i={};if(t&&(i.scale=t),As(e)){const{datum:o}=e;$c(o)?i.signal=ac(o):Se(o)?i.signal=o.signal:bm(o)?i.signal=o.expr:i.value=o}else i.field=ue(e,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function xv({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!Se(s)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return W_e(e);default:return G_e(e,t)}};let JG=KG;function QG(e){JG=e}function V_e(){QG(KG)}function Nf(e,t,{allowDisabling:n,includeDefault:r=!0}){var a;const i=(a=nO(e))==null?void 0:a.title;if(!te(e))return i??e.title;const o=e,s=r?rO(o,t):void 0;return n?Qt(i,o.title,s):i??o.title??s}function nO(e){if(yd(e)&&e.axis)return e.axis;if(YG(e)&&e.legend)return e.legend;if(eO(e)&&e.header)return e.header}function rO(e,t){return JG(e,t)}function _v(e){if(XG(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=nO(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function q_e(e,t){var o;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(tO(e)&&K(e.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=e;if(i)return"temporal";if(r||n&&!Kl(n)&&!da(n))return"quantitative";if(Nc(e)&&((o=e.scale)!=null&&o.type))switch(rk[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function ps(e){if(te(e))return e;if(Nb(e))return e.condition}function hn(e){if(Ue(e))return e;if(Sm(e))return e.condition}function ZG(e,t,n,r={}){if(pe(e)||ct(e)||Ll(e)){const i=pe(e)?"string":ct(e)?"number":"boolean";return ne(Ybe(t,i,e)),{value:e}}return Ue(e)?Ev(e,t,n,r):Sm(e)?{...e,condition:Ev(e.condition,t,n,r)}:e}function Ev(e,t,n,r){if(XG(e)){const{format:i,formatType:o,...s}=e;if(cc(o)&&!n.customFormatTypes)return ne(oP(t)),Ev(s,t,n,r)}else{const i=yd(e)?"axis":YG(e)?"legend":eO(e)?"header":null;if(i&&e[i]){const{format:o,formatType:s,...a}=e[i];if(cc(s)&&!n.customFormatTypes)return ne(oP(t)),Ev({...e,[i]:a},t,n,r)}}return te(e)?iO(e,t,r):Y_e(e)}function Y_e(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=ct(n)?"quantitative":pe(n)?"nominal":$c(n)?"temporal":void 0,{...e,type:t}}function iO(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=e,a={...e};if(!n&&r&&!O$(r)&&!Kl(r)&&!da(r)&&(ne(Kbe(r)),delete a.aggregate),i&&(a.timeUnit=Rn(i)),s&&(a.field=`${s}`),Rt(o)&&(a.bin=Mb(o,t)),Dn(o)&&!an(t)&&ne(Twe(t)),Ar(a)){const{type:l}=a,u=Zwe(l);l!==u&&(a.type=u),l!=="quantitative"&&QH(r)&&(ne(Xbe(l,r)),a.type="quantitative")}else if(!VH(t)){const l=q_e(a,t);a.type=l}if(Ar(a)){const{compatible:l,warning:u}=X_e(a,t)||{};l===!1&&ne(u)}if(tO(a)&&pe(a.sort)){const{sort:l}=a;if(fP(l))return{...a,sort:{encoding:l}};const u=l.substr(1);if(l.charAt(0)==="-"&&fP(u))return{...a,sort:{encoding:u,order:"descending"}}}if(eO(a)){const{header:l}=a;if(l){const{orient:u,...c}=l;if(u)return{...a,header:{...c,labelOrient:l.labelOrient||u,titleOrient:l.titleOrient||u}}}}return a}function Mb(e,t){return Ll(e)?{maxbins:KI(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:KI(t)}:e}const Wc={compatible:!0};function X_e(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case ta:case na:case gb:return wv(e)?Wc:{compatible:!1,warning:ewe(t)};case Lt:case Nn:case Wl:case Vd:case Jr:case Es:case Ss:case ym:case vm:case mb:case sc:case yb:case vb:case Ac:case qi:case Fo:case xb:return Wc;case Io:case Gi:case Do:case Po:return n!==lc?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Wc;case wa:case Vl:case ql:case Yl:case ba:case xa:case va:case Mo:case _s:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Wc;case Qr:case Xl:return!wv(e)&&!U_e(e)?{compatible:!1,warning:twe(t)}:Wc;case dd:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Wc}}function vd(e){const{formatType:t}=_v(e);return t==="time"||!t&&K_e(e)}function K_e(e){return e&&(e.type==="temporal"||te(e)&&!!e.timeUnit)}function Fb(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var l;const o=t&&((l=Rn(t))==null?void 0:l.unit);let s=o||n==="temporal",a;return bm(e)?a=e.expr:Se(e)?a=e.signal:$c(e)?(s=!0,a=ac(e)):(pe(e)||ct(e))&&s&&(a=`datetime(${St(e)})`,Bwe(o)&&(ct(e)&&e<1e4||pe(e)&&isNaN(Date.parse(e)))&&(a=ac({[o]:e}))),a?r&&s?`time(${a})`:a:i?void 0:St(e)}function eW(e,t){const{type:n}=e;return t.map(r=>{const i=te(e)&&!Oc(e.timeUnit)?e.timeUnit:void 0,o=Fb(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function km(e,t){return Rt(e.bin)?_a(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const pP={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Cm(e){return e==null?void 0:e.condition}const tW=["domain","grid","labels","ticks","title"],J_e={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},nW={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Q_e={...nW,style:1,labelExpr:1,encoding:1};function gP(e){return!!Q_e[e]}const Z_e={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},rW=Z(Z_e);function Ea(e){return"mark"in e}class Db{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Ea(t)?T_e(t.mark)===this.name:!1}}function zu(e,t){const n=e&&e[t];return n?K(n)?ic(n,r=>!!r.field):te(n)||Nb(n):!1}function iW(e,t){const n=e&&e[t];return n?K(n)?ic(n,r=>!!r.field):te(n)||As(n)||Sm(n):!1}function oW(e,t){if(an(t)){const n=e[t];if((te(n)||As(n))&&(CG(n.type)||te(n)&&n.timeUnit)){const r=A$(t);return iW(e,r)}}return!1}function oO(e){return ic(tbe,t=>{if(zu(e,t)){const n=e[t];if(K(n))return ic(n,r=>!!r.aggregate);{const r=ps(n);return r&&!!r.aggregate}}return!1})}function sW(e,t){const n=[],r=[],i=[],o=[],s={};return sO(e,(a,l)=>{if(te(a)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=nO(a),g=p==null?void 0:p.title;let m=ue(a,{forAs:!0});const y={...g?[]:{title:Nf(a,t,{allowDisabling:!0})},...h,field:m};if(c){let v;if(Kl(c)?(v="argmax",m=ue({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${u}`):da(c)?(v="argmin",m=ue({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${u}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(v=c),v){const b={op:v,as:m};u&&(b.field=u),o.push(b)}}else if(n.push(m),Ar(a)&&Rt(f)){if(r.push({bin:f,field:u,as:m}),n.push(ue(a,{binSuffix:"end"})),km(a,l)&&n.push(ue(a,{binSuffix:"range"})),an(l)){const v={field:`${m}_end`};s[`${l}2`]=v}y.bin="binned",VH(l)||(y.type=lc)}else if(d&&!Oc(d)){i.push({timeUnit:d,field:u,as:m});const v=Ar(a)&&a.type!==pd&&"time";v&&(l===ym||l===sc?y.formatType=v:fbe(l)?y.legend={formatType:v,...y.legend}:an(l)&&(y.axis={formatType:v,...y.axis}))}s[l]=y}else n.push(u),s[l]=e[l]}else s[l]=e[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function e2e(e,t,n){const r=hbe(t,n);if(r){if(r==="binned"){const i=e[t===Mo?Lt:Nn];return!!(te(i)&&te(e[t])&&Dn(i.bin))}}else return!1;return!0}function t2e(e,t,n,r){const i={};for(const o of Z(e))WH(o)||ne(Zbe(o));for(let o of abe){if(!e[o])continue;const s=e[o];if(xm(o)){const a=sbe(o),l=i[a];if(te(l)&&Qwe(l.type)&&te(s)&&!l.timeUnit){ne(qbe(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(ne(Vbe),o=qi),!e2e(e,o,t)){ne(Eb(o,t));continue}if(o===ba&&t==="line"){const a=ps(e[o]);if(a!=null&&a.aggregate){ne(Qbe);continue}}if(o===Jr&&(n?"fill"in e:"stroke"in e)){ne(cG("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===vm||o===dd&&!K(s)&&!Ao(s)||o===sc&&K(s)){if(s){if(o===dd){const a=e[o];if(qG(a)){i[o]=a;continue}}i[o]=me(s).reduce((a,l)=>(te(l)?a.push(iO(l,o)):ne(nk(l,o)),a),[])}}else{if(o===sc&&s===null)i[o]=null;else if(!te(s)&&!As(s)&&!Ao(s)&&!Ob(s)&&!Se(s)){ne(nk(s,o));continue}i[o]=ZG(s,o,r)}}return i}function Ib(e,t){const n={};for(const r of Z(e)){const i=ZG(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function n2e(e){const t=[];for(const n of Z(e))if(zu(e,n)){const r=e[n],i=me(r);for(const o of i)te(o)?t.push(o):Nb(o)&&t.push(o.condition)}return t}function sO(e,t,n){if(e)for(const r of Z(e)){const i=e[r];if(K(i))for(const o of i)t.call(n,o,r);else t.call(n,i,r)}}function r2e(e,t,n,r){return e?Z(e).reduce((i,o)=>{const s=e[o];return K(s)?s.reduce((a,l)=>t.call(r,a,l,o),i):t.call(r,i,s,o)},n):n}function aW(e,t){return Z(t).reduce((n,r)=>{switch(r){case Lt:case Nn:case yb:case xb:case vb:case Mo:case _s:case Wl:case Vd:case qi:case xa:case Fo:case va:case Do:case Io:case Po:case Gi:case ym:case Qr:case Ac:case sc:return n;case dd:if(e==="line"||e==="trail")return n;case vm:case mb:{const i=t[r];if(K(i)||te(i))for(const o of me(i))o.aggregate||n.push(ue(o,{}));return n}case ba:if(e==="trail")return n;case Jr:case Es:case Ss:case wa:case Vl:case ql:case Xl:case Yl:{const i=ps(t[r]);return i&&!i.aggregate&&n.push(ue(i,{})),n}}},[])}function i2e(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(K(t)){for(const o of t)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return K(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function sk(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=e.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${aO(t)}`:"";return{field:s+t.field,type:t.type,title:Se(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=n2e(n).map(B_e);return{tooltip:[...i,...Qo(o,et)]}}function aO(e){const{title:t,field:n}=e;return Qt(t,n)}function lO(e,t,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:u,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=aO(n);return lW(e,a,i,{mark:l,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...pe(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...r,...f}})}}function lW(e,t,n,r){const{clip:i,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...hs(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(t)}`,...Ll(e[t])?{}:e[t]}}]:[]}function uW(e,t,n){const{encoding:r}=e,i=t==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:$0(o,n),continuousAxisChannelDef2:$0(s,n),continuousAxisChannelDefError:$0(a,n),continuousAxisChannelDefError2:$0(l,n),continuousAxis:i}}function $0(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...r}=e;return n!==t&&ne(Awe(n,t)),r}else return e}function cW(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(hs(n)&&n.orient)return n.orient;if(Za(i)){if(Za(o)){const s=te(i)&&i.aggregate,a=te(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return vd(o)&&!vd(i)?"horizontal":"vertical"}return"horizontal"}else{if(Za(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Sv="boxplot",o2e=["box","median","outliers","rule","ticks"],s2e=new Db(Sv,dW);function fW(e){return ct(e)?"tukey":e}function dW(e,{config:t}){e={...e,encoding:Ib(e.encoding,t)};const{mark:n,encoding:r,params:i,projection:o,...s}=e,a=hs(n)?n:{type:n};i&&ne(lG("boxplot"));const l=a.extent??t.boxplot.extent,u=vt("size",a,t),c=a.invalid,f=fW(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:v,encodingWithoutContinuousAxis:b,ticksOrient:w,boxOrient:_,customTooltipWithoutAggregatedField:k}=a2e(e,l,t),{color:E,size:A,...N}=b,O=Mn=>lO(a,m,g,Mn,t.boxplot),F=O(N),U=O(b),M=O({...N,...A?{size:A}:{}}),L=sk([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,b),I={type:"tick",color:"black",opacity:1,orient:w,invalid:c,aria:!1},B=f==="min-max"?L:sk([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),H=[...F({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:B}),...F({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:B}),...F({partName:"ticks",mark:I,positionPrefix:"lower_whisker",extraEncoding:B}),...F({partName:"ticks",mark:I,positionPrefix:"upper_whisker",extraEncoding:B})],z=[...f!=="tukey"?H:[],...U({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:L}),...M({partName:"median",mark:{type:"tick",invalid:c,...ye(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:L})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:z};const j=`datum["lower_box_${g.field}"]`,J=`datum["upper_box_${g.field}"]`,ce=`(${J} - ${j})`,_e=`${j} - ${l} * ${ce}`,Ye=`${J} + ${l} * ${ce}`,je=`datum["${g.field}"]`,ft={joinaggregate:hW(g.field),groupby:y},ln={transform:[{filter:`(${_e} <= ${je}) && (${je} <= ${Ye})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${g.field}`},{op:"max",field:g.field,as:`upper_whisker_${g.field}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${g.field}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${g.field}`},...v],groupby:y}],layer:H},{tooltip:ni,...Ts}=N,{scale:xe,axis:He}=g,qe=aO(g),ee=Wr(He,["title"]),en=lW(a,"outliers",t.boxplot,{transform:[{filter:`(${je} < ${_e}) || (${je} > ${Ye})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...qe!==void 0?{title:qe}:{},...xe!==void 0?{scale:xe}:{},...Et(ee)?{}:{axis:ee}},...Ts,...E?{color:E}:{},...k?{tooltip:k}:{}}})[0];let at;const yn=[...d,...h,ft];return en?at={transform:yn,layer:[en,ln]}:(at=ln,at.transform.unshift(...yn)),{...s,layer:[at,{transform:p,layer:z}]}}function hW(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}function a2e(e,t,n){const r=cW(e,Sv),{continuousAxisChannelDef:i,continuousAxis:o}=uW(e,r,Sv),s=i.field,a=fW(t),l=[...hW(s),{op:"median",field:s,as:`mid_box_${s}`},{op:"min",field:s,as:(a==="min-max"?"lower_whisker_":"min_")+s},{op:"max",field:s,as:(a==="min-max"?"upper_whisker_":"max_")+s}],u=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${s}"] - datum["lower_box_${s}"]`,as:`iqr_${s}`},{calculate:`min(datum["upper_box_${s}"] + datum["iqr_${s}"] * ${t}, datum["max_${s}"])`,as:`upper_whisker_${s}`},{calculate:`max(datum["lower_box_${s}"] - datum["iqr_${s}"] * ${t}, datum["min_${s}"])`,as:`lower_whisker_${s}`}],{[o]:c,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=i2e(f),{bins:p,timeUnits:g,aggregate:m,groupby:y,encoding:v}=sW(h,n),b=r==="vertical"?"horizontal":"vertical",w=r,_=[...p,...g,{aggregate:[...m,...l],groupby:y},...u];return{bins:p,timeUnits:g,transform:_,groupby:y,aggregate:m,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:d}}const uO="errorbar",l2e=["ticks","rule"],u2e=new Db(uO,pW);function pW(e,{config:t}){e={...e,encoding:Ib(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:u}=gW(e,uO,t);delete o.size;const c=lO(a,i,r,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function c2e(e,t){const{encoding:n}=e;if(f2e(n))return{orient:cW(e,t),inputType:"raw"};const r=d2e(n),i=h2e(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Ue(a)&&Ue(l))throw new Error(`${t} cannot have both x2 and y2`);if(Ue(a)){if(Za(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Ue(l)){if(Za(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,u=n.yError,c=n.yError2;if(Ue(l)&&!Ue(a))throw new Error(`${t} cannot have xError2 without xError`);if(Ue(c)&&!Ue(u))throw new Error(`${t} cannot have yError2 without yError`);if(Ue(a)&&Ue(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Ue(a)){if(Za(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Ue(u)){if(Za(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function f2e(e){return(Ue(e.x)||Ue(e.y))&&!Ue(e.x2)&&!Ue(e.y2)&&!Ue(e.xError)&&!Ue(e.xError2)&&!Ue(e.yError)&&!Ue(e.yError2)}function d2e(e){return Ue(e.x2)||Ue(e.y2)}function h2e(e){return Ue(e.xError)||Ue(e.xError2)||Ue(e.yError)||Ue(e.yError2)}function gW(e,t,n){const{mark:r,encoding:i,params:o,projection:s,...a}=e,l=hs(r)?r:{type:r};o&&ne(lG(t));const{orient:u,inputType:c}=c2e(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=uW(e,u,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=p2e(l,f,d,h,p,c,t,n),{[g]:w,[g==="x"?"x2":"y2"]:_,[g==="x"?"xError":"yError"]:k,[g==="x"?"xError2":"yError2"]:E,...A}=i,{bins:N,timeUnits:O,aggregate:F,groupby:U,encoding:M}=sW(A,n),L=[...F,...m],I=c!=="raw"?[]:U,B=sk(v,f,M,b);return{transform:[...a.transform??[],...N,...O,...L.length===0?[]:[{aggregate:L,groupby:I}],...y],groupby:I,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:M,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:B}}function p2e(e,t,n,r,i,o,s,a){let l=[],u=[];const c=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&ne(Cwe(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:mm(h)},{fieldPrefix:"upper_",titlePrefix:mP(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:mP(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),l=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:Nf({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Nf({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Nf({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&ne(kwe(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:`upper_${c}`}],i?u.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:`lower_${c}`}):u.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:`lower_${c}`}));for(const h of u)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:oc(oc(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function mP(e,t,n){return`${mm(e)} ${n} ${t}`}const cO="errorband",g2e=["band","borders"],m2e=new Db(cO,mW);function mW(e,{config:t}){e={...e,encoding:Ib(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=gW(e,cO,t),u=s,c=lO(u,i,r,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):u.interpolate?ne(aP("interpolate")):u.tension&&ne(aP("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const yW={};function fO(e,t,n){const r=new Db(e,t);yW[e]={normalizer:r,parts:n}}function y2e(){return Z(yW)}fO(Sv,dW,o2e);fO(uO,pW,l2e);fO(cO,mW,g2e);const v2e=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],vW={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},xW={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},x2e=Z(vW),b2e=Z(xW),w2e={header:1,headerRow:1,headerColumn:1,headerFacet:1},bW=Z(w2e),wW=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],_2e={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},E2e={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},To="_vgsid_",S2e={point:{on:"click",fields:[To],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function dO(e){return e==="legend"||!!(e!=null&&e.legend)}function J_(e){return dO(e)&&ye(e)}function hO(e){return!!(e!=null&&e.select)}function _W(e){const t=[];for(const n of e||[]){if(hO(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};t.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};t.push(s)}}return t}function k2e(e){return Pb(e)||gO(e)||pO(e)}function pO(e){return"concat"in e}function Pb(e){return"vconcat"in e}function gO(e){return"hconcat"in e}function EW({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function gs(e){return ye(e)&&e.step!==void 0}function yP(e){return e.view||e.width||e.height}const vP=20,C2e={align:1,bounds:1,center:1,columns:1,spacing:1},A2e=Z(C2e);function T2e(e,t,n){const r=n[t],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&($b(e)&&!Em(e.facet)||pO(e))&&(i.columns=s),Pb(e)&&(i.columns=1);for(const a of A2e)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];i[a]=ct(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=e[a];return i}function ak(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function kv(e,t){const n=Cv(e,t);return gs(n)?n.step:SW}function Cv(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Qt(n,{step:e.step})}const SW=20,R2e={continuousWidth:200,continuousHeight:200,step:SW},$2e={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:R2e,mark:__e,arc:{},area:{},bar:k_e,circle:{},geoshape:{},image:{},line:{},point:{},rect:C_e,rule:{color:"black"},square:{},text:{color:"black"},tick:A_e,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:i_e,projection:{},legend:_2e,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:S2e,style:{},title:{},facet:{spacing:vP},concat:{spacing:vP},normalizedNumberFormat:".0%"},Fs=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],xP={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},bP={blue:Fs[0],orange:Fs[1],red:Fs[2],teal:Fs[3],green:Fs[4],yellow:Fs[5],purple:Fs[6],pink:Fs[7],brown:Fs[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function O2e(e={}){return{signals:[{name:"color",value:ye(e)?{...bP,...e}:bP}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function N2e(e){return{signals:[{name:"fontSize",value:ye(e)?{...xP,...e}:xP}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function M2e(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function kW(e){const t=Z(e||{}),n={};for(const r of t){const i=e[r];n[r]=Cm(i)?tG(i):ai(i)}return n}function F2e(e){const t=Z(e),n={};for(const r of t)n[r]=kW(e[r]);return n}const D2e=[...IG,...rW,...bW,"background","padding","legend","lineBreak","scale","style","title","view"];function CW(e={}){const{color:t,font:n,fontSize:r,selection:i,...o}=e,s=Od({},Be($2e),n?M2e(n):{},t?O2e(t):{},r?N2e(r):{},o||{});i&&Nd(s,"selection",i,!0);const a=Wr(s,D2e);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=ai(s[l]));for(const l of IG)s[l]&&(a[l]=Ir(s[l]));for(const l of rW)s[l]&&(a[l]=kW(s[l]));for(const l of bW)s[l]&&(a[l]=Ir(s[l]));return s.legend&&(a.legend=Ir(s.legend)),s.scale&&(a.scale=Ir(s.scale)),s.style&&(a.style=F2e(s.style)),s.title&&(a.title=Ir(s.title)),s.view&&(a.view=Ir(s.view)),a}const I2e=new Set(["view",...m_e]),P2e=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],L2e={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...w_e};function z2e(e){e=Be(e);for(const t of P2e)delete e[t];if(e.axis)for(const t in e.axis)Cm(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of v2e)delete e.legend[t];if(e.mark){for(const t of uP)delete e.mark[t];e.mark.tooltip&&ye(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(_W(e.params)),delete e.params);for(const t of I2e){for(const r of uP)delete e[t][r];const n=L2e[t];if(n)for(const r of n)delete e[t][r];j2e(e,t)}for(const t of y2e())delete e[t];B2e(e);for(const t in e)ye(e[t])&&Et(e[t])&&delete e[t];return Et(e)?void 0:e}function B2e(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=eG(e.title);Et(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Et(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Et(r)?delete e.title:e.title=r}function j2e(e,t,n,r){const i=r?e[t][r]:e[t];t==="view"&&(n="cell");const o={...i,...e.style[n??t]};Et(o)||(e.style[n??t]=o),r||delete e[t]}function Lb(e){return"layer"in e}function U2e(e){return"repeat"in e}function H2e(e){return!K(e.repeat)&&e.repeat.layer}class mO{map(t,n){return $b(t)?this.mapFacet(t,n):U2e(t)?this.mapRepeat(t,n):gO(t)?this.mapHConcat(t,n):Pb(t)?this.mapVConcat(t,n):pO(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Lb(t))return this.mapLayer(t,n);if(Ea(t))return this.mapUnit(t,n);throw new Error(N$(t))}mapLayer(t,n){return{...t,layer:t.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(r=>this.map(r,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(r=>this.map(r,n))}}mapConcat(t,n){const{concat:r,...i}=t;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const G2e={zero:1,center:1,normalize:1};function W2e(e){return e in G2e}const V2e=new Set([MG,Cb,kb,vv,Tb,Y$,X$,Ab,FG,q$]),q2e=new Set([Cb,kb,MG]);function Vc(e){return te(e)&&md(e)==="quantitative"&&!e.bin}function wP(e,t,{orient:n,type:r}){const i=t==="x"?"y":"radius",o=t==="x",s=e[t],a=e[i];if(te(s)&&te(a))if(Vc(s)&&Vc(a)){if(s.stack)return t;if(a.stack)return i;const l=te(s)&&!!s.aggregate,u=te(a)&&!!a.aggregate;if(l!==u)return l?t:i;if(o&&["bar","area"].includes(r)){if(n==="vertical")return i;if(n==="horizontal")return t}}else{if(Vc(s))return t;if(Vc(a))return i}else{if(Vc(s))return t;if(Vc(a))return i}}function Y2e(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function AW(e,t){var g,m;const n=hs(e)?e:{type:e},r=n.type;if(!V2e.has(r))return null;const i=wP(t,"x",n)||wP(t,"theta",n);if(!i)return null;const o=t[i],s=te(o)?ue(o,{}):void 0,a=Y2e(i),l=[],u=new Set;if(t[a]){const y=t[a],v=te(y)?ue(y,{}):void 0;v&&v!==s&&(l.push(a),u.add(v))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=te(f)?ue(f,{}):void 0;d&&d!==s&&(l.push(c),u.add(d));const h=lbe.reduce((y,v)=>{if(v!=="tooltip"&&zu(t,v)){const b=t[v];for(const w of me(b)){const _=ps(w);if(_.aggregate)continue;const k=ue(_,{});(!k||!u.has(k))&&y.push({channel:v,fieldDef:_})}}return y},[]);let p;return o.stack!==void 0?Ll(o.stack)?p=o.stack?"zero":null:p=o.stack:q2e.has(r)&&(p="zero"),!p||!W2e(p)||oO(t)&&h.length===0?null:(g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==Vr.LINEAR?(o!=null&&o.stack&&ne(_we(o.scale.type)),null):Ue(t[ks(i)])?(o.stack!==void 0&&ne(wwe(i)),null):(te(o)&&o.aggregate&&!bbe.has(o.aggregate)&&ne(Ewe(o.aggregate)),{groupbyChannels:l,groupbyFields:u,fieldChannel:i,impute:o.impute===null?!1:Ql(r),stackBy:h,offset:p})}function TW(e,t,n){const r=Ir(e),i=vt("orient",r,n);if(r.orient=Q2e(r.type,t,i),i!==void 0&&i!==r.orient&&ne(owe(r.orient,i)),r.type==="bar"&&r.orient){const a=vt("cornerRadiusEnd",r,n);if(a!==void 0){const l=r.orient==="horizontal"&&t.x2||r.orient==="vertical"&&t.y2?["cornerRadius"]:S_e[r.orient];for(const u of l)r[u]=a;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}return vt("opacity",r,n)===void 0&&(r.opacity=K2e(r.type,t)),vt("cursor",r,n)===void 0&&(r.cursor=X2e(r,t,n)),r}function X2e(e,t,n){return t.href||e.href||vt("href",e,n)?"pointer":e.cursor}function K2e(e,t){if(tt([Tb,q$,Y$,X$],e)&&!oO(t))return .7}function J2e(e,t,{graticule:n}){if(n)return!1;const r=ha("filled",e,t),i=e.type;return Qt(r,i!==Tb&&i!==Ab&&i!==vv)}function Q2e(e,t,n){switch(e){case Tb:case Y$:case X$:case FG:case p_e:case h_e:return}const{x:r,y:i,x2:o,y2:s}=t;switch(e){case Cb:if(te(r)&&(Dn(r.bin)||te(i)&&i.aggregate&&!r.aggregate))return"vertical";if(te(i)&&(Dn(i.bin)||te(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(te(r)&&r.type===lc&&!Rt(r.bin)||bv(r))&&te(i)&&Dn(i.bin)?"horizontal":"vertical";if(!s)return(te(i)&&i.type===lc&&!Rt(i.bin)||bv(i))&&te(r)&&Dn(r.bin)?"vertical":"horizontal"}case vv:if(o&&!(te(r)&&Dn(r.bin))&&s&&!(te(i)&&Dn(i.bin)))return;case kb:if(s)return te(i)&&Dn(i.bin)?"horizontal":"vertical";if(o)return te(r)&&Dn(r.bin)?"vertical":"horizontal";if(e===vv){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case Ab:case q$:{const a=hP(r),l=hP(i);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const u=Ar(r)&&r.type===pd,c=Ar(i)&&i.type===pd;if(u&&!c)return"vertical";if(!u&&c)return"horizontal"}return}}return"vertical"}function Z2e(e){const{point:t,line:n,...r}=e;return Z(r).length>1?r:r.type}function eEe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Wr(e[t],["point","line"])});return e}function Q_(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?ye(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?ye(t.point)?t.point:{}:void 0}function _P(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class tEe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Ea(t)){const{mark:r,encoding:i}=t,o=hs(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!Q_(o,n[o.type],i);case"area":return!!Q_(o,n[o.type],i)||!!_P(o,n[o.type])}}return!1}run(t,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:u,...c}=t,f=Ib(u,i),d=hs(a)?a:{type:a},h=Q_(d,i[d.type],f),p=d.type==="area"&&_P(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:Z2e({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:Wr(f,["shape"])}],m=AW(TW(d,f,i),f);let y=f;if(m){const{fieldChannel:v,offset:b}=m;y={...f,[v]:{...f[v],...b?{stack:b}:{}}}}return y=Wr(y,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...cd(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...cd(d,["clip","tooltip"]),...h},encoding:y}),r({...c,layer:g},{...n,config:eEe(i)})}}function nEe(e,t){return t?Em(e)?$W(e,t):RW(e,t):e}function Z_(e,t){return t?$W(e,t):e}function lk(e,t,n){const r=t[e];if(L_e(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};ne(zbe(r.repeat));return}return t}function RW(e,t){if(e=lk("field",e,t),e!==void 0){if(e===null)return null;if(tO(e)&&is(e.sort)){const n=lk("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function EP(e,t){if(te(e))return RW(e,t);{const n=lk("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function SP(e,t){if(Ue(e)){const n=EP(e,t);if(n)return n;if(Ob(e))return{condition:e.condition}}else{if(Sm(e)){const n=EP(e.condition,t);if(n)return{...e,condition:n};{const{condition:r,...i}=e;return i}}return e}}function $W(e,t){const n={};for(const r in e)if(Oe(e,r)){const i=e[r];if(K(i))n[r]=i.map(o=>SP(o,t)).filter(o=>o);else{const o=SP(i,t);o!==void 0&&(n[r]=o)}}return n}class rEe{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Ea(t)){const{encoding:n,mark:r}=t;if(r==="line"||hs(r)&&r.type==="line")for(const i of obe){const o=Tc(i),s=n[o];if(n[i]&&(te(s)&&!Dn(s.bin)||As(s)))return!0}}return!1}run(t,n,r){const{encoding:i,mark:o}=t;return ne(iwe(!!i.x2,!!i.y2)),r({...t,mark:ye(o)?{...o,type:"rule"}:"rule"},n)}}class iEe extends mO{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[s2e,u2e,m2e,new tEe,new rEe]}map(t,n){if(Ea(t)){const r=zu(t.encoding,ta),i=zu(t.encoding,na),o=zu(t.encoding,gb);if(r||i||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:r,parentProjection:i}=n,o=Z_(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(t,n){return H2e(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:r,spec:i,...o}=t,{row:s,column:a,layer:l}=r,{repeater:u={},repeaterPrefix:c=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...u,layer:f},h=`${(i.name?`${i.name}_`:"")+c}child__layer_${Pt(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:r,spec:i,data:o,...s}=t;!K(r)&&t.columns&&(t=Wr(t,["columns"]),ne(rP("repeat")));const a=[],{repeater:l={},repeaterPrefix:u=""}=n,c=!K(r)&&r.row||[l?l.row:null],f=!K(r)&&r.column||[l?l.column:null],d=K(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:l.layer},v=(i.name?`${i.name}_`:"")+u+"child__"+(K(r)?`${Pt(p)}`:(r.row?`row_${Pt(g)}`:"")+(r.column?`column_${Pt(m)}`:"")),b=this.map(i,{...n,repeater:y,repeaterPrefix:v});b.name=v,a.push(Wr(b,["data"]))}const h=K(r)?t.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:r}=t;return Em(r)&&t.columns&&(t=Wr(t,["columns"]),ne(rP("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:r,projection:i}=t,{parentEncoding:o,parentProjection:s,config:a}=n,l=CP({parentProjection:s,projection:i}),u=kP({parentEncoding:o,encoding:Z_(r,n.repeater)});return this.mapUnit({...t,...l?{projection:l}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,n){const{row:r,column:i,facet:o,...s}=t.encoding,{mark:a,width:l,projection:u,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),y=Z_(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...c?{height:c}:{},...f?{view:f}:{},...u?{projection:u}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:r,column:i,facet:o}=t;if(r||i){o&&ne(nwe([...r?[ta]:[],...i?[na]:[]]));const s={},a={};for(const l of[ta,na]){const u=t[l];if(u){const{align:c,center:f,spacing:d,columns:h,...p}=u;s[l]=p;for(const g of["align","center","spacing"])u[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=u[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:u,...c}=o;return{facetMapping:nEe(c,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...u?{columns:u}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=t,l={...i,parentEncoding:kP({parentEncoding:n,encoding:o,layer:!0}),parentProjection:CP({parentProjection:r,projection:s})};return super.mapLayer({...a,...t.name?{name:[l.repeaterPrefix,t.name].filter(u=>u).join("_")}:{}},l)}}function kP({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){const i=new Set([...Z(e),...Z(t)]);for(const o of i){const s=t[o],a=e[o];if(Ue(s)){const l={...a,...s};r[o]=l}else Sm(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||Ao(a)||Se(a)||Ue(a)||K(a))&&(r[o]=a)}}else r=t;return!r||Et(r)?void 0:r}function CP(e){const{parentProjection:t,projection:n}=e;return t&&n&&ne(Wbe({parentProjection:t,projection:n})),n??t}function yO(e){return"filter"in e}function oEe(e){return(e==null?void 0:e.stop)!==void 0}function OW(e){return"lookup"in e}function sEe(e){return"data"in e}function aEe(e){return"param"in e}function lEe(e){return"pivot"in e}function uEe(e){return"density"in e}function cEe(e){return"quantile"in e}function fEe(e){return"regression"in e}function dEe(e){return"loess"in e}function hEe(e){return"sample"in e}function pEe(e){return"window"in e}function gEe(e){return"joinaggregate"in e}function mEe(e){return"flatten"in e}function yEe(e){return"calculate"in e}function NW(e){return"bin"in e}function vEe(e){return"impute"in e}function xEe(e){return"timeUnit"in e}function bEe(e){return"aggregate"in e}function wEe(e){return"stack"in e}function _Ee(e){return"fold"in e}function EEe(e){return"extent"in e&&!("density"in e)}function SEe(e){return e.map(t=>yO(t)?{filter:$f(t.filter,Jwe)}:t)}class kEe extends mO{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=AP(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=AP(t,n),t.encoding){const r={};for(const[i,o]of Tl(t.encoding))r[i]=MW(o,n);t={...t,encoding:r}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:r,...i}=t;return r?{...i,params:Tl(r).map(([o,s])=>{const{init:a,bind:l,empty:u,...c}=s;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[o]=u!=="none";for(const f of Bn(n.selectionPredicates[o]??{}))f.empty=u!=="none";return{name:o,value:a,select:c,bind:l}})}:t}}function AP(e,t){const{transform:n,...r}=e;if(n){const i=n.map(o=>{if(yO(o))return{filter:uk(o,t)};if(NW(o)&&Rc(o.bin))return{...o,bin:FW(o.bin)};if(OW(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return e}function MW(e,t){var r,i;const n=Be(e);if(te(n)&&Rc(n.bin)&&(n.bin=FW(n.bin)),Nc(n)&&((i=(r=n.scale)==null?void 0:r.domain)!=null&&i.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(Ob(n))if(K(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:l,...u}=o;return a?o:{...u,test:uk(o,t)}});else{const{selection:o,param:s,test:a,...l}=MW(n.condition,t);n.condition=s?n.condition:{...l,test:uk(n.condition,t)}}return n}function FW(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function uk(e,t){const n=r=>$f(r,i=>{var o;const s=t.emptySelections[i]??!0,a={param:i,empty:s};return(o=t.selectionPredicates)[i]??(o[i]=[]),t.selectionPredicates[i].push(a),a});return e.selection?n(e.selection):$f(e.test||e.filter,r=>r.selection?n(r.selection):r)}class ck extends mO{map(t,n){const r=n.selections??[];if(t.params&&!Ea(t)){const i=[];for(const o of t.params)hO(o)?r.push(o):i.push(o);t.params=i}return n.selections=r,super.map(t,n)}mapUnit(t,n){const r=n.selections;if(!r||!r.length)return t;const i=(n.path??[]).concat(t.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(pe(a)&&(a===t.name||i.includes(a))||K(a)&&a.map(l=>i.indexOf(l)).every((l,u,c)=>l!==-1&&(u===0||l>c[u-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=ck.prototype[e];ck.prototype[e]=function(n,r){return t.call(this,n,CEe(n,r))}}function CEe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function DW(e,t){t===void 0&&(t=CW(e.config));const n=$Ee(e,t),{width:r,height:i}=e,o=OEe(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const AEe=new iEe,TEe=new kEe,REe=new ck;function $Ee(e,t={}){const n={config:t};return REe.map(AEe.map(TEe.map(e,n),n),n)}function TP(e){return pe(e)?{type:e}:e??{}}function OEe(e,t,n){let{width:r,height:i}=t;const o=Ea(e)||Lb(e),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(ne(ZI("width")),r=void 0),i=="container"&&(ne(ZI("height")),i=void 0));const a={type:"pad",...s,...n?TP(n.autosize):{},...TP(e.autosize)};if(a.type==="fit"&&!o&&(ne(Rbe),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&ne(eP("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&ne(eP("height")),!fi(a,{type:"pad"}))return a}function NEe(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function MEe(e){return e?`fit-${bb(e)}`:"fit"}const FEe=["background","padding"];function RP(e,t){const n={};for(const r of FEe)e&&e[r]!==void 0&&(n[r]=ai(e[r]));return t&&(n.params=e.params),n}class Sa{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Sa(Be(this.explicit),Be(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Qt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:r}){n!==void 0&&this.set(t,n,r)}set(t,n,r){return delete this[r?"implicit":"explicit"][t],this[r?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:r}){n[t]!==void 0?this.set(t,n[t],!0):r[t]!==void 0&&this.set(t,r[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of Z(t.combine())){const r=t.getWithExplicit(n);this.setWithExplicit(n,r)}}}function Vo(e){return{explicit:!0,value:e}}function ri(e){return{explicit:!1,value:e}}function IW(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:zb(t,n,r,i)}}function zb(e,t,n,r){return e.explicit&&t.explicit&&ne(pwe(n,r,e.value,t.value)),e}function Ol(e,t,n,r,i=zb){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:fi(e.value,t.value)?e:i(e,t,n,r)}class DEe extends Sa{constructor(t={},n={},r=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=r}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function xd(e){return"url"in e}function Sg(e){return"values"in e}function PW(e){return"name"in e&&!xd(e)&&!Sg(e)&&!pl(e)}function pl(e){return e&&(LW(e)||zW(e)||vO(e))}function LW(e){return"sequence"in e}function zW(e){return"sphere"in e}function vO(e){return"graticule"in e}var At;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(At||(At={}));function BW(e){const{signals:t,hasLegend:n,index:r,...i}=e;return i.field=Hi(i.field),i}function fc(e,t=!0,n=ar){if(K(e)){const r=e.map(i=>fc(i,t,n));return t?`[${r.join(", ")}]`:r}else if($c(e))return n(t?ac(e):zwe(e));return t?n(St(e)):e}function IEe(e,t){for(const n of Bn(e.component.selection??{})){const r=n.name;let i=`${r}${Ml}, ${n.resolve==="global"?"true":`{unit: ${Bu(e)}}`}`;for(const o of Hb)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(i=o.modifyExpr(e,n,i)));t.push({name:r+pSe,on:[{events:{signal:n.name+Ml},update:`modify(${ie(n.name+dc)}, ${i})`}]})}return xO(t)}function PEe(e,t){if(e.component.selection&&Z(e.component.selection).length){const n=ie(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Gl("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return xO(t)}function LEe(e,t){let n=!1;for(const r of Bn(e.component.selection??{})){const i=r.name,o=ie(i+dc);if(t.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";t.push({name:r.name,update:`${iV}(${o}, ${ie(a)}${l}`})}n=!0;for(const a of Hb)a.defined(r)&&a.topLevelSignals&&(t=a.topLevelSignals(e,r,t))}return n&&t.filter(i=>i.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),xO(t)}function zEe(e,t){const n=[...t],r=Bu(e,{escape:!1});for(const i of Bn(e.component.selection??{})){const o={name:i.name+dc};if(i.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:To}}]),i.init){const a=i.project.items.map(BW);o.values=i.project.hasSelectionId?i.init.map(l=>({unit:r,[To]:fc(l,!1)[0]})):i.init.map(l=>({unit:r,fields:a,values:fc(l,!1)}))}n.filter(a=>a.name===i.name+dc).length||n.push(o)}return n}function jW(e,t){for(const n of Bn(e.component.selection??{}))for(const r of Hb)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function BEe(e,t){for(const n of e.children)qt(n)&&(t=jW(n,t));return t}function jEe(e,t,n,r){const i=uV(e,t.param,t);return{signal:xi(n.get("type"))&&K(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function xO(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class wt{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){ne(Ube);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this);const r=t.parent.removeChild(t);this._parent=n,n.addChild(this,r),t.parent=this}}class Er extends wt{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,r,i){super(t,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${PH()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function e2(e){return e.as!==void 0}function $P(e){return`${e}_end`}class os extends wt{clone(){return new os(null,Be(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let u;if(Oc(l)){if(qt(n)){const{mark:c,markDef:f,config:d}=n,h=$l({fieldDef:o,markDef:f,config:d});(Eg(c)||h)&&(u={timeUnit:Rn(l),field:a})}}else u={as:ue(o,{forAs:!0}),field:a,timeUnit:l};if(qt(n)){const{mark:c,markDef:f,config:d}=n,h=$l({fieldDef:o,markDef:f,config:d});Eg(c)&&an(s)&&h!==.5&&(u.rectBandPosition=h)}u&&(i[et(u)]=u)}return i},{});return Et(r)?null:new os(t,r)}static makeFromTransform(t,n){const{timeUnit:r,...i}={...n},o=Rn(r),s={...i,timeUnit:o};return new os(t,{[et(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[r,i]of Tl(this.timeUnits)){const o=e2(i)?i.as:`${i.field}_end`;t.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(Bn(this.timeUnits).map(t=>e2(t)?t.as:$P(t.field)))}dependentFields(){return new Set(Bn(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${et(this.timeUnits)}`}assemble(){const t=[];for(const n of Bn(this.timeUnits)){const{rectBandPosition:r}=n,i=Rn(n.timeUnit);if(e2(n)){const{field:o,as:s}=n,{unit:a,utc:l,...u}=i,c=[s,`${s}_end`];t.push({field:Hi(o),type:"timeunit",...a?{units:Sb(a)}:{},...l?{timezone:"utc"}:{},...u,as:c}),t.push(...OP(c,r,i))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=UW({timeUnit:i,field:s}),l=$P(s);t.push({type:"formula",expr:a,as:l}),t.push(...OP([s,l],r,i))}}return t}}const Bb="offsetted_rect_start",jb="offsetted_rect_end";function UW({timeUnit:e,field:t,reverse:n}){const{unit:r,utc:i}=e,o=xG(r),{part:s,step:a}=EG(o,e.step);return`${i?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-a:a})`}function OP([e,t],n,r){if(n!==void 0&&n!==.5){const i=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:NP([UW({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${Bb}`},{type:"formula",expr:NP([i,o],n+.5),as:`${e}_${jb}`}]}return[]}function NP([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Am="_tuple_fields";class UEe{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const HEe={defined:()=>!0,parse:(e,t,n)=>{const r=t.name,i=t.project??(t.project=new UEe),o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=Pt(`${r}_${m}`);for(let v=1;a.has(y);v++)y=Pt(`${r}_${m}_${v}`);return a.add(y),{[g]:y}},u=t.type,c=e.config.selection[u],f=n.value!==void 0?me(n.value):null;let{fields:d,encodings:h}=ye(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ye(p))for(const g of Z(p))ibe(g)?(h||(h=[])).push(g):u==="interval"?(ne(Lbe),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){ne($be(p,g.aggregate));continue}else if(!m){ne(nP(p));continue}if(g.timeUnit&&!Oc(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};s[et(y)]=y}if(!o[m]){const y=u==="interval"&&_a(p)&&xi(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",v={field:m,channel:p,type:y,index:i.items.length};v.signals={...l(v,"data"),...l(v,"visual")},i.items.push(o[m]=v),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===To,HH(p)?(v.geoChannel=p,v.channel=UH(p),i.hasChannel[v.channel]=o[m]):i.hasChannel[p]=o[m]}}else ne(nP(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===To}f&&(t.init=f.map(p=>i.items.map(g=>ye(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Et(s)||(i.timeUnit=new os(null,s))},signals:(e,t,n)=>{const r=t.name+Am;return n.filter(o=>o.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(BW)})}},ra={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!_a(i))continue;const o=e.getScaleComponent(i),s=o?o.get("type"):void 0;if(!o||!xi(s)){ne(Mbe);continue}o.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||MP(e)||r.length===0)return n;const i=n.filter(s=>s.name===t.name)[0];let o=i.update;if(o.indexOf(iV)>=0)i.update=`{${r.map(s=>`${ie(Hi(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${ie(Hi(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!MP(e))for(const r of t.scales){const i=n.filter(o=>o.name===r.signals.data)[0];i.push="outer",delete i.value,delete i.update}return n}};function fk(e,t){return`domain(${ie(e.scaleName(t))})`}function MP(e){return e.parent&&Qd(e.parent)&&!e.parent.parent}const Mf="_brush",HW="_scale_trigger",$h="geo_interval_init_tick",GW="_init",GEe="_center",WEe={defined:e=>e.type==="interval",parse:(e,t,n)=>{var r;if(e.hasProjection){const i={...ye(n.select)?n.select:{}};i.fields=[To],i.encodings||(i.encodings=n.value?Z(n.value):[Io,Do]),n.select={type:"interval",...i}}if(t.translate&&!ra.defined(t)){const i=`!event.item || event.item.mark.name !== ${ie(t.name+Mf)}`;for(const o of t.events){if(!o.between){ne(`${o} is not an ordered event stream for interval selections.`);continue}const s=me((r=o.between[0]).filter??(r.filter=[]));s.indexOf(i)<0&&s.push(i)}}},signals:(e,t,n)=>{const r=t.name,i=r+Ml,o=Bn(t.project.hasChannel).filter(a=>a.channel===Lt||a.channel===Nn),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(VEe(e,t,l,s&&s[l.index])),[])),e.hasProjection){const a=ie(e.projectionName()),l=e.projectionName()+GEe,{x:u,y:c}=t.project.hasChannel,f=u&&u.signals.visual,d=c&&c.signals.visual,h=u?s&&s[u.index]:`${l}[0]`,p=c?s&&s[c.index]:`${l}[1]`,g=_=>e.getSizeSignalRef(_).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:r+GW,init:`[scale(${a}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),(!u||!c)&&(n.find(k=>k.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${ie(e.getName("marks"))}}, unit.mark)`,v=`{unit: ${Bu(e)}}`,b=`vlSelectionTuples(${y}, ${v})`,w=o.map(_=>_.signals.visual);return n.concat({name:i,on:[{events:[...w.length?[{signal:w.join(" || ")}]:[],...s?[{signal:$h}]:[]],update:b}]})}else{if(!ra.defined(t)){const u=r+HW,c=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=ie(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=xi(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:u,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${u} : {}`}]})}const a=o.map(u=>u.signals.data),l=`unit: ${Bu(e)}, fields: ${r+Am}, values`;return n.concat({name:i,...s?{init:`{${l}: ${fc(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(qt(e)&&e.hasProjection&&t.init&&(n.filter(i=>i.name===$h).length||n.unshift({name:$h,value:null,on:[{events:"timer{1}",update:`${$h} === null ? {} : ${$h}`}]})),n),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,s=i==null?void 0:i.signals.visual,a=o==null?void 0:o.signals.visual,l=`data(${ie(t.name+dc)})`;if(ra.defined(t)||!i&&!o)return n;const u={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const g of Z(u))u[g]=[{test:`${l}.length && ${l}[0].unit === ${Bu(e)}`,...u[g]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=Z(h).reduce((g,m)=>(g[m]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[m]},{value:null}],g),{});return[{name:`${r+Mf}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:r+Mf,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}};function VEe(e,t,n,r){const i=!e.hasProjection,o=n.channel,s=n.signals.visual,a=ie(i?e.scaleName(o):e.projectionName()),l=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(o===Lt?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${s}[0], clamp(${c}, 0, ${u})]`}],[]);if(i){const d=n.signals.data,h=ra.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:fc(r,!0,l)}:{value:[]};return f.push({events:{signal:t.name+HW},update:xi(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:fc(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===Lt?0:1,h=t.name+GW,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const qEe={defined:e=>e.type==="point",signals:(e,t,n)=>{const r=t.name,i=r+Am,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=Bn(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Mf):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${Bu(e)}, `;if(t.project.hasSelectionId)u+=`${To}: ${s}[${ie(To)}]`;else{const f=o.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${ie(e.vgField(d.channel,{}))}], ${s}[${ie(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${ie(d.field)}]`}).join(", ");u+=`fields: ${i}, values: [${f}]`}const c=t.events;return n.concat([{name:r+Ml,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}};function Yd(e,t,n,r){const i=Ob(t)&&t.condition,o=r(t);if(i){const a=me(i).map(l=>{const u=r(l);if(P_e(l)){const{param:c,empty:f}=l;return{test:lV(e,{param:c,empty:f}),...u}}else return{test:Rv(e,l.test),...u}});return{[n]:[...a,...o!==void 0?[o]:[]]}}else return o!==void 0?{[n]:o}:{}}function bO(e,t="text"){const n=e.encoding[t];return Yd(e,n,t,r=>Ub(r,e.config))}function Ub(e,t,n="datum"){if(e){if(Ao(e))return Nt(e.value);if(Ue(e)){const{format:r,formatType:i}=_v(e);return Z$({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function WW(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,s=n.tooltip;if(K(s))return{tooltip:FP({tooltip:s},o,i,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Yd(e,s,"tooltip",l=>{const u=Ub(l,i,a);if(u)return u;if(l===null)return;let c=vt("tooltip",r,i);if(c===!0&&(c={content:"encoding"}),pe(c))return{value:c};if(ye(c))return Se(c)?c:c.content==="encoding"?FP(n,o,i,t):{signal:a}})}}function VW(e,t,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o={},s=r?"datum.datum":"datum",a=[];function l(c,f){const d=Tc(f),h=Ar(c)?c:{...c,type:e[d].type},p=h.title||rO(h,i),g=me(p).join(", ").replaceAll(/"/g,'\\"');let m;if(an(f)){const y=f==="x"?"x2":"y2",v=ps(e[y]);if(Dn(h.bin)&&v){const b=ue(h,{expr:s}),w=ue(v,{expr:s}),{format:_,formatType:k}=_v(h);m=_m(b,w,_,k,i),o[y]=!0}}if((an(f)||f===qi||f===Fo)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:v}=_v(h);m=Z$({fieldOrDatumDef:h,format:y,formatType:v,expr:s,config:i,normalizeStack:!0}).signal}m??(m=Ub(h,i,s).signal),a.push({channel:f,key:g,value:m})}sO(e,(c,f)=>{te(c)?l(c,f):Nb(c)&&l(c.condition,f)});const u={};for(const{channel:c,key:f,value:d}of a)!o[c]&&!u[f]&&(u[f]=d);return u}function FP(e,t,n,{reactiveGeom:r}={}){const i=VW(e,t,n,{reactiveGeom:r}),o=Tl(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function YEe(e){const{markDef:t,config:n}=e,r=vt("aria",t,n);return r===!1?{}:{...r?{aria:r}:{},...XEe(e),...KEe(e)}}function XEe(e){const{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};const i=vt("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:t in Cbe?{}:{ariaRoleDescription:{value:t}}}function KEe(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return Yd(e,o,"description",l=>Ub(l,e.config));const s=vt("description",n,r);if(s!=null)return{description:Nt(s)};if(r.aria===!1)return{};const a=VW(t,i,r);if(!Et(a))return{description:{signal:Tl(a).map(([l,u],c)=>`"${c>0?"; ":""}${l}: " + (${u})`).join(" + ")}}}function _n(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;a===void 0&&(l??(l=vt(e,r,o,{vgChannel:s,ignoreVgConfig:!0})),l!==void 0&&(a=Nt(l)));const u=i[e];return Yd(t,u,s??e,c=>Q$({channel:e,channelDef:c,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function qW(e,t={filled:void 0}){const{markDef:n,encoding:r,config:i}=e,{type:o}=n,s=t.filled??vt("filled",n,i),a=tt(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=vt(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,u=vt(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...l?{fill:Nt(l)}:{},...u?{stroke:Nt(u)}:{}};return n.color&&(s?n.fill:n.stroke)&&ne(cG("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,..._n("color",e,{vgChannel:c,defaultValue:s?l:u}),..._n("fill",e,{defaultValue:r.fill?l:void 0}),..._n("stroke",e,{defaultValue:r.stroke?u:void 0})}}function JEe(e){const{encoding:t,mark:n}=e,r=t.order;return!Ql(n)&&Ao(r)?Yd(e,r,"zindex",i=>Nt(i.value)):{}}function bd({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:Q$({channel:o,channelDef:a,markDef:t,config:r==null?void 0:r.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:Nt(s),bandPosition:i})};const l=t[o];return l?{offsetType:"visual",offset:l}:{}}function er(e,t,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=t,l=i[e],u=i[ks(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=bd({channel:e,markDef:o,encoding:i,model:t,bandPosition:.5}),p=wO({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!l&&an(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:QEe({channel:e,channelDef:l,channel2Def:u,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||e]:g}:void 0}function QEe(e){const{channel:t,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=e;if(Ue(n)&&i&&t===i.fieldChannel){if(te(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return xv({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Lu(n,r,{suffix:"end"},{offset:o})}return K$(e)}function wO({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=e;return()=>{const a=Tc(n),l=Rl(n),u=vt(n,o,s,{vgChannel:l});if(u!==void 0)return $p(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const c=i.get("type");if(!tt([Vr.LOG,Vr.TIME,Vr.UTC],c)){if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[Zr(n)],mult:.5}}}}const ZEe={left:"x",center:"xc",right:"x2"},eSe={top:"y",middle:"yc",bottom:"y2"};function YW(e,t,n,r="middle"){if(e==="radius"||e==="theta")return Rl(e);const i=e==="x"?"align":"baseline",o=vt(i,t,n);let s;return Se(o)?(ne(rwe(i)),s=void 0):s=o,e==="x"?ZEe[s||(r==="top"?"left":"center")]:eSe[s||r]}function Av(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?XW(e,t,{defaultPos:n,defaultPos2:r}):er(e,t,{defaultPos:n})}function XW(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,s=ks(e),a=Zr(e),l=tSe(t,r,s),u=l[a]?YW(e,i,o):Rl(e);return{...er(e,t,{defaultPos:n,vgChannel:u}),...l}}function tSe(e,t,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=e,l=Tc(n),u=Zr(n),c=Rl(n),f=r[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in r||n in o?bd({channel:n,markDef:o,encoding:r,model:e}):bd({channel:l,markDef:o,encoding:r,model:e});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=Zr(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=nSe({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:O0(n,o)||O0(n,{[n]:mv(n,o,a.style),[u]:mv(u,o,a.style)})||O0(n,a[i])||O0(n,a.mark)||{[c]:wO({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function nSe({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:u}){return Ue(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Lu(t,o,{suffix:"start"},{offset:l}):K$({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:u})}function O0(e,t){const n=Zr(e),r=Rl(e);if(t[r]!==void 0)return{[r]:$p(e,t[r])};if(t[e]!==void 0)return{[r]:$p(e,t[e])};if(t[n]){const i=t[n];if(uc(i))ne(Jbe(n));else return{[n]:$p(e,i)}}}function Nl(e,t){const{config:n,encoding:r,markDef:i}=e,o=i.type,s=ks(t),a=Zr(t),l=r[t],u=r[s],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=i.orient,h=r[a]??r.size??vt("size",i,n,{vgChannel:a}),p=qH(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return te(l)&&(Rt(l.bin)||Dn(l.bin)||l.timeUnit&&!u)&&!(h&&!uc(h))&&!r[p]&&!$n(f)?oSe({fieldDef:l,fieldDef2:u,channel:t,model:e}):(Ue(l)&&$n(f)||g)&&!u?iSe(l,t,e):XW(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function rSe(e,t,n,r,i,o,s){if(uc(i))if(n){const l=n.get("type");if(l==="band"){let u=`bandwidth('${t}')`;i.band!==1&&(u=`${i.band} * ${u}`);const c=ha("minBandSize",{type:s},r);return{signal:c?`max(${ho(c)}, ${u})`:u}}else i.band!==1&&(ne(awe(l)),i=void 0)}else return{mult:i.band,field:{group:e}};else{if(Se(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(Jl(l)&&ct(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:u,rectBandPaddingInner:c}=r.scale,f=Qt(l,s==="bar"?u:c);if(Se(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(ct(f))return{signal:`${1-f} * ${e}`}}return{value:kv(r.view,e)-2}}function iSe(e,t,n){var N,O;const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=Zr(t),f=ks(t),d=qH(t),h=n.scaleName(d),p=n.getScaleComponent(A$(t)),g=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(i.size||r.size)&&(g?m=_n("size",n,{vgChannel:c,defaultRef:Nt(r.size)}):ne(fwe(r.type)));const y=!!m,v=WG({channel:t,fieldDef:e,markDef:r,config:o,scaleType:(N=u||p)==null?void 0:N.get("type"),useVlSizeChannel:g});m=m||{[c]:rSe(c,h||l,p||u,o,v,!!e,r.type)};const b=((O=u||p)==null?void 0:O.get("type"))==="band"&&uc(v)&&!y?"top":"middle",w=YW(t,r,o,b),_=w==="xc"||w==="yc",{offset:k,offsetType:E}=bd({channel:t,markDef:r,encoding:i,model:n,bandPosition:_?.5:0}),A=K$({channel:t,channelDef:e,markDef:r,config:o,scaleName:l,scale:u,stack:s,offset:k,defaultRef:wO({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:_?E==="encoding"?0:.5:Se(v)?{signal:`(1-${v})/2`}:uc(v)?(1-v.band)/2:0});if(c)return{[w]:A,...m};{const F=Rl(f),U=m[c],M=k?{...U,offset:k}:U;return{[w]:A,[F]:K(A)?[A[0],{...A[1],offset:M}]:{...A,offset:M}}}}function DP(e,t,n,r,i,o,s){if(jH(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(Se(n)||Se(i)||Se(r)||o){const u=ho(n),c=ho(i),f=ho(r),d=ho(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=u?`(${u} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return i=i||0,r+(n?-i-l:+i+l)}function oSe({fieldDef:e,fieldDef2:t,channel:n,model:r}){var O;const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),u=a?a.get("type"):void 0,c=a.get("reverse"),f=WG({channel:n,fieldDef:e,markDef:o,config:i,scaleType:u}),d=(O=r.component.axes[n])==null?void 0:O[0],h=(d==null?void 0:d.get("translate"))??.5,p=an(n)?vt("binSpacing",o,i)??0:0,g=ks(n),m=Rl(n),y=Rl(g),v=ha("minBandSize",o,i),{offset:b}=bd({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:w}=bd({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),_=N_e({fieldDef:e,scaleName:l}),k=DP(n,p,c,h,b,v,_),E=DP(g,p,c,h,w??b,v,_),A=Se(f)?{signal:`(1-${f.signal})/2`}:uc(f)?(1-f.band)/2:.5,N=$l({fieldDef:e,fieldDef2:t,markDef:o,config:i});if(Rt(e.bin)||e.timeUnit){const F=e.timeUnit&&N!==.5;return{[y]:IP({fieldDef:e,scaleName:l,bandPosition:A,offset:E,useRectOffsetField:F}),[m]:IP({fieldDef:e,scaleName:l,bandPosition:Se(A)?{signal:`1-${A.signal}`}:1-A,offset:k,useRectOffsetField:F})}}else if(Dn(e.bin)){const F=Lu(e,l,{},{offset:E});if(te(t))return{[y]:F,[m]:Lu(t,l,{},{offset:k})};if(Rc(e.bin)&&e.bin.step)return{[y]:F,[m]:{signal:`scale("${l}", ${ue(e,{expr:"datum"})} + ${e.bin.step})`,offset:k}}}ne(hG(g))}function IP({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return xv({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:Bb,endSuffix:jb}:{}})}const sSe=new Set(["aria","width","height"]);function Yi(e,t){const{fill:n=void 0,stroke:r=void 0}=t.color==="include"?qW(e):{};return{...aSe(e.markDef,t),...PP(e,"fill",n),...PP(e,"stroke",r),..._n("opacity",e),..._n("fillOpacity",e),..._n("strokeOpacity",e),..._n("strokeWidth",e),..._n("strokeDash",e),...JEe(e),...WW(e),...bO(e,"href"),...YEe(e)}}function PP(e,t,n){const{config:r,mark:i,markDef:o}=e;if(vt("invalid",o,r)==="hide"&&n&&!Ql(i)){const a=lSe(e,{invalid:!0,channels:wb});if(a)return{[t]:[{test:a,value:null},...me(n)]}}return n?{[t]:n}:{}}function aSe(e,t){return kbe.reduce((n,r)=>(!sSe.has(r)&&e[r]!==void 0&&t[r]!=="ignore"&&(n[r]=Nt(e[r])),n),{})}function lSe(e,{invalid:t=!1,channels:n}){const r=n.reduce((o,s)=>{const a=e.getScaleComponent(s);if(a){const l=a.get("type"),u=e.vgField(s,{expr:"datum"});u&&xi(l)&&(o[u]=!0)}return o},{}),i=Z(r);if(i.length>0){const o=t?"||":"&&";return i.map(s=>J$(s,t)).join(` ${o} `)}}function _O(e){const{config:t,markDef:n}=e;if(vt("invalid",n,t)){const i=uSe(e,{channels:Cs});if(i)return{defined:{signal:i}}}return{}}function uSe(e,{invalid:t=!1,channels:n}){const r=n.reduce((o,s)=>{var l;const a=e.getScaleComponent(s);if(a){const u=a.get("type"),c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&xi(u)&&(o[c]=!0)}return o},{}),i=Z(r);if(i.length>0){const o=t?"||":"&&";return i.map(s=>J$(s,t)).join(` ${o} `)}}function LP(e,t){if(t!==void 0)return{[e]:Nt(t)}}const t2="voronoi",KW={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(t2)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(Ql(o))return ne(Obe(o)),n;const s={name:e.getName(t2),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...WW(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((u,c)=>{const f=u.name??"";f===e.component.mark[0].name?a=c:f.indexOf(t2)>=0&&(l=!0)}),l||n.splice(a+1,0,s),n}},JW={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!dO(e.bind),parse:(e,t,n)=>oV(t,n),topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,s=t.init&&t.init[0],a=KW.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,u)=>{const c=Pt(`${r}_${l.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...s?{init:fc(s[u])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${ie(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter(u=>u.name===r+Ml)[0],s=r+Am,a=i.items.map(u=>Pt(`${r}_${u.field}`)),l=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},Tv="_toggle",QW={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Tv,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Ml,r=t.name+Tv;return`${r} ? null : ${n}, `+(t.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${Bu(e)}}, `)+`${r} ? ${n} : null`}},cSe={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=pe(t.clear)?Gl(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(JW.defined(t))for(const r of t.project.items){const i=n.findIndex(o=>o.name===Pt(`${t.name}_${r.field}`));i!==-1&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const i of t.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===t.name+Ml);r(i,"null"),QW.defined(t)&&(i=n.findIndex(o=>o.name===t.name+Tv),r(i,"false"))}return n}},ZW={defined:e=>{const t=e.resolve==="global"&&e.bind&&dO(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==To;return t&&!n&&ne(Fbe),t&&n},parse:(e,t,n)=>{const r=Be(n);if(r.select=pe(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},oV(t,r),ye(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=me(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=J_(t.bind)?t.bind.legend:"click",o=pe(i)?Gl(i,"view"):me(i);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=J_(t.bind)&&t.bind.legend,o=s=>a=>{const l=Be(a);return l.markname=s,l};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${Pt(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(c=>c.name===l).length===0){const c=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(d=>d.name===r+Ml),s=r+Am,a=i.items.filter(d=>d.hasLegend).map(d=>Pt(`${r}_${Pt(d.field)}_legend`)),u=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(o.update=u,delete o.value,delete o.on);const c=n.find(d=>d.name===r+Tv),f=J_(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function fSe(e,t,n){var i;const r=(i=e.fieldDef(t))==null?void 0:i.field;for(const o of Bn(e.component.selection??{})){const s=o.project.hasField[r]??o.project.hasChannel[t];if(s&&ZW.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const eV="_translate_anchor",tV="_translate_delta",dSe={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const r=t.name,i=ra.defined(t),o=r+eV,{x:s,y:a}=t.project.hasChannel;let l=Gl(t.translate,"scope");return i||(l=l.map(u=>(u.between[0].markname=r+Mf,u))),n.push({name:o,value:{},on:[{events:l.map(u=>u.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${i?fk(e,Lt):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${i?fk(e,Nn):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:r+tV,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&zP(e,t,s,"width",n),a!==void 0&&zP(e,t,a,"height",n),n}};function zP(e,t,n,r,i){const o=t.name,s=o+eV,a=o+tV,l=n.channel,u=ra.defined(t),c=i.filter(_=>_.name===n.signals[u?"data":"visual"])[0],f=e.getSizeSignalRef(r).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=u?l===Lt?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,y=`${g}${a}.${l} / ${u?`${f}`:`span(${m})`}`,v=!u||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",b=u?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",w=`${v}(${m}, ${y}${b})`;c.on.push({events:{signal:a},update:u?w:`clampRange(${w}, 0, ${f})`})}const nV="_zoom_anchor",rV="_zoom_delta",hSe={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=ra.defined(t),o=r+rV,{x:s,y:a}=t.project.hasChannel,l=ie(e.scaleName(Lt)),u=ie(e.scaleName(Nn));let c=Gl(t.zoom,"scope");return i||(c=c.map(f=>(f.markname=r+Mf,f))),n.push({name:r+nV,on:[{events:c,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&BP(e,t,s,"width",n),a!==void 0&&BP(e,t,a,"height",n),n}};function BP(e,t,n,r,i){const o=t.name,s=n.channel,a=ra.defined(t),l=i.filter(v=>v.name===n.signals[a?"data":"visual"])[0],u=e.getSizeSignalRef(r).signal,c=e.getScaleComponent(s),f=c&&c.get("type"),d=a?fk(e,s):l.name,h=o+rV,p=`${o}${nV}.${s}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${u})`})}const dc="_store",Ml="_tuple",pSe="_modify",iV="vlSelectionResolve",Hb=[qEe,WEe,HEe,QW,JW,ra,ZW,cSe,dSe,hSe,KW];function gSe(e){let t=e.parent;for(;t&&!_o(t);)t=t.parent;return t}function Bu(e,{escape:t}={escape:!0}){let n=t?ie(e.name):e.name;const r=gSe(e);if(r){const{facet:i}=r;for(const o of Mi)i[o]&&(n+=` + '__facet_${o}_' + (facet[${ie(r.vgField(o))}])`)}return n}function EO(e){return Bn(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function oV(e,t){(pe(t.select)||!t.select.on)&&delete e.events,(pe(t.select)||!t.select.clear)&&delete e.clear,(pe(t.select)||!t.select.toggle)&&delete e.toggle}function dk(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...dk(e.object)),t.push(...dk(e.property))),t)}function sV(e){return e.object.type==="MemberExpression"?sV(e.object):e.object.name==="datum"}function aV(e){const t=UR(e),n=new Set;return t.visit(r=>{r.type==="MemberExpression"&&sV(r)&&n.add(dk(r).slice(1).join("."))}),n}class Xd extends wt{clone(){return new Xd(null,this.model,Be(this.filter))}constructor(t,n,r){super(t),this.model=n,this.filter=r,this.expr=Rv(this.model,this.filter,this),this._dependentFields=aV(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function mSe(e,t){const n={},r=e.config.selection;if(!t||!t.length)return n;for(const i of t){const o=Pt(i.name),s=i.select,a=pe(s)?s:s.type,l=ye(s)?Be(s):{type:a},u=r[a];for(const d in u)d==="fields"||d==="encodings"||(d==="mark"&&(l[d]={...u[d],...l[d]}),(l[d]===void 0||l[d]===!0)&&(l[d]=Be(u[d]??l[d])));const c=n[o]={...l,name:o,type:a,init:i.value,bind:i.bind,events:pe(l.on)?Gl(l.on,"scope"):me(Be(l.on))},f=Be(i);for(const d of Hb)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function lV(e,t,n,r="datum"){const i=pe(t)?t:t.param,o=Pt(i),s=ie(o+dc);let a;try{a=e.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${ie(a.resolve)})`,c=`${l}${s}, ${r}${u}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function uV(e,t,n){const r=Pt(t),i=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&ne(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${ie(o)}.`);else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,ne((a.length?"Multiple ":"No ")+`matching ${ie(i)} encoding found for selection ${ie(n.param)}. Using "field": ${ie(o)}.`)):o=a[0].field}return`${s.name}[${ie(Hi(o))}]`}function ySe(e,t){for(const[n,r]of Tl(e.component.selection??{})){const i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new Er(new Xd(t,e,{param:n}),i,At.Lookup,e.component.data.outputNodeRefCounts)}}function Rv(e,t,n){return Rp(t,r=>pe(r)?r:Ywe(r)?lV(e,r,n):kG(r))}function vSe(e,t){if(e)return K(e)&&!Pa(e)?e.map(n=>rO(n,t)).join(", "):e}function n2(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}function sp(e,t,n,r={header:!1}){var f,d;const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:u,...c}=e.combine();if(!i){for(const h in c){const p=J_e[h],g=c[h];if(p&&p!==t&&p!=="both")delete c[h];else if(Cm(g)){const{condition:m,...y}=g,v=me(m),b=pP[h];if(b){const{vgProp:w,part:_}=b,k=[...v.map(E=>{const{test:A,...N}=E;return{test:Rv(null,A),...N}}),y];n2(c,_,w,k),delete c[h]}else if(b===null){const w={signal:v.map(_=>{const{test:k,...E}=_;return`${Rv(null,k)} ? ${QI(E)} : `}).join("")+QI(y)};c[h]=w}}else if(Se(g)){const m=pP[h];if(m){const{vgProp:y,part:v}=m;n2(c,v,y,g),delete c[h]}}tt(["labelAlign","labelBaseline"],h)&&c[h]===null&&delete c[h]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Et(c.encode)&&delete c.encode}return{scale:s,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Qt(u,0)}}else{if(!r.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&Se(c.encode.labels.update.text)&&(p=oc(a,"datum.label",c.encode.labels.update.text.signal)),n2(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of tW)e.hasAxisPart(p)||delete c.encode[p];Et(c.encode)&&delete c.encode}const h=vSe(l,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Qt(u,0)}}}}function cV(e){const{axes:t}=e.component,n=[];for(const r of Cs)if(t[r]){for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function xSe(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(i=>sp(i,"grid",t)),...r.map(i=>sp(i,"grid",t)),...n.map(i=>sp(i,"main",t)),...r.map(i=>sp(i,"main",t))].filter(i=>i)}function jP(e,t,n,r){return Object.assign.apply(null,[{},...e.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...Z(s),...Z(a)]),u={};for(const c of l.values())u[c]={signal:`${r.signal} === "${o}" ? ${ho(s[c])} : ${ho(a[c])}`};return u}return t[i]})])}function bSe(e,t,n,r){const i=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:RG(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=Se(n)?"axisOrient":`axis${mm(n)}`,a=[...i,...i.map(u=>o+u.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:jP(a,r,e,n),vgAxisConfig:jP(l,r,e,n),axisConfigStyle:wSe([...l,...a],r)}}function wSe(e,t){var r;const n=[{}];for(const i of e){let o=(r=t[i])==null?void 0:r.style;if(o){o=me(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function hk(e,t,n,r={}){var o;const i=rG(e,n,t);if(i!==void 0)return{configFrom:"style",configValue:i};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=r[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:r[s][e]};return{}}const UP={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??_Se(n,e),gridScale:({model:e,channel:t})=>ESe(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||dV(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||fV(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??kSe(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??CSe(t.type,n,te(t)&&!!t.timeUnit,te(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??TSe({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:RSe,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const r=hV(t,n);if(r!==void 0)return r;const i=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return oG(i?[dP(i)]:[],te(s)?[dP(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>$Se(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??OSe(n,t)};function _Se(e,t){return!$n(e)&&te(t)&&!Rt(t==null?void 0:t.bin)&&!Dn(t==null?void 0:t.bin)}function ESe(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function SSe(e,t,n,r,i){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return Se(o)?o:_g(o);{const{configValue:s}=hk("labelAngle",r,t==null?void 0:t.style,i);return s!==void 0?_g(s):n===Lt&&tt([V$,W$],e.type)&&!(te(e)&&e.timeUnit)?270:void 0}}function pk(e){return`(((${e.signal} % 360) + 360) % 360)`}function fV(e,t,n,r){if(e!==void 0)if(n==="x"){if(Se(e)){const i=pk(e),o=Se(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(Nc(r)&&GG(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((u,c)=>`${kG({field:o,timeUnit:s,equal:u})} ? ${c} : `).join("")+a.length;t=new wd(t,{calculate:l,as:_d(r,i,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${et(this.transform)}`}}function _d(e,t,n){return ue(e,{prefix:t,suffix:"sort_index",...n??{}})}function Gb(e,t){return tt(["top","bottom"],t)?"column":tt(["left","right"],t)||e==="row"?"row":"column"}function Ed(e,t,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return Qt((t||{})[e],i[e],n.header[e])}function Wb(e,t,n,r){const i={};for(const o of e){const s=Ed(o,t||{},n,r);s!==void 0&&(i[o]=s)}return i}const SO=["row","column"],kO=["header","footer"];function NSe(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=Wb(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),l=Gb(t,a),u=_g(s);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...gV(u,l),...pV(l,u,o),...mV(r,i,t,x2e,vW)}}}function pV(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=dV(t,e==="row"?"left":"top",e==="row"?"y":"x");return r?{align:r}:{}}function gV(e,t){const n=fV(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function MSe(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of kO)if(n[i])for(const o of n[i]){const s=DSe(e,t,i,n,o);s!=null&&r.push(s)}return r}function FSe(e,t){const{sort:n}=e;return is(n)?{field:ue(n,{expr:"datum"}),order:n.order??"ascending"}:K(n)?{field:_d(e,t,{expr:"datum"}),order:"ascending"}:{field:ue(e,{expr:"datum"}),order:n??"ascending"}}function gk(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=Wb(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=Z$({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=Gb(t,a);return{text:{signal:l?oc(oc(l,"datum.label",u),"datum.value",ue(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...gV(o,c),...pV(c,o,s),...mV(n,e,t,b2e,xW)}}function DSe(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=e.config?e.config:void 0;if(s&&i.labels){const{labelOrient:f}=Wb(["labelOrient"],s.header,a,t);(t==="row"&&!tt(["top","bottom"],f)||t==="column"&&!tt(["left","right"],f))&&(o=gk(s,t,a))}const l=_o(e)&&!Em(e.facet),u=i.axes,c=(u==null?void 0:u.length)>0;if(o||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:FSe(s,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const ISe={column:{start:0,end:1},row:{start:1,end:0}};function PSe(e,t){return ISe[t][e]}function LSe(e,t){const n={};for(const r of Mi){const i=e[r];if(i!=null&&i.facetFieldDef){const{titleAnchor:o,titleOrient:s}=Wb(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=Gb(r,s),l=PSe(o,a);l!==void 0&&(n[a]=l)}}return Et(n)?void 0:n}function mV(e,t,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=Ed(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[i[s]]=a)}return o}function CO(e){return[...N0(e,"width"),...N0(e,"height"),...N0(e,"childWidth"),...N0(e,"childHeight")]}function N0(e,t){const n=t==="width"?"x":"y",r=e.component.layoutSize.get(t);if(!r||r==="merged")return[];const i=e.getSizeSignalRef(t).signal;if(r==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if($n(s)&&Jl(a)){const l=e.scaleName(n);return _o(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[HP(l,a)]:[HP(l,a),{name:i,update:yV(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=ak(e.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function HP(e,t){const n=`${e}_step`;return Se(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function yV(e,t,n){const r=t.get("type"),i=t.get("padding"),o=Qt(t.get("paddingOuter"),i);let s=t.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${ho(s)}, ${ho(o)}) * ${e}_step`}function vV(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function xV(e,t){return Z(e).reduce((n,r)=>{const i=e[r];return{...n,...Yd(t,i,r,o=>Nt(o.value))}},{})}function bV(e,t){if(_o(t))return e==="theta"?"independent":"shared";if(Qd(t))return"shared";if(MO(t))return an(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function AO(e,t){const n=e.scale[t],r=an(t)?"axis":"legend";return n==="independent"?(e[r][t]==="shared"&&ne(mwe(t)),"independent"):e[r][t]||"shared"}const zSe={...E2e,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},wV=Z(zSe);class BSe extends Sa{}const GP={symbols:jSe,gradient:USe,labels:HSe,entries:GSe};function jSe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:u}=n,c=s.filled&&u!=="trail";let f={...Tbe({},n,x_e),...qW(n,{filled:c})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?_V(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||c&&r===Jr)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=Nt(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=Nt(g??1));else if(K(f.fill)){const m=mk(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Nt(m))}}if(f.stroke){if(r==="stroke"||!c&&r===Jr)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(K(f.stroke)){const m=Qt(mk(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==wa){const m=te(t)&&SV(n,i,t);m?f.opacity=[{test:m,...Nt(g??1)},Nt(l.legend.unselectedOpacity)]:g&&(f.opacity=Nt(g))}return f={...f,...e},Et(f)?void 0:f}function USe(e,{model:t,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=t;let a={};const u=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?_V(s.opacity)||o.opacity:void 0;return u&&(a.opacity=Nt(u)),a={...a,...e},Et(a)?void 0:a}function HSe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=te(t)?SV(n,i,t):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=o;let f;cc(c)?f=go({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:s}):u===void 0&&c===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=go({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&te(t)&&t.timeUnit===void 0&&(f=go({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return Et(d)?void 0:d}function GSe(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function _V(e){return EV(e,(t,n)=>Math.max(t,n.value))}function mk(e){return EV(e,(t,n)=>Qt(t,n.value))}function EV(e,t){if(z_e(e))return me(e.condition).reduce(t,e.value);if(Ao(e))return e.value}function SV(e,t,n){const r=t.get("selections");if(!(r!=null&&r.length))return;const i=ie(n.field);return r.map(o=>`(!length(data(${ie(Pt(o)+dc)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const WP={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return BG(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return jG(r,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??JSe(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??QSe(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??VSe(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>Nf(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Of(n)&&po(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>WSe(t,e)};function WSe(e,t){const n=e.values;if(K(n))return eW(t,n);if(Se(n))return n}function VSe(e,t,n,r){if(t!=="shape"){const i=mk(n)??r;if(i)return i}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function qSe(e){const{legend:t}=e;return Qt(t.type,YSe(e))}function YSe({channel:e,timeUnit:t,scaleType:n}){if(Of(e)){if(tt(["quarter","month","day"],t))return"symbol";if(po(n))return"gradient"}return"symbol"}function XSe({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??KSe(n,t)}function KSe(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function JSe({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(po(i))return n==="horizontal"?r==="top"||r==="bottom"?VP(t,"width",s,o):s:VP(t,"height",l,a)}function VP(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function QSe(e){if(tt(["quantile","threshold","log","symlog"],e))return"greedy"}function kV(e){const t=qt(e)?ZSe(e):rke(e);return e.component.legends=t,t}function ZSe(e){const{encoding:t}=e,n={};for(const r of[Jr,...wW]){const i=hn(t[r]);!i||!e.getScaleComponent(r)||r===Qr&&te(i)&&i.type===qd||(n[r]=nke(e,r))}return n}function eke(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function tke(e,t,n,r){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(r==null?void 0:r.title))return!0}return e===(n||{})[t]}function nke(e,t){var w;let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,s=o.legend,a=new BSe({},eke(e,t));fSe(e,t,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),c=hn(i[t]),f=te(c)?(w=Rn(c.timeUnit))==null?void 0:w.unit:void 0,d=n.orient||o.legend.orient||"right",h=qSe({legend:n,channel:t,timeUnit:f,scaleType:u}),p=XSe({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:u,orient:d,legendType:h,direction:p};for(const _ of wV){if(h==="gradient"&&_.startsWith("symbol")||h==="symbol"&&_.startsWith("gradient"))continue;const k=_ in WP?WP[_](g):n[_];if(k!==void 0){const E=tke(k,_,n,e.fieldDef(t));(E||o.legend[_]===void 0)&&a.set(_,k,E)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),v={},b={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const k=xV(m[_]??{},e),E=_ in GP?GP[_](k,b):k;E!==void 0&&!Et(E)&&(v[_]={...y!=null&&y.length&&te(c)?{name:`${Pt(c.field)}_legend_${_}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:E})}return Et(v)||a.set("encode",v,!!(n!=null&&n.encoding)),a}function rke(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){kV(r);for(const i of Z(r.component.legends))n.legend[i]=AO(e.component.resolve,i),n.legend[i]==="shared"&&(t[i]=CV(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of Z(t))for(const i of e.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return t}function CV(e,t){var o,s,a,l;if(!e)return t.clone();const n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const u of wV){const c=Ol(e.getWithExplicit(u),t.getWithExplicit(u),u,"legend",(f,d)=>{switch(u){case"symbolType":return ike(f,d);case"title":return aG(f,d);case"type":return i=!0,ri("symbol")}return zb(f,d,u,"legend")});e.setWithExplicit(u,c)}return i&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&gv(e.implicit,["encode","gradient"]),(l=(a=e.explicit)==null?void 0:a.encode)!=null&&l.gradient&&gv(e.explicit,["encode","gradient"])),e}function ike(e,t){return t.value==="circle"?t:e}function oke(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}function AV(e){const t=e.component.legends,n={};for(const i of Z(t)){const o=e.getScaleComponent(i),s=St(o.get("domains"));if(n[s])for(const a of n[s])CV(a,t[i])||n[s].push(t[i]);else n[s]=[t[i].clone()]}return Bn(n).flat().map(i=>ske(i,e.config)).filter(i=>i!==void 0)}function ske(e,t){var s,a,l;const{disable:n,labelExpr:r,selections:i,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const u=o.encode.symbols.update;u.fill&&u.fill.value!=="transparent"&&!u.stroke&&!o.stroke&&(u.stroke={value:"transparent"});for(const c of wW)o[c]&&delete u[c]}if(o.title||delete o.title,r!==void 0){let u=r;(l=(a=o.encode)==null?void 0:a.labels)!=null&&l.update&&Se(o.encode.labels.update.text)&&(u=oc(r,"datum.label",o.encode.labels.update.text.signal)),oke(o,"labels","text",{signal:u})}return o}}function ake(e){return Qd(e)||MO(e)?lke(e):TV(e)}function lke(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),TV(e))}function TV(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const l=Se(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return tt(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const uke=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class RV extends Sa{constructor(t,n,r,i){super({...n},{name:t}),this.specifiedProjection=n,this.size=r,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function $V(e){e.component.projection=qt(e)?cke(e):hke(e)}function cke(e){if(e.hasProjection){const t=Ir(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=n?fke(e):void 0,o=new RV(e.projectionName(!0),{...Ir(e.config.projection)??{},...t??{}},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function fke(e){const t=[],{encoding:n}=e;for(const r of[[Io,Do],[Gi,Po]])(hn(n[r[0]])||hn(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Qr)&&e.typedFieldDef(Qr).type===qd&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(At.Main)),t}function dke(e,t){const n=x$(uke,i=>!!(!Oe(e.explicit,i)&&!Oe(t.explicit,i)||Oe(e.explicit,i)&&Oe(t.explicit,i)&&fi(e.get(i),t.get(i))));if(fi(e.size,t.size)){if(n)return e;if(fi(e.explicit,{}))return t;if(fi(t.explicit,{}))return e}return null}function hke(e){if(e.children.length===0)return;let t;for(const r of e.children)$V(r);const n=x$(e.children,r=>{const i=r.component.projection;if(i)if(t){const o=dke(t,i);return o&&(t=o),!!o}else return t=i,!0;else return!0});if(t&&n){const r=e.projectionName(!0),i=new RV(r,t.specifiedProjection,t.size,Be(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function pke(e,t,n,r){if(km(t,n)){const i=qt(e)?e.axis(n)??e.legend(n)??{}:{},o=ue(t,{expr:"datum"}),s=ue(t,{expr:"datum",binSuffix:"end"});return{formulaAs:ue(t,{binSuffix:"range",forAs:!0}),formula:_m(o,s,i.format,i.formatType,r)}}return{}}function OV(e,t){return`${ZH(e)}_${t}`}function gke(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function TO(e,t,n){const r=Mb(n,void 0)??{},i=OV(r,t);return e.getName(`${i}_bins`)}function mke(e){return"as"in e}function qP(e,t,n){let r,i;mke(e)?r=pe(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:r=[ue(e,{forAs:!0}),ue(e,{binSuffix:"end",forAs:!0})];const o={...Mb(t,void 0)},s=OV(o,e.field),{signal:a,extentSignal:l}=gke(n,s);if(_b(o.extent)){const c=o.extent;i=uV(n,c.param,c),delete o.extent}const u={bin:o,field:e.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:u}}class ss extends wt{clone(){return new ss(null,Be(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{if(Ar(o)&&Rt(o.bin)){const{key:a,binComponent:l}=qP(o,o.bin,n);i[a]={...l,...i[a],...pke(n,o,s,n.config)}}return i},{});return Et(r)?null:new ss(t,r)}static makeFromTransform(t,n,r){const{key:i,binComponent:o}=qP(n,n.bin,r);return new ss(t,{[i]:o})}merge(t,n){for(const r of Z(t.bins))r in this.bins?(n(t.bins[r].signal,this.bins[r].signal),this.bins[r].as=Qo([...this.bins[r].as,...t.bins[r].as],et)):this.bins[r]=t.bins[r];for(const r of t.children)t.removeChild(r),r.parent=this;t.remove()}producedFields(){return new Set(Bn(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(Bn(this.bins).map(t=>t.field))}hash(){return`Bin ${et(this.bins)}`}assemble(){return Bn(this.bins).flatMap(t=>{const n=[],[r,...i]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:Hi(t.field),as:r,signal:t.signal,..._b(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:Hi(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const l of i)for(let u=0;u<2;u++)n.push({type:"formula",expr:ue({field:r[u]},{expr:"datum"}),as:l[u]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function yke(e,t,n,r){var o;const i=qt(r)?r.encoding[ks(t)]:void 0;if(Ar(n)&&qt(r)&&VG(n,i,r.markDef,r.config)){e.add(ue(n,{})),e.add(ue(n,{suffix:"end"}));const{mark:s,markDef:a,config:l}=r,u=$l({fieldDef:n,markDef:a,config:l});Eg(s)&&u!==.5&&an(t)&&(e.add(ue(n,{suffix:Bb})),e.add(ue(n,{suffix:jb}))),n.bin&&km(n,t)&&e.add(ue(n,{binSuffix:"range"}))}else if(HH(t)){const s=UH(t);e.add(r.getName(s))}else e.add(ue(n));return Nc(n)&&a_e((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function vke(e,t){for(const n of Z(t)){const r=t[n];for(const i of Z(r))n in e?e[n][i]=new Set([...e[n][i]??[],...r[i]]):e[n]={[i]:r[i]}}}class wo extends wt{clone(){return new wo(null,new Set(this.dimensions),Be(this.measures))}constructor(t,n,r){super(t),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:u}=s;if(l)if(l==="count")i["*"]??(i["*"]={}),i["*"].count=new Set([ue(s,{forAs:!0})]);else{if(da(l)||Kl(l)){const c=da(l)?"argmin":"argmax",f=l[c];i[f]??(i[f]={}),i[f][c]=new Set([ue({op:c,field:f},{forAs:!0})])}else i[u]??(i[u]={}),i[u][l]=new Set([ue(s,{forAs:!0})]);_a(a)&&n.scaleDomain(a)==="unaggregated"&&(i[u]??(i[u]={}),i[u].min=new Set([ue({field:u,aggregate:"min"},{forAs:!0})]),i[u].max=new Set([ue({field:u,aggregate:"max"},{forAs:!0})]))}else yke(o,a,s,n)}),o.size+Z(i).length===0)?null:new wo(t,o,i)}static makeFromTransform(t,n){const r=new Set,i={};for(const o of n.aggregate){const{op:s,field:a,as:l}=o;s&&(s==="count"?(i["*"]??(i["*"]={}),i["*"].count=new Set([l||ue(o,{forAs:!0})])):(i[a]??(i[a]={}),i[a][s]=new Set([l||ue(o,{forAs:!0})])))}for(const o of n.groupby??[])r.add(o);return r.size+Z(i).length===0?null:new wo(t,r,i)}merge(t){return FH(this.dimensions,t.dimensions)?(vke(this.measures,t.measures),!0):(Nwe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Z(this.measures)])}producedFields(){const t=new Set;for(const n of Z(this.measures))for(const r of Z(this.measures[n])){const i=this.measures[n][r];i.size===0?t.add(`${r}_${n}`):i.forEach(t.add,t)}return t}hash(){return`Aggregate ${et({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],r=[];for(const o of Z(this.measures))for(const s of Z(this.measures[o]))for(const a of this.measures[o][s])r.push(a),t.push(s),n.push(o==="*"?null:Hi(o));return{type:"aggregate",groupby:[...this.dimensions].map(Hi),ops:t,fields:n,as:r}}}class Kd extends wt{constructor(t,n,r,i){super(t),this.model=n,this.name=r,this.data=i;for(const o of Mi){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[ue(s),...Rt(a)?[ue(s,{binSuffix:"end"})]:[]],...is(l)?{sortField:l}:K(l)?{sortIndexField:_d(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Mi)this[n]&&(t+=` ${n.charAt(0)}:${et(this[n])}`);return t}get fields(){var n;const t=[];for(const r of Mi)(n=this[r])!=null&&n.fields&&t.push(...this[r].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Mi)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Cs){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if($n(i)&&Jl(o)){const s=Vb(this.childModel,n),a=NO(s);a?t[n]=a:ne(M$(n))}}}return t}assembleRowColumnHeaderData(t,n,r){const i={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:u}=this[t];if(l){const{op:c=Rb,field:f}=l;o.push(f),s.push(c),a.push(ue(l,{forAs:!0}))}else u&&(o.push(u),s.push("max"),a.push(u));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){var l;const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const u of SO){for(const c of kO){const f=(r[u]&&r[u][c])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){o[u]=!0;break}}if(o[u]){const c=`length(data("${this.facet.name}"))`,f=u==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};i.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[na,ta])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&t.push(...a)}return t}}function YP(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function xke(e,t){const n=_$(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const r=YP(t.slice(5,t.length));return`timeParse(${n},'${r}')`}else if(t.startsWith("utc:")){const r=YP(t.slice(4,t.length));return`utcParse(${n},'${r}')`}else return ne(jbe(t)),null}function bke(e){const t={};return Ey(e.filter,n=>{if(SG(n)){let r=null;P$(n)?r=ai(n.equal):z$(n)?r=ai(n.lte):L$(n)?r=ai(n.lt):B$(n)?r=ai(n.gt):j$(n)?r=ai(n.gte):U$(n)?r=n.range[0]:H$(n)&&(r=(n.oneOf??n.in)[0]),r&&($c(r)?t[n.field]="date":ct(r)?t[n.field]="number":pe(r)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function wke(e){const t={};function n(r){vd(r)?t[r.field]="date":r.type==="quantitative"&&xbe(r.aggregate)?t[r.field]="number":fd(r.field)>1?r.field in t||(t[r.field]="flatten"):Nc(r)&&is(r.sort)&&fd(r.sort.field)>1&&(r.sort.field in t||(t[r.sort.field]="flatten"))}if((qt(e)||_o(e))&&e.forEachFieldDef((r,i)=>{if(Ar(r))n(r);else{const o=Tc(i),s=e.fieldDef(o);n({...r,type:s.type})}}),qt(e)){const{mark:r,markDef:i,encoding:o}=e;if(Ql(r)&&!e.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];te(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function _ke(e){const t={};if(qt(e)&&e.component.selection)for(const n of Z(e.component.selection)){const r=e.component.selection[n];for(const i of r.project.items)!i.channel&&fd(i.field)>1&&(t[i.field]="flatten")}return t}class tr extends wt{clone(){return new tr(null,Be(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${et(this._parse)}`}static makeExplicit(t,n,r){var s;let i={};const o=n.data;return!pl(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(i=o.format.parse),this.makeWithAncestors(t,i,{},r)}static makeWithAncestors(t,n,r,i){for(const a of Z(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:ne(iP(a,r[a],l.value)))}for(const a of Z(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:ne(iP(a,n[a],l)))}const o=new Sa(n,r);i.copyAll(o);const s={};for(const a of Z(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return Z(s).length===0||i.parseNothing?null:new tr(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of Z(this._parse)){const r=this._parse[n];fd(n)===1&&(t[n]=r)}return t}producedFields(){return new Set(Z(this._parse))}dependentFields(){return new Set(Z(this._parse))}assembleTransforms(t=!1){return Z(this._parse).filter(n=>t?fd(n)>1:!0).map(n=>{const r=xke(n,this._parse[n]);return r?{type:"formula",expr:r,as:E$(n)}:null}).filter(n=>n!==null)}}class Fl extends wt{clone(){return new Fl(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([To])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:To}}}class Tm extends wt{clone(){return new Tm(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${et(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class Rm extends wt{clone(){return new Rm(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${et(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class hc extends wt{constructor(t){super(null),t??(t={name:"source"});let n;if(pl(t)||(n=t.format?{...Wr(t.format,["parse"])}:{}),Sg(t))this._data={values:t.values};else if(xd(t)){if(this._data={url:t.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(t.url)[1];tt(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else zW(t)?this._data={values:[{type:"Sphere"}]}:(PW(t)||pl(t))&&(this._data={});this._generator=pl(t),t.name&&(this._name=t.name),n&&!Et(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var XP=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},Eke=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ap;function RO(e){return e instanceof hc||e instanceof Tm||e instanceof Rm}class $O{constructor(){ap.set(this,void 0),XP(this,ap,!1,"f")}setModified(){XP(this,ap,!0,"f")}get modifiedFlag(){return Eke(this,ap,"f")}}ap=new WeakMap;class Mc extends $O{getNodeDepths(t,n,r){r.set(t,n);for(const i of t.children)this.getNodeDepths(i,n+1,r);return r}optimize(t){const r=[...this.getNodeDepths(t,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class OO extends $O{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Ske extends OO{mergeNodes(t,n){const r=n.shift();for(const i of n)t.removeChild(i),i.parent=r,i.remove()}run(t){const n=t.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(t,r[i]))}}class kke extends OO{constructor(t){super(),this.requiresSelectionId=t&&EO(t)}run(t){t instanceof Fl&&(this.requiresSelectionId&&(RO(t.parent)||t.parent instanceof wo||t.parent instanceof tr)||(this.setModified(),t.remove()))}}class Cke extends $O{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let r=new Set;t instanceof os&&(r=t.producedFields(),b$(r,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const i of t.children)this.run(i,new Set([...n,...r]))}}class Ake extends OO{constructor(){super()}run(t){t instanceof Er&&!t.isRequired()&&(this.setModified(),t.remove())}}class Tke extends Mc{run(t){if(!RO(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof tr)if(t instanceof tr)this.setModified(),t.merge(n);else{if(w$(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Rke extends Mc{run(t){const n=[...t.children],r=t.children.filter(i=>i instanceof tr);if(t.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of Z(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Et(i)){this.setModified();const s=new tr(t,i);for(const a of n){if(a instanceof tr)for(const l of Z(i))delete a.parse[l];t.removeChild(a),a.parent=s,a instanceof tr&&Z(a.parse).length===0&&a.remove()}}}}}class $ke extends Mc{run(t){t instanceof Er||t.numChildren()>0||t instanceof Kd||t instanceof hc||(this.setModified(),t.remove())}}class Oke extends Mc{run(t){const n=t.children.filter(i=>i instanceof os),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class Nke extends Mc{run(t){const n=t.children.filter(i=>i instanceof wo),r={};for(const i of n){const o=et(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of Z(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class Mke extends Mc{constructor(t){super(),this.model=t}run(t){const n=!(RO(t)||t instanceof Xd||t instanceof tr||t instanceof Fl),r=[],i=[];for(const o of t.children)o instanceof ss&&(n&&!w$(t.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof ss?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class Fke extends Mc{run(t){const n=[...t.children];if(!ic(n,s=>s instanceof Er)||t.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof Er){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof Er)a=l;else break}i.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class Fc extends wt{clone(){return new Fc(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Qo(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??ue(t)}hash(){return`JoinAggregateTransform ${et(this.transform)}`}assemble(){const t=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:t,...i!==void 0?{groupby:i}:{}}}}function Dke(e){return e.stack.stackBy.reduce((t,n)=>{const r=n.fieldDef,i=ue(r);return i&&t.push(i),t},[])}function Ike(e){return K(e)&&e.every(t=>pe(t))&&e.length>1}class ia extends wt{clone(){return new ia(null,Be(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(Qt(f.order,"ascending"));const u={field:a,order:l};let c;return Ike(o)?c=o:pe(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new ia(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:u,facetby:[],as:c})}static makeFromEncoding(t,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,u=o.map(h=>{const p=i[h];return ps(p)}).filter(h=>!!h),c=Dke(n),f=n.encoding.order;let d;if(K(f)||te(f))d=iG(f);else{const h=qG(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.push(g),p.order.push(h),p),{field:[],order:[]})}return new ia(t,{dimensionFieldDefs:u,stackField:n.vgField(s),facetby:[],stackby:c,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${et(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:r}=this._stack;return t.length>0?t.map(i=>i.bin?n?[ue(i,{binSuffix:"mid"})]:[ue(i,{}),ue(i,{binSuffix:"end"})]:[ue(i)]).flat():r??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:u}=this._stack;if(l)for(const c of r){const{bandPosition:f=.5,bin:d}=c;if(d){const h=ue(c,{expr:"datum"}),p=ue(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${f}*${h}+${1-f}*${p}`,as:ue(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...o,...n],key:ue(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:u,offset:a}),t}}class Jd extends wt{clone(){return new Jd(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Qo(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??ue(t)}hash(){return`WindowTransform ${et(this.transform)}`}assemble(){const t=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>O$(f)))return{type:"joinaggregate",as:r,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const u={field:a,order:l},c=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:t,sort:u,...c!==void 0?{ignorePeers:c}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function Pke(e){function t(n){if(!(n instanceof Kd)){const r=n.clone();if(r instanceof Er){const i=vk+r.getSource();r.setSource(i),e.model.component.data.outputNodes[i]=r}else(r instanceof wo||r instanceof ia||r instanceof Jd||r instanceof Fc)&&r.addDimensions(e.fields);for(const i of n.children.flatMap(t))i.parent=r;return[r]}return n.children.flatMap(t)}return t}function yk(e){if(e instanceof Kd)if(e.numChildren()===1&&!(e.children[0]instanceof Er)){const t=e.children[0];(t instanceof wo||t instanceof ia||t instanceof Jd||t instanceof Fc)&&t.addDimensions(e.fields),t.swapWithParent(),yk(e)}else{const t=e.model.component.data.main;NV(t);const n=Pke(e),r=e.children.map(n).flat();for(const i of r)i.parent=t}else e.children.map(yk)}function NV(e){if(e instanceof Er&&e.type===At.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Kd||(t.swapWithParent(),NV(e))}}const vk="scale_",M0=5;function xk(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!xk(t.children))return!1}return!0}function Ki(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function KP(e,t,n){let r=e.sources,i=!1;return i=Ki(new Ake,r)||i,i=Ki(new kke(t),r)||i,r=r.filter(o=>o.numChildren()>0),i=Ki(new $ke,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Ki(new Tke,r)||i,i=Ki(new Mke(t),r)||i,i=Ki(new Cke,r)||i,i=Ki(new Rke,r)||i,i=Ki(new Nke,r)||i,i=Ki(new Oke,r)||i,i=Ki(new Ske,r)||i,i=Ki(new Fke,r)||i),e.sources=r,i}function Lke(e,t){xk(e.sources);let n=0,r=0;for(let i=0;it(n))}}function MV(e){qt(e)?zke(e):Bke(e)}function zke(e){const t=e.component.scales;for(const n of Z(t)){const r=Uke(e,n);if(t[n].setWithExplicit("domains",r),Gke(e,n),e.component.data.isFaceted){let o=e;for(;!_o(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)Ks(a)&&(a.data=vk+a.data.replace(vk,""))}}}function Bke(e){for(const n of e.children)MV(n);const t=e.component.scales;for(const n of Z(t)){let r,i=null;for(const o of e.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=Ol(r,s.getWithExplicit("domains"),"domains","scale",bk);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&ne(Pbe),i=a}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}function jke(e,t,n,r){if(e==="unaggregated"){const{valid:i,reason:o}=JP(t,n);if(!i){ne(o);return}}else if(e===void 0&&r.useUnaggregatedDomain){const{valid:i}=JP(t,n);if(i)return"unaggregated"}return e}function Uke(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=jke(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),t==="x"&&hn(r.x2)?hn(r.x)?Ol($a(n,i,e,"x"),$a(n,i,e,"x2"),"domain","scale",bk):$a(n,i,e,"x2"):t==="y"&&hn(r.y2)?hn(r.y)?Ol($a(n,i,e,"y"),$a(n,i,e,"y2"),"domain","scale",bk):$a(n,i,e,"y2"):$a(n,i,e,t)}function Hke(e,t,n){return e.map(r=>({signal:`{data: ${Fb(r,{timeUnit:n,type:t})}}`}))}function r2(e,t,n){var i;const r=(i=Rn(n))==null?void 0:i.unit;return t==="temporal"||r?Hke(e,t,r):[e]}function $a(e,t,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,u=hn(i[r]),{type:c}=u,f=u.timeUnit;if(s_e(t)){const p=$a(e,void 0,n,r),g=r2(t.unionWith,c,f);return Vo([...g,...p.value])}else{if(Se(t))return Vo([t]);if(t&&t!=="unaggregated"&&!OG(t))return Vo(r2(t,c,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return ri([[0,1]]);const p=n.requestDataName(At.Main);return ri([{data:p,field:n.vgField(r,{suffix:"start"})},{data:p,field:n.vgField(r,{suffix:"end"})}])}const d=_a(r)&&te(u)?Wke(n,r,e):void 0;if(As(u)){const p=r2([u.datum],c,f);return ri(p)}const h=u;if(t==="unaggregated"){const p=n.requestDataName(At.Main),{field:g}=u;return ri([{data:p,field:ue({field:g,aggregate:"min"})},{data:p,field:ue({field:g,aggregate:"max"})}])}else if(Rt(h.bin)){if($n(e))return ri(e==="bin-ordinal"?[]:[{data:wg(d)?n.requestDataName(At.Main):n.requestDataName(At.Raw),field:n.vgField(r,km(h,r)?{binSuffix:"range"}:{}),sort:d===!0||!ye(d)?{field:n.vgField(r,{}),op:"min"}:d}]);{const{bin:p}=h;if(Rt(p)){const g=TO(n,h.field,p);return ri([new wn(()=>{const m=n.getSignalName(g);return`[${m}.start, ${m}.stop]`})])}else return ri([{data:n.requestDataName(At.Main),field:n.vgField(r,{})}])}}else if(h.timeUnit&&tt(["time","utc"],e)){const p=i[ks(r)];if(VG(h,p,o,a)){const g=n.requestDataName(At.Main),m=$l({fieldDef:h,fieldDef2:p,markDef:o,config:a}),y=Eg(s)&&m!==.5;return ri([{data:g,field:n.vgField(r,y?{suffix:Bb}:{})},{data:g,field:n.vgField(r,{suffix:y?jb:"end"})}])}}return ri(d?[{data:wg(d)?n.requestDataName(At.Main):n.requestDataName(At.Raw),field:n.vgField(r),sort:d}]:[{data:n.requestDataName(At.Main),field:n.vgField(r)}])}function i2(e,t){const{op:n,field:r,order:i}=e;return{op:n??(t?"sum":Rb),...r?{field:Hi(r)}:{},...i?{order:i}:{}}}function Gke(e,t){var a;const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=(a=e.fieldDef(t))==null?void 0:a.bin,o=OG(r)&&r,s=Rc(i)&&_b(i.extent)&&i.extent;(o||s)&&n.set("selectionExtent",o??s,!0)}function Wke(e,t,n){if(!$n(n))return;const r=e.fieldDef(t),i=r.sort;if(GG(i))return{op:"min",field:_d(r,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(is(i)){const a=o&&!s.has(i.field);return i2(i,a)}else if(HG(i)){const{encoding:a,order:l}=i,u=e.fieldDef(a),{aggregate:c,field:f}=u,d=o&&!s.has(f);if(da(c)||Kl(c))return i2({field:ue(u),order:l},d);if(O$(c)||!c)return i2({op:c,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(tt(["ascending",void 0],i))return!0}}function JP(e,t){const{aggregate:n,type:r}=e;return n?pe(n)&&!wbe.has(n)?{valid:!1,reason:uwe(n)}:r==="quantitative"&&t==="log"?{valid:!1,reason:cwe(e)}:{valid:!0}:{valid:!1,reason:lwe(e)}}function bk(e,t,n,r){return e.explicit&&t.explicit&&ne(gwe(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Vke(e){const t=Qo(e.map(s=>{if(Ks(s)){const{sort:a,...l}=s;return l}return s}),et),n=Qo(e.map(s=>{if(Ks(s)){const a=s.sort;return a!==void 0&&!wg(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),et);if(t.length===0)return;if(t.length===1){const s=e[0];if(Ks(s)&&n.length>0){let a=n[0];if(n.length>1){ne(sP);const l=n.filter(u=>ye(u)&&"op"in u&&u.op!=="min");n.every(u=>ye(u)&&"op"in u)&&l.length===1?a=l[0]:a=!0}else if(ye(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Qo(n.map(s=>wg(s)||!("op"in s)||pe(s.op)&&s.op in ybe?s:(ne(ywe(s)),!0)),et);let i;r.length===1?i=r[0]:r.length>1&&(ne(sP),i=!0);const o=Qo(e.map(s=>Ks(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function NO(e){if(Ks(e)&&pe(e.field))return e.field;if(_be(e)){let t;for(const n of e.fields)if(Ks(n)&&pe(n.field)){if(!t)t=n.field;else if(t!==n.field)return ne(vwe),t}return ne(xwe),t}else if(Ebe(e)){ne(bwe);const t=e.fields[0];return pe(t)?t:void 0}}function Vb(e,t){const r=e.component.scales[t].get("domains").map(i=>(Ks(i)&&(i.data=e.lookupDataSource(i.data)),i));return Vke(r)}function FV(e){return Qd(e)||MO(e)?e.children.reduce((t,n)=>t.concat(FV(n)),QP(e)):QP(e)}function QP(e){return Z(e.component.scales).reduce((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:u,reverse:c,...f}=i,d=qke(i.range,o,n,e),h=Vb(e,n),p=a?jEe(e,a,r,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function qke(e,t,n,r){if(an(n)){if(Jl(e))return{step:{signal:`${t}_step`}}}else if(ye(e)&&Ks(e))return{...e,data:r.lookupDataSource(e.data)};return e}class DV extends Sa{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:ic(this.get("domains"),t=>K(t)&&t.length===2&&ct(t[0])&&t[0]<=0&&ct(t[1])&&t[1]>=0)}}const Yke=["range","scheme"];function Xke(e){const t=e.component.scales;for(const n of wb){const r=t[n];if(!r)continue;const i=Kke(n,e);r.setWithExplicit("range",i)}}function ZP(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:r,field:i}=n,o=Zr(t),s=e.getName(o);if(ye(r)&&r.binned&&r.step!==void 0)return new wn(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${e.getSignalName(s)} / (${l})`});if(Rt(r)){const a=TO(e,i,r);return new wn(()=>{const l=e.getSignalName(a),u=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(s)} / (${u})`})}}}function Kke(e,t){const n=t.specifiedScales[e],{size:r}=t,o=t.getScaleComponent(e).get("type");for(const f of Yke)if(n[f]!==void 0){const d=ik(o,f),h=NG(e,f);if(!d)ne(fG(o,f,e));else if(h)ne(h);else switch(f){case"range":{const p=n.range;if(K(p)){if(an(e))return Vo(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return wn.fromName(y,m)}return g}))}else if(ye(p))return Vo({data:t.requestDataName(At.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return Vo(p)}case"scheme":return Vo(Jke(n[f]))}}const s=e===Lt||e==="xOffset"?"width":"height",a=r[s];if(gs(a)){if(an(e))if($n(o)){const f=PV(a,t,e);if(f)return Vo({step:f})}else ne(dG(s));else if(xm(e)){const f=e===Wl?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=LV(a,o);if(p)return Vo(p)}}}const{rangeMin:l,rangeMax:u}=n,c=Qke(e,t);return(l!==void 0||u!==void 0)&&ik(o,"rangeMin")&&K(c)&&c.length===2?Vo([l??c[0],u??c[1]]):ri(c)}function Jke(e){return o_e(e)?{scheme:e.name,...Wr(e,["name"])}:{scheme:e}}function IV(e,t,n,{center:r}={}){const i=Zr(e),o=t.getName(i),s=t.getSignalName.bind(t);return e===Nn&&xi(n)?r?[wn.fromName(a=>`${s(a)}/2`,o),wn.fromName(a=>`-${s(a)}/2`,o)]:[wn.fromName(s,o),0]:r?[wn.fromName(a=>`-${s(a)}/2`,o),wn.fromName(a=>`${s(a)}/2`,o)]:[0,wn.fromName(s,o)]}function Qke(e,t){const{size:n,config:r,mark:i,encoding:o}=t,{type:s}=hn(o[e]),l=t.getScaleComponent(e).get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case Lt:case Nn:{if(tt(["point","band"],l)){const f=zV(e,n,r.view);if(gs(f))return{step:PV(f,t,e)}}return IV(e,t,l)}case Wl:case Vd:return Zke(e,t,l);case ba:{const f=t.component.scales[e].get("zero"),d=BV(i,f,r),h=nCe(i,n,t,r);return gd(l)?tCe(d,h,eCe(l,r,u,e)):[d,h]}case qi:return[0,Math.PI*2];case Ac:return[0,360];case Fo:return[0,new wn(()=>{const f=t.getSignalName("width"),d=t.getSignalName("height");return`min(${f},${d})/2`})];case Yl:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case Xl:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Qr:return"symbol";case Jr:case Es:case Ss:return l==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case wa:case Vl:case ql:return[r.scale.minOpacity,r.scale.maxOpacity]}}function PV(e,t,n){const{encoding:r}=t,i=t.getScaleComponent(n),o=A$(n),s=r[o];if(EW({step:e,offsetIsDiscrete:Ue(s)&&CG(s.type)})==="offset"&&iW(r,o)){const l=t.getScaleComponent(o);let c=`domain('${t.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${c} / (1-${Abe(f)})`}}else return e.step}function LV(e,t){if(EW({step:e,offsetIsDiscrete:$n(t)})==="offset")return{step:e.step}}function Zke(e,t,n){const r=e===Wl?"x":"y",i=t.getScaleComponent(r);if(!i)return IV(r,t,n,{center:!0});const o=i.get("type"),s=t.scaleName(r),{markDef:a,config:l}=t;if(o==="band"){const u=zV(r,t.size,t.config.view);if(gs(u)){const c=LV(u,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const u=t.encoding[r];if(te(u)&&u.timeUnit){const c=_G(u.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=$l({fieldDef:u,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Se(f)?`${f.signal}/2`+h:`${f/2+d}`,g=Se(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return NH(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function zV(e,t,n){const r=e===Lt?"width":"height",i=t[r];return i||Cv(n,r)}function eCe(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&K(n)?n.length+1:(ne(Rwe(r)),3)}}function tCe(e,t,n){const r=()=>{const i=ho(t),o=ho(e),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return Se(t)?new wn(r):{signal:r()}}function BV(e,t,n){if(t)return Se(t)?{signal:`${t.signal} ? 0 : ${BV(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Eb("size",e))}const e5=.95;function nCe(e,t,n,r){const i={x:ZP(n,"x"),y:ZP(n,"y")};switch(e){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=t5(t,i,r.view);return ct(o)?o-1:new wn(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=t5(t,i,r.view);return ct(o)?Math.pow(e5*o,2):new wn(()=>`pow(${e5} * ${o.signal}, 2)`)}}throw new Error(Eb("size",e))}function t5(e,t,n){const r=gs(e.width)?e.width.step:kv(n,"width"),i=gs(e.height)?e.height.step:kv(n,"height");return t.x||t.y?new wn(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function jV(e,t){qt(e)?rCe(e,t):HV(e,t)}function rCe(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=e;for(const a of Z(n)){const l=s[a],u=n[a],c=e.getScaleComponent(a),f=hn(i[a]),d=l[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=ik(h,t),y=NG(a,t);if(d!==void 0&&(m?y&&ne(y):ne(fG(h,t,a))),m&&y===void 0)if(d!==void 0){const v=f.timeUnit,b=f.type;switch(t){case"domainMax":case"domainMin":$c(l[t])||b==="temporal"||v?u.set(t,{signal:Fb(l[t],{type:b,timeUnit:v})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const v=t in n5?n5[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:oW(i,a),hasSecondaryRangeChannel:!!i[ks(a)]}):r.scale[t];v!==void 0&&u.set(t,v,!1)}}}const n5={bins:({model:e,fieldOrDatumDef:t})=>te(t)?iCe(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>oCe(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>sCe(e,t,n,r,i,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>aCe(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>lCe(e,t,n.type,r,i.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>uCe(e,t,n,r,i.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{const i=te(e)?e.sort:void 0;return cCe(t,i,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>fCe(e,t,n,r,i,o.scale,s)};function UV(e){qt(e)?Xke(e):HV(e,"range")}function HV(e,t){const n=e.component.scales;for(const r of e.children)t==="range"?UV(r):jV(r,t);for(const r of Z(n)){let i;for(const o of e.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(t);i=Ol(i,a,t,"scale",IW((l,u)=>{switch(t){case"range":return l.step&&u.step?l.step-u.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function iCe(e,t){const n=t.bin;if(Rt(n)){const r=TO(e,t.field,n);return new wn(()=>e.getSignalName(r))}else if(Dn(n)&&Rc(n)&&n.step!==void 0)return{step:n.step}}function oCe(e,t){if(tt([Jr,Es,Ss],e)&&t!=="nominal")return"hcl"}function sCe(e,t,n,r,i,o){var s;if(!((s=ps(o))!=null&&s.bin||K(n)||i!=null||r!=null||tt([Vr.TIME,Vr.UTC],e)))return an(t)?!0:void 0}function aCe(e,t,n,r,i,o){if(an(e)){if(po(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(te(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===Vr.POINT)return n.pointPadding}}function lCe(e,t,n,r,i,o=!1){if(e===void 0){if(an(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,bandWithNestedOffsetPaddingInner:u}=i;return o?u:Qt(s,n==="bar"?a:l)}else if(xm(t)&&r===Vr.BAND)return i.offsetBandPaddingInner}}function uCe(e,t,n,r,i,o=!1){if(e===void 0){if(an(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===Vr.BAND)return Qt(s,Se(r)?{signal:`${r.signal}/2`}:r/2)}else if(xm(t)){if(n===Vr.POINT)return .5;if(n===Vr.BAND)return i.offsetBandPaddingOuter}}}function cCe(e,t,n,r){if(n==="x"&&r.xReverse!==void 0)return xi(e)&&t==="descending"?Se(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(xi(e)&&t==="descending")return!0}function fCe(e,t,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&xi(i)){if(K(n)){const l=n[0],u=n[n.length-1];if(ct(l)&&l<=0&&ct(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!gd(i))return!0;if(!(te(t)&&t.bin)&&tt([...Cs,...ube],e)){const{orient:l,type:u}=r;return tt(["bar","area","line","trail"],u)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:tt(["bar","area"],u)&&!s?!0:o==null?void 0:o.zero}return!1}function dCe(e,t,n,r,i=!1){const o=hCe(t,n,r,i),{type:s}=e;return _a(t)?s!==void 0?d_e(t,s)?te(n)&&!f_e(s,n.type)?(ne(hwe(s,o)),o):s:(ne(dwe(t,s,o)),o):o:null}function hCe(e,t,n,r){var i;switch(t.type){case"nominal":case"ordinal":{if(Of(e)||X_(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&ne(K_(e,"ordinal")),"ordinal";if(an(e)||xm(e)){if(tt(["rect","bar","image","rule"],n.type)||r)return"band"}else if(n.type==="arc"&&e in $$)return"band";const o=n[Zr(e)];return uc(o)||yd(t)&&((i=t.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return Of(e)?"time":X_(e)==="discrete"?(ne(K_(e,"temporal")),"ordinal"):te(t)&&t.timeUnit&&Rn(t.timeUnit).utc?"utc":"time";case"quantitative":return Of(e)?te(t)&&Rt(t.bin)?"bin-ordinal":"linear":X_(e)==="discrete"?(ne(K_(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(uG(t.type))}function pCe(e,{ignoreRange:t}={}){GV(e),MV(e);for(const n of c_e)jV(e,n);t||UV(e)}function GV(e){qt(e)?e.component.scales=gCe(e):e.component.scales=yCe(e)}function gCe(e){const{encoding:t,mark:n,markDef:r}=e,i={};for(const o of wb){const s=hn(t[o]);if(s&&n===DG&&o===Qr&&s.type===qd)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const l=oW(t,o),u=dCe(a,o,s,r,l);i[o]=new DV(e.scaleName(`${o}`,!0),{value:u,explicit:a.type===u})}}return i}const mCe=IW((e,t)=>lP(e)-lP(t));function yCe(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const o of e.children){GV(o);for(const s of Z(o.component.scales))if((t=i.scale)[s]??(t[s]=bV(s,e)),i.scale[s]==="shared"){const a=r[s],l=o.component.scales[s].getWithExplicit("type");a?e_e(a.value,l.value)?r[s]=Ol(a,l,"type","scale",mCe):(i.scale[s]="independent",delete r[s]):r[s]=l}}for(const o of Z(r)){const s=e.scaleName(o,!0),a=r[o];n[o]=new DV(s,a);for(const l of e.children){const u=l.component.scales[o];u&&(l.renameScale(u.get("name"),s),u.merged=!0)}}return n}class o2{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function qt(e){return(e==null?void 0:e.type)==="unit"}function _o(e){return(e==null?void 0:e.type)==="facet"}function MO(e){return(e==null?void 0:e.type)==="concat"}function Qd(e){return(e==null?void 0:e.type)==="layer"}class FO{constructor(t,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.correctDataNames=l=>{var u,c,f;return(u=l.from)!=null&&u.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(c=l.from)==null?void 0:c.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=r,this.config=o,this.view=Ir(a),this.name=t.name??i,this.title=Pa(t.title)?{text:t.title}:t.title?Ir(t.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new o2,this.projectionNameMap=r?r.projectionNameMap:new o2,this.signalNameMap=r?r.signalNameMap:new o2,this.data=t.data,this.description=t.description,this.transforms=SEe(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:T2e(t,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:$b(t)||(r==null?void 0:r.component.data.isFaceted)&&t.data===void 0},layoutSize:new Sa,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Be(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){pCe(this)}parseProjection(){$V(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){kV(this)}assembleEncodeFromView(t){const{style:n,...r}=t,i={};for(const o of Z(r)){const s=r[o];s!==void 0&&(i[o]=Nt(s))}return i}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Nt(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n??{}}:Et(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:r,config:i}=this,o=LSe(r.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const r of Mi)t[r].title&&n.push(NSe(this,r));for(const r of SO)n=n.concat(MSe(this,r));return n}assembleAxes(){return xSe(this.component.axes,this.config)}assembleLegends(){return AV(this)}assembleProjections(){return ake(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},r={...eG(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(r.text)return tt(["unit","layer"],this.type)?tt(["middle",void 0],r.anchor)&&(r.frame??(r.frame="group")):r.anchor??(r.anchor="start"),Et(r)?void 0:r}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||_o(this.parent)?FV(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return Pt((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(At[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(t){if(_o(this.parent)){const n=vV(t),r=bb(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if($n(o)&&Jl(s)){const a=i.get("name"),l=Vb(this,r),u=NO(l);if(u){const c=ue({aggregate:"distinct",field:u},{expr:"datum"});return{signal:yV(a,i,c)}}else return ne(M$(r)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(WH(t)&&_a(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let r=this.component.selection[t];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(t,n)),!r)throw new Error(Nbe(n));return r}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(r=>r.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(r=>r.hasOrientSignalRef()))}}class WV extends FO{vgField(t,n={}){const r=this.fieldDef(t);if(r)return ue(r,n)}reduceFieldDef(t,n){return r2e(this.getMapping(),(r,i,o)=>{const s=ps(i);return s?t(r,s,o):r},n)}forEachFieldDef(t,n){sO(this.getMapping(),(r,i)=>{const o=ps(r);o&&t(o,i)},n)}}class qb extends wt{clone(){return new qb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${et(this.transform)}`}assemble(){const{density:t,...n}=this.transform,r={type:"kde",field:t,...n};return this.transform.groupby&&(r.resolve="shared"),r}}class Yb extends wt{clone(){return new Yb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${et(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class kg extends wt{clone(){return new kg(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n){const{config:r,mark:i,markDef:o}=n;if(vt("invalid",o,r)!=="filter")return null;const a=n.reduceFieldDef((l,u,c)=>{const f=_a(c)&&n.getScaleComponent(c);if(f){const d=f.get("type");xi(d)&&u.aggregate!=="count"&&!Ql(i)&&(l[u.field]=u)}return l},{});return Z(a).length?new kg(t,a):null}dependentFields(){return new Set(Z(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${et(this.filter)}`}assemble(){const t=Z(this.filter).reduce((n,r)=>{const i=this.filter[r],o=ue(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (isValid(${o}) && isFinite(+${o})))`):i.type==="quantitative"&&(n.push(`isValid(${o})`),n.push(`isFinite(+${o})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class Xb extends wt{clone(){return new Xb(this.parent,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${et(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Kb extends wt{clone(){return new Kb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${et(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Ff extends wt{clone(){return new Ff(null,Be(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(const i of[[Io,Do],[Gi,Po]]){const o=i.map(s=>{const a=hn(n.encoding[s]);return te(a)?a.field:As(a)?{expr:`${a.datum}`}:Ao(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new Ff(t,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(Qr)){const i=n.typedFieldDef(Qr);i.type===qd&&(t=new Ff(t,null,i.field,n.getName(`geojson_${r++}`)))}return t}constructor(t,n,r,i){super(t),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const t=(this.fields??[]).filter(pe);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${et(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Cg extends wt{clone(){return new Cg(null,this.projection,Be(this.fields),Be(this.as))}constructor(t,n,r,i){super(t),this.projection=n,this.fields=r,this.as=i}static parseAll(t,n){if(!n.projectionName())return t;for(const r of[[Io,Do],[Gi,Po]]){const i=r.map(s=>{const a=hn(n.encoding[s]);return te(a)?a.field:As(a)?{expr:`${a.datum}`}:Ao(a)?{expr:`${a.value}`}:void 0}),o=r[0]===Gi?"2":"";(i[0]||i[1])&&(t=new Cg(t,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(pe))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${et(this.fields)} ${et(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class ju extends wt{clone(){return new ju(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:r,step:i}=t;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(t,n){return new ju(t,n)}static makeFromEncoding(t,n){const r=n.encoding,i=r.x,o=r.y;if(te(i)&&te(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:u,frame:c,keyvals:f}=s.impute,d=aW(n.mark,r);return new ju(t,{impute:s.field,key:a.field,...l?{method:l}:{},...u!==void 0?{value:u}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${et(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:t,key:n,...r?{keyvals:oEe(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const u={type:"window",as:[`imputed_${t}_value`],ops:[i],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[l,u,c]}else return[l]}}class Jb extends wt{clone(){return new Jb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${et(this.transform)}`}assemble(){const{loess:t,on:n,...r}=this.transform;return{type:"loess",x:n,y:t,...r}}}class Ag extends wt{clone(){return new Ag(null,Be(this.transform),this.secondary)}constructor(t,n,r){super(t),this.transform=n,this.secondary=r}static make(t,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(sEe(s)){let l=YV(s.data,o);l||(l=new hc(s.data),o.push(l));const u=n.getName(`lookup_${i}`);a=new Er(l,u,At.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[u]=a}else if(aEe(s)){const l=s.param;r={as:l,...r};let u;try{u=n.getSelectionComponent(Pt(l),l)}catch{throw new Error(Dbe(l))}if(a=u.materialized,!a)throw new Error(Ibe(l))}return new Ag(t,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?me(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${et({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:me(this.transform.as)}:{}};else{let n=this.transform.as;pe(n)||(ne(Gbe),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Qb extends wt{clone(){return new Qb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${et(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Zb extends wt{clone(){return new Zb(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Be(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${et(this.transform)}`}assemble(){const{regression:t,on:n,...r}=this.transform;return{type:"regression",x:n,y:t,...r}}}class ew extends wt{clone(){return new ew(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Qo((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${et(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:t,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class tw extends wt{clone(){return new tw(null,Be(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${et(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function VV(e){let t=0;function n(r,i){if(r instanceof hc&&!r.isGenerator&&!xd(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof tr&&(r.parent instanceof hc&&!i.source?(i.format={...i.format??{},parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof Kd){i.name||(i.name=`data_${t++}`),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof Tm||r instanceof Rm||r instanceof kg||r instanceof Xd||r instanceof wd||r instanceof Cg||r instanceof wo||r instanceof Ag||r instanceof Jd||r instanceof Fc||r instanceof Kb||r instanceof Xb||r instanceof qb||r instanceof Jb||r instanceof Qb||r instanceof Zb||r instanceof Fl||r instanceof tw||r instanceof ew||r instanceof Yb)&&i.transform.push(r.assemble()),(r instanceof ss||r instanceof os||r instanceof ju||r instanceof ia||r instanceof Ff)&&i.transform.push(...r.assemble()),r instanceof Er&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof Er?r.setSource(i.name):(i.name||(i.name=`data_${t++}`),r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof Er&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${t++}`);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function vCe(e){const t=[],n=VV(t);for(const r of e.children)n(r,{source:e.name,name:null,transform:[]});return t}function xCe(e,t){const n=[],r=VV(n);let i=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function bCe(e){return e==="top"||e==="left"||Se(e)?"header":"footer"}function wCe(e){for(const t of Mi)_Ce(e,t);r5(e,"x"),r5(e,"y")}function _Ce(e,t){var s;const{facet:n,config:r,child:i,component:o}=e;if(e.channelHasField(t)){const a=n[t],l=Ed("title",null,r,t);let u=Nf(a,r,{allowDisabling:!0,includeDefault:l===void 0||!!l});i.component.layoutHeaders[t].title&&(u=K(u)?u.join(", "):u,u+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);const c=Ed("labelOrient",a.header,r,t),f=a.header!==null?Qt((s=a.header)==null?void 0:s.labels,r.header.labels,!0):!1,d=tt(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[d]:t==="facet"?[]:[qV(e,t,f)]}}}function qV(e,t,n){const r=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function r5(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=AO(i,t),i.axis[t]==="shared"){const o=t==="x"?"column":"row",s=r[o];for(const a of n.component.axes[t]){const l=bCe(a.get("orient"));s[l]??(s[l]=[qV(e,o,!1)]);const u=sp(a,"main",e.config,{header:!0});u&&s[l][0].axes.push(u),a.mainExtracted=!0}}}}function ECe(e){DO(e),$v(e,"width"),$v(e,"height")}function SCe(e){DO(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";$v(e,t),$v(e,n)}function DO(e){for(const t of e.children)t.parseLayoutSize()}function $v(e,t){const n=vV(t),r=bb(n),i=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),u=i.scale[r]??bV(r,e);if(u==="independent"&&l.value==="step"){s=void 0;break}if(s){if(u==="independent"&&s.value!==l.value){s=void 0;break}s=Ol(s,l,n,"")}else s=l}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function kCe(e){const{size:t,component:n}=e;for(const r of Cs){const i=Zr(r);if(t[i]){const o=t[i];n.layoutSize.set(i,gs(o)?"step":o,!0)}else{const o=CCe(e,i);n.layoutSize.set(i,o,!1)}}}function CCe(e,t){const n=t==="width"?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if($n(o)){const a=Cv(r.view,t);return Jl(s)||gs(a)?"step":a}else return ak(r.view,t)}else{if(e.hasProjection||e.mark==="arc")return ak(r.view,t);{const o=Cv(r.view,t);return gs(o)?o.step:o}}}function wk(e,t,n){return ue(t,{suffix:`by_${ue(e)}`,...n??{}})}class Op extends WV{constructor(t,n,r,i){super(t,"facet",n,r,i,t.resolve),this.child=BO(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Em(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=Z(t),r={};for(const i of n){if(![ta,na].includes(i)){ne(Eb(i,"facet"));break}const o=t[i];if(o.field===void 0){ne(nk(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(t,n){const r=iO(t,n);return r.header?r.header=Ir(r.header):r.header===null&&(r.header=null),r}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=nw(this),this.child.parseData()}parseLayoutSize(){DO(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),wCe(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Mi)for(const r of kO){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=Ed("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=Gb(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[l]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[l]??(t[l]={}),t[l][n]=.5),i.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,r=t?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Op))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Op?{...this.channelHasField("column")?{encode:{update:{columns:{field:ue(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],r=[];if(this.child instanceof Op){if(this.child.channelHasField("column")){const i=ue(this.child.facet.column);t.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of Cs){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if($n(s)&&Jl(a)){const l=Vb(this.child,i),u=NO(l);u?(t.push(u),n.push("distinct"),r.push(`distinct_${u}`)):ne(M$(i))}}}return{fields:t,ops:n,as:r}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const c of Mi){const f=this.facet[c];if(f){l.push(ue(f));const{bin:d,sort:h}=f;if(Rt(d)&&l.push(ue(f,{binSuffix:"end"})),is(h)){const{field:p,op:g=Rb}=h,m=wk(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(K(h)){const p=_d(f,c);o.push(p),s.push("max"),a.push(p)}}}const u=!!r&&!!i;return{name:t,data:n,groupby:l,...u||o.length>0?{aggregate:{...u?{cross:u}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,r=n[t];return r?is(r.sort)?[wk(r,r.sort,{expr:"datum"})]:K(r.sort)?[_d(r,t,{expr:"datum"})]:[ue(r,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,r=n[t];if(r){const{sort:i}=r;return[(is(i)?i.order:!K(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){var i;const{facet:t,config:n}=this;if(t.facet)return gk(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const o of SO)if(t[o]){const s=Ed("labelOrient",(i=t[o])==null?void 0:i.header,n,o);if(r[o].includes(s))return gk(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,r=vCe(n),i=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:Mi.map(l=>this.facetSortFields(l)).flat(),order:Mi.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup(PEe(this,[]))}]}getMapping(){return this.facet}}function ACe(e,t){const{row:n,column:r}=t;if(n&&r){let i=null;for(const o of[n,r])if(is(o.sort)){const{field:s,op:a=Rb}=o.sort;e=i=new Fc(e,{joinaggregate:[{op:a,field:s,as:wk(o,o.sort,{forAs:!0})}],groupby:[ue(o)]})}return i}return null}function YV(e,t){var n,r,i,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const l=(n=e.format)==null?void 0:n.mesh,u=(r=a.format)==null?void 0:r.feature;if(l&&u)continue;const c=(i=e.format)==null?void 0:i.feature;if((c||u)&&c!==u)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((l||f)&&l!==f)){if(Sg(e)&&Sg(a)){if(fi(e.values,a.values))return s}else if(xd(e)&&xd(a)){if(e.url===a.url)return s}else if(PW(e)&&e.name===s.dataName)return s}}return null}function TCe(e,t){if(e.data||!e.parent){if(e.data===null){const r=new hc({values:[]});return t.push(r),r}const n=YV(e.data,t);if(n)return pl(e.data)||(n.data.format=MH({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const r=new hc(e.data);return t.push(r),r}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function RCe(e,t,n){let r=0;for(const i of t.transforms){let o,s;if(yEe(i))s=e=new wd(e,i),o="derived";else if(yO(i)){const a=bke(i);s=e=tr.makeWithAncestors(e,{},a,n)??e,e=new Xd(e,t,i.filter)}else if(NW(i))s=e=ss.makeFromTransform(e,i,t),o="number";else if(xEe(i))o="date",n.getWithExplicit(i.field).value===void 0&&(e=new tr(e,{[i.field]:o}),n.set(i.field,o,!1)),s=e=os.makeFromTransform(e,i);else if(bEe(i))s=e=wo.makeFromTransform(e,i),o="number",EO(t)&&(e=new Fl(e));else if(OW(i))s=e=Ag.make(e,t,i,r++),o="derived";else if(pEe(i))s=e=new Jd(e,i),o="number";else if(gEe(i))s=e=new Fc(e,i),o="number";else if(wEe(i))s=e=ia.makeFromTransform(e,i),o="derived";else if(_Ee(i))s=e=new Kb(e,i),o="derived";else if(EEe(i))s=e=new Yb(e,i),o="derived";else if(mEe(i))s=e=new Xb(e,i),o="derived";else if(lEe(i))s=e=new ew(e,i),o="derived";else if(hEe(i))e=new tw(e,i);else if(vEe(i))s=e=ju.makeFromTransform(e,i),o="derived";else if(uEe(i))s=e=new qb(e,i),o="derived";else if(cEe(i))s=e=new Qb(e,i),o="derived";else if(fEe(i))s=e=new Zb(e,i),o="derived";else if(dEe(i))s=e=new Jb(e,i),o="derived";else{ne(Hbe(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function nw(e){var g;let t=TCe(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,s=!(i&&(pl(i)||xd(i)||Sg(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new DEe;pl(i)?(LW(i)?t=new Rm(t,i.sequence):vO(i)&&(t=new Tm(t,i.graticule)),s.parseNothing=!0):((g=i==null?void 0:i.format)==null?void 0:g.parse)===null&&(s.parseNothing=!0),t=tr.makeExplicit(t,e,s)??t,t=new Fl(t);const a=e.parent&&Qd(e.parent);(qt(e)||_o(e))&&a&&(t=ss.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=RCe(t,e,s));const l=_ke(e),u=wke(e);t=tr.makeWithAncestors(t,{},{...l,...u},s)??t,qt(e)&&(t=Ff.parseAll(t,e),t=Cg.parseAll(t,e)),(qt(e)||_o(e))&&(a||(t=ss.makeFromEncoding(t,e)??t),t=os.makeFromEncoding(t,e)??t,t=wd.parseAllForSortIndex(t,e));const c=e.getDataName(At.Raw),f=new Er(t,c,At.Raw,r);if(n[c]=f,t=f,qt(e)){const m=wo.makeFromEncoding(t,e);m&&(t=m,EO(e)&&(t=new Fl(t))),t=ju.makeFromEncoding(t,e)??t,t=ia.makeFromEncoding(t,e)??t}qt(e)&&(t=kg.make(t,e)??t);const d=e.getDataName(At.Main),h=new Er(t,d,At.Main,r);n[d]=h,t=h,qt(e)&&ySe(e,h);let p=null;if(_o(e)){const m=e.getName("facet");t=ACe(t,e.facet)??t,p=new Kd(t,e,m,h.getSource()),n[m]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:f,main:h,facetRoot:p,ancestorParse:s}}class $Ce extends FO{constructor(t,n,r,i){var o,s,a,l;super(t,"concat",n,r,i,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((l=(a=t.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&ne(Bbe),this.children=this.getChildren(t).map((u,c)=>BO(u,this,this.getName(`concat_${c}`),void 0,i))}parseData(){this.component.data=nw(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Z(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Pb(t)?t.vconcat:gO(t)?t.hconcat:t.concat}parseLayoutSize(){SCe(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=CO(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),r=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function OCe(e){return e===!1||e===null}const NCe={disable:1,gridScale:1,scale:1,...nW,labelExpr:1,encode:1},XV=Z(NCe);class IO extends Sa{constructor(t={},n={},r=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=r}clone(){return new IO(Be(this.explicit),Be(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!OCe(this.get(t))}hasOrientSignalRef(){return Se(this.explicit.orient)}}function MCe(e,t,n){const{encoding:r,config:i}=e,o=hn(r[t])??hn(r[ks(t)]),s=e.axis(t)||{},{format:a,formatType:l}=s;if(cc(l))return{text:go({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(md(o)==="quantitative"){if(yd(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:go({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:go({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(md(o)==="temporal"&&i.timeFormatType&&te(o)&&!o.timeUnit)return{text:go({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function FCe(e){return Cs.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[jCe(n,e)]),t),{})}const DCe={bottom:"top",top:"bottom",left:"right",right:"left"};function ICe(e){const{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(const i of e.children){i.parseAxesAndHeaders();for(const o of Z(i.component.axes))n.axis[o]=AO(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=PCe(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const i of Cs){for(const o of e.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){t[i]=(t[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!Se(a)){if(r[a]>0&&!l){const u=DCe[a];r[a]>r[u]&&s.set("orient",u,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&t[i]&&t[i].length>1)for(const[o,s]of(t[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function PCe(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let r=0;rn.clone());return e}function LCe(e,t){for(const n of XV){const r=Ol(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return aG(i,o);case"gridScale":return{explicit:i.explicit,value:Qt(i.value,o.value)}}return zb(i,o,n,"axis")});e.setWithExplicit(n,r)}return e}function zCe(e,t,n,r,i){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Se(n.labelAngle)?n.labelAngle:_g(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===hV(r,i))return!0}return e===n[t]}const BCe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function jCe(e,t){var y,v;let n=t.axis(e);const r=new IO,i=hn(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((v=s.axis)==null?void 0:v.orient)||ASe(e),l=t.getScaleComponent(e).get("type"),u=bSe(e,l,a,t.config),c=n!==void 0?!n:hk("disable",s.style,n==null?void 0:n.style,u).configValue;if(r.set("disable",c,n!==void 0),c)return r;n=n||{};const f=SSe(i,n,e,s.style,u),d=jG(n.formatType,i,l),h=BG(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const b of XV){const w=b in UP?UP[b](p):gP(b)?n[b]:void 0,_=w!==void 0,k=zCe(w,b,n,t,e);if(_&&k)r.set(b,w,k);else{const{configValue:E=void 0,configFrom:A=void 0}=gP(b)&&b!=="values"?hk(b,s.style,n.style,u):{},N=E!==void 0;_&&!N?r.set(b,w,k):(A!=="vgAxisConfig"||BCe.has(b)&&N||Cm(E)||Se(E))&&r.set(b,E,!1)}}const g=n.encoding??{},m=tW.reduce((b,w)=>{if(!r.hasAxisPart(w))return b;const _=xV(g[w]??{},t),k=w==="labels"?MCe(t,e,_):_;return k!==void 0&&!Et(k)&&(b[w]={update:k}),b},{});return Et(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function UCe({encoding:e,size:t}){for(const n of Cs){const r=Zr(n);gs(t[r])&&Za(e[n])&&(delete t[r],ne(dG(r)))}return t}const HCe={vgMark:"arc",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),...Nl(e,"radius"),...Nl(e,"theta")})},GCe={vgMark:"area",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Av("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Av("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),..._O(e)})},WCe={vgMark:"rect",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Nl(e,"x"),...Nl(e,"y")})},VCe={vgMark:"shape",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&te(n)&&n.type===qd?{field:ue(n,{expr:"datum"})}:{}}]}},qCe={vgMark:"image",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Nl(e,"x"),...Nl(e,"y"),...bO(e,"url")})},YCe={vgMark:"line",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),..._n("size",e,{vgChannel:"strokeWidth"}),..._O(e)})},XCe={vgMark:"trail",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),..._n("size",e),..._O(e)})};function PO(e,t){const{config:n}=e;return{...Yi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),..._n("size",e),..._n("angle",e),...KCe(e,n,t)}}function KCe(e,t,n){return n?{shape:{value:n}}:_n("shape",e)}const JCe={vgMark:"symbol",encodeEntry:e=>PO(e)},QCe={vgMark:"symbol",encodeEntry:e=>PO(e,"circle")},ZCe={vgMark:"symbol",encodeEntry:e=>PO(e,"square")},eAe={vgMark:"rect",encodeEntry:e=>({...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Nl(e,"x"),...Nl(e,"y")})},tAe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Av("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Av("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),..._n("size",e,{vgChannel:"strokeWidth"})}}},nAe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Yi(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...er("x",e,{defaultPos:"mid"}),...er("y",e,{defaultPos:"mid"}),...bO(e),..._n("size",e,{vgChannel:"fontSize"}),..._n("angle",e),...LP("align",rAe(e.markDef,n,t)),...LP("baseline",iAe(e.markDef,n,t)),...er("radius",e,{defaultPos:null}),...er("theta",e,{defaultPos:null})}}};function rAe(e,t,n){if(vt("align",e,n)===void 0)return"center"}function iAe(e,t,n){if(vt("baseline",e,n)===void 0)return"middle"}const oAe={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i=r==="horizontal"?"width":"height",o=r==="horizontal"?"height":"width";return{...Yi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...er("x",e,{defaultPos:"mid",vgChannel:"xc"}),...er("y",e,{defaultPos:"mid",vgChannel:"yc"}),..._n("size",e,{defaultValue:sAe(e),vgChannel:i}),[o]:Nt(vt("thickness",n,t))}}};function sAe(e){const{config:t,markDef:n}=e,{orient:r}=n,i=r==="horizontal"?"width":"height",o=e.getScaleComponent(r==="horizontal"?"x":"y"),s=vt("size",n,t,{vgChannel:i})??t.tick.bandSize;if(s!==void 0)return s;{const a=o?o.get("range"):void 0;return a&&Jl(a)&&ct(a.step)?a.step*3/4:kv(t.view,i)*3/4}}const F0={arc:HCe,area:GCe,bar:WCe,circle:QCe,geoshape:VCe,image:qCe,line:YCe,point:JCe,rect:eAe,rule:tAe,square:ZCe,text:nAe,tick:oAe,trail:XCe};function aAe(e){if(tt([Ab,kb,g_e],e.mark)){const t=aW(e.mark,e.encoding);if(t.length>0)return lAe(e,t)}else if(e.mark===Cb){const t=tk.some(n=>vt(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return uAe(e)}return LO(e)}const i5="faceted_path_";function lAe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:i5+e.requestDataName(At.Main),data:e.requestDataName(At.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:LO(e,{fromPrefix:i5})}]}const o5="stack_group_";function uAe(e){var u;const[t]=LO(e,{fromPrefix:o5}),n=e.scaleName(e.stack.fieldChannel),r=(c={})=>e.vgField(e.stack.fieldChannel,c),i=(c,f)=>{const d=[r({prefix:"min",suffix:"start",expr:f}),r({prefix:"max",suffix:"start",expr:f}),r({prefix:"min",suffix:"end",expr:f}),r({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...cd(t.encode.update,["y","yc","y2","height",...tk]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Wr(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...cd(t.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Wr(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of tk){const f=ha(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):f&&(o[c]=Nt(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((u=e.stack.groupbyChannels)==null?void 0:u.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=ue(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ue(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=ha(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Nt(d)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(At.Main),name:o5+e.requestDataName(At.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function cAe(e){var a;const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,s=t.order;if(!(!K(s)&&Ao(s)&&ZS(s.value)||!s&&ZS(vt("order",i,o)))){if((K(s)||te(s))&&!n)return iG(s,{expr:"datum"});if(Ql(r)){const l=i.orient==="horizontal"?"y":"x",u=t[l];if(te(u)){const c=u.sort;if(K(c))return{field:ue(u,{prefix:l,suffix:"sort_index",expr:"datum"})};if(is(c))return{field:ue({aggregate:oO(e.encoding)?c.op:void 0,field:c.field},{expr:"datum"})};if(HG(c)){const f=e.fieldDef(c.encoding);return{field:ue(f,{expr:"datum"}),order:c.order}}else return c===null?void 0:{field:ue(u,{binSuffix:(a=e.stack)!=null&&a.impute?"mid":void 0,expr:"datum"})}}return}}}function LO(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,s=Qt(r.clip,fAe(e),dAe(e)),a=nG(r),l=i.key,u=cAe(e),c=hAe(e),f=vt("aria",r,o),d=F0[n].postEncodingTransform?F0[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:F0[n].vgMark,...s?{clip:!0}:{},...a?{style:a}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(At.Main)},encode:{update:F0[n].encodeEntry(e)},...d?{transform:d}:{}}]}function fAe(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function dAe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function hAe(e){if(!e.component.selection)return null;const t=Z(e.component.selection).length;let n=t,r=e.parent;for(;r&&n===0;)n=Z(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip}:null}class KV extends WV{constructor(t,n,r,i={},o){super(t,"unit",n,r,o,void 0,yP(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=hs(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=J2e(s,o,{graticule:t.data&&vO(t.data)}));const l=this.encoding=t2e(t.encoding||{},a,s.filled,o);this.markDef=TW(s,l,o),this.size=UCe({encoding:l,size:yP(t)?{...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:i}),this.stack=AW(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(u=>hO(u))}get hasProjection(){const{encoding:t}=this,n=this.mark===DG,r=t&&ebe.some(i=>Ue(t[i]));return n||r}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return wb.reduce((r,i)=>{const o=hn(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(t){const{domain:n,range:r}=t,i=Ir(t);return K(n)&&(i.domain=n.map(ai)),K(r)&&(i.range=r.map(ai)),i}initAxes(t){return Cs.reduce((n,r)=>{const i=t[r];if(Ue(i)||r===Lt&&Ue(t.x2)||r===Nn&&Ue(t.y2)){const o=Ue(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=Z(t),r={};for(const i of n){const o=t[i];r[i]=Cm(o)?tG(o):ai(o)}return r}initLegends(t){return cbe.reduce((n,r)=>{const i=hn(t[r]);if(i&&dbe(r)){const o=i.legend;n[r]=o&&Ir(o)}return n},{})}parseData(){this.component.data=nw(this)}parseLayoutSize(){kCe(this)}parseSelections(){this.component.selection=mSe(this,this.selection)}parseMarkGroup(){this.component.mark=aAe(this)}parseAxesAndHeaders(){this.component.axes=FCe(this)}assembleSelectionTopLevelSignals(t){return LEe(this,t)}assembleSignals(){return[...cV(this),...IEe(this,[])]}assembleSelectionData(t){return zEe(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return CO(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Qd(this.parent))&&(t=jW(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return zu(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return ps(n)}typedFieldDef(t){const n=this.fieldDef(t);return Ar(n)?n:null}}class zO extends FO{constructor(t,n,r,i,o){super(t,"layer",n,r,o,t.resolve,t.view);const s={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,l)=>{if(Lb(a))return new zO(a,this,this.getName(`layer_${l}`),s,o);if(Ea(a))return new KV(a,this,this.getName(`layer_${l}`),s,o);throw new Error(N$(a))})}parseData(){this.component.data=nw(this);for(const t of this.children)t.parseData()}parseLayoutSize(){ECe(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Z(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){ICe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),cV(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),CO(this))}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const r of this.children)for(const i of me(r.assembleGroupStyle()))t.add(i);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return BEe(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),AV(this))}}function BO(e,t,n,r,i){if($b(e))return new Op(e,t,n,i);if(Lb(e))return new zO(e,t,n,r,i);if(Ea(e))return new KV(e,t,n,r,i);if(k2e(e))return new $Ce(e,t,n,i);throw new Error(N$(e))}function pAe(e,t={}){t.logger&&$we(t.logger),t.fieldTitle&&QG(t.fieldTitle);try{const n=CW(Od(t.config,e.config)),r=DW(e,n),i=BO(r,null,"",void 0,n);return i.parse(),Lke(i.component.data,i),{spec:mAe(i,gAe(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&Owe(),t.fieldTitle&&V_e()}}function gAe(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):pe(t)&&(t={type:t}),i&&o&&NEe(t.type)){if(i==="step"&&o==="step")ne(tP()),t.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";ne(tP(bb(s)));const a=s==="width"?"height":"width";t.type=MEe(a)}}return{...Z(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...RP(n,!1),...RP(e,!0)}}function mAe(e,t,n={},r){const i=e.config?z2e(e.config):void 0,o=[].concat(e.assembleSelectionData([]),xCe(e.component.data,n)),s=e.assembleProjections(),a=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),..._W(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const yAe=Yxe.version,vAe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:fd,accessPathWithDatum:_$,compile:pAe,contains:tt,deepEqual:fi,deleteNestedProperty:gv,duplicate:Be,entries:Tl,every:x$,fieldIntersection:w$,flatAccessWithDatum:DH,getFirstDefined:Qt,hasIntersection:b$,hash:et,internalField:LH,isBoolean:wg,isEmpty:Et,isEqual:Kxe,isInternalField:zH,isNullOrFalse:ZS,isNumeric:pb,keys:Z,logicalExpr:Rp,mergeDeep:MH,never:NH,normalize:DW,normalizeAngle:_g,omit:Wr,pick:cd,prefixGenerator:ek,removePathFromField:E$,replaceAll:oc,replacePathInField:Hi,resetIdCounter:Qxe,setEqual:FH,some:ic,stringify:St,titleCase:mm,unique:Qo,uniqueId:PH,vals:Bn,varName:Pt,version:yAe},Symbol.toStringTag,{value:"Module"}));function JV(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var xAe="vega-themes",bAe="2.14.0",wAe="Themes for stylized Vega and Vega-Lite visualizations.",_Ae=["vega","vega-lite","themes","style"],EAe="BSD-3-Clause",SAe={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},kAe=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],CAe="build/vega-themes.js",AAe="build/vega-themes.module.js",TAe="build/vega-themes.min.js",RAe="build/vega-themes.min.js",$Ae="build/vega-themes.module.d.ts",OAe={type:"git",url:"https://github.com/vega/vega-themes.git"},NAe=["src","build"],MAe={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},FAe={"@babel/core":"^7.22.9","@babel/plugin-proposal-async-generator-functions":"^7.20.7","@babel/plugin-proposal-json-strings":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/plugin-proposal-optional-catch-binding":"^7.18.6","@babel/plugin-transform-runtime":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","browser-sync":"^2.29.3",concurrently:"^8.2.0",eslint:"^8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","gh-pages":"^5.0.0",prettier:"^3.0.0","release-it":"^16.1.0",rollup:"^3.26.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.1.6",vega:"^5.25.0","vega-lite":"^5.9.3"},DAe={vega:"*","vega-lite":"*"},IAe={},PAe={name:xAe,version:bAe,description:wAe,keywords:_Ae,license:EAe,author:SAe,contributors:kAe,main:CAe,module:AAe,unpkg:TAe,jsdelivr:RAe,types:$Ae,repository:OAe,files:NAe,scripts:MAe,devDependencies:FAe,peerDependencies:DAe,dependencies:IAe};const qc="#fff",s5="#888",LAe={background:"#333",view:{stroke:s5},title:{color:qc,subtitleColor:qc},style:{"guide-label":{fill:qc},"guide-title":{fill:qc}},axis:{domainColor:qc,gridColor:s5,tickColor:qc}},ru="#4572a7",zAe={background:"#fff",arc:{fill:ru},area:{fill:ru},line:{stroke:ru,strokeWidth:2},path:{stroke:ru},rect:{fill:ru},shape:{stroke:ru},symbol:{fill:ru,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},iu="#30a2da",s2="#cbcbcb",BAe="#999",jAe="#333",a5="#f0f0f0",l5="#333",UAe={arc:{fill:iu},area:{fill:iu},axis:{domainColor:s2,grid:!0,gridColor:s2,gridWidth:1,labelColor:BAe,labelFontSize:10,titleColor:jAe,tickColor:s2,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:a5,group:{fill:a5},legend:{labelColor:l5,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:l5,titleFontSize:14,titlePadding:10},line:{stroke:iu,strokeWidth:2},path:{stroke:iu,strokeWidth:.5},rect:{fill:iu},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:iu},bar:{binSpacing:2,fill:iu,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},ou="#000",HAe={group:{fill:"#e5e5e5"},arc:{fill:ou},area:{fill:ou},line:{stroke:ou},path:{stroke:ou},rect:{fill:ou},shape:{stroke:ou},symbol:{fill:ou,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},GAe=22,WAe="normal",u5="Benton Gothic, sans-serif",c5=11.5,VAe="normal",su="#82c6df",a2="Benton Gothic Bold, sans-serif",f5="normal",d5=13,Oh={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},qAe={background:"#ffffff",title:{anchor:"start",color:"#000000",font:a2,fontSize:GAe,fontWeight:WAe},arc:{fill:su},area:{fill:su},line:{stroke:su,strokeWidth:2},path:{stroke:su},rect:{fill:su},shape:{stroke:su},symbol:{fill:su,size:30},axis:{labelFont:u5,labelFontSize:c5,labelFontWeight:VAe,titleFont:a2,titleFontSize:d5,titleFontWeight:f5},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:u5,labelFontSize:c5,symbolType:"square",titleFont:a2,titleFontSize:d5,titleFontWeight:f5},range:{category:Oh["category-6"],diverging:Oh["fireandice-6"],heatmap:Oh["fire-7"],ordinal:Oh["fire-7"],ramp:Oh["fire-7"]}},au="#ab5787",D0="#979797",YAe={background:"#f9f9f9",arc:{fill:au},area:{fill:au},line:{stroke:au},path:{stroke:au},rect:{fill:au},shape:{stroke:au},symbol:{fill:au,size:30},axis:{domainColor:D0,domainWidth:.5,gridWidth:.2,labelColor:D0,tickColor:D0,tickWidth:.2,titleColor:D0},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},lu="#3e5c69",XAe={background:"#fff",arc:{fill:lu},area:{fill:lu},line:{stroke:lu},path:{stroke:lu},rect:{fill:lu},shape:{stroke:lu},symbol:{fill:lu},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Ci="#1696d2",h5="#000000",KAe="#FFFFFF",I0="Lato",l2="Lato",JAe="Lato",QAe="#DEDDDD",ZAe=18,Nh={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},eTe={background:KAe,title:{anchor:"start",fontSize:ZAe,font:I0},axisX:{domain:!0,domainColor:h5,domainWidth:1,grid:!1,labelFontSize:12,labelFont:l2,labelAngle:0,tickColor:h5,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:I0},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:QAe,gridWidth:1,labelFontSize:12,labelFont:l2,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:I0,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:l2,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:I0,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Nh["six-groups-cat-1"],diverging:Nh["diverging-colors"],heatmap:Nh["diverging-colors"],ordinal:Nh["six-groups-seq"],ramp:Nh["shades-blue"]},area:{fill:Ci},rect:{fill:Ci},line:{color:Ci,stroke:Ci,strokeWidth:5},trail:{color:Ci,stroke:Ci,strokeWidth:0,size:1},path:{stroke:Ci,strokeWidth:.5},point:{filled:!0},text:{font:JAe,color:Ci,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Ci,stroke:null}},arc:{fill:Ci},shape:{stroke:Ci},symbol:{fill:Ci,size:30}},uu="#3366CC",p5="#ccc",P0="Arial, sans-serif",tTe={arc:{fill:uu},area:{fill:uu},path:{stroke:uu},rect:{fill:uu},shape:{stroke:uu},symbol:{stroke:uu},circle:{fill:uu},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:P0,fontSize:12},"guide-title":{font:P0,fontSize:12},"group-title":{font:P0,fontSize:12}},title:{font:P0,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:p5,tickColor:p5,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},jO=e=>e*(1/3+1),g5=jO(9),m5=jO(10),y5=jO(12),Mh="Segoe UI",v5="wf_standard-font, helvetica, arial, sans-serif",x5="#252423",Fh="#605E5C",b5="transparent",nTe="#C8C6C4",Qi="#118DFF",rTe="#12239E",iTe="#E66C37",oTe="#6B007B",sTe="#E044A7",aTe="#744EC2",lTe="#D9B300",uTe="#D64550",QV=Qi,ZV="#DEEFFF",w5=[ZV,QV],cTe=[ZV,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",QV],fTe={view:{stroke:b5},background:b5,font:Mh,header:{titleFont:v5,titleFontSize:y5,titleColor:x5,labelFont:Mh,labelFontSize:m5,labelColor:Fh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Fh,labelFontSize:g5,titleFont:v5,titleColor:x5,titleFontSize:y5,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:nTe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Qi},line:{stroke:Qi,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Mh,fontSize:g5,fill:Fh},arc:{fill:Qi},area:{fill:Qi,line:!0,opacity:.6},path:{stroke:Qi},rect:{fill:Qi},point:{fill:Qi,filled:!0,size:75},shape:{stroke:Qi},symbol:{fill:Qi,strokeWidth:1.5,size:50},legend:{titleFont:Mh,titleFontWeight:"bold",titleColor:Fh,labelFont:Mh,labelFontSize:m5,labelColor:Fh,symbolType:"circle",symbolSize:75},range:{category:[Qi,rTe,iTe,oTe,sTe,aTe,lTe,uTe],diverging:w5,heatmap:w5,ordinal:cTe}},u2='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',_5=400,dTe=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],hTe=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function rw({type:e,background:t}){const n=e==="dark"?"#161616":"#ffffff",r=e==="dark"?"#f4f4f4":"#161616",i=e==="dark"?dTe:hTe,o=e==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:n,stroke:n},group:{fill:n},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:u2,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:u2,fill:r,fontWeight:_5},"guide-title":{font:u2,fill:r,fontWeight:_5}},range:{category:i,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const pTe=rw({type:"light",background:"#ffffff"}),gTe=rw({type:"light",background:"#f4f4f4"}),mTe=rw({type:"dark",background:"#262626"}),yTe=rw({type:"dark",background:"#161616"}),vTe=PAe.version,xTe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:gTe,carbong100:yTe,carbong90:mTe,carbonwhite:pTe,dark:LAe,excel:zAe,fivethirtyeight:UAe,ggplot2:HAe,googlecharts:tTe,latimes:qAe,powerbi:fTe,quartz:YAe,urbaninstitute:eTe,version:vTe,vox:XAe},Symbol.toStringTag,{value:"Module"}));function bTe(e,t,n){if(K(e))return`[${e.map(r=>t(pe(r)?r:E5(r,n))).join(", ")}]`;if(ye(e)){let r="";const{title:i,image:o,...s}=e;i&&(r+=`

${t(i)}

`),o&&(r+=``);const a=Object.keys(s);if(a.length>0){r+="";for(const l of a){let u=s[l];u!==void 0&&(ye(u)&&(u=E5(u,n)),r+=``)}r+="
${t(l)}${t(u)}
"}return r||"{}"}return t(e)}function wTe(e){const t=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}function E5(e,t){return JSON.stringify(e,wTe(t))}var _Te=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -145,7 +145,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho #vg-tooltip-element.dark-theme td.key { color: #bfbfbf; } -`;const eq="vg-tooltip-element",ETe={offsetX:10,offsetY:10,id:eq,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:STe,maxDepth:2,formatTooltip:bTe};function STe(e){return String(e).replace(/&/g,"&").replace(/window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}class ATe{constructor(t){this.options={...ETe,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=kTe(n);const i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}}tooltipHandler(t,n,r,i){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=CTe(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}function Tg(e){"@babel/helpers - typeof";return Tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tg(e)}function TTe(e,t){if(Tg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Tg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RTe(e){var t=TTe(e,"string");return Tg(t)==="symbol"?t:String(t)}function $Te(e,t,n){return t=RTe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OTe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c2,S5;function NTe(){return S5||(S5=1,c2=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),c2}var MTe=gt;gt.Node=pc;gt.create=gt;function gt(e){var t=this;if(t instanceof gt||(t=new gt),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};gt.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};gt.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};gt.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};gt.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new gt;if(tthis.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};gt.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r1;class LTe{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[bu]=t.max||1/0;const n=t.length||f2;if(this[Yc]=typeof n!="function"?f2:n,this[Np]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Tu]=t.maxAge||0,this[Ps]=t.dispose,this[k5]=t.noDisposeOnSet||!1,this[tq]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[bu]=t||1/0,Dh(this)}get max(){return this[bu]}set allowStale(t){this[Np]=!!t}get allowStale(){return this[Np]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Tu]=t,Dh(this)}get maxAge(){return this[Tu]}set lengthCalculator(t){typeof t!="function"&&(t=f2),t!==this[Yc]&&(this[Yc]=t,this[js]=0,this[xn].forEach(n=>{n.length=this[Yc](n.value,n.key),this[js]+=n.length})),Dh(this)}get lengthCalculator(){return this[Yc]}get length(){return this[js]}get itemCount(){return this[xn].length}rforEach(t,n){n=n||this;for(let r=this[xn].tail;r!==null;){const i=r.prev;C5(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[xn].head;r!==null;){const i=r.next;C5(this,t,r,n),r=i}}keys(){return this[xn].toArray().map(t=>t.key)}values(){return this[xn].toArray().map(t=>t.value)}reset(){this[Ps]&&this[xn]&&this[xn].length&&this[xn].forEach(t=>this[Ps](t.key,t.value)),this[Zi]=new Map,this[xn]=new PTe,this[js]=0}dump(){return this[xn].map(t=>Ov(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[xn]}set(t,n,r){if(r=r||this[Tu],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,o=this[Yc](n,t);if(this[Zi].has(t)){if(o>this[bu])return Df(this,this[Zi].get(t)),!1;const l=this[Zi].get(t).value;return this[Ps]&&(this[k5]||this[Ps](t,l.value)),l.now=i,l.maxAge=r,l.value=n,this[js]+=o-l.length,l.length=o,this.get(t),Dh(this),!0}const s=new zTe(t,n,o,i,r);return s.length>this[bu]?(this[Ps]&&this[Ps](t,n),!1):(this[js]+=s.length,this[xn].unshift(s),this[Zi].set(t,this[xn].head),Dh(this),!0)}has(t){if(!this[Zi].has(t))return!1;const n=this[Zi].get(t).value;return!Ov(this,n)}get(t){return d2(this,t,!0)}peek(t){return d2(this,t,!1)}pop(){const t=this[xn].tail;return t?(Df(this,t),t.value):null}del(t){Df(this,this[Zi].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],o=i.e||0;if(o===0)this.set(i.k,i.v);else{const s=o-n;s>0&&this.set(i.k,i.v,s)}}}prune(){this[Zi].forEach((t,n)=>d2(this,n,!1))}}const d2=(e,t,n)=>{const r=e[Zi].get(t);if(r){const i=r.value;if(Ov(e,i)){if(Df(e,r),!e[Np])return}else n&&(e[tq]&&(r.value.now=Date.now()),e[xn].unshiftNode(r));return i.value}},Ov=(e,t)=>{if(!t||!t.maxAge&&!e[Tu])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Tu]&&n>e[Tu]},Dh=e=>{if(e[js]>e[bu])for(let t=e[xn].tail;e[js]>e[bu]&&t!==null;){const n=t.prev;Df(e,t),t=n}},Df=(e,t)=>{if(t){const n=t.value;e[Ps]&&e[Ps](n.key,n.value),e[js]-=n.length,e[Zi].delete(n.key),e[xn].removeNode(t)}};class zTe{constructor(t,n,r,i,o){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=o||0}}const C5=(e,t,n,r)=>{let i=n.value;Ov(e,i)&&(Df(e,n),e[Np]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var BTe=LTe;const jTe=Object.freeze({loose:!0}),UTe=Object.freeze({}),HTe=e=>e?typeof e!="object"?jTe:e:UTe;var UO=HTe,_k={exports:{}};const GTe="2.0.0",nq=256,WTe=Number.MAX_SAFE_INTEGER||9007199254740991,VTe=16,qTe=nq-6,YTe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var HO={MAX_LENGTH:nq,MAX_SAFE_COMPONENT_LENGTH:VTe,MAX_SAFE_BUILD_LENGTH:qTe,MAX_SAFE_INTEGER:WTe,RELEASE_TYPES:YTe,SEMVER_SPEC_VERSION:GTe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const XTe=typeof process=="object"&&{GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_e3978b98-8677-40e4-9233-7ce106a87f25",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_user_agent:"npm/10.7.0 node/v18.20.4 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_e3978b98-8677-40e4-9233-7ce106a87f25",NYCDB_URL:"postgres://anon:tenantpower@nyc-db.cluster-custom-ckvyf7p6u5rl.us-east-1.rds.amazonaws.com/nycdb",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/usr/local/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"housing-data-coalition",GRADLE_HOME:"/usr/share/gradle-8.10.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"67811844",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu22",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_userconfig:"/home/runner/.npmrc",npm_config_local_prefix:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",SYSTEMD_EXEC_PID:"601",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",GOROOT_1_20_X64:"/opt/hostedtoolcache/go/1.20.14/x64",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20240915.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.7/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",JOURNAL_STREAM:"8:5244",GITHUB_WORKFLOW:"Build and Deploy",_:"/usr/local/bin/npm",npm_config_prefix:"/usr/local",npm_config_npm_version:"10.7.0",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"10978177256",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"branch",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_BASE_REF:"",ImageOS:"ubuntu22",GITHUB_WORKFLOW_REF:"housing-data-coalition/rtc-eviction-viz/.github/workflows/deploy.yml@refs/heads/main",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/node_modules/.bin:/home/runner/work/rtc-eviction-viz/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_c5766334-d8e7-439c-8ae6-75119ec9f81a",INVOCATION_ID:"838c9b53ec3e4fb4a9172e3ec48a18c7",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/usr/local/bin/node",npm_package_name:"rtc-eviction-viz",GITHUB_ACTION:"__run",GITHUB_RUN_NUMBER:"1413",GITHUB_TRIGGERING_ACTOR:"austensen",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 19",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",VITE_BASE_URL:"rtc-eviction-viz",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"housing-data-coalition/rtc-eviction-viz",STATS_D_D:"true",npm_lifecycle_script:"tsc && vite build",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"314042554",GITHUB_ACTIONS:"true",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",ACCEPT_EULA:"Y",GITHUB_JOB:"build-and-deploy",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_RUN_ATTEMPT:"1",REACT_APP_PASSWORD:"housing",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR:"austensen",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",LEIN_HOME:"/usr/local/lib/lein",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_e3978b98-8677-40e4-9233-7ce106a87f25",JAVA_HOME:"/usr/lib/jvm/temurin-11-jdk-amd64",PWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",GITHUB_ACTOR_ID:"16906516",RUNNER_WORKSPACE:"/home/runner/work/rtc-eviction-viz",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"schedule",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",LEIN_JAR:"/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_e3978b98-8677-40e4-9233-7ce106a87f25",npm_config_global_prefix:"/usr/local",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.1.12297006",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",STATS_EXTP:"https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.189/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_e3978b98-8677-40e4-9233-7ce106a87f25",INIT_CWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",EDITOR:"vi",NODE_ENV:"production"}&&{GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_e3978b98-8677-40e4-9233-7ce106a87f25",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_user_agent:"npm/10.7.0 node/v18.20.4 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_e3978b98-8677-40e4-9233-7ce106a87f25",NYCDB_URL:"postgres://anon:tenantpower@nyc-db.cluster-custom-ckvyf7p6u5rl.us-east-1.rds.amazonaws.com/nycdb",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/usr/local/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"housing-data-coalition",GRADLE_HOME:"/usr/share/gradle-8.10.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"67811844",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu22",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_userconfig:"/home/runner/.npmrc",npm_config_local_prefix:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",SYSTEMD_EXEC_PID:"601",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",GOROOT_1_20_X64:"/opt/hostedtoolcache/go/1.20.14/x64",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20240915.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.7/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",JOURNAL_STREAM:"8:5244",GITHUB_WORKFLOW:"Build and Deploy",_:"/usr/local/bin/npm",npm_config_prefix:"/usr/local",npm_config_npm_version:"10.7.0",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"10978177256",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"branch",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_BASE_REF:"",ImageOS:"ubuntu22",GITHUB_WORKFLOW_REF:"housing-data-coalition/rtc-eviction-viz/.github/workflows/deploy.yml@refs/heads/main",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/node_modules/.bin:/home/runner/work/rtc-eviction-viz/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_c5766334-d8e7-439c-8ae6-75119ec9f81a",INVOCATION_ID:"838c9b53ec3e4fb4a9172e3ec48a18c7",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/usr/local/bin/node",npm_package_name:"rtc-eviction-viz",GITHUB_ACTION:"__run",GITHUB_RUN_NUMBER:"1413",GITHUB_TRIGGERING_ACTOR:"austensen",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 19",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",VITE_BASE_URL:"rtc-eviction-viz",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"housing-data-coalition/rtc-eviction-viz",STATS_D_D:"true",npm_lifecycle_script:"tsc && vite build",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"314042554",GITHUB_ACTIONS:"true",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",ACCEPT_EULA:"Y",GITHUB_JOB:"build-and-deploy",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_RUN_ATTEMPT:"1",REACT_APP_PASSWORD:"housing",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR:"austensen",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",LEIN_HOME:"/usr/local/lib/lein",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_e3978b98-8677-40e4-9233-7ce106a87f25",JAVA_HOME:"/usr/lib/jvm/temurin-11-jdk-amd64",PWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",GITHUB_ACTOR_ID:"16906516",RUNNER_WORKSPACE:"/home/runner/work/rtc-eviction-viz",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"schedule",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",LEIN_JAR:"/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_e3978b98-8677-40e4-9233-7ce106a87f25",npm_config_global_prefix:"/usr/local",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.1.12297006",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",STATS_EXTP:"https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.189/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_e3978b98-8677-40e4-9233-7ce106a87f25",INIT_CWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",EDITOR:"vi",NODE_ENV:"production"}.NODE_DEBUG&&/\bsemver\b/i.test({GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_e3978b98-8677-40e4-9233-7ce106a87f25",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_user_agent:"npm/10.7.0 node/v18.20.4 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_e3978b98-8677-40e4-9233-7ce106a87f25",NYCDB_URL:"postgres://anon:tenantpower@nyc-db.cluster-custom-ckvyf7p6u5rl.us-east-1.rds.amazonaws.com/nycdb",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/usr/local/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"housing-data-coalition",GRADLE_HOME:"/usr/share/gradle-8.10.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"67811844",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu22",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_userconfig:"/home/runner/.npmrc",npm_config_local_prefix:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",SYSTEMD_EXEC_PID:"601",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",GOROOT_1_20_X64:"/opt/hostedtoolcache/go/1.20.14/x64",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20240915.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.7/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",JOURNAL_STREAM:"8:5244",GITHUB_WORKFLOW:"Build and Deploy",_:"/usr/local/bin/npm",npm_config_prefix:"/usr/local",npm_config_npm_version:"10.7.0",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"10978177256",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"branch",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_BASE_REF:"",ImageOS:"ubuntu22",GITHUB_WORKFLOW_REF:"housing-data-coalition/rtc-eviction-viz/.github/workflows/deploy.yml@refs/heads/main",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/node_modules/.bin:/home/runner/work/rtc-eviction-viz/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_c5766334-d8e7-439c-8ae6-75119ec9f81a",INVOCATION_ID:"838c9b53ec3e4fb4a9172e3ec48a18c7",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/usr/local/bin/node",npm_package_name:"rtc-eviction-viz",GITHUB_ACTION:"__run",GITHUB_RUN_NUMBER:"1413",GITHUB_TRIGGERING_ACTOR:"austensen",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 19",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",VITE_BASE_URL:"rtc-eviction-viz",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"housing-data-coalition/rtc-eviction-viz",STATS_D_D:"true",npm_lifecycle_script:"tsc && vite build",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"314042554",GITHUB_ACTIONS:"true",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",ACCEPT_EULA:"Y",GITHUB_JOB:"build-and-deploy",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_RUN_ATTEMPT:"1",REACT_APP_PASSWORD:"housing",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR:"austensen",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",LEIN_HOME:"/usr/local/lib/lein",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_e3978b98-8677-40e4-9233-7ce106a87f25",JAVA_HOME:"/usr/lib/jvm/temurin-11-jdk-amd64",PWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",GITHUB_ACTOR_ID:"16906516",RUNNER_WORKSPACE:"/home/runner/work/rtc-eviction-viz",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"schedule",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",LEIN_JAR:"/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_e3978b98-8677-40e4-9233-7ce106a87f25",npm_config_global_prefix:"/usr/local",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.1.12297006",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",STATS_EXTP:"https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.189/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_e3978b98-8677-40e4-9233-7ce106a87f25",INIT_CWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",EDITOR:"vi",NODE_ENV:"production"}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var iw=XTe;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=HO,o=iw;t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const v=h(m),b=c++;o(g,b,m),u[g]=b,l[b]=m,s[b]=new RegExp(m,y?"g":void 0),a[b]=new RegExp(v,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(_k,_k.exports);var GO=_k.exports;const A5=/^[0-9]+$/,rq=(e,t)=>{const n=A5.test(e),r=A5.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:erq(t,e);var JTe={compareIdentifiers:rq,rcompareIdentifiers:KTe};const L0=iw,{MAX_LENGTH:T5,MAX_SAFE_INTEGER:z0}=HO,{safeRe:R5,t:$5}=GO,QTe=UO,{compareIdentifiers:Xc}=JTe;let ZTe=class Uo{constructor(t,n){if(n=QTe(n),t instanceof Uo){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>T5)throw new TypeError(`version is longer than ${T5} characters`);L0("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?R5[$5.LOOSE]:R5[$5.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>z0||this.major<0)throw new TypeError("Invalid major version");if(this.minor>z0||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>z0||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const o=+i;if(o>=0&&o=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];r===!1&&(o=[n]),Xc(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var WO=ZTe;const O5=WO,eRe=(e,t,n)=>new O5(e,n).compare(new O5(t,n));var Zd=eRe;const tRe=Zd,nRe=(e,t,n)=>tRe(e,t,n)===0;var rRe=nRe;const iRe=Zd,oRe=(e,t,n)=>iRe(e,t,n)!==0;var sRe=oRe;const aRe=Zd,lRe=(e,t,n)=>aRe(e,t,n)>0;var uRe=lRe;const cRe=Zd,fRe=(e,t,n)=>cRe(e,t,n)>=0;var dRe=fRe;const hRe=Zd,pRe=(e,t,n)=>hRe(e,t,n)<0;var gRe=pRe;const mRe=Zd,yRe=(e,t,n)=>mRe(e,t,n)<=0;var vRe=yRe;const xRe=rRe,bRe=sRe,wRe=uRe,_Re=dRe,ERe=gRe,SRe=vRe,kRe=(e,t,n,r)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return xRe(e,n,r);case"!=":return bRe(e,n,r);case">":return wRe(e,n,r);case">=":return _Re(e,n,r);case"<":return ERe(e,n,r);case"<=":return SRe(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};var CRe=kRe,h2,N5;function ARe(){if(N5)return h2;N5=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}h2=t;const n=UO,{safeRe:r,t:i}=GO,o=CRe,s=iw,a=WO,l=iq();return h2}var p2,M5;function iq(){if(M5)return p2;M5=1;class e{constructor(L,I){if(I=r(I),L instanceof e)return L.loose===!!I.loose&&L.includePrerelease===!!I.includePrerelease?L:new e(L.raw,I);if(L instanceof i)return this.raw=L.value,this.set=[[L]],this.format(),this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=L.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(H=>!p(H[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const H of this.set)if(H.length===1&&g(H[0])){this.set=[H];break}}}this.format()}format(){return this.range=this.set.map(L=>L.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(L){const B=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+L,H=n.get(B);if(H)return H;const z=this.options.loose,j=z?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];L=L.replace(j,F(this.options.includePrerelease)),o("hyphen replace",L),L=L.replace(a[l.COMPARATORTRIM],u),o("comparator trim",L),L=L.replace(a[l.TILDETRIM],c),o("tilde trim",L),L=L.replace(a[l.CARETTRIM],f),o("caret trim",L);let J=L.split(" ").map(je=>y(je,this.options)).join(" ").split(/\s+/).map(je=>O(je,this.options));z&&(J=J.filter(je=>(o("loose invalid filter",je,this.options),!!je.match(a[l.COMPARATORLOOSE])))),o("range list",J);const ce=new Map,_e=J.map(je=>new i(je,this.options));for(const je of _e){if(p(je))return[je];ce.set(je.value,je)}ce.size>1&&ce.has("")&&ce.delete("");const Ye=[...ce.values()];return n.set(B,Ye),Ye}intersects(L,I){if(!(L instanceof e))throw new TypeError("a Range is required");return this.set.some(B=>m(B,I)&&L.set.some(H=>m(H,I)&&B.every(z=>H.every(j=>z.intersects(j,I)))))}test(L){if(!L)return!1;if(typeof L=="string")try{L=new s(L,this.options)}catch{return!1}for(let I=0;IM.value==="<0.0.0-0",g=M=>M.value==="",m=(M,L)=>{let I=!0;const B=M.slice();let H=B.pop();for(;I&&B.length;)I=B.every(z=>H.intersects(z,L)),H=B.pop();return I},y=(M,L)=>(o("comp",M,L),M=_(M,L),o("caret",M),M=b(M,L),o("tildes",M),M=E(M,L),o("xrange",M),M=N(M,L),o("stars",M),M),v=M=>!M||M.toLowerCase()==="x"||M==="*",b=(M,L)=>M.trim().split(/\s+/).map(I=>w(I,L)).join(" "),w=(M,L)=>{const I=L.loose?a[l.TILDELOOSE]:a[l.TILDE];return M.replace(I,(B,H,z,j,J)=>{o("tilde",M,B,H,z,j,J);let ce;return v(H)?ce="":v(z)?ce=`>=${H}.0.0 <${+H+1}.0.0-0`:v(j)?ce=`>=${H}.${z}.0 <${H}.${+z+1}.0-0`:J?(o("replaceTilde pr",J),ce=`>=${H}.${z}.${j}-${J} <${H}.${+z+1}.0-0`):ce=`>=${H}.${z}.${j} <${H}.${+z+1}.0-0`,o("tilde return",ce),ce})},_=(M,L)=>M.trim().split(/\s+/).map(I=>k(I,L)).join(" "),k=(M,L)=>{o("caret",M,L);const I=L.loose?a[l.CARETLOOSE]:a[l.CARET],B=L.includePrerelease?"-0":"";return M.replace(I,(H,z,j,J,ce)=>{o("caret",M,H,z,j,J,ce);let _e;return v(z)?_e="":v(j)?_e=`>=${z}.0.0${B} <${+z+1}.0.0-0`:v(J)?z==="0"?_e=`>=${z}.${j}.0${B} <${z}.${+j+1}.0-0`:_e=`>=${z}.${j}.0${B} <${+z+1}.0.0-0`:ce?(o("replaceCaret pr",ce),z==="0"?j==="0"?_e=`>=${z}.${j}.${J}-${ce} <${z}.${j}.${+J+1}-0`:_e=`>=${z}.${j}.${J}-${ce} <${z}.${+j+1}.0-0`:_e=`>=${z}.${j}.${J}-${ce} <${+z+1}.0.0-0`):(o("no pr"),z==="0"?j==="0"?_e=`>=${z}.${j}.${J}${B} <${z}.${j}.${+J+1}-0`:_e=`>=${z}.${j}.${J}${B} <${z}.${+j+1}.0-0`:_e=`>=${z}.${j}.${J} <${+z+1}.0.0-0`),o("caret return",_e),_e})},E=(M,L)=>(o("replaceXRanges",M,L),M.split(/\s+/).map(I=>A(I,L)).join(" ")),A=(M,L)=>{M=M.trim();const I=L.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return M.replace(I,(B,H,z,j,J,ce)=>{o("xRange",M,B,H,z,j,J,ce);const _e=v(z),Ye=_e||v(j),je=Ye||v(J),ft=je;return H==="="&&ft&&(H=""),ce=L.includePrerelease?"-0":"",_e?H===">"||H==="<"?B="<0.0.0-0":B="*":H&&ft?(Ye&&(j=0),J=0,H===">"?(H=">=",Ye?(z=+z+1,j=0,J=0):(j=+j+1,J=0)):H==="<="&&(H="<",Ye?z=+z+1:j=+j+1),H==="<"&&(ce="-0"),B=`${H+z}.${j}.${J}${ce}`):Ye?B=`>=${z}.0.0${ce} <${+z+1}.0.0-0`:je&&(B=`>=${z}.${j}.0${ce} <${z}.${+j+1}.0-0`),o("xRange return",B),B})},N=(M,L)=>(o("replaceStars",M,L),M.trim().replace(a[l.STAR],"")),O=(M,L)=>(o("replaceGTE0",M,L),M.trim().replace(a[L.includePrerelease?l.GTE0PRE:l.GTE0],"")),F=M=>(L,I,B,H,z,j,J,ce,_e,Ye,je,ft,ln)=>(v(B)?I="":v(H)?I=`>=${B}.0.0${M?"-0":""}`:v(z)?I=`>=${B}.${H}.0${M?"-0":""}`:j?I=`>=${I}`:I=`>=${I}${M?"-0":""}`,v(_e)?ce="":v(Ye)?ce=`<${+_e+1}.0.0-0`:v(je)?ce=`<${_e}.${+Ye+1}.0-0`:ft?ce=`<=${_e}.${Ye}.${je}-${ft}`:M?ce=`<${_e}.${Ye}.${+je+1}-0`:ce=`<=${ce}`,`${I} ${ce}`.trim()),U=(M,L,I)=>{for(let B=0;B0){const H=M[B].semver;if(H.major===L.major&&H.minor===L.minor&&H.patch===L.patch)return!0}return!1}return!0};return p2}const TRe=iq(),RRe=(e,t,n)=>{try{t=new TRe(t,n)}catch{return!1}return t.test(e)};var $Re=RRe,oq=OTe($Re);function ORe(e,t,n){const r=e.open(t),i=1e4,o=250,{origin:s}=new URL(t);let a=~~(i/o);function l(c){c.source===r&&(a=0,e.removeEventListener("message",l,!1))}e.addEventListener("message",l,!1);function u(){a<=0||(r.postMessage(n,s),setTimeout(u,o),a-=1)}setTimeout(u,o)}var NRe=`.vega-embed { +`;const eq="vg-tooltip-element",ETe={offsetX:10,offsetY:10,id:eq,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:STe,maxDepth:2,formatTooltip:bTe};function STe(e){return String(e).replace(/&/g,"&").replace(/window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}class ATe{constructor(t){this.options={...ETe,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=kTe(n);const i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}}tooltipHandler(t,n,r,i){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=CTe(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}function Tg(e){"@babel/helpers - typeof";return Tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tg(e)}function TTe(e,t){if(Tg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Tg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RTe(e){var t=TTe(e,"string");return Tg(t)==="symbol"?t:String(t)}function $Te(e,t,n){return t=RTe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OTe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c2,S5;function NTe(){return S5||(S5=1,c2=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),c2}var MTe=gt;gt.Node=pc;gt.create=gt;function gt(e){var t=this;if(t instanceof gt||(t=new gt),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};gt.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};gt.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};gt.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};gt.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new gt;if(tthis.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};gt.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r1;class LTe{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[bu]=t.max||1/0;const n=t.length||f2;if(this[Yc]=typeof n!="function"?f2:n,this[Np]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Tu]=t.maxAge||0,this[Ps]=t.dispose,this[k5]=t.noDisposeOnSet||!1,this[tq]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[bu]=t||1/0,Dh(this)}get max(){return this[bu]}set allowStale(t){this[Np]=!!t}get allowStale(){return this[Np]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Tu]=t,Dh(this)}get maxAge(){return this[Tu]}set lengthCalculator(t){typeof t!="function"&&(t=f2),t!==this[Yc]&&(this[Yc]=t,this[js]=0,this[xn].forEach(n=>{n.length=this[Yc](n.value,n.key),this[js]+=n.length})),Dh(this)}get lengthCalculator(){return this[Yc]}get length(){return this[js]}get itemCount(){return this[xn].length}rforEach(t,n){n=n||this;for(let r=this[xn].tail;r!==null;){const i=r.prev;C5(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[xn].head;r!==null;){const i=r.next;C5(this,t,r,n),r=i}}keys(){return this[xn].toArray().map(t=>t.key)}values(){return this[xn].toArray().map(t=>t.value)}reset(){this[Ps]&&this[xn]&&this[xn].length&&this[xn].forEach(t=>this[Ps](t.key,t.value)),this[Zi]=new Map,this[xn]=new PTe,this[js]=0}dump(){return this[xn].map(t=>Ov(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[xn]}set(t,n,r){if(r=r||this[Tu],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,o=this[Yc](n,t);if(this[Zi].has(t)){if(o>this[bu])return Df(this,this[Zi].get(t)),!1;const l=this[Zi].get(t).value;return this[Ps]&&(this[k5]||this[Ps](t,l.value)),l.now=i,l.maxAge=r,l.value=n,this[js]+=o-l.length,l.length=o,this.get(t),Dh(this),!0}const s=new zTe(t,n,o,i,r);return s.length>this[bu]?(this[Ps]&&this[Ps](t,n),!1):(this[js]+=s.length,this[xn].unshift(s),this[Zi].set(t,this[xn].head),Dh(this),!0)}has(t){if(!this[Zi].has(t))return!1;const n=this[Zi].get(t).value;return!Ov(this,n)}get(t){return d2(this,t,!0)}peek(t){return d2(this,t,!1)}pop(){const t=this[xn].tail;return t?(Df(this,t),t.value):null}del(t){Df(this,this[Zi].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],o=i.e||0;if(o===0)this.set(i.k,i.v);else{const s=o-n;s>0&&this.set(i.k,i.v,s)}}}prune(){this[Zi].forEach((t,n)=>d2(this,n,!1))}}const d2=(e,t,n)=>{const r=e[Zi].get(t);if(r){const i=r.value;if(Ov(e,i)){if(Df(e,r),!e[Np])return}else n&&(e[tq]&&(r.value.now=Date.now()),e[xn].unshiftNode(r));return i.value}},Ov=(e,t)=>{if(!t||!t.maxAge&&!e[Tu])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Tu]&&n>e[Tu]},Dh=e=>{if(e[js]>e[bu])for(let t=e[xn].tail;e[js]>e[bu]&&t!==null;){const n=t.prev;Df(e,t),t=n}},Df=(e,t)=>{if(t){const n=t.value;e[Ps]&&e[Ps](n.key,n.value),e[js]-=n.length,e[Zi].delete(n.key),e[xn].removeNode(t)}};class zTe{constructor(t,n,r,i,o){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=o||0}}const C5=(e,t,n,r)=>{let i=n.value;Ov(e,i)&&(Df(e,n),e[Np]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var BTe=LTe;const jTe=Object.freeze({loose:!0}),UTe=Object.freeze({}),HTe=e=>e?typeof e!="object"?jTe:e:UTe;var UO=HTe,_k={exports:{}};const GTe="2.0.0",nq=256,WTe=Number.MAX_SAFE_INTEGER||9007199254740991,VTe=16,qTe=nq-6,YTe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var HO={MAX_LENGTH:nq,MAX_SAFE_COMPONENT_LENGTH:VTe,MAX_SAFE_BUILD_LENGTH:qTe,MAX_SAFE_INTEGER:WTe,RELEASE_TYPES:YTe,SEMVER_SPEC_VERSION:GTe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const XTe=typeof process=="object"&&{GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_2aac9f4b-fbe3-4834-a238-abb913e0df31",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_user_agent:"npm/10.7.0 node/v18.20.4 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_2aac9f4b-fbe3-4834-a238-abb913e0df31",NYCDB_URL:"postgres://anon:tenantpower@nyc-db.cluster-custom-ckvyf7p6u5rl.us-east-1.rds.amazonaws.com/nycdb",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/usr/local/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"housing-data-coalition",GRADLE_HOME:"/usr/share/gradle-8.10.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"67811844",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu22",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_userconfig:"/home/runner/.npmrc",npm_config_local_prefix:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",SYSTEMD_EXEC_PID:"611",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",GOROOT_1_20_X64:"/opt/hostedtoolcache/go/1.20.14/x64",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20240915.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.7/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",JOURNAL_STREAM:"8:1930",GITHUB_WORKFLOW:"Build and Deploy",_:"/usr/local/bin/npm",npm_config_prefix:"/usr/local",npm_config_npm_version:"10.7.0",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"10987554851",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"branch",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_BASE_REF:"",ImageOS:"ubuntu22",GITHUB_WORKFLOW_REF:"housing-data-coalition/rtc-eviction-viz/.github/workflows/deploy.yml@refs/heads/main",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/node_modules/.bin:/home/runner/work/rtc-eviction-viz/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_b336e405-6238-4da3-9c50-be08e21e4525",INVOCATION_ID:"13bb9b03093c4e6496b8596453834972",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/usr/local/bin/node",npm_package_name:"rtc-eviction-viz",GITHUB_ACTION:"__run",GITHUB_RUN_NUMBER:"1414",GITHUB_TRIGGERING_ACTOR:"austensen",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 15",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",VITE_BASE_URL:"rtc-eviction-viz",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"housing-data-coalition/rtc-eviction-viz",STATS_D_D:"true",npm_lifecycle_script:"tsc && vite build",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"314042554",GITHUB_ACTIONS:"true",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",ACCEPT_EULA:"Y",GITHUB_JOB:"build-and-deploy",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_RUN_ATTEMPT:"1",REACT_APP_PASSWORD:"housing",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR:"austensen",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",LEIN_HOME:"/usr/local/lib/lein",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_2aac9f4b-fbe3-4834-a238-abb913e0df31",JAVA_HOME:"/usr/lib/jvm/temurin-11-jdk-amd64",PWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",GITHUB_ACTOR_ID:"16906516",RUNNER_WORKSPACE:"/home/runner/work/rtc-eviction-viz",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"schedule",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",LEIN_JAR:"/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_2aac9f4b-fbe3-4834-a238-abb913e0df31",npm_config_global_prefix:"/usr/local",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.1.12297006",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",STATS_EXTP:"https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.189/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_2aac9f4b-fbe3-4834-a238-abb913e0df31",INIT_CWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",EDITOR:"vi",NODE_ENV:"production"}&&{GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_2aac9f4b-fbe3-4834-a238-abb913e0df31",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_user_agent:"npm/10.7.0 node/v18.20.4 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_2aac9f4b-fbe3-4834-a238-abb913e0df31",NYCDB_URL:"postgres://anon:tenantpower@nyc-db.cluster-custom-ckvyf7p6u5rl.us-east-1.rds.amazonaws.com/nycdb",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/usr/local/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"housing-data-coalition",GRADLE_HOME:"/usr/share/gradle-8.10.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"67811844",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu22",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_userconfig:"/home/runner/.npmrc",npm_config_local_prefix:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",SYSTEMD_EXEC_PID:"611",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",GOROOT_1_20_X64:"/opt/hostedtoolcache/go/1.20.14/x64",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20240915.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.7/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",JOURNAL_STREAM:"8:1930",GITHUB_WORKFLOW:"Build and Deploy",_:"/usr/local/bin/npm",npm_config_prefix:"/usr/local",npm_config_npm_version:"10.7.0",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"10987554851",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"branch",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_BASE_REF:"",ImageOS:"ubuntu22",GITHUB_WORKFLOW_REF:"housing-data-coalition/rtc-eviction-viz/.github/workflows/deploy.yml@refs/heads/main",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/node_modules/.bin:/home/runner/work/rtc-eviction-viz/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_b336e405-6238-4da3-9c50-be08e21e4525",INVOCATION_ID:"13bb9b03093c4e6496b8596453834972",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/usr/local/bin/node",npm_package_name:"rtc-eviction-viz",GITHUB_ACTION:"__run",GITHUB_RUN_NUMBER:"1414",GITHUB_TRIGGERING_ACTOR:"austensen",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 15",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",VITE_BASE_URL:"rtc-eviction-viz",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"housing-data-coalition/rtc-eviction-viz",STATS_D_D:"true",npm_lifecycle_script:"tsc && vite build",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"314042554",GITHUB_ACTIONS:"true",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",ACCEPT_EULA:"Y",GITHUB_JOB:"build-and-deploy",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_RUN_ATTEMPT:"1",REACT_APP_PASSWORD:"housing",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR:"austensen",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",LEIN_HOME:"/usr/local/lib/lein",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_2aac9f4b-fbe3-4834-a238-abb913e0df31",JAVA_HOME:"/usr/lib/jvm/temurin-11-jdk-amd64",PWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",GITHUB_ACTOR_ID:"16906516",RUNNER_WORKSPACE:"/home/runner/work/rtc-eviction-viz",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"schedule",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",LEIN_JAR:"/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_2aac9f4b-fbe3-4834-a238-abb913e0df31",npm_config_global_prefix:"/usr/local",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.1.12297006",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",STATS_EXTP:"https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.189/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_2aac9f4b-fbe3-4834-a238-abb913e0df31",INIT_CWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",EDITOR:"vi",NODE_ENV:"production"}.NODE_DEBUG&&/\bsemver\b/i.test({GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_2aac9f4b-fbe3-4834-a238-abb913e0df31",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_user_agent:"npm/10.7.0 node/v18.20.4 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_2aac9f4b-fbe3-4834-a238-abb913e0df31",NYCDB_URL:"postgres://anon:tenantpower@nyc-db.cluster-custom-ckvyf7p6u5rl.us-east-1.rds.amazonaws.com/nycdb",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/usr/local/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"housing-data-coalition",GRADLE_HOME:"/usr/share/gradle-8.10.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"67811844",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu22",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_userconfig:"/home/runner/.npmrc",npm_config_local_prefix:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",SYSTEMD_EXEC_PID:"611",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",GOROOT_1_20_X64:"/opt/hostedtoolcache/go/1.20.14/x64",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20240915.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.7/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",JOURNAL_STREAM:"8:1930",GITHUB_WORKFLOW:"Build and Deploy",_:"/usr/local/bin/npm",npm_config_prefix:"/usr/local",npm_config_npm_version:"10.7.0",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"10987554851",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"branch",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_BASE_REF:"",ImageOS:"ubuntu22",GITHUB_WORKFLOW_REF:"housing-data-coalition/rtc-eviction-viz/.github/workflows/deploy.yml@refs/heads/main",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz/node_modules/.bin:/home/runner/work/rtc-eviction-viz/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_b336e405-6238-4da3-9c50-be08e21e4525",INVOCATION_ID:"13bb9b03093c4e6496b8596453834972",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/usr/local/bin/node",npm_package_name:"rtc-eviction-viz",GITHUB_ACTION:"__run",GITHUB_RUN_NUMBER:"1414",GITHUB_TRIGGERING_ACTOR:"austensen",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 15",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",VITE_BASE_URL:"rtc-eviction-viz",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"housing-data-coalition/rtc-eviction-viz",STATS_D_D:"true",npm_lifecycle_script:"tsc && vite build",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"314042554",GITHUB_ACTIONS:"true",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",ACCEPT_EULA:"Y",GITHUB_JOB:"build-and-deploy",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"5c4fdba3747caa7a59618b406a96f1b500c73efb",GITHUB_RUN_ATTEMPT:"1",REACT_APP_PASSWORD:"housing",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR:"austensen",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",LEIN_HOME:"/usr/local/lib/lein",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_2aac9f4b-fbe3-4834-a238-abb913e0df31",JAVA_HOME:"/usr/lib/jvm/temurin-11-jdk-amd64",PWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",GITHUB_ACTOR_ID:"16906516",RUNNER_WORKSPACE:"/home/runner/work/rtc-eviction-viz",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"schedule",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",LEIN_JAR:"/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_2aac9f4b-fbe3-4834-a238-abb913e0df31",npm_config_global_prefix:"/usr/local",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.1.12297006",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",STATS_EXTP:"https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.189/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.1.12297006",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_2aac9f4b-fbe3-4834-a238-abb913e0df31",INIT_CWD:"/home/runner/work/rtc-eviction-viz/rtc-eviction-viz",EDITOR:"vi",NODE_ENV:"production"}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var iw=XTe;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=HO,o=iw;t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const v=h(m),b=c++;o(g,b,m),u[g]=b,l[b]=m,s[b]=new RegExp(m,y?"g":void 0),a[b]=new RegExp(v,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(_k,_k.exports);var GO=_k.exports;const A5=/^[0-9]+$/,rq=(e,t)=>{const n=A5.test(e),r=A5.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:erq(t,e);var JTe={compareIdentifiers:rq,rcompareIdentifiers:KTe};const L0=iw,{MAX_LENGTH:T5,MAX_SAFE_INTEGER:z0}=HO,{safeRe:R5,t:$5}=GO,QTe=UO,{compareIdentifiers:Xc}=JTe;let ZTe=class Uo{constructor(t,n){if(n=QTe(n),t instanceof Uo){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>T5)throw new TypeError(`version is longer than ${T5} characters`);L0("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?R5[$5.LOOSE]:R5[$5.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>z0||this.major<0)throw new TypeError("Invalid major version");if(this.minor>z0||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>z0||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const o=+i;if(o>=0&&o=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];r===!1&&(o=[n]),Xc(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var WO=ZTe;const O5=WO,eRe=(e,t,n)=>new O5(e,n).compare(new O5(t,n));var Zd=eRe;const tRe=Zd,nRe=(e,t,n)=>tRe(e,t,n)===0;var rRe=nRe;const iRe=Zd,oRe=(e,t,n)=>iRe(e,t,n)!==0;var sRe=oRe;const aRe=Zd,lRe=(e,t,n)=>aRe(e,t,n)>0;var uRe=lRe;const cRe=Zd,fRe=(e,t,n)=>cRe(e,t,n)>=0;var dRe=fRe;const hRe=Zd,pRe=(e,t,n)=>hRe(e,t,n)<0;var gRe=pRe;const mRe=Zd,yRe=(e,t,n)=>mRe(e,t,n)<=0;var vRe=yRe;const xRe=rRe,bRe=sRe,wRe=uRe,_Re=dRe,ERe=gRe,SRe=vRe,kRe=(e,t,n,r)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return xRe(e,n,r);case"!=":return bRe(e,n,r);case">":return wRe(e,n,r);case">=":return _Re(e,n,r);case"<":return ERe(e,n,r);case"<=":return SRe(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};var CRe=kRe,h2,N5;function ARe(){if(N5)return h2;N5=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}h2=t;const n=UO,{safeRe:r,t:i}=GO,o=CRe,s=iw,a=WO,l=iq();return h2}var p2,M5;function iq(){if(M5)return p2;M5=1;class e{constructor(L,I){if(I=r(I),L instanceof e)return L.loose===!!I.loose&&L.includePrerelease===!!I.includePrerelease?L:new e(L.raw,I);if(L instanceof i)return this.raw=L.value,this.set=[[L]],this.format(),this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=L.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(H=>!p(H[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const H of this.set)if(H.length===1&&g(H[0])){this.set=[H];break}}}this.format()}format(){return this.range=this.set.map(L=>L.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(L){const B=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+L,H=n.get(B);if(H)return H;const z=this.options.loose,j=z?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];L=L.replace(j,F(this.options.includePrerelease)),o("hyphen replace",L),L=L.replace(a[l.COMPARATORTRIM],u),o("comparator trim",L),L=L.replace(a[l.TILDETRIM],c),o("tilde trim",L),L=L.replace(a[l.CARETTRIM],f),o("caret trim",L);let J=L.split(" ").map(je=>y(je,this.options)).join(" ").split(/\s+/).map(je=>O(je,this.options));z&&(J=J.filter(je=>(o("loose invalid filter",je,this.options),!!je.match(a[l.COMPARATORLOOSE])))),o("range list",J);const ce=new Map,_e=J.map(je=>new i(je,this.options));for(const je of _e){if(p(je))return[je];ce.set(je.value,je)}ce.size>1&&ce.has("")&&ce.delete("");const Ye=[...ce.values()];return n.set(B,Ye),Ye}intersects(L,I){if(!(L instanceof e))throw new TypeError("a Range is required");return this.set.some(B=>m(B,I)&&L.set.some(H=>m(H,I)&&B.every(z=>H.every(j=>z.intersects(j,I)))))}test(L){if(!L)return!1;if(typeof L=="string")try{L=new s(L,this.options)}catch{return!1}for(let I=0;IM.value==="<0.0.0-0",g=M=>M.value==="",m=(M,L)=>{let I=!0;const B=M.slice();let H=B.pop();for(;I&&B.length;)I=B.every(z=>H.intersects(z,L)),H=B.pop();return I},y=(M,L)=>(o("comp",M,L),M=_(M,L),o("caret",M),M=b(M,L),o("tildes",M),M=E(M,L),o("xrange",M),M=N(M,L),o("stars",M),M),v=M=>!M||M.toLowerCase()==="x"||M==="*",b=(M,L)=>M.trim().split(/\s+/).map(I=>w(I,L)).join(" "),w=(M,L)=>{const I=L.loose?a[l.TILDELOOSE]:a[l.TILDE];return M.replace(I,(B,H,z,j,J)=>{o("tilde",M,B,H,z,j,J);let ce;return v(H)?ce="":v(z)?ce=`>=${H}.0.0 <${+H+1}.0.0-0`:v(j)?ce=`>=${H}.${z}.0 <${H}.${+z+1}.0-0`:J?(o("replaceTilde pr",J),ce=`>=${H}.${z}.${j}-${J} <${H}.${+z+1}.0-0`):ce=`>=${H}.${z}.${j} <${H}.${+z+1}.0-0`,o("tilde return",ce),ce})},_=(M,L)=>M.trim().split(/\s+/).map(I=>k(I,L)).join(" "),k=(M,L)=>{o("caret",M,L);const I=L.loose?a[l.CARETLOOSE]:a[l.CARET],B=L.includePrerelease?"-0":"";return M.replace(I,(H,z,j,J,ce)=>{o("caret",M,H,z,j,J,ce);let _e;return v(z)?_e="":v(j)?_e=`>=${z}.0.0${B} <${+z+1}.0.0-0`:v(J)?z==="0"?_e=`>=${z}.${j}.0${B} <${z}.${+j+1}.0-0`:_e=`>=${z}.${j}.0${B} <${+z+1}.0.0-0`:ce?(o("replaceCaret pr",ce),z==="0"?j==="0"?_e=`>=${z}.${j}.${J}-${ce} <${z}.${j}.${+J+1}-0`:_e=`>=${z}.${j}.${J}-${ce} <${z}.${+j+1}.0-0`:_e=`>=${z}.${j}.${J}-${ce} <${+z+1}.0.0-0`):(o("no pr"),z==="0"?j==="0"?_e=`>=${z}.${j}.${J}${B} <${z}.${j}.${+J+1}-0`:_e=`>=${z}.${j}.${J}${B} <${z}.${+j+1}.0-0`:_e=`>=${z}.${j}.${J} <${+z+1}.0.0-0`),o("caret return",_e),_e})},E=(M,L)=>(o("replaceXRanges",M,L),M.split(/\s+/).map(I=>A(I,L)).join(" ")),A=(M,L)=>{M=M.trim();const I=L.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return M.replace(I,(B,H,z,j,J,ce)=>{o("xRange",M,B,H,z,j,J,ce);const _e=v(z),Ye=_e||v(j),je=Ye||v(J),ft=je;return H==="="&&ft&&(H=""),ce=L.includePrerelease?"-0":"",_e?H===">"||H==="<"?B="<0.0.0-0":B="*":H&&ft?(Ye&&(j=0),J=0,H===">"?(H=">=",Ye?(z=+z+1,j=0,J=0):(j=+j+1,J=0)):H==="<="&&(H="<",Ye?z=+z+1:j=+j+1),H==="<"&&(ce="-0"),B=`${H+z}.${j}.${J}${ce}`):Ye?B=`>=${z}.0.0${ce} <${+z+1}.0.0-0`:je&&(B=`>=${z}.${j}.0${ce} <${z}.${+j+1}.0-0`),o("xRange return",B),B})},N=(M,L)=>(o("replaceStars",M,L),M.trim().replace(a[l.STAR],"")),O=(M,L)=>(o("replaceGTE0",M,L),M.trim().replace(a[L.includePrerelease?l.GTE0PRE:l.GTE0],"")),F=M=>(L,I,B,H,z,j,J,ce,_e,Ye,je,ft,ln)=>(v(B)?I="":v(H)?I=`>=${B}.0.0${M?"-0":""}`:v(z)?I=`>=${B}.${H}.0${M?"-0":""}`:j?I=`>=${I}`:I=`>=${I}${M?"-0":""}`,v(_e)?ce="":v(Ye)?ce=`<${+_e+1}.0.0-0`:v(je)?ce=`<${_e}.${+Ye+1}.0-0`:ft?ce=`<=${_e}.${Ye}.${je}-${ft}`:M?ce=`<${_e}.${Ye}.${+je+1}-0`:ce=`<=${ce}`,`${I} ${ce}`.trim()),U=(M,L,I)=>{for(let B=0;B0){const H=M[B].semver;if(H.major===L.major&&H.minor===L.minor&&H.patch===L.patch)return!0}return!1}return!0};return p2}const TRe=iq(),RRe=(e,t,n)=>{try{t=new TRe(t,n)}catch{return!1}return t.test(e)};var $Re=RRe,oq=OTe($Re);function ORe(e,t,n){const r=e.open(t),i=1e4,o=250,{origin:s}=new URL(t);let a=~~(i/o);function l(c){c.source===r&&(a=0,e.removeEventListener("message",l,!1))}e.addEventListener("message",l,!1);function u(){a<=0||(r.postMessage(n,s),setTimeout(u,o),a-=1)}setTimeout(u,o)}var NRe=`.vega-embed { position: relative; display: inline-block; box-sizing: border-box; @@ -268,4 +268,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho -`,LRe="chart-wrapper";function zRe(e){return typeof e=="function"}function D5(e,t,n,r){const i=`${t}
`,o=`
${n}`,s=window.open("");s.document.write(i+e+o),s.document.title=`${lp[r]} JSON Source`}function BRe(e,t){if(e.$schema){const n=JV(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${lp[n.library]}, but mode argument sets ${lp[t]??t}.`);const r=n.library;return oq(Nv[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${lp[r]} ${n.version}, but the current version of ${lp[r]} is v${Nv[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function jRe(e){return!!(e&&"load"in e)}function I5(e){return jRe(e)?e:Go.loader(e)}function URe(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return pe(t.defaultStyle)&&(t.defaultStyle=!1),t}async function HRe(e,t,n={}){let r,i;pe(t)?(i=I5(n.loader),r=JSON.parse(await i.load(t))):r=t;const o=URe(r),s=o.loader;(!i||s)&&(i=I5(n.loader??s));const a=await P5(o,i),l=await P5(n,i),u=gl(gl({},sq(l,a)),{},{config:Od(l.config??{},a.config??{})});return await WRe(e,r,u,i)}async function P5(e,t){const n=pe(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=pe(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return gl(gl(gl({},e),r?{patch:r}:{}),n?{config:n}:{})}function GRe(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function WRe(e,t,n={},r){const i=n.theme?Od(xTe[n.theme],n.config??{}):n.config,o=Ll(n.actions)?n.actions:sq({},FRe,n.actions??{}),s=gl(gl({},DRe),n.i18n),a=n.renderer??"canvas",l=n.logLevel??Go.Warn,u=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const _="vega-embed-style",{root:k,rootContainer:E}=GRe(c);if(!k.getElementById(_)){const A=document.createElement("style");A.id=_,A.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?NRe.toString():n.defaultStyle,E.appendChild(A)}}const f=BRe(t,n.mode);let d=IRe[f](t,i);if(f==="vega-lite"&&d.$schema){const _=JV(d.$schema);oq(Nv.vega,`^${_.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${_.version}, but current version is v${Nv.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){const _=document.createElement("div");_.classList.add(LRe),c.appendChild(_),h=_}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Zv(d,p,!0,!1).newDocument),n.formatLocale&&Go.formatLocale(n.formatLocale),n.timeFormatLocale&&Go.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const _ in n.expressionFunctions){const k=n.expressionFunctions[_];"fn"in k?Go.expressionFunction(_,k.fn,k.visitor):k instanceof Function&&Go.expressionFunction(_,k)}const{ast:g}=n,m=Go.parse(d,f==="vega-lite"?{}:i,{ast:g}),y=new(n.viewClass||Go.View)(m,gl({loader:r,logLevel:l,renderer:a},g?{expr:Go.expressionInterpreter??n.expr??kxe}:{}));if(y.addSignalListener("autosize",(_,k)=>{const{type:E}=k;E=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):E=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):E=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const _=zRe(n.tooltip)?n.tooltip:new ATe(n.tooltip===!0?{}:n.tooltip).call;y.tooltip(_)}let{hover:v}=n;if(v===void 0&&(v=f==="vega"),v){const{hoverSet:_,updateSet:k}=typeof v=="boolean"?{}:v;y.hover(_,k)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let b;if(o!==!1){let _=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const E=document.createElement("details");E.title=s.CLICK_TO_VIEW_ACTIONS,c.append(E),_=E;const A=document.createElement("summary");A.innerHTML=PRe,E.append(A),b=N=>{E.contains(N.target)||E.removeAttribute("open")},document.addEventListener("click",b)}const k=document.createElement("div");if(_.append(k),k.classList.add("vega-actions"),o===!0||o.export!==!1){for(const E of["svg","png"])if(o===!0||o.export===!0||o.export[E]){const A=s[`${E.toUpperCase()}_ACTION`],N=document.createElement("a"),O=ye(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;N.text=A,N.href="#",N.target="_blank",N.download=`${u}.${E}`,N.addEventListener("mousedown",async function(F){F.preventDefault();const U=await y.toImageURL(E,O);this.href=U}),k.append(N)}}if(o===!0||o.source!==!1){const E=document.createElement("a");E.text=s.SOURCE_ACTION,E.href="#",E.addEventListener("click",function(A){D5(Uw(t),n.sourceHeader??"",n.sourceFooter??"",f),A.preventDefault()}),k.append(E)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const E=document.createElement("a");E.text=s.COMPILED_ACTION,E.href="#",E.addEventListener("click",function(A){D5(Uw(d),n.sourceHeader??"",n.sourceFooter??"","vega"),A.preventDefault()}),k.append(E)}if(o===!0||o.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",A=document.createElement("a");A.text=s.EDITOR_ACTION,A.href="#",A.addEventListener("click",function(N){ORe(window,E,{config:i,mode:f,renderer:a,spec:Uw(t)}),N.preventDefault()}),k.append(A)}}function w(){b&&document.removeEventListener("click",b),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:w,embedOptions:n}}function mo(e){var t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}Zt("numberWithCommas",mo);const VRe=({spec:e,className:t})=>{const n=he.useRef(null);return he.useEffect(()=>{const{current:r}=n;if(!r)throw new Error("Expected ref for Vega container to exist!");const i=HRe(r,e,{actions:!1});return()=>{i.then(o=>o.finalize())}},[e]),R.jsx("div",{ref:n,className:t})},qRe=Object.freeze(Object.defineProperty({__proto__:null,default:VRe,numberWithCommas:mo},Symbol.toStringTag,{value:"Module"})),YRe=()=>R.jsx(Ro,{url:DQ.json,fallback:R.jsx(Ei,{className:Pg}),children:e=>R.jsx(XRe,{values:e})}),XRe=e=>{const t=KRe(e),n=["Statewide Totals"," without NYC commercial #s","Pre-Pandemic #"," without NYC commercial #s","Pandemic #"," without NYC commercial #s","NYC Totals"," residential only #s","Pre-Pandemic #"," residential only #s","Pandemic #"," residential only #s","Outside NYC Totals","Pre-Pandemic #","Pandemic #"];for(var r=[],i=0;iR.jsx("tr",{...f.getHeaderGroupProps(),children:f.headers.map(d=>R.jsx("th",{...d.getHeaderProps(),children:d.render("Header")}))}))}),R.jsx("tbody",{...a(),children:u.map((f,d)=>(c(f),R.jsx("tr",{...f.getRowProps(),children:f.cells.map(h=>R.jsx("td",{align:"right",...h.getCellProps(),style:{background:[0,6,12].includes(h.row.index)?"yellow":"white",fontWeight:[0,2,4,6,8,10,12].includes(h.row.index)?"bold":"normal"},children:h.render("Cell")}))})))})]})};function KRe(e){var t=Object.fromEntries(new Map(e.values.map(o=>[o.category,o.count]))),n=C6(t);const r={"outside-pandemic-all":n["Outside NYC"]["Issued Pandemic"].All,"outside-prepandemic-all":n["Outside NYC"]["Issued Prepandemic"].All,"nyc-pandemic-residential":n.NYC["Issued Pandemic"].Residential,"nyc-pandemic-commercial":n.NYC["Issued Pandemic"].Commercial,"nyc-prepandemic-residential":n.NYC["Issued Prepandemic"].Residential,"nyc-prepandemic-commercial":n.NYC["Issued Prepandemic"].Commercial};var i=Array.from(Array(15),()=>Array(3));return JRe(i,r)}function JRe(e,t){e[6+2][1]=t["nyc-prepandemic-residential"]["Non-Payment"]+t["nyc-prepandemic-commercial"]["Non-Payment"],e[6+2][2]=t["nyc-prepandemic-residential"].Holdover+t["nyc-prepandemic-commercial"].Holdover,e[6+3][1]=t["nyc-prepandemic-residential"]["Non-Payment"],e[6+3][2]=t["nyc-prepandemic-residential"].Holdover,e[6+4][1]=t["nyc-pandemic-residential"]["Non-Payment"]+t["nyc-pandemic-commercial"]["Non-Payment"],e[6+4][2]=t["nyc-pandemic-residential"].Holdover+t["nyc-pandemic-commercial"].Holdover,e[6+5][1]=t["nyc-pandemic-residential"]["Non-Payment"],e[6+5][2]=t["nyc-pandemic-residential"].Holdover,e[12+1][1]=t["outside-prepandemic-all"]["Non-Payment"],e[12+1][2]=t["outside-prepandemic-all"].Holdover,e[12+2][1]=t["outside-pandemic-all"]["Non-Payment"],e[12+2][2]=t["outside-pandemic-all"].Holdover;for(var l=1;l<=2;l++)e[12][l]=e[12+1][l]+e[12+2][l],e[6][l]=e[6+2][l]+e[6+4][l],e[6+1][l]=e[6+3][l]+e[6+5][l],e[0+2][l]=e[6+2][l]+e[12+1][l],e[0+3][l]=e[6+3][l]+e[12+1][l],e[0+4][l]=e[6+4][l]+e[12+2][l],e[0+5][l]=e[6+5][l]+e[12+2][l],e[0][l]=e[0+2][l]+e[0+4][l],e[0+1][l]=e[0+3][l]+e[0+5][l];for(var u=12;uR.jsxs(R.Fragment,{children:[R.jsx("span",{children:"Note: Zip codes may appear in multiple courts."}),R.jsx(Ro,{url:QRe.json,fallback:R.jsx(Ei,{className:Pg}),children:e=>R.jsx(n$e,{values:e})})]}),e$e=({columns:e,data:t})=>{const{getTableProps:n,getTableBodyProps:r,headerGroups:i,rows:o,prepareRow:s}=ll.useTable({columns:e,data:t,initialState:{groupBy:["court"]}},ll.useGroupBy,ll.useExpanded);return R.jsxs("table",{...n(),children:[R.jsx("thead",{children:i.map(a=>R.jsx("tr",{...a.getHeaderGroupProps(),children:a.headers.map(l=>R.jsxs("th",{...l.getHeaderProps(),children:[l.id=="court"?R.jsx("span",{...l.getGroupByToggleProps(),children:l.isGrouped?"➡️ ":"⬇️ "}):null,l.render("Header")]}))}))}),R.jsx("tbody",{...r(),children:o.map((a,l)=>(s(a),R.jsx("tr",{...a.getRowProps(),children:a.cells.map(u=>R.jsx("td",{align:"left",...u.getCellProps(),children:u.isGrouped?R.jsxs(R.Fragment,{children:[R.jsx("span",{...a.getToggleRowExpandedProps(),children:a.isExpanded?"⬇️":"➡️"})," ",u.render("Cell")," (",a.subRows.length,")"]}):u.isAggregated?u.render("Aggregated"):u.isPlaceholder?null:u.render("Cell")}))})))})]})};function t$e(){return Sr.useMemo(()=>[{Header:"Court",accessor:"court_name",id:"court"},{Header:"Zipcode",accessor:"zipcode",aggregate:"count",Aggregated:({value:t})=>R.jsx(R.Fragment,{children:`${t} zip codes`})},{Header:"Total cases filed since March 23, 2020",accessor:"filings",aggregate:"sum",Aggregated:({value:t})=>R.jsx(R.Fragment,{children:`${mo(t)}`})}],[])}const n$e=e=>{var t=e.values;const n=t$e();return R.jsx(e$e,{columns:n,data:t})},r$e=new _i("monthly-filings-table-by-zip"),i$e=()=>R.jsxs(R.Fragment,{children:[R.jsx("span",{children:"Note: Filings from past 5-6 weeks may be artificially low due to reporting lags."}),R.jsx(Ro,{url:r$e.json,fallback:R.jsx(Ei,{className:Pg}),children:e=>R.jsx(a$e,{values:e})})]}),o$e=({columns:e,data:t})=>{const{getTableProps:n,getTableBodyProps:r,headerGroups:i,rows:o,prepareRow:s}=ll.useTable({columns:e,data:t});return R.jsxs("table",{...n(),children:[R.jsx("thead",{children:i.map(a=>R.jsx("tr",{...a.getHeaderGroupProps(),children:a.headers.map(l=>R.jsx("th",{...l.getHeaderProps(),children:l.render("Header")}))}))}),R.jsx("tbody",{...r(),children:o.map((a,l)=>(s(a),R.jsx("tr",{...a.getRowProps(),children:a.cells.map(u=>R.jsx("td",{align:"left",...u.getCellProps(),children:u.isPlaceholder?null:u.render("Cell")}))})))})]})};function s$e(){return Sr.useMemo(()=>[{Header:"Zipcode",accessor:"zipcode"},{Header:"Borough",accessor:"borough"},{Header:"3 months ago",accessor:"three_months_ago"},{Header:"2 months ago",accessor:"two_months_ago"},{Header:"# Increase",accessor:"num_increase"},{Header:"% Increase",accessor:"percent_increase",Cell:({value:t})=>R.jsx(R.Fragment,{children:`${mo(t)}%`})}],[])}const a$e=e=>{var t=e.values;const n=s$e();return R.jsx(o$e,{columns:n,data:t})},l$e=new _i("monthly-filings-table-citywide"),u$e=()=>R.jsxs(R.Fragment,{children:[R.jsx("span",{children:"Note: Filings from past 5-6 weeks may be artificially low due to reporting lags."}),R.jsx(Ro,{url:l$e.json,fallback:R.jsx(Ei,{className:Pg}),children:e=>R.jsx(h$e,{values:e})})]}),c$e=({columns:e,data:t})=>{const{getTableProps:n,getTableBodyProps:r,headerGroups:i,rows:o,prepareRow:s}=ll.useTable({columns:e,data:t,initialState:{groupBy:["region"]}},ll.useGroupBy,ll.useExpanded);return R.jsxs("table",{...n(),children:[R.jsx("thead",{children:i.map(a=>R.jsx("tr",{...a.getHeaderGroupProps(),children:a.headers.map(l=>R.jsxs("th",{...l.getHeaderProps(),children:[l.id=="court"?R.jsx("span",{...l.getGroupByToggleProps(),children:l.isGrouped?"➡️ ":"⬇️ "}):null,l.render("Header")]}))}))}),R.jsx("tbody",{...r(),children:o.map((a,l)=>(s(a),R.jsx("tr",{...a.getRowProps(),children:a.cells.map(u=>R.jsx("td",{align:"left",...u.getCellProps(),children:u.isGrouped?R.jsxs(R.Fragment,{children:[R.jsx("span",{...a.getToggleRowExpandedProps(),children:a.isExpanded?"⬇️":"➡️"})," ",u.render("Cell")," (",a.subRows.length,")"]}):u.isAggregated?u.render("Aggregated"):u.isPlaceholder?null:u.render("Cell")}))})))})]})};function f$e(){return Sr.useMemo(()=>[{Header:"Region",accessor:"region",id:"region"},{Header:"Borough",accessor:"borough",aggregate:"count",Aggregated:({value:t})=>R.jsx(R.Fragment,{children:`${t} boroughs`})},{Header:"3 months ago",accessor:"three_months_ago",aggregate:t=>t.reduce((n,r)=>parseInt(n)+parseInt(r)),Aggregated:({value:t})=>R.jsx(R.Fragment,{children:`${mo(t)}`}),Cell:({value:t})=>t},{Header:"2 months ago",accessor:"two_months_ago",aggregate:t=>t.reduce((n,r)=>parseInt(n)+parseInt(r)),Aggregated:({value:t})=>R.jsx(R.Fragment,{children:`${mo(t)}`}),Cell:({value:t})=>t},{Header:"# Increase",accessor:"num_increase",aggregate:t=>t.reduce((n,r)=>parseInt(n)+parseInt(r)),Aggregated:({value:t})=>R.jsx(R.Fragment,{children:`${mo(t)}`}),Cell:({value:t})=>t},{Header:"% Increase",accessor:"percent_increase",aggregate:t=>d$e(t),aggregateValue:(t,{original:n})=>`${n.two_months_ago}-${n.three_months_ago}`,Aggregated:({value:t})=>R.jsx(R.Fragment,{children:`${t}%`}),Cell:({value:t})=>R.jsx(R.Fragment,{children:`${mo(t)}%`})}],[])}function d$e(e){var t=0,n=0;for(let r in e){let i=e[r].split("-");t+=parseInt(i[0]),n+=parseInt(i[1])}return Math.round((t-n)/n*100)}const h$e=e=>{var t=e.values;const n=f$e();return R.jsx(c$e,{columns:n,data:t})};function Mv(e){return e*Math.PI/180}function aq(e,t,n){return e>n?n:e=0)&&(n[i]=e[i]);return n}function y$e(e){var t=e.renderLabel,n=e.labelProps,r=t(n);if(typeof r=="string"||typeof r=="number"){n.dataEntry,n.dataIndex;var i=fq(n,["dataEntry","dataIndex"]);return Sr.createElement("text",Object.assign({dominantBaseline:"central"},i),r)}return Sr.isValidElement(r)?r:null}function v$e(e){var t=1e14;return Math.round((e+Number.EPSILON)*t)/t}function x$e(e){var t=e.labelPosition,n=e.lineWidth,r=e.labelHorizontalShift,i=v$e(r);if(i===0)return"middle";if(t>100)return i>0?"start":"end";var o=100-n;return t0?"end":"start":"middle"}function b$e(e,t){return e.map(function(n,r){var i,o=(i=Fv(t.segmentsShift,r))!=null?i:0,s=ow(t.radius,t.labelPosition)+o,a=uq(lq(n.startAngle,n.degrees),s),l=a.dx,u=a.dy,c={x:t.center[0],y:t.center[1],dx:l,dy:u,textAnchor:x$e({labelPosition:t.labelPosition,lineWidth:t.lineWidth,labelHorizontalShift:l}),dataEntry:n,dataIndex:r,style:Fv(t.labelStyle,r)};return c})}function w$e(e,t){var n=t.label;if(n)return b$e(e,t).map(function(r,i){return Sr.createElement(y$e,{key:"label-"+(r.dataEntry.key||i),renderLabel:n,labelProps:r})})}var _$e=function(t,n,r,i,o){var s=o-i;if(s===0)return[];var a=r*Math.cos(i)+t,l=r*Math.sin(i)+n,u=r*Math.cos(o)+t,c=r*Math.sin(o)+n,f=Math.abs(s)<=Math.PI?"0":"1",d=s<0?"0":"1";return[["M",a,l],["A",r,r,0,f,d,u,c]]},E$e=_$e,S$e=E$e;function k$e(e,t,n,r,i){var o=aq(r,-359.999,359.999);return S$e(e,t,i,Mv(n),Mv(n+o)).map(function(s){return s.join(" ")}).join(" ")}function L5(e){var t=e.cx,n=e.cy,r=e.lengthAngle,i=e.lineWidth,o=e.radius,s=e.shift,a=s===void 0?0:s,l=e.reveal,u=e.rounded,c=e.startAngle,f=e.title,d=fq(e,["cx","cy","lengthAngle","lineWidth","radius","shift","reveal","rounded","startAngle","title"]),h=o-i/2,p=uq(lq(c,r),a),g=p.dx,m=p.dy,y=k$e(t+g,n+m,c,r,h),v,b;if(cq(l)){var w=Mv(h)*r;v=Math.abs(w),b=v-ow(v,l)}return Sr.createElement("path",Object.assign({d:y,fill:"none",strokeWidth:i,strokeDasharray:v,strokeDashoffset:b,strokeLinecap:u?"round":void 0},d),f&&Sr.createElement("title",null,f))}function C$e(e,t,n){var r="stroke-dashoffset "+e+"ms "+t;return n&&n.transition&&(r=r+","+n.transition),{transition:r}}function A$e(e){return e.animate&&!cq(e.reveal)?100:e.reveal}function Kc(e,t){return e&&function(n){e(n,t)}}function T$e(e,t,n){var r=n??A$e(t),i=t.radius,o=t.center,s=o[0],a=o[1],l=ow(i,t.lineWidth),u=e.map(function(c,f){var d=Fv(t.segmentsStyle,f);return Sr.createElement(L5,{cx:s,cy:a,key:c.key||f,lengthAngle:c.degrees,lineWidth:l,radius:i,rounded:t.rounded,reveal:r,shift:Fv(t.segmentsShift,f),startAngle:c.startAngle,title:c.title,style:Object.assign({},d,t.animate&&C$e(t.animationDuration,t.animationEasing,d)),stroke:c.color,tabIndex:t.segmentsTabIndex,onBlur:Kc(t.onBlur,f),onClick:Kc(t.onClick,f),onFocus:Kc(t.onFocus,f),onKeyDown:Kc(t.onKeyDown,f),onMouseOver:Kc(t.onMouseOver,f),onMouseOut:Kc(t.onMouseOut,f)})});return t.background&&u.unshift(Sr.createElement(L5,{cx:s,cy:a,key:"bg",lengthAngle:t.lengthAngle,lineWidth:l,radius:i,rounded:t.rounded,startAngle:t.startAngle,stroke:t.background})),u}var R$e={animationDuration:500,animationEasing:"ease-out",center:[50,50],data:[],labelPosition:50,lengthAngle:360,lineWidth:100,paddingAngle:0,radius:50,startAngle:0,viewBoxSize:[100,100]};function z5(e){var t=p$e(e,R$e),n=he.useState(t.animate?0:null),r=n[0],i=n[1];he.useEffect(function(){t.animate&&i(null)},[]);var o=m$e(t);return Sr.createElement("svg",{viewBox:"0 0 "+t.viewBoxSize[0]+" "+t.viewBoxSize[1],width:"100%",height:"100%",className:t.className,style:t.style},T$e(o,t,r),w$e(o,t),t.children)}const $$e=new _i("borough-pie-chart-active-cases"),O$e=()=>R.jsx(R.Fragment,{children:R.jsx(Ro,{url:$$e.json,fallback:R.jsx(Ei,{className:Pg}),children:e=>R.jsx(N$e,{values:e})})}),N$e=e=>{const t=M$e(e.values),n={fontSize:"5px",fontFamily:"sans-serif"},[r,i]=he.useState(void 0);function o(s,a){return r===a?{...s,title:`${s.value} filings`}:s}return R.jsxs("div",{className:"pie-chart-section",children:[R.jsxs("section",{className:"pie-chart",children:[R.jsx("h4",{children:"Pre-pandemic Active Cases (NYC)"}),R.jsx(z5,{data:t.prePandemicData.map(o),label:({dataEntry:s})=>`${s.title}: ${Math.round(s.percentage)}%`,labelStyle:{...n},style:{height:"250px"},onMouseOver:(s,a)=>{i(a)},onMouseOut:()=>{i(void 0)}})]}),R.jsxs("section",{className:"pie-chart",children:[R.jsx("h4",{children:"Pandemic Active Cases (NYC)"}),R.jsx(z5,{data:t.pandemicData.map(o),label:({dataEntry:s})=>`${s.title}: ${Math.round(s.percentage)}%`,labelStyle:{...n},style:{height:"250px"},onMouseOver:(s,a)=>{i(a)},onMouseOut:()=>{i(void 0)}})]})]})};function M$e(e){const t={Bronx:"#B3EFFF",Brooklyn:"#00CFFF",Manhattan:"#046B99",Queens:"#4373B1","Staten Island":"#606060"};function n(i,o){return i.title({title:i.borough,value:i.count,color:t[i.borough]});return{prePandemicData:e.filter(i=>i.timeBucket=="Issued Prepandemic").map(r).sort(n),pandemicData:e.filter(i=>i.timeBucket=="Issued Pandemic").map(r).sort(n)}}const dq="https://github.com/housing-data-coalition",hq=e=>new Date(e).toLocaleDateString("en-us",{weekday:"long",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}),F$e=()=>{const[e,t]=he.useState(null),n=new _i("latest-filing-date");return he.useEffect(()=>{fetch(n.json).then(r=>r.json()).then(r=>{const i=hq(r[0].latest_date);t(i)})},[n.json]),e===null?R.jsx(R.Fragment,{}):R.jsxs("li",{children:["NYCDB is automatically updated with the latest OCA files overnight each Sunday. If successfully updated, the latest filing date in the data should be the latest Friday. The latest filing date in NYCDB is"," ",R.jsx("b",{children:e}),"."]})},D$e=()=>{const[e,t]=he.useState(null),n="https://oca-2-dev.s3.amazonaws.com/public/last-updated-date.txt";return he.useEffect(()=>{fetch(n,{mode:"no-cors"}).then(r=>r.text()).then(r=>{const i=hq(r);t(i)})},[n]),e===null?R.jsx(R.Fragment,{}):R.jsxs("li",{children:[R.jsx("a",{href:`${dq}/oca#csv-files`,target:"_blank",children:"Raw data files from Office of Court Administration"})," ","should be updated every Tuesday. These files were last updated on"," ",R.jsx("b",{children:`${e}`}),"."]})},I$e=()=>R.jsxs(R.Fragment,{children:[R.jsx("p",{children:"Maintenance Checklist:"}),R.jsxs("ul",{children:[D$e(),F$e(),R.jsxs("li",{children:["Check the tracker’s"," ",R.jsx("a",{href:`${dq}/rtc-eviction-viz/actions/workflows/deploy.yml`,target:"_blank",children:"build/deploy history"})," ","to confirm latest build/deploy date is today and there are no recent unsuccessful builds."]})]})]}),pq="widget",gq="config",VO="view",Ek="fieldName",mq="height",yq=150,P$e=500,j0=500,L$e="housing",z$e=Sr.lazy(()=>g6(()=>import("./viz-6bf477d7.js"),[])),vq=new Map([["filings_by_zip","Filings By Zip Code"],["total_active_cases","Total Active Cases"],["total_judgments","Total Eviction Judgments"],["marshal_evictions","Total Marshal Evictions"],["pct_repped","Share of Represented Tenants"]]),B5=({files:e,title:t})=>R.jsxs(R.Fragment,{children:[R.jsx("p",{children:R.jsxs("a",{href:e.csv,children:["Download ",t," CSV"]})}),R.jsx("p",{children:R.jsxs("a",{href:e.json,children:["Download ",t," JSON"]})})]}),xq=({height:e})=>R.jsx(he.Suspense,{fallback:R.jsx(Ei,{className:fQ}),children:R.jsx(z$e,{height:e})}),B$e=()=>R.jsxs("div",{className:"container",children:[R.jsx("h1",{children:"New York Eviction Filings Tracker"}),R.jsxs("p",{children:["Managed by RTC Coalition's ",R.jsx("a",{href:"https://www.righttocounselnyc.org/hcmc",target:"_blank",children:"Housing Courts Must Change! Campaign"}),R.jsx("br",{}),R.jsxs("em",{children:["Powered by the ",R.jsx("a",{href:"https://www.housingdatanyc.org/",target:"_blank",children:"Housing Data Coalition"}),", ",R.jsx("a",{href:"https://www.justfix.nyc/",target:"_blank",children:"JustFix.nyc"}),", and ",R.jsx("a",{href:"https://anhd.org/",target:"_blank",children:"ANHD"})]})]}),R.jsxs("p",{children:["This website is for internal use by the Right to Counsel Coalition. Accuracy is not guaranteed and it should not be referenced publicly. If you would like to use or reference this data, please contact ",R.jsx("a",{href:"mailto:malika@righttocounselnyc.org",target:"_blank",children:"malika@righttocounselnyc.org"}),"."]}),R.jsx("h2",{children:"Total Active Cases"}),R.jsx(YRe,{}),R.jsx("br",{}),R.jsx(O$e,{}),R.jsx("br",{}),R.jsx("h2",{children:"Active Cases since 2020"}),R.jsx(x6,{height:P$e}),R.jsx("br",{}),R.jsx("h2",{children:"Marshal Evictions since Jan 15 2022"}),R.jsx(b6,{height:j0}),R.jsx("br",{}),R.jsx("h2",{children:"Share of Represented Tenants"}),R.jsx(w6,{height:j0}),R.jsx("br",{}),R.jsx("h2",{children:"Eviction Judgments since 3/23/2020"}),R.jsx(_6,{height:j0}),R.jsx(MQ,{height:j0}),R.jsx("br",{}),R.jsx("h2",{children:"Filings by zip code (NYC)"}),R.jsx(xq,{height:600}),R.jsxs("small",{children:[R.jsx("strong",{children:"Data sources:"})," New York State Office of Court Administration eviction filings and PLUTO19v2 via ",R.jsx("a",{href:"https://github.com/nycdb/nycdb",target:"_blank",children:"NYCDB"}),". By the ",R.jsx("a",{href:"https://housingdatanyc.org",target:"_blank",children:"Housing Data Coalition"}),", ",R.jsx("a",{href:"https://justfix.nyc",target:"_blank",children:"JustFix.nyc"}),", and ",R.jsx("a",{href:"https://anhd.org",target:"_blank",children:"ANHD"}),". *Numbers of total units per zip code exclude single-unit properties to approximate the number of rental units."]}),R.jsx(B5,{files:uQ,title:"filings by zip code (NYC)"}),R.jsx("br",{}),R.jsx("h2",{children:"Filings by zip code (Outside NYC)"}),R.jsx(ZRe,{}),R.jsx("br",{}),R.jsx("h2",{children:"Monthly filings"}),R.jsx("h3",{children:"By zip code"}),R.jsx(i$e,{}),R.jsx("h3",{children:"Statewide"}),R.jsx(u$e,{}),R.jsx("br",{}),R.jsx("h2",{children:"Filings over time"}),R.jsx(v6,{height:yq}),R.jsx(B5,{files:m6,title:"filings over time"}),R.jsx("p",{children:R.jsx("a",{href:`?${VO}=${gq}`,children:"Configure this page as a widget"})}),R.jsx("p",{children:R.jsx("a",{href:"https://github.com/housing-data-coalition/rtc-eviction-viz",children:"Learn more on GitHub"})}),R.jsx("p",{children:R.jsx("a",{href:"https://github.com/housing-data-coalition/rtc-eviction-viz/actions/workflows/deploy.yml",children:"See when this site was last deployed"})}),R.jsx(I$e,{})]}),j$e=({fieldName:e,height:t})=>e==="filings_by_zip"?R.jsx(xq,{height:t}):e==="total_active_cases"?R.jsx(x6,{height:t}):e==="total_judgments"?R.jsx(_6,{height:t}):e==="marshal_evictions"?R.jsx(b6,{height:t}):e==="pct_repped"?R.jsx(w6,{height:t}):R.jsx(v6,{height:t,fieldNames:[e]}),U$e=()=>R.jsxs("div",{className:"container",children:[R.jsx("h1",{children:"New York Evictions Widget Configurator"}),R.jsxs("p",{children:["Use the following form to generate a widget. Once you submit it, grab the URL from the address bar and put it in an ",R.jsx("code",{children:"