vendor: 95,620 bytes, lines 1-2
1import{f as WD,m as GD,d as HD,q as fb,a as VD,b as pw,c as XD,$ as YD,p as KD,i as JD,l as QD,e as ZD,s as eR,g as tR,u as nR,h as gw,j as iR,k as rR,n as sR,o as oR,r as aR,t as uR,v as lR,w as cR,x as fR,y as dR,z as hR,A as pR,B as gR,C as mR,D as yR,E as bR,F as xR,G as vR,H as ER,I as wR,J as SR,K as kR,L as mw,S as $R,M as yw,N as AR,O as CR,P as FR,Q as OR,R as DR,T as RR,U as _R,V as TR,W as NR,X as MR,Y as LR,Z as PR,_ as IR,a0 as zR,a1 as BR,a2 as UR,a3 as jR,a4 as bw,a5 as qR,a6 as WR,a7 as GR,a8 as HR,a9 as VR,aa as XR,ab as YR,ac as KR,ad as JR,ae as QR,af as db,ag as ZR,ah as e_,ai as t_,aj as n_,ak as i_,al as r_,am as s_,an as o_,ao as a_,ap as u_,aq as l_,ar as c_,as as f_,at as wd}from"./mollweide-XXUPULVr.js";import{b as gg,t as Ua,p as d_,d as h_,e as p_,f as xw,l as g_,g as m_,h as Wl,i as y_,j as b_,k as x_}from"./linear-8mDBZVC7.js";import{p as vw,s as Ew,o as v_,n as E_,l as vl,d as ww,c as hb,q as w_,u as S_,r as k_,v as El,w as Sw,x as pb,y as $_,z as A_,b as C_,A as F_,B as O_,C as D_,a as Ra,m as R_,t as __,D as T_,E as N_}from"./time-BMaLdJ6b.js";import{c as M_,a as gb,f as L_,b as P_}from"./defaultLocale-CzDG__Ur.js";import{d as I_}from"./dsv-DB8NKgIY.js";import{r as ys}from"./range-OtVwhkKS.js";import{o as kw,i as z_}from"./ordinal-BeghXfj9.js";import{D as B_,E as U_,F as j_,G as q_,H as W_,I as G_,J as H_,K as V_,L as X_,M as Y_,N as K_,O as J_,P as Q_,Q as Z_,S as eT,T as tT,U as nT,k as iT,V as mg,l as rT,W as Gl,X as sT}from"./step-B-Gbak1k.js";import{d as oT}from"./arc-Bt_eNeYl.js";import{h as aT,t as uT,a as lT,b as cT,c as fT}from"./index-BU4IRnz1.js";import"./dispatch-kxCwF96_.js";import"./init-Dmth1JHB.js";import"./colors-Cc3OSVma.js";function Mt(e,t,n){return e.fields=t||[],e.fname=n,e}function Me(e){return e==null?null:e.fname}function pt(e){return e==null?null:e.fields}function $w(e){return e.length===1?dT(e[0]):hT(e)}const dT=e=>function(t){return t[e]},hT=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function A(e){throw Error(e)}function si(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||A("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&A("Access path missing closing bracket: "+e),i&&A("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function rn(e,t,n){const i=si(e);return e=i.length===1?i[0]:e,Mt((n&&n.get||$w)(i),[e],t||e)}const lu=rn("id"),bt=Mt(e=>e,[],"identity"),Yi=Mt(()=>0,[],"zero"),Ro=Mt(()=>1,[],"one"),sn=Mt(()=>!0,[],"true"),ji=Mt(()=>!1,[],"false"),yg=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function"),"__proto__"]);function pT(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Aw=0,bg=1,xg=2,Cw=3,Fw=4;function Lc(e,t,n=pT){let i=e||Aw;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=bg&&n(t||"error","ERROR",arguments),this},warn(){return i>=xg&&n(t||"warn","WARN",arguments),this},info(){return i>=Cw&&n(t||"log","INFO",arguments),this},debug(){return i>=Fw&&n(t||"log","DEBUG",arguments),this}}}var F=Array.isArray;function U(e){return e===Object(e)}const mb=e=>e!=="__proto__";function _o(...e){return e.reduce((t,n)=>{for(const i in n)if(i==="signals")t.signals=gT(t.signals,n.signals);else{const r=i==="legend"?{layout:1}:i==="style"?!0:null;To(t,i,n[i],r)}return t},{})}function To(e,t,n,i){if(!mb(t))return;let r,s;if(U(n)&&!F(n)){s=U(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?To(s,r,n[r]):mb(r)&&(s[r]=n[r])}else e[t]=n}function gT(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function ue(e){return e[e.length-1]}function dt(e){return e==null||e===""?null:+e}const Ow=e=>t=>e*Math.exp(t),Dw=e=>t=>Math.log(e*t),Rw=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),_w=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Hl=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Pc(e,t,n,i){const r=n(e[0]),s=n(ue(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function Tw(e,t){return Pc(e,t,dt,bt)}function Nw(e,t){var n=Math.sign(e[0]);return Pc(e,t,Dw(n),Ow(n))}function Mw(e,t,n){return Pc(e,t,Hl(n),Hl(1/n))}function Lw(e,t,n){return Pc(e,t,Rw(n),_w(n))}function Ic(e,t,n,i,r){const s=i(e[0]),o=i(ue(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function vg(e,t,n){return Ic(e,t,n,dt,bt)}function Eg(e,t,n){const i=Math.sign(e[0]);return Ic(e,t,n,Dw(i),Ow(i))}function Vl(e,t,n,i){return Ic(e,t,n,Hl(i),Hl(1/i))}function wg(e,t,n,i){return Ic(e,t,n,Rw(i),_w(i))}function Pw(e){return 1+~~(new Date(e).getMonth()/3)}function Iw(e){return 1+~~(new Date(e).getUTCMonth()/3)}function q(e){return e!=null?F(e)?e:[e]:[]}function zw(e,t,n){let i=e[0],r=e[1],s;return r<i&&(s=r,r=i,i=s),s=r-i,s>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function ie(e){return typeof e=="function"}const mT="descending";function Sg(e,t,n){n=n||{},t=q(t)||[];const i=[],r=[],s={},o=n.comparator||yT;return q(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===mT?-1:1),r.push(a=ie(a)?a:rn(a,null,n)),(pt(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:Mt(o(r,i),Object.keys(s))}const No=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),yT=(e,t)=>e.length===1?bT(e[0],t[0]):xT(e,t,e.length),bT=(e,t)=>function(n,i){return No(e(n),e(i))*t},xT=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++a<n;)s=e[a],o=No(s(i),s(r));return o*t[a]});function xt(e){return ie(e)?e:()=>e}function kg(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function re(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Zn(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}function Bw(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i<n;)if(s=e[i],s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=e[i],s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}else{for(;++i<n;)if(s=t(e[i],i,e),s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=t(e[i],i,e),s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}return[a,u]}function G(e,t){return Object.hasOwn(e,t)}const Yu={};function Mo(e){let t={},n;function i(s){return G(t,s)&&t[s]!==Yu}const r={size:0,empty:0,object:t,has:i,get(s){return i(s)?t[s]:void 0},set(s,o){return i(s)||(++r.size,t[s]===Yu&&--r.empty),t[s]=o,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=Yu),this},clear(){r.size=r.empty=0,r.object=t={}},test(s){return arguments.length?(n=s,r):n},clean(){const s={};let o=0;for(const a in t){const u=t[a];u!==Yu&&(!n||!n(u))&&(s[a]=u,++o)}r.size=o,r.empty=0,r.object=t=s}};return e&&Object.keys(e).forEach(s=>{r.set(s,e[s])}),r}function Uw(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=ue(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=o?i:c<=o?r:s}function z(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),re(i,n)}function Gs(e,t,n,i){let r=t[0],s=t[t.length-1],o;return r>s&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=s:e<s)}function bs(e){return typeof e=="boolean"}function rr(e){return Object.prototype.toString.call(e)==="[object Date]"}function jw(e){return e&&ie(e[Symbol.iterator])}function de(e){return typeof e=="number"}function $g(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function j(e){return typeof e=="string"}function Ag(e,t,n){e&&(e=t?q(e).map(a=>a.replace(/\\(.)/g,"$1")):q(e));const i=e&&e.length,r=n&&n.get||$w,s=a=>r(t?[a]:si(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return Mt(o,e,"key")}function qw(e,t){const n=e[0],i=ue(e),r=+t;return r?r===1?i:n+r*(i-n):n}const vT=1e4;function Ww(e){e=+e||vT;let t,n,i;const r=()=>{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>G(t,o)||G(n,o),get:o=>G(t,o)?t[o]:G(n,o)?s(o,n[o]):void 0,set:(o,a)=>G(t,o)?t[o]=a:s(o,a)}}function Gw(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,u=0,l=0;for(;a<r&&u<s;++l)o[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)o[l]=t[a];for(;u<s;++u,++l)o[l]=n[u];return o}function ya(e,t){let n="";for(;--t>=0;)n+=e;return n}function Hw(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?ya(r,o)+s:i==="center"?ya(r,~~(o/2))+s+ya(r,Math.ceil(o/2)):s+ya(r,o)}function cu(e){return e&&ue(e)-e[0]||0}function L(e){return F(e)?`[${e.map(t=>t===null?"null":L(t))}]`:U(e)||j(e)?JSON.stringify(e).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):e}function Cg(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const ET=e=>de(e)||rr(e)?e:Date.parse(e);function Fg(e,t){return t=t||ET,e==null||e===""?null:t(e)}function Og(e){return e==null||e===""?null:e+""}function $n(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function Vw(e,t,n,i){const r=i??"â¦",s=e+"",o=s.length,a=Math.max(0,t-r.length);return o<=t?s:n==="left"?r+s.slice(o-a):n==="center"?s.slice(0,Math.ceil(a/2))+r+s.slice(o-~~(a/2)):s.slice(0,a)+r}function Gi(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const s=t(e[r]);s&&n(s,r,e)}}else e.forEach(n)}const st="year",Dt="quarter",gt="month",We="week",Rt="date",ft="day",ei="dayofyear",Ht="hours",Vt="minutes",on="seconds",An="milliseconds",Dg=[st,Dt,gt,We,Rt,ft,ei,Ht,Vt,on,An],Sd=Dg.reduce((e,t,n)=>(e[t]=1+n,e),{});function Rg(e){const t=q(e).slice(),n={};return t.length||A("Missing time unit."),t.forEach(r=>{G(Sd,r)?n[r]=1:A(`Invalid time unit: ${r}.`)}),(n[We]||n[ft]?1:0)+(n[Dt]||n[gt]||n[Rt]?1:0)+(n[ei]?1:0)>1&&A(`Incompatible time units: ${e}`),t.sort((r,s)=>Sd[r]-Sd[s]),t}const wT={[st]:"%Y ",[Dt]:"Q%q ",[gt]:"%b ",[Rt]:"%d ",[We]:"W%U ",[ft]:"%a ",[ei]:"%j ",[Ht]:"%H:00",[Vt]:"00:%M",[on]:":%S",[An]:".%L",[`${st}-${gt}`]:"%Y-%m ",[`${st}-${gt}-${Rt}`]:"%Y-%m-%d ",[`${Ht}-${Vt}`]:"%H:%M"};function Xw(e,t){const n=re({},wT,t),i=Rg(e),r=i.length;let s="",o=0,a,u;for(o=0;o<r;)for(a=i.length;a>o;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const Ur=new Date;function _g(e){return Ur.setFullYear(e),Ur.setMonth(0),Ur.setDate(1),Ur.setHours(0,0,0,0),Ur}function Yw(e){return Jw(new Date(e))}function Kw(e){return Ih(new Date(e))}function Jw(e){return vl.count(_g(e.getFullYear())-1,e)}function Ih(e){return ww.count(_g(e.getFullYear())-1,e)}function zh(e){return _g(e).getDay()}function ST(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function Qw(e){return eS(new Date(e))}function Zw(e){return Bh(new Date(e))}function eS(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return El.count(t-1,e)}function Bh(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Sw.count(t-1,e)}function Uh(e){return Ur.setTime(Date.UTC(e,0,1)),Ur.getUTCDay()}function kT(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function tS(e,t,n,i,r){const s=t||1,o=ue(e),a=(y,b,v)=>(v=v||y,$T(n[v],i[v],y===o&&s,b)),u=new Date,l=$n(e),c=l[st]?a(st):xt(2012),f=l[gt]?a(gt):l[Dt]?a(Dt):Yi,d=l[We]&&l[ft]?a(ft,1,We+ft):l[We]?a(We,1):l[ft]?a(ft,1):l[Rt]?a(Rt,1):l[ei]?a(ei,1):Ro,p=l[Ht]?a(Ht):Yi,h=l[Vt]?a(Vt):Yi,g=l[on]?a(on):Yi,m=l[An]?a(An):Yi;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),p(u),h(u),g(u),m(u))}}function $T(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function io(e,t,n){return t+e*7-(n+6)%7}const AT={[st]:e=>e.getFullYear(),[Dt]:e=>Math.floor(e.getMonth()/3),[gt]:e=>e.getMonth(),[Rt]:e=>e.getDate(),[Ht]:e=>e.getHours(),[Vt]:e=>e.getMinutes(),[on]:e=>e.getSeconds(),[An]:e=>e.getMilliseconds(),[ei]:e=>Jw(e),[We]:e=>Ih(e),[We+ft]:(e,t)=>io(Ih(e),e.getDay(),zh(t)),[ft]:(e,t)=>io(1,e.getDay(),zh(t))},CT={[Dt]:e=>3*e,[We]:(e,t)=>io(e,0,zh(t))};function nS(e,t){return tS(e,t||1,AT,CT,ST)}const FT={[st]:e=>e.getUTCFullYear(),[Dt]:e=>Math.floor(e.getUTCMonth()/3),[gt]:e=>e.getUTCMonth(),[Rt]:e=>e.getUTCDate(),[Ht]:e=>e.getUTCHours(),[Vt]:e=>e.getUTCMinutes(),[on]:e=>e.getUTCSeconds(),[An]:e=>e.getUTCMilliseconds(),[ei]:e=>eS(e),[We]:e=>Bh(e),[ft]:(e,t)=>io(1,e.getUTCDay(),Uh(t)),[We+ft]:(e,t)=>io(Bh(e),e.getUTCDay(),Uh(t))},OT={[Dt]:e=>3*e,[We]:(e,t)=>io(e,0,Uh(t))};function iS(e,t){return tS(e,t||1,FT,OT,kT)}const DT={[st]:w_,[Dt]:hb.every(3),[gt]:hb,[We]:ww,[Rt]:vl,[ft]:vl,[ei]:vl,[Ht]:E_,[Vt]:v_,[on]:Ew,[An]:vw},RT={[st]:$_,[Dt]:pb.every(3),[gt]:pb,[We]:Sw,[Rt]:El,[ft]:El,[ei]:El,[Ht]:k_,[Vt]:S_,[on]:Ew,[An]:vw};function Lo(e){return DT[e]}function Po(e){return RT[e]}function rS(e,t,n){return e?e.offset(t,n):void 0}function sS(e,t,n){return rS(Lo(e),t,n)}function oS(e,t,n){return rS(Po(e),t,n)}function aS(e,t,n,i){return e?e.range(t,n,i):void 0}function uS(e,t,n,i){return aS(Lo(e),t,n,i)}function lS(e,t,n,i){return aS(Po(e),t,n,i)}const ba=1e3,xa=ba*60,va=xa*60,zc=va*24,_T=zc*7,yb=zc*30,jh=zc*365,cS=[st,gt,Rt,Ht,Vt,on,An],Ea=cS.slice(0,-1),wa=Ea.slice(0,-1),Sa=wa.slice(0,-1),TT=Sa.slice(0,-1),NT=[st,We],bb=[st,gt],fS=[st],Zo=[[Ea,1,ba],[Ea,5,5*ba],[Ea,15,15*ba],[Ea,30,30*ba],[wa,1,xa],[wa,5,5*xa],[wa,15,15*xa],[wa,30,30*xa],[Sa,1,va],[Sa,3,3*va],[Sa,6,6*va],[Sa,12,12*va],[TT,1,zc],[NT,1,_T],[bb,1,yb],[bb,3,3*yb],[fS,1,jh]];function dS(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(cu(t))/n;let r=gg(a=>a[2]).right(Zo,i),s,o;return r===Zo.length?(s=fS,o=Ua(t[0]/jh,t[1]/jh,n)):r?(r=Zo[i/Zo[r-1][2]<Zo[r][2]/i?r-1:r],s=r[0],o=r[1]):(s=cS,o=Math.max(Ua(t[0],t[1],n),1)),{units:s,step:o}}function ka(e){const t={};return n=>t[n]||(t[n]=e(n))}function MT(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=LT(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function LT(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function hS(e){const t=ka(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=gb(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return MT(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=gb(o??",f");const a=Ua(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=p_(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=h_(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=d_(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let qh;pS();function pS(){return qh=hS({format:L_,formatPrefix:P_})}function gS(e){return hS(M_(e))}function Xl(e){return arguments.length?qh=gS(e):qh}function xb(e,t,n){n=n||{},U(n)||A(`Invalid time multi-format specifier: ${n}`);const i=t(on),r=t(Vt),s=t(Ht),o=t(Rt),a=t(We),u=t(gt),l=t(Dt),c=t(st),f=e(n[An]||".%L"),d=e(n[on]||":%S"),p=e(n[Vt]||"%I:%M"),h=e(n[Ht]||"%I %p"),g=e(n[Rt]||n[ft]||"%a %d"),m=e(n[We]||"%b %d"),y=e(n[gt]||"%B"),b=e(n[Dt]||"%B"),v=e(n[st]||"%Y");return w=>(i(w)<w?f:r(w)<w?d:s(w)<w?p:o(w)<w?h:u(w)<w?a(w)<w?g:m:c(w)<w?l(w)<w?y:b:v)(w)}function mS(e){const t=ka(e.format),n=ka(e.utcFormat);return{timeFormat:i=>j(i)?t(i):xb(t,Lo,i),utcFormat:i=>j(i)?n(i):xb(n,Po,i),timeParse:ka(e.parse),utcParse:ka(e.utcParse)}}let Wh;yS();function yS(){return Wh=mS({format:C_,parse:D_,utcFormat:F_,utcParse:O_})}function bS(e){return mS(A_(e))}function ja(e){return arguments.length?Wh=bS(e):Wh}const Gh=(e,t)=>re({},e,t);function xS(e,t){const n=e?gS(e):Xl(),i=t?bS(t):ja();return Gh(n,i)}function Tg(e,t){const n=arguments.length;return n&&n!==2&&A("defaultLocale expects either zero or two arguments."),n?Gh(Xl(e),ja(t)):Gh(Xl(),ja())}function PT(){return pS(),yS(),Tg()}const IT=/^(data:|([A-Za-z]+:)?\/\/)/,zT=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,BT=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,vb="file://";function UT(e){return t=>({options:t||{},sanitize:qT,load:jT,fileAccess:!1,file:WT(),http:HT})}async function jT(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t?.http)}async function qT(e,t){t=re({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=zT.test(e.replace(BT,""));(e==null||typeof e!="string"||!a)&&A("Sanitize failure, invalid URI: "+L(e));const u=IT.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(vb))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(vb.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function WT(e){return GT}async function GT(){A("No file system access.")}async function HT(e,t){const n=re({},this.options.http,t),i=t&&t.response,r=await fetch(e,n);return r.ok?ie(r[i])?r[i]():r.text():A(r.status+""+r.statusText)}const VT=e=>e!=null&&e===e,XT=e=>e==="true"||e==="false"||e===!0||e===!1,YT=e=>!Number.isNaN(Date.parse(e)),vS=e=>!Number.isNaN(+e)&&!(e instanceof Date),KT=e=>vS(e)&&Number.isInteger(+e),Hh={boolean:Cg,integer:dt,number:dt,date:Fg,string:Og,unknown:bt},Ku=[XT,KT,vS,YT],JT=["boolean","integer","number","date"];function ES(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Ku.length,r=Ku.map((s,o)=>o+1);for(let s=0,o=0,a,u;s<n;++s)for(u=t?e[s][t]:e[s],a=0;a<i;++a)if(r[a]&&VT(u)&&!Ku[a](u)&&(r[a]=0,++o,o===Ku.length))return"string";return JT[r.reduce((s,o)=>s===0?o:s,0)-1]}function wS(e,t){return t.reduce((n,i)=>(n[i]=ES(e,i),n),{})}function Eb(e){const t=function(n,i){const r={delimiter:e};return Ng(n,i?re(i,r):r)};return t.responseType="text",t}function Ng(e,t){return t.header&&(e=t.header.map(L).join(t.delimiter)+` 2`+e),I_(t.delimiter).parse(e+"")}Ng.responseType="text";function QT(e){return typeof Buffer=="function"&&ie(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Mg(e,t){const n=t&&t.property?rn(t.property):bt;return U(e)&&!QT(e)?ZT(n(e),t):n(JSON.parse(e))}Mg.responseType="json";function ZT(e,t){return!F(e)&&jw(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const eN={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function SS(e,t){let n,i,r,s;return e=Mg(e,t),t&&t.feature?(n=WD,r=t.feature):t&&t.mesh?(n=GD,r=t.mesh,s=eN[t.filter]):A("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):A("Invalid TopoJSON object: "+r),i&&i.features||[i]}SS.responseType="json";const wl={dsv:Ng,csv:Eb(","),tsv:Eb(" "),json:Mg,topojson:SS};function Lg(e,t){return arguments.length>1?(wl[e]=t,this):G(wl,e)?wl[e]:null}function kS(e){const t=Lg(e);return t&&t.responseType||"text"}function $S(e,t,n,i){t=t||{};const r=Lg(t.type||"json");return r||A("Unknown data format type: "+t.type),e=r(e,t),t.parse&&tN(e,t.parse,n,i),G(e,"columns")&&delete e.columns,e}function tN(e,t,n,i){if(!e.length)return;const r=ja();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=wS(e,s)),s=Object.keys(t);const d=s.map(p=>{const h=t[p];let g,m;if(h&&(h.startsWith("date:")||h.startsWith("utc:")))return g=h.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!Hh[h])throw Error("Illegal format pattern: "+p+":"+h);return Hh[h]});for(u=0,c=e.length,f=s.length;u<c;++u)for(o=e[u],l=0;l<f;++l)a=s[l],o[a]=d[l](o[a])}const Bc=UT();function Uc(e){const t=e||bt,n=[],i={};return n.add=r=>{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function Sl(e,t){try{await t(e)}catch(n){e.error(n)}}const AS=Symbol("vega_id");let nN=1;function jc(e){return!!(e&&Q(e))}function Q(e){return e[AS]}function CS(e,t){return e[AS]=t,e}function ge(e){const t=e===Object(e)?e:{data:e};return Q(t)?t:CS(t,nN++)}function Pg(e){return qc(e,ge({}))}function qc(e,t){for(const n in e)t[n]=e[n];return t}function FS(e,t){return CS(t,Q(e))}function xs(e,t){return e?t?(n,i)=>e(n,i)||Q(t(n))-Q(t(i)):(n,i)=>e(n,i)||Q(n)-Q(i):null}function OS(e){return e&&e.constructor===vs}function vs(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:vs,insert(a){const u=q(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=ie(a)?i:t,l=q(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:xt(l)};return ie(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return ie(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return s=a,this},reflow(){return o=!0,this},pulse(a,u){const l={},c={};let f,d,p,h,g,m;for(f=0,d=u.length;f<d;++f)l[Q(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[Q(g)]=-1;for(f=0,d=i.length;f<d;++f)h=i[f],u.forEach(b=>{h(b)&&(l[Q(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=Q(g),l[m]?l[m]=1:a.add.push(ge(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[Q(g)]<0&&a.rem.push(g);function y(b,v,w){w?b[v]=w(b):a.encode=v,o||(c[Q(b)]=b)}for(f=0,d=n.length;f<d;++f)p=n[f],g=p.tuple,h=p.field,m=l[Q(g)],m>0&&(y(g,h,p.value),a.modifies(h));for(f=0,d=r.length;f<d;++f)p=r[f],h=p.filter,u.forEach(b=>{h(b)&&l[Q(b)]>0&&y(b,p.field,p.value)}),a.modifies(p.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[Q(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const kl="_:mod:_";function Wc(){Object.defineProperty(this,kl,{writable:!0,value:{}})}Wc.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[kl];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=F(n)?1+n.length:-1),r},modified(e,t){const n=this[kl];if(arguments.length){if(F(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[kl]={},this}};let iN=0;const rN="pulse",sN=new Wc,oN=1,aN=2;function we(e,t,n,i){this.id=++iN,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function wb(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}we.prototype={targets(){return this._targets||(this._targets=Uc(lu))},set(e){return this.value!==e?(this.value=e,1):0},skip:wb(oN),modified:wb(aN),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Wc,r=this._argops=this._argops||[],s=[];let o,a,u,l;const c=(f,d,p)=>{p instanceof we?(p!==this&&(t&&p.targets().add(this),s.push(p)),r.push({op:p,name:f,index:d})):i.set(f,d,p)};for(o in e)if(a=e[o],o===rN)q(a).forEach(f=>{f instanceof we?f!==this&&(f.targets().add(this),s.push(f)):A("Pulse parameters must be operator instances.")}),this.source=a;else if(F(a))for(i.set(o,-1,Array(u=a.length)),l=0;l<u;++l)c(o,l,a[l]);else c(o,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||sN,n=this._argops;let i,r,s,o;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],s=i.op,o=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,o);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function uN(e,t,n,i){let r=1,s;return e instanceof we?s=e:e&&e.prototype instanceof we?s=new e:ie(e)?s=new we(null,e):(r=0,s=new we(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function lN(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let cN=0;function Gc(e,t,n){this.id=++cN,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function qi(e,t,n){return new Gc(e,t,n)}Gc.prototype={_filter:sn,_apply:bt,targets(){return this._targets||(this._targets=Uc(lu))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=qi(e);return this.targets().add(t),t},apply(e){const t=qi(null,e);return this.targets().add(t),t},merge(){const e=qi();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=qi();return this.targets().add(qi(null,null,kg(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(qi(null,null,()=>n=!0)),t.targets().add(qi(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=sn,this._targets=null}};function fN(e,t,n,i){const r=this,s=qi(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=q(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,o);return s}function dN(e,t){const n=this.locale();return $S(e,t,n.timeParse,n.utcParse)}function hN(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function pN(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:kS(t&&t.type)});try{r=n.parse(r,t)}catch(s){i=-2,n.warn("Data ingestion failed",e,s)}}catch(s){i=-1,n.warn("Loading failed",e,s)}return{data:r,status:i}}async function gN(e,t,n){const i=this,r=i._pending||mN(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(sn).insert(s.data||[])),r.done(),s}function mN(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const yN={skip:!0};function bN(e,t,n,i,r){return(e instanceof we?vN:xN)(this,e,t,n,i,r),this}function xN(e,t,n,i,r,s){const o=re({},s,yN);let a,u;ie(n)||(n=xt(n)),i===void 0?a=l=>e.touch(n(l)):ie(i)?(u=new we(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;OS(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function vN(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new we(null,EN(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function EN(e,t){return t=ie(t)?t:xt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function wN(e){e.rank=++this._rank}function SN(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&A("Cycle detected in dataflow graph.")}const Yl={},Wn=1,Hi=2,xi=4,kN=Wn|Hi,Sb=Wn|xi,Ns=Wn|Hi|xi,kb=8,ea=16,$b=32,Ab=64;function sr(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function kd(e,t){const n=[];return Gi(e,t,i=>n.push(i)),n}function Cb(e,t){const n={};return e.visit(t,i=>{n[Q(i)]=1}),i=>n[Q(i)]?null:i}function Ju(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}sr.prototype={StopPropagation:Yl,ADD:Wn,REM:Hi,MOD:xi,ADD_REM:kN,ADD_MOD:Sb,ALL:Ns,REFLOW:kb,SOURCE:ea,NO_SOURCE:$b,NO_FIELDS:Ab,fork(e){return new sr(this.dataflow).init(this,e)},clone(){const e=this.fork(Ns);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(Ns|ea)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new sr(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&Ab)&&(n.fields=e.fields),t&Wn?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Hi?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&xi?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&$b?(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||Ns;return t&Wn&&this.add.length||t&Hi&&this.rem.length||t&xi&&this.mod.length},reflow(e){if(e)return this.fork(Ns).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(xi,Cb(this,Wn))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return F(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?F(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Wn&&(n.addF=Ju(n.addF,t)),e&Hi&&(n.remF=Ju(n.remF,t)),e&xi&&(n.modF=Ju(n.modF,t)),e&ea&&(n.srcF=Ju(n.srcF,t)),n},materialize(e){e=e||Ns;const t=this;return e&Wn&&t.addF&&(t.add=kd(t.add,t.addF),t.addF=null),e&Hi&&t.remF&&(t.rem=kd(t.rem,t.remF),t.remF=null),e&xi&&t.modF&&(t.mod=kd(t.mod,t.modF),t.modF=null),e&ea&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&ea)return Gi(n.source,n.srcF,i),n;e&Wn&&Gi(n.add,n.addF,i),e&Hi&&Gi(n.rem,n.remF,i),e&xi&&Gi(n.mod,n.modF,i);const r=n.source;if(e&kb&&r){const s=n.add.length+n.mod.length;s===r.length||(s?Gi(r,Cb(n,Sb),i):Gi(r,n.srcF,i))}return n}};function Ig(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}z(Ig,sr,{fork(e){const t=new sr(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?F(e)?e.some(i=>n[i]):n[e]:0},filter(){A("MultiPulse does not support filtering.")},materialize(){A("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});async function $N(e,t,n){const i=this,r=[];if(i._pulse)return DS(i);if(i._pending&&await i._pending,t&&await Sl(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new sr(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Uc(lu);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Yl),u!==Yl&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await Sl(i,c[f].callback)}return n&&await Sl(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function AN(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function CN(e,t,n){return this._pulse?DS(this):(this.evaluate(e,t,n),this)}function FN(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function DS(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function ON(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function DN(e,t){const n=e.source,i=this._clock;return n&&F(n)?new Ig(this,i,n.map(r=>r.pulse),t):this._input[e.id]||RN(this._pulse,n&&n.pulse)}function RN(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Yl&&(e.source=t.source),e)}const zg={skip:!1,force:!1};function _N(e,t){const n=t||zg;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function TN(e,t,n){const i=n||zg;return(e.set(t)||i.force)&&this.touch(e,i),this}function NN(e,t,n){this.touch(e,n||zg);const i=new sr(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function MN(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),RS(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,LN(t,0,e)):i=n,i}}}function RS(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function LN(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o<r;)a=o+1,a<r&&n(e[o],e[a])>=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,RS(e,i,t,n)}function Ks(){this.logger(Lc()),this.logLevel(bg),this._clock=0,this._rank=0,this._locale=Tg();try{this._loader=Bc()}catch{}this._touched=Uc(lu),this._input={},this._pulse=null,this._heap=MN((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ta(e){return function(){return this._log[e].apply(this,arguments)}}Ks.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:ta("error"),warn:ta("warn"),info:ta("info"),debug:ta("debug"),logLevel:ta("level"),cleanThreshold:1e4,add:uN,connect:lN,rank:wN,rerank:SN,pulse:NN,touch:_N,update:TN,changeset:vs,ingest:hN,parse:dN,preload:gN,request:pN,events:fN,on:bN,evaluate:$N,run:CN,runAsync:AN,runAfter:FN,_enqueue:ON,_getPulse:DN};function $(e,t){we.call(this,e,null,t)}z($,we,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const ro={};function _S(e){const t=TS(e);return t&&t.Definition||null}function TS(e){return e=e&&e.toLowerCase(),G(ro,e)?ro[e]:null}function*NS(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Bg(e,t,n){const i=Float64Array.from(NS(e,n));return i.sort(xw),t.map(r=>VD(i,r))}function Ug(e,t){return Bg(e,[.25,.5,.75],t)}function jg(e,t){const n=e.length,i=HD(e,t),r=Ug(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function MS(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const p=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=p/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(p)/i)-u));Math.ceil(p/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&p/c<=t&&(a=c)}c=Math.log(a);const h=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-h-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=s<c?c-a:c,o=Math.ceil(o/a)*a),{start:s,stop:o===s?s+a:o,step:a}}var an=Math.random;function PN(e){an=e}function LS(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(NS(e,i)),s=r.length,o=t;let a,u,l,c;for(l=0,c=Array(o);l<o;++l){for(a=0,u=0;u<s;++u)a+=r[~~(an()*s)];c[l]=a/s}return c.sort(xw),[fb(c,n/2),fb(c,1-n/2)]}function PS(e,t,n,i){i=i||(d=>d);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;o<a;++o)s[o]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;o<a;++o)s[o]=l;return n?IN(s,t+t/4):s}function IN(e,t){const n=e.length;let i=0,r=1,s,o;for(;e[i]===e[r];)++r;for(;r<n;){for(s=r+1;e[r]===e[s];)++s;if(e[r]-e[r-1]<t){for(o=r+(i+s-r-r>>1);o<r;)e[o++]=e[r];for(;o>r;)e[o--]=e[i]}i=r,r=s}return e}function zN(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function BN(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*an())},pdf(o){return o===Math.floor(o)&&o>=n&&o<i?1/r:0},cdf(o){const a=Math.floor(o);return a<n?0:a>=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const IS=Math.sqrt(2*Math.PI),UN=Math.SQRT2;let na=NaN;function Hc(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(na===na)n=na,na=NaN;else{do n=an()*2-1,i=an()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,na=i*s}return e+n*t}function qg(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*IS)}function Vc(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function Xc(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*UN*jN(2*e-1)}function jN(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 Wg(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Hc(n,i),pdf:s=>qg(s,n,i),cdf:s=>Vc(s,n,i),icdf:s=>Xc(s,n,i)};return r.mean(e).stdev(t)}function Gg(e,t){const n=Wg();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=jg(e)),r):t},sample(){return e[~~(an()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;a<i;++a)o+=n.pdf((s-e[a])/t);return o/t/i},cdf(s){let o=0,a=0;for(;a<i;++a)o+=n.cdf((s-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Hg(e,t){return e=e||0,t=t??1,Math.exp(e+Hc()*t)}function Vg(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*IS*e)}function Xg(e,t,n){return Vc(Math.log(e),t,n)}function Yg(e,t,n){return Math.exp(Xc(e,t,n))}function zS(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Hg(n,i),pdf:s=>Vg(s,n,i),cdf:s=>Xg(s,n,i),icdf:s=>Yg(s,n,i)};return r.mean(e).stdev(t)}function BS(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=o[l]==null?1:+o[l];for(l=0;l<n;++l)a[l]/=u;return a}const s={weights(o){return arguments.length?(i=r(t=o||[]),s):t},distributions(o){return arguments.length?(o?(n=o.length,e=o):(n=0,e=[]),s.weights(t)):e},sample(){const o=an();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(o<u){a=e[l];break}return a.sample()},pdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(o);return a},cdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(o);return a},icdf(){throw Error("Mixture icdf not supported.")}};return s.distributions(e).weights(t)}function Kg(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*an()}function Jg(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Qg(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Zg(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function US(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Kg(n,i),pdf:s=>Jg(s,n,i),cdf:s=>Qg(s,n,i),icdf:s=>Zg(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function em(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function fu(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Yc(e,t,n,i){e=e.filter(p=>{let h=t(p),g=n(p);return h!=null&&(h=+h)>=h&&g!=null&&(g=+g)>=g}),i&&e.sort((p,h)=>t(p)-t(h));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)s[a]-=u,o[a]-=l;return[s,o,u,l]}function du(e,t,n,i){let r=-1,s,o;for(const a of e)s=t(a),o=n(a),s!=null&&(s=+s)>=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function Io(e,t,n,i,r){let s=0,o=0;return du(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function tm(e,t,n){let i=0,r=0,s=0,o=0,a=0;du(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=fu(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Io(e,t,n,r,l)}}function jS(e,t,n){let i=0,r=0,s=0,o=0,a=0;du(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=fu(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Io(e,t,n,r,l)}}function qS(e,t,n){const[i,r,s,o]=Yc(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,p,h;du(e,t,n,(b,v)=>{d=i[f++],p=Math.log(v),h=d*v,a+=(v*p-a)/f,u+=(h-u)/f,l+=(h*p-l)/f,c+=(d*h-c)/f});const[g,m]=fu(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:Io(e,t,n,o,y)}}function WS(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;du(e,t,n,(f,d)=>{const p=Math.log(f),h=Math.log(d);++u,i+=(p-i)/u,r+=(h-r)/u,s+=(p*h-s)/u,o+=(p*p-o)/u,a+=(d-a)/u});const l=fu(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Io(e,t,n,a,c)}}function nm(e,t,n){const[i,r,s,o]=Yc(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,p,h,g,m;for(p=0;p<a;)h=i[p],g=r[p++],m=h*h,u+=(m-u)/p,l+=(m*h-l)/p,c+=(m*m-c)/p,f+=(h*g-f)/p,d+=(m*g-d)/p;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,w=(f*y-d*l)/b,E=-v*u,S=x=>(x=x-s,v*x*x+w*x+E+o);return{coef:[E-w*s+v*s*s+o,w-2*v*s,v],predict:S,rSquared:Io(e,t,n,o,S)}}function GS(e,t,n,i){if(i===0)return em(e,t,n);if(i===1)return tm(e,t,n);if(i===2)return nm(e,t,n);const[r,s,o,a]=Yc(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,p,h,g,m;for(d=0;d<f;++d){for(h=0,g=0;h<u;++h)g+=Math.pow(r[h],d)*s[h];for(l.push(g),m=new Float64Array(f),p=0;p<f;++p){for(h=0,g=0;h<u;++h)g+=Math.pow(r[h],d+p);m[p]=g}c.push(m)}c.push(l);const y=WN(c),b=v=>{v-=o;let w=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)w+=y[d]*Math.pow(v,d);return w};return{coef:qN(f,y,-o,a),predict:b,rSquared:Io(e,t,n,a,b)}}function qN(e,t,n,i){const r=Array(e);let s,o,a,u;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function WN(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;i<t;++i){for(o=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][o])&&(o=r);for(s=i;s<t+1;++s)a=e[s][i],e[s][i]=e[s][o],e[s][o]=a;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;s<t;++s)a+=e[s][r]*n[s];n[r]=(e[t][r]-a)/e[r][r]}return n}const Fb=2,Ob=1e-12;function HS(e,t,n,i){const[r,s,o,a]=Yc(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let p=-1;++p<=Fb;){const h=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=h[0],v=h[1],w=y-r[b]>r[v]-y?b:v;let E=0,S=0,x=0,k=0,D=0;const P=1/Math.abs(r[w]-y||1);for(let ce=b;ce<=v;++ce){const T=r[ce],O=s[ce],I=GN(Math.abs(y-T)*P)*d[ce],W=T*I;E+=I,S+=W,x+=O*I,k+=O*W,D+=T*W}const[K,ee]=fu(S/E,x/E,k/E,D/E);c[m]=K+ee*y,f[m]=Math.abs(s[m]-c[m]),HN(r,m+1,h)}if(p===Fb)break;const g=pw(f);if(Math.abs(g)<Ob)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?Ob:(b=1-y*y)*b}return VN(r,c,o,a)}function GN(e){return(e=1-e*e*e)*e*e}function HN(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function VN(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o<r;++o)l=e[o]+n,u[0]===l?u[1]+=(t[o]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[o]],s.push(u));return u[1]+=i,s}const XN=.5*Math.PI/180;function Kc(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(s+g/n*a));return l.push(r(o)),l}else{c.push(r(o));for(let g=n;--g>0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const p=1/a,h=YN(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&KN(f,g,d,p,h)>XN?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function YN(e,t){let n=e,i=e;const r=t.length;for(let s=0;s<r;++s){const o=t[s][1];o<n&&(n=o),o>i&&(i=o)}return 1/(i-n)}function KN(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function JN(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function Vh(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:JN(e)}function VS(e,t,n){return n||e+(t?"_"+t:"")}const $d=()=>{},QN={init:$d,add:$d,rem:$d,idx:0},qa={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},hu=Object.keys(qa).filter(e=>e!=="__count__");function ZN(e,t){return(n,i)=>re({name:e,aggregate_param:i,out:n||e},QN,t)}[...hu,"__count__"].forEach(e=>{qa[e]=ZN(e,qa[e])});function XS(e,t,n){return qa[e](n,t)}function YS(e,t){return e.idx-t.idx}function eM(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=qa[r]())})};return e.forEach(n),Object.values(t).sort(YS)}function tM(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function nM(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function iM(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function rM(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function KS(e,t){const n=t||bt,i=eM(e),r=e.slice().sort(YS);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=tM,s.prototype.add=nM,s.prototype.rem=iM,s.prototype.set=rM,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function im(e){this._key=e?rn(e):Q,this.reset()}const at=im.prototype;at.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};at.add=function(e){this._add.push(e)};at.rem=function(e){this._rem.push(e)};at.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a<r;++a)o[n(t[a])]=1;for(a=0,u=0;a<i;++a)o[n(l=e[a])]?o[n(l)]=0:s[u++]=l;return this._rem=[],this._add=s};at.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",G(n,s)||(n[s]=1,++r);return r};at.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=Bw(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};at.argmin=function(e){return this.extent(e)[0]||{}};at.argmax=function(e){return this.extent(e)[1]||{}};at.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};at.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};at.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=Ug(this.values(),e),this._get=e),this._q};at.q1=function(e){return this.quartile(e)[0]};at.q2=function(e){return this.quartile(e)[1]};at.q3=function(e){return this.quartile(e)[2]};at.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=LS(this.values(),1e3,.05,e),this._get=e),this._ci};at.ci0=function(e){return this.ci(e)[0]};at.ci1=function(e){return this.ci(e)[1]};function lr(e){$.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}lr.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:hu},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};z(lr,$,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}s(e._prev),s(t);function o(a,u,l){const c=n[l],f=i[l++];for(const d in f){const p=a?a+"|"+d:d;u[c]=f[d],l<r?o(p,u,l):t[p]||e.cell(p,u)}}o("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=q(pt(b)),w=v.length;let E=0,S;for(;E<w;++E)i[S=v[E]]||(i[S]=1,t.push(S))}this._dims=q(e.groupby),this._dnames=this._dims.map(b=>{const v=Me(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:Vh(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,p,h,g,m,y;for(l!==o.length&&A("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=s[y],d=o[y],p=a[y]||null,f==null&&d!=="count"&&A("Null aggregate field specified."),g=Me(f),m=VS(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}h=c[g],h||(r(f),h=c[g]=[],h.field=f,this._measures.push(h)),d!=="count"&&(this._countOnly=!1),h.push(XS(d,p,m))}return this._measures=this._measures.map(b=>KS(b,b.field)),Object.create(null)},cellkey:Vh(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let s=0;s<r;++s)n.agg[s]=new i[s](n)}return n.store&&(n.data=new im),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let o=0;o<r;++o)s[n[o]]=i[o](e);return t?FS(t.tuple,s):ge(s)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,s=i.length;r<s;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,o=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&o.push(u.tuple);for(c=0,f=this._alen;c<f;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?o:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const sM=1e-14;function rm(e){$.call(this,null,e)}rm.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};z(rm,$,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,s=i.step,o=e.as||["bin0","bin1"],a=o[0],u=o[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(pt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=MS(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=dt(t(l));return c==null?null:c<r?-1/0:c>s?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(sM+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=Mt(u,pt(t),e.name||"bin_"+Me(t))}});function JS(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?Gw(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function sm(e){$.call(this,[],e)}sm.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};z(sm,$,{transform(e,t){const n=t.fork(t.ALL),i=JS(Q,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(xs(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function QS(e){we.call(this,null,oM,e)}z(QS,we);function oM(e){return this.value&&!e.modified()?this.value:Sg(e.fields,e.orders)}function om(e){$.call(this,null,e)}om.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 aM(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}z(om,$,{transform(e,t){const n=f=>d=>{for(var p=aM(a(d),e.case,s)||[],h,g=0,m=p.length;g<m;++g)o.test(h=p[g])||f(h)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,o=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=ge({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function am(e){$.call(this,null,e)}am.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};z(am,$,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=uM(a,r,s,e.filter||sn)):n.mod=a,n.source=this.value,n.modifies(i)}});function uM(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;a<o;++a)for(s[t]=l=e[a],u=0;u<o;++u)s[n]=e[u],i(s)&&(r.push(ge(s)),s={},s[t]=l);return r}const Db={kde:Gg,mixture:BS,normal:Wg,lognormal:zS,uniform:US},lM="distributions",Rb="function",cM="field";function ZS(e,t){const n=e[Rb];G(Db,n)||A("Unknown distribution function: "+n);const i=Db[n]();for(const r in e)r===cM?i.data((e.from||t()).map(e[r])):r===lM?i[r](e[r].map(s=>ZS(s,t))):typeof i[r]===Rb&&i[r](e[r]);return i}function um(e){$.call(this,null,e)}const e2=[{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}]}],fM={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:e2},{name:"weights",type:"number",array:!0}]};um.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:e2.concat(fM)},{name:"as",type:"string",array:!0,default:["value","density"]}]};z(um,$,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=ZS(e.distribution,dM(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&A("Invalid density method: "+o),!e.extent&&!i.data&&A("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||Zn(i.data()),l=Kc(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],ge(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function dM(e){return()=>e.materialize(e.SOURCE).source}function t2(e,t){return e?e.map((n,i)=>t[i]||Me(n)):null}function lm(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;o<a;++o)u=e[o],l=t.map(r),c=s[l],c||(s[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const n2="bin";function cm(e){$.call(this,null,e)}cm.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:n2}]};const hM=(e,t)=>cu(Zn(e,t))/30;z(cm,$,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=lm(t.source,e.groupby,bt),r=e.smooth||!1,s=e.field,o=e.step||hM(n,s),a=xs((h,g)=>s(h)-s(g)),u=e.as||n2,l=i.length;let c=1/0,f=-1/0,d=0,p;for(;d<l;++d){const h=i[d].sort(a);p=-1;for(const g of PS(h,o,r,s))g<c&&(c=g),g>f&&(f=g),h[++p][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function i2(e){we.call(this,null,pM,e),this.modified(!0)}z(i2,we);function pM(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Mt(n=>t(n,e),pt(t),Me(t))}function fm(e){$.call(this,[void 0,void 0],e)}fm.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};z(fm,$,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=dt(i(a));u!=null&&(u<s&&(s=u),u>o&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Me(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function dm(e,t){we.call(this,e),this.parent=t,this.count=0}z(dm,we,{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 Jc(e){$.call(this,{},e),this._keys=Mo();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}z(Jc,$,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=G(r,e)&&r[e],o,a;return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new dm(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,s=this._keys,o=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=Q(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(Q(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=Q(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(Q(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=Q(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function r2(e){we.call(this,null,gM,e)}z(r2,we);function gM(e){return this.value&&!e.modified()?this.value:F(e.name)?q(e.name).map(t=>rn(t)):rn(e.name,e.as)}function hm(e){$.call(this,Mo(),e)}hm.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};z(hm,$,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=Q(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(Q(f),1)});function c(f){const d=Q(f),p=u(f,e),h=i.get(d);p&&h?(i.delete(d),s.push(f)):!p&&!h?(i.set(d,1),o.push(f)):l&&p&&!h&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function pm(e){$.call(this,[],e)}pm.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}]};z(pm,$,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=t2(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(h=>h(a)),l=u.reduce((h,g)=>Math.max(h,g.length),0);let c=0,f,d,p;for(;c<l;++c){for(d=Pg(a),f=0;f<o;++f)d[r[f]]=(p=u[f][c])==null?null:p;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function gm(e){$.call(this,[],e)}gm.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};z(gm,$,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Me),s=e.as||["key","value"],o=s[0],a=s[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Pg(l),f[o]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function mm(e){$.call(this,null,e)}mm.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};z(mm,$,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(s,o=>o[i]=n(o,e))}});function s2(e){$.call(this,[],e)}z(s2,$,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=ge(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const Qu={value:"value",median:pw,mean:XD,min:R_,max:Ra},mM=[];function ym(e){$.call(this,[],e)}ym.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 yM(e){var t=e.method||Qu.value,n;if(Qu[t]==null)A("Unrecognized imputation method: "+t);else return t===Qu.value?(n=e.value!==void 0?e.value:0,()=>n):Qu[t]}function bM(e){const t=e.field;return n=>n?t(n):NaN}z(ym,$,{transform(e,t){var n=t.fork(t.ALL),i=yM(e),r=bM(e),s=Me(e.field),o=Me(e.key),a=(e.groupby||[]).map(Me),u=xM(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,p,h,g,m,y,b,v,w,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],h=d.values,p=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],E={_impute:!0},y=0,w=h.length;y<w;++y)E[a[y]]=h[y];E[o]=g,E[s]=Number.isNaN(p)?p=i(d,r):p,l.push(ge(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function xM(e,t,n,i){var r=y=>y(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,p,h,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],h=n(m),p=a[h]||(a[h]=o.push(h)),c=(l=t?t.map(r):mM)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[p-1]=m;return s.domain=o,s}function bm(e){lr.call(this,e)}bm.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:hu},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};z(bm,lr,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,s=>n.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{re(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function xm(e){$.call(this,null,e)}xm.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};z(xm,$,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=lm(i,e.groupby,e.field),s=(e.groupby||[]).map(Me),o=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&A("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Zn(i,e.field)),f=d=e.steps||d),r.forEach(p=>{const h=Gg(p,o)[a],g=e.counts?p.length:1,m=c||Zn(p);Kc(h,m,f,d).forEach(y=>{const b={};for(let v=0;v<s.length;++v)b[s[v]]=p.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(ge(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function o2(e){we.call(this,null,vM,e)}z(o2,we);function vM(e){return this.value&&!e.modified()?this.value:Ag(e.fields,e.flat)}function a2(e){$.call(this,[],e),this._pending=null}z(a2,$,{transform(e,t){const n=t.dataflow;return this._pending?Ad(this,t,this._pending):EM(e)?t.StopPropagation:e.values?Ad(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=q(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Ad(this,t,q(i.data)))}});function EM(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Ad(e,t,n){n.forEach(ge);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function vm(e){$.call(this,{},e)}vm.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}]};z(vm,$,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,p;return r?(d=r.length,a>1&&!c&&A('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&A('The "as" parameter has too few output field names.'),c=c||r.map(Me),f=function(h){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](h)),b==null)for(y=0;y<d;++y,++m)h[c[m]]=s;else for(y=0;y<d;++y,++m)h[c[m]]=r[y](b)}):(c||A("Missing output field names."),f=function(h){for(var g=0,m;g<a;++g)m=i.get(n[g](h)),h[c[g]]=m??s}),o?l=t.reflow(!0):(p=n.some(h=>t.modified(h.fields)),u|=p?t.MOD:0),t.visit(u,f),l.modifies(c)}});function u2(e){we.call(this,null,wM,e)}z(u2,we);function wM(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;s<n;++s)o=t[s],o[0]<i&&(i=o[0]),o[1]>r&&(r=o[1]);return[i,r]}function l2(e){we.call(this,null,SM,e)}z(l2,we);function SM(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function c2(e){$.call(this,null,e)}z(c2,$,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Em(e){lr.call(this,e)}Em.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:hu,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};z(Em,lr,{_transform:lr.prototype.transform,transform(e,t){return this._transform(kM(e,t),t)}});function kM(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=pt(n).concat(pt(i)),o=AM(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>$M(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function $M(e,t,n,i){return Mt(r=>t(r)===e?n(r):NaN,i,e+"")}function AM(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(No),t?r.slice(0,t):r}function f2(e){Jc.call(this,e)}z(f2,Jc,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(Q(s),n,t,s);return(e.modified("field")||i&&t.modified(pt(i)))&&A("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(ge(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function wm(e){$.call(this,null,e)}wm.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};z(wm,$,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=t2(e.fields,e.as||[]),s=i?(a,u)=>CM(a,u,i,r):qc;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=Q(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,ge({}));o[Q(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[Q(a)]))}),n}});function CM(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function d2(e){$.call(this,null,e)}z(d2,$,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Sm(e){$.call(this,null,e)}Sm.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const FM=1e-14;z(Sm,$,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,s=lm(r,e.groupby,e.field),o=(e.groupby||[]).map(Me),a=[],u=e.step||.01,l=e.probs||ys(u/2,1-FM,u),c=l.length;return s.forEach(f=>{const d=Bg(f,l);for(let p=0;p<c;++p){const h={};for(let g=0;g<o.length;++g)h[o[g]]=f.dims[g];h[i[0]]=l[p],h[i[1]]=d[p],a.push(ge(h))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function h2(e){$.call(this,null,e)}z(h2,$,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const s=Q(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=Pg(r);i[Q(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[Q(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function km(e){$.call(this,[],e),this.count=0}km.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};z(km,$,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[Q(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length<r?o.push(c):(d=~~((a+1)*an()),d<o.length&&d>=u&&(f=o[d],s[Q(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=Q(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[Q(c)]!==-1)),(t.rem.length||i)&&o.length<r&&t.source&&(u=a=o.length,t.visit(t.SOURCE,c=>{s[Q(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f<c;++f)s[Q(o[f])]=-1,n.rem.push(o[f]);o=o.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[Q(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[Q(c)])),this.count=a,this.value=n.source=o,n}});function $m(e){$.call(this,null,e)}$m.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"}]};z($m,$,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=ys(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,ge(s)}),n.add=t.add.concat(this.value),n}});function p2(e){$.call(this,null,e),this.modified(!0)}z(p2,$,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Am(e){$.call(this,null,e)}const g2=["unit0","unit1"];Am.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Dg,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:g2}]};z(Am,$,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?Po:Lo)(s.unit).offset,a=e.as||g2,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,p=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(pt(n)))&&(t=t.reflow(!0),p=t.SOURCE,f=1/0,d=-1/0),t.visit(p,h=>{const g=n(h);let m,y;g==null?(h[u]=null,i&&(h[l]=null)):(h[u]=m=y=s(g),i&&(h[l]=y=o(m,c)),m<f&&(f=m),y>d&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:dS({extent:e.extent||Zn(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=Rg(i),o=this.value||{},a=(n?iS:nS)(s,r);return a.unit=ue(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function m2(e){$.call(this,Mo(),e)}z(m2,$,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function y2(e){$.call(this,null,e)}z(y2,$,{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(xs(e.sort)):t.source).map(e.field))}});function OM(e,t,n,i){const r=Wa[e](t,n);return{init:r.init||Yi,update:function(s,o){o[i]=r.next(s)}}}const Wa={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=Wa.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||A("ntile num must be greater than zero.");const n=Wa.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||A("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=DM(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function DM(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const RM=Object.keys(Wa);function b2(e){const t=q(e.ops),n=q(e.fields),i=q(e.params),r=q(e.aggregate_params),s=q(e.as),o=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function p(h){q(pt(h)).forEach(g=>u[g]=1)}p(e.sort),t.forEach((h,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Me(m),w=VS(h,v,s[g]);if(p(m),o.push(w),G(Wa,h))a.push(OM(h,m,y,w));else{if(m==null&&h!=="count"&&A("Null aggregate field specified."),h==="count"){c.push(w);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(XS(h,b,w))}}),(c.length||f.length)&&(this.cell=_M(f,c,d)),this.inputs=Object.keys(u)}const x2=b2.prototype;x2.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};x2.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o<e.i0;++o)n.rem(r[o]);for(o=e.p1;o<e.i1;++o)n.add(r[o]);n.set(t)}for(o=0;o<s;++o)i[o].update(e,t)};function _M(e,t,n){e=e.map(u=>KS(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;o<r;++o)s[o]=new e[o](i);if(i.store)var a=i.data=new im;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)s[l].add(s[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)s[l].rem(s[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=s.length;l<c;++l)s[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)s[u].init()},i}function Cm(e){$.call(this,{},e),this._mlen=0,this._mods=[]}Cm.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:RM.concat(hu)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};z(Cm,$,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=xs(e.sort),r=Vh(e.groupby),s=a=>this.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new b2(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)TM(this._mods[a],o,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(o.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=JS(Q),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function TM(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,o=i.frame||[null,0],a=e.data(n),u=a.length,l=s?gg(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||xt(-1)};t.init();for(let f=0;f<u;++f)NM(c,o,f,u),s&&MM(c,l),t.update(c,a[f])}function NM(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function MM(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,o=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<o&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}const LM=Object.freeze(Object.defineProperty({__proto__:null,aggregate:lr,bin:rm,collect:sm,compare:QS,countpattern:om,cross:am,density:um,dotbin:cm,expression:i2,extent:fm,facet:Jc,field:r2,filter:hm,flatten:pm,fold:gm,formula:mm,generate:s2,impute:ym,joinaggregate:bm,kde:xm,key:o2,load:a2,lookup:vm,multiextent:u2,multivalues:l2,params:c2,pivot:Em,prefacet:f2,project:wm,proxy:d2,quantile:Sm,relay:h2,sample:km,sequence:$m,sieve:p2,subflow:dm,timeunit:Am,tupleindex:m2,values:y2,window:Cm},Symbol.toStringTag,{value:"Module"}));function or(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 PM=()=>typeof Image<"u"?Image:null;function Fm(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const IM="identity",so="linear",Fi="log",pu="pow",gu="sqrt",Qc="symlog",Zr="time",es="utc",Yn="sequential",zo="diverging",oo="quantile",Zc="quantize",ef="threshold",Om="ordinal",Xh="point",v2="band",Dm="bin-ordinal",Ve="continuous",mu="discrete",yu="discretizing",cn="interpolating",Rm="temporal";function zM(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function BM(e){return function(t){const n=e.range();let i=t[0],r=t[1],s=-1,o,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function _m(){const e=kw().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],p=i[1-d],h=Fm(f,a,u);let g=i[d-0];r=(p-g)/(h||1),o&&(r=Math.floor(r)),g+=(p-g-r*(f-a))*l,s=r*(1-a),o&&(g=Math.round(g),s=Math.round(s));const m=ys(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],p=d?n().reverse():n(),h=p.length-1;let g=+f[0],m=+f[1],y,b,v;if(!(g!==g||m!==m)&&(m<g&&(v=g,g=m,m=v),!(m<p[0]||g>i[1-d])))return y=Math.max(0,Wl(p,g)-1),b=g===m?y:Wl(p,m)-1,g-p[y]>s+1e-10&&++y,d&&(v=y,y=h-b,b=h-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return _m().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function E2(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return E2(t())},e}function UM(){return E2(_m().paddingInner(1))}var jM=Array.prototype.map;function qM(e){return jM.call(e,dt)}const WM=Array.prototype.slice;function w2(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Wl(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=qM(i),n):e.slice()},n.range=function(i){return arguments.length?(t=WM.call(i),n):t.slice()},n.tickFormat=function(i,r){return m_(e[0],ue(e),i??10,r)},n.copy=function(){return w2().domain(n.domain()).range(n.range())},n}const Kl=new Map,S2=Symbol("vega_scale");function k2(e){return e[S2]=!0,e}function _b(e){return e&&e[S2]===!0}function GM(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?zM(s):s.invertExtent?BM(s):void 0),s.type=e,k2(s)};return i.metadata=$n(q(n)),i}function he(e,t,n){return arguments.length>1?(Kl.set(e,GM(e,t,n)),this):$2(e)?Kl.get(e):void 0}he(IM,JD);he(so,g_,Ve);he(Fi,QD,[Ve,Fi]);he(pu,ZD,Ve);he(gu,eR,Ve);he(Qc,tR,Ve);he(Zr,__,[Ve,Rm]);he(es,nR,[Ve,Rm]);he(Yn,gw,[Ve,cn]);he(`${Yn}-${so}`,gw,[Ve,cn]);he(`${Yn}-${Fi}`,iR,[Ve,cn,Fi]);he(`${Yn}-${pu}`,rR,[Ve,cn]);he(`${Yn}-${gu}`,sR,[Ve,cn]);he(`${Yn}-${Qc}`,oR,[Ve,cn]);he(`${zo}-${so}`,aR,[Ve,cn]);he(`${zo}-${Fi}`,uR,[Ve,cn,Fi]);he(`${zo}-${pu}`,lR,[Ve,cn]);he(`${zo}-${gu}`,cR,[Ve,cn]);he(`${zo}-${Qc}`,fR,[Ve,cn]);he(oo,dR,[yu,oo]);he(Zc,hR,yu);he(ef,pR,yu);he(Dm,w2,[mu,yu]);he(Om,kw,mu);he(v2,_m,mu);he(Xh,UM,mu);function $2(e){return Kl.has(e)}function Es(e,t){const n=Kl.get(e);return n&&n.metadata[t]}function Tm(e){return Es(e,Ve)}function ao(e){return Es(e,mu)}function Yh(e){return Es(e,yu)}function A2(e){return Es(e,Fi)}function HM(e){return Es(e,Rm)}function C2(e){return Es(e,cn)}function F2(e){return Es(e,oo)}const VM=["clamp","base","constant","exponent"];function O2(e,t){const n=t[0],i=ue(t)-n;return function(r){return e(n+r*i)}}function tf(e,t,n){return KD(Nm(t||"rgb",n),e)}function D2(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function R2(e,t,n){const i=n-t;let r,s,o;return!i||!Number.isFinite(i)?xt(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),o=he(s)().domain([t,n]).range([0,1]),VM.forEach(a=>e[a]?o[a](e[a]()):0),o)}function Nm(e,t){const n=YD[XM(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function XM(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const YM={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:"0d088723069033
2059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",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"},KM={accent:kR,category10:SR,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:wR,observable10:ER,paired:vR,pastel1:xR,pastel2:bR,set1:yR,set2:mR,set3:gR,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function _2(e){if(F(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function T2(e,t){for(const n in e)Mm(n,t(e[n]))}const Tb={};T2(KM,_2);T2(YM,e=>tf(_2(e)));function Mm(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Tb[e]=t,this):Tb[e]}const $l="symbol",JM="discrete",QM="gradient",ZM=e=>F(e)?e.map(t=>String(t)):String(e),eL=(e,t)=>e[1]-t[1],tL=(e,t)=>t[1]-e[1];function Lm(e,t,n){let i;return de(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(cu(e.domain())/n||1)+1))),U(t)&&(i=t.step,t=t.interval),j(t)&&(t=e.type===Zr?Lo(t):e.type==es?Po(t):A("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function N2(e,t,n){let i=e.range(),r=i[0],s=ue(i),o=eL;if(r>s&&(i=s,s=r,r=i,o=tL),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],ue(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Pm(e,t){return e.bins?N2(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function M2(e,t,n,i,r,s){const o=t.type;let a=ZM;if(o===Zr||r===Zr)a=e.timeFormat(i);else if(o===es||r===es)a=e.utcFormat(i);else if(A2(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=L2(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function L2(e,t,n){const i=Pm(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r<r-.5&&(l*=r),l<=o};return n?i.filter(a):a}const Kh={[oo]:"quantiles",[Zc]:"thresholds",[ef]:"domain"},P2={[oo]:"quantiles",[Zc]:"domain"};function I2(e,t){return e.bins?rL(e.bins):e.type===Fi?L2(e,t,!0):Kh[e.type]?iL(e[Kh[e.type]]()):Pm(e,t)}function nL(e,t,n){const i=t[P2[t.type]](),r=i.length;let s=r>1?i[1]-i[0]:i[0],o;for(o=1;o<r;++o)s=Math.min(s,i[o]-i[o-1]);return e.formatSpan(0,s,30,n)}function iL(e){const t=[-1/0].concat(e);return t.max=1/0,t}function rL(e){const t=e.slice(0,-1);return t.max=ue(e),t}const sL=e=>Kh[e.type]||e.bins;function z2(e,t,n,i,r,s,o){const a=P2[t.type]&&s!==Zr&&s!==es?nL(e,t,r):M2(e,t,n,r,s,o);return i===$l&&sL(t)?oL(a):i===JM?aL(a):uL(a)}const oL=e=>(t,n,i)=>{const r=Nb(i[n+1],Nb(i.max,1/0)),s=Mb(t,e),o=Mb(r,e);return s&&o?s+" â "+o:o?"< "+o:"⥠"+s},Nb=(e,t)=>
vendor: 33,587 bytes, line 2
2e??t,aL=e=>(t,n)=>n?e(t):null,uL=e=>t=>e(t),Mb=(e,t)=>Number.isFinite(e)?t(e):null;function lL(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+ue(t),s=r-i;if(e.type===ef){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function cL(e,t,n,i){const r=i||t.type;return j(n)&&HM(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Zr?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===es?e.utcFormat("%A, %d %B %Y, %X UTC"):z2(e,t,5,null,n,i,!0)}function B2(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=cL(e,t,n.format,n.formatType);if(Yh(t.type)){const s=I2(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(ao(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(ue(s))}`}}let U2=0;function fL(){U2=0}const Jl="p_";function Im(e){return e&&e.gradient}function j2(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Jl:"";return r||(r=e.id="gradient_"+U2++,i==="radial"?(e.x1=Un(e.x1,.5),e.y1=Un(e.y1,.5),e.r1=Un(e.r1,0),e.x2=Un(e.x2,.5),e.y2=Un(e.y2,.5),e.r2=Un(e.r2,.5),s=Jl):(e.x1=Un(e.x1,0),e.y1=Un(e.y1,0),e.x2=Un(e.x2,1),e.y2=Un(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Un(e,t){return e??t}function q2(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const Lb={basis:{curve:iT},"basis-closed":{curve:nT},"basis-open":{curve:tT},bundle:{curve:eT,tension:"beta",value:.85},cardinal:{curve:Z_,tension:"tension",value:0},"cardinal-open":{curve:Q_,tension:"tension",value:0},"cardinal-closed":{curve:J_,tension:"tension",value:0},"catmull-rom":{curve:K_,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Y_,tension:"alpha",value:.5},"catmull-rom-open":{curve:X_,tension:"alpha",value:.5},linear:{curve:V_},"linear-closed":{curve:H_},monotone:{horizontal:G_,vertical:W_},natural:{curve:q_},step:{curve:j_},"step-after":{curve:U_},"step-before":{curve:B_}};function zm(e,t,n){var i=G(Lb,e)&&Lb[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const dL={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},hL=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,pL=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,gL=/^((\s+,?\s*)|(,\s*))/,mL=/^[01]/;function uo(e){const t=[];return(e.match(hL)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=dL[s],a=yL(s,o,i.slice(1).trim()),u=a.length;if(u<o||u&&u%o!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,o)]),u!==o){s==="m"&&(r=r==="M"?"L":"l");for(let l=o;l<u;l+=o)t.push([r,...a.slice(l,l+o)])}}),t}function yL(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const o=e==="a"&&(s===3||s===4)?mL:pL,a=n.slice(r).match(o);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(gL);u!==null&&(r+=u[0].length)}return i}const cr=Math.PI/180,bL=1e-14,jr=Math.PI/2,Vn=Math.PI*2,Ms=Math.sqrt(3)/2;var Cd={},Fd={},W2=[].join;function xL(e,t,n,i,r,s,o,a,u){const l=W2.call(arguments);if(Cd[l])return Cd[l];const c=o*cr,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const p=d*(a-e)*.5+f*(u-t)*.5,h=d*(u-t)*.5-f*(a-e)*.5;let g=p*p/(n*n)+h*h/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,w=m*a+y*u,E=b*a+v*u,S=m*e+y*t,x=b*e+v*t;let D=1/((S-w)*(S-w)+(x-E)*(x-E))-.25;D<0&&(D=0);let P=Math.sqrt(D);s==r&&(P=-P);const K=.5*(w+S)-P*(x-E),ee=.5*(E+x)+P*(S-w),ce=Math.atan2(E-ee,w-K);let O=Math.atan2(x-ee,S-K)-ce;O<0&&s===1?O+=Vn:O>0&&s===0&&(O-=Vn);const I=Math.ceil(Math.abs(O/(jr+.001))),W=[];for(let V=0;V<I;++V){const H=ce+V*O/I,Z=ce+(V+1)*O/I;W[V]=[K,ee,H,Z,n,i,f,d]}return Cd[l]=W}function vL(e){const t=W2.call(e);if(Fd[t])return Fd[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],l=e[7];const c=l*o,f=-u*a,d=u*o,p=l*a,h=Math.cos(r),g=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),v=Math.sin(b*.5),w=8/3*v*v/Math.sin(b),E=n+h-w*g,S=i+g+w*h,x=n+m,k=i+y,D=x+w*y,P=k-w*m;return Fd[t]=[c*E+f*S,d*E+p*S,c*D+f*P,d*D+p*P,c*x+f*k,d*x+p*k]}const Kt=["l",0,0,0,0,0,0,0];function EL(e,t,n){const i=Kt[0]=e[0];if(i==="a"||i==="A")Kt[1]=t*e[1],Kt[2]=n*e[2],Kt[3]=e[3],Kt[4]=e[4],Kt[5]=e[5],Kt[6]=t*e[6],Kt[7]=n*e[7];else if(i==="h"||i==="H")Kt[1]=t*e[1];else if(i==="v"||i==="V")Kt[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)Kt[r]=(r%2==1?t:n)*e[r];return Kt}function Ga(e,t,n,i,r,s){var o,a=null,u=0,l=0,c=0,f=0,d,p,h,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),s==null&&(s=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(o=t[b],(r!==1||s!==1)&&(o=EL(o,r,s)),o[0]){case"l":u+=o[1],l+=o[2],e.lineTo(u+n,l+i);break;case"L":u=o[1],l=o[2],e.lineTo(u+n,l+i);break;case"h":u+=o[1],e.lineTo(u+n,l+i);break;case"H":u=o[1],e.lineTo(u+n,l+i);break;case"v":l+=o[1],e.lineTo(u+n,l+i);break;case"V":l=o[1],e.lineTo(u+n,l+i);break;case"m":u+=o[1],l+=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=o[1],l=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+o[5],p=l+o[6],c=u+o[3],f=l+o[4],e.bezierCurveTo(u+o[1]+n,l+o[2]+i,c+n,f+i,d+n,p+i),u=d,l=p;break;case"C":u=o[5],l=o[6],c=o[3],f=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+o[3],p=l+o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+o[1]+n,l+o[2]+i,d+n,p+i),c=u+o[1],f=l+o[2],u=d,l=p;break;case"S":d=o[3],p=o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,o[1]+n,o[2]+i,d+n,p+i),u=d,l=p,c=o[1],f=o[2];break;case"q":d=u+o[3],p=l+o[4],c=u+o[1],f=l+o[2],e.quadraticCurveTo(c+n,f+i,d+n,p+i),u=d,l=p;break;case"Q":d=o[3],p=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,d+n,p+i),u=d,l=p,c=o[1],f=o[2];break;case"t":d=u+o[1],p=l+o[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-h,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),h=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,p+i),u=d,l=p,c=u+o[1],f=l+o[2];break;case"T":d=o[1],p=o[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,p+i),u=d,l=p;break;case"a":Pb(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+u+n,o[7]+l+i]),u+=o[6],l+=o[7];break;case"A":Pb(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),u=o[6],l=o[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=o}}function Pb(e,t,n,i){const r=xL(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let s=0;s<r.length;++s){const o=vL(r[s]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}const Ib=.5773502691896257,zb={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Vn)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ms*n,r=i-n*Ib,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ms*n,r=i-n*Ib;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ms*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ms*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ms*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ms*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function G2(e){return G(zb,e)?zb[e]:wL(e)}var Od={};function wL(e){if(!G(Od,e)){const t=uo(e);Od[e]={draw:function(n,i){Ga(n,t,0,0,Math.sqrt(i)/2)}}}return Od[e]}const Ui=.448084975506;function SL(e){return e.x}function kL(e){return e.y}function $L(e){return e.width}function AL(e){return e.height}function gi(e){return typeof e=="function"?e:()=>+e}function Zu(e,t,n){return Math.max(t,Math.min(e,n))}function H2(){var e=SL,t=kL,n=$L,i=AL,r=gi(0),s=r,o=r,a=r,u=null;function l(c,f,d){var p,h=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Zu(+r.call(this,c),0,b),w=Zu(+s.call(this,c),0,b),E=Zu(+o.call(this,c),0,b),S=Zu(+a.call(this,c),0,b);if(u||(u=p=mg()),v<=0&&w<=0&&E<=0&&S<=0)u.rect(h,g,m,y);else{var x=h+m,k=g+y;u.moveTo(h+v,g),u.lineTo(x-w,g),u.bezierCurveTo(x-Ui*w,g,x,g+Ui*w,x,g+w),u.lineTo(x,k-S),u.bezierCurveTo(x,k-Ui*S,x-Ui*S,k,x-S,k),u.lineTo(h+E,k),u.bezierCurveTo(h+Ui*E,k,h,k-Ui*E,h,k-E),u.lineTo(h,g+v),u.bezierCurveTo(h,g+Ui*v,h+Ui*v,g,h+v,g),u.closePath()}if(p)return u=null,p+""||null}return l.x=function(c){return arguments.length?(e=gi(c),l):e},l.y=function(c){return arguments.length?(t=gi(c),l):t},l.width=function(c){return arguments.length?(n=gi(c),l):n},l.height=function(c){return arguments.length?(i=gi(c),l):i},l.cornerRadius=function(c,f,d,p){return arguments.length?(r=gi(c),s=f!=null?gi(f):r,a=d!=null?gi(d):r,o=p!=null?gi(p):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function V2(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,p){const h=p/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,w=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*h,d-m*h),r.arc(f,d,h,w-Math.PI,w),r.lineTo(o+b,a+v),r.arc(o,a,u,w,w+Math.PI)}else r.arc(f,d,h,0,Vn);r.closePath()}else s=1;o=f,a=d,u=h}function c(f){var d,p=f.length,h,g=!1,m;for(r==null&&(r=m=mg()),d=0;d<=p;++d)!(d<p&&i(h=f[d],d,f))===g&&(g=!g)&&(s=0),g&&l(+e(h,d,f),+t(h,d,f),+n(h,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function bu(e,t){return e??t}const xu=e=>e.x||0,vu=e=>e.y||0,CL=e=>e.width||0,FL=e=>e.height||0,OL=e=>(e.x||0)+(e.width||0),DL=e=>(e.y||0)+(e.height||0),RL=e=>e.startAngle||0,_L=e=>e.endAngle||0,TL=e=>e.padAngle||0,NL=e=>e.innerRadius||0,ML=e=>e.outerRadius||0,LL=e=>e.cornerRadius||0,PL=e=>bu(e.cornerRadiusTopLeft,e.cornerRadius)||0,IL=e=>bu(e.cornerRadiusTopRight,e.cornerRadius)||0,zL=e=>bu(e.cornerRadiusBottomRight,e.cornerRadius)||0,BL=e=>bu(e.cornerRadiusBottomLeft,e.cornerRadius)||0,UL=e=>bu(e.size,64),jL=e=>e.size||1,nf=e=>e.defined!==!1,qL=e=>G2(e.shape||"circle"),WL=oT().startAngle(RL).endAngle(_L).padAngle(TL).innerRadius(NL).outerRadius(ML).cornerRadius(LL),GL=mw().x(xu).y1(vu).y0(DL).defined(nf),HL=mw().y(vu).x1(xu).x0(OL).defined(nf),VL=rT().x(xu).y(vu).defined(nf),XL=H2().x(xu).y(vu).width(CL).height(FL).cornerRadius(PL,IL,zL,BL),YL=$R().type(qL).size(UL),KL=V2().x(xu).y(vu).defined(nf).size(jL);function Bm(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function JL(e,t){return WL.context(e)(t)}function QL(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?HL:GL).curve(zm(i,n.orient,n.tension)).context(e)(t)}function ZL(e,t){const n=t[0],i=n.interpolate||"linear";return VL.curve(zm(i,n.orient,n.tension)).context(e)(t)}function Bo(e,t,n,i){return XL.context(e)(t,n,i)}function e5(e,t){return(t.mark.shape||t.shape).context(e)(t)}function t5(e,t){return YL.context(e)(t)}function n5(e,t){return KL.context(e)(t)}var X2=1;function i5(){X2=1}function Um(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+X2++),o=r.clipping[s]||(r.clipping[s]={id:s});return ie(i)?o.path=i(null):Bm(n)?o.path=Bo(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function Ue(e){this.clear(),e&&this.union(e)}Ue.prototype={clone(){return new Ue(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function rf(e){this.mark=e,this.bounds=this.bounds||new Ue}function sf(e){rf.call(this,e),this.items=this.items||[]}z(sf,rf);class Y2{constructor(t){this._pending=0,this._loader=t||Bc()}pending(){return this._pending}sanitizeURL(t){const n=this;return Bb(n),n._loader.sanitize(t,{context:"href"}).then(i=>(ia(n),i)).catch(()=>(ia(n),null))}loadImage(t){const n=this,i=PM();return Bb(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=G(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>ia(n),o.onerror=()=>ia(n),o.src=s,o}).catch(r=>(ia(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function Bb(e){e._pending+=1}function ia(e){e._pending-=1}function _i(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?r5(t,i):0))}return e}function r5(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const s5=Vn-1e-8;let of,Al,Cl,Gr,Jh,Fl,Qh,Zh;const Ki=(e,t)=>of.add(e,t),Ol=(e,t)=>Ki(Al=e,Cl=t),Ub=e=>Ki(e,of.y1),jb=e=>Ki(of.x1,e),qr=(e,t)=>Jh*e+Qh*t,Wr=(e,t)=>Fl*e+Zh*t,Dd=(e,t)=>Ki(qr(e,t),Wr(e,t)),Rd=(e,t)=>Ol(qr(e,t),Wr(e,t));function Eu(e,t){return of=e,t?(Gr=t*cr,Jh=Zh=Math.cos(Gr),Fl=Math.sin(Gr),Qh=-Fl):(Jh=Zh=1,Gr=Fl=Qh=0),o5}const o5={beginPath(){},closePath(){},moveTo:Rd,lineTo:Rd,rect(e,t,n,i){Gr?(Dd(e+n,t),Dd(e+n,t+i),Dd(e,t+i),Rd(e,t)):(Ki(e+n,t+i),Ol(e,t))},quadraticCurveTo(e,t,n,i){const r=qr(e,t),s=Wr(e,t),o=qr(n,i),a=Wr(n,i);qb(Al,r,o,Ub),qb(Cl,s,a,jb),Ol(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=qr(e,t),a=Wr(e,t),u=qr(n,i),l=Wr(n,i),c=qr(r,s),f=Wr(r,s);Wb(Al,o,u,c,Ub),Wb(Cl,a,l,f,jb),Ol(c,f)},arc(e,t,n,i,r,s){if(i+=Gr,r+=Gr,Al=n*Math.cos(r)+e,Cl=n*Math.sin(r)+t,Math.abs(r-i)>s5)Ki(e-n,t-n),Ki(e+n,t+n);else{const o=l=>Ki(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%Vn,i<0&&(i+=Vn),r=r%Vn,r<0&&(r+=Vn),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=Vn,a=i-i%jr,u=0;u<4&&a>r;++u,a-=jr)o(a);else for(a=i-i%jr+jr,u=0;u<4&&a<r;++u,a=a+jr)o(a)}}};function qb(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function Wb(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(s)>bL?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0<u&&u<1&&r(Gb(u,e,t,n,i)),0<l&&l<1&&r(Gb(l,e,t,n,i))}function Gb(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var ar=(ar=or(1,1))?ar.getContext("2d"):null;const ep=new Ue;function jm(e){return function(t,n){if(!ar)return!0;e(ar,t),ep.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=ep;for(let a=r;a<=o;++a)for(let u=i;u<=s;++u)if(ar.isPointInPath(u,a))return!0;return!1}}function qm(e,t){return t.contains(e.x||0,e.y||0)}function K2(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(ep.set(n,i,n+r,i+s))}function J2(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,s=e.y2!=null?e.y2:i;return Hs(t,n,i,r,s)}function Hs(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,p,h,g,m;for(m=0;m<4;++m){if(m===0&&(p=-l,h=-(s-t)),m===1&&(p=l,h=a-t),m===2&&(p=-c,h=-(o-n)),m===3&&(p=c,h=u-n),Math.abs(p)<1e-10&&h<0)return!1;if(g=h/p,p<0){if(g>d)return!1;g>f&&(f=g)}else if(p>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function lo(e,t){e.globalCompositeOperation=t.blend||"source-over"}function pn(e,t){return e??t}function Hb(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function a5(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+pn(t.x1,.5)*i,n.y1+pn(t.y1,.5)*r,Math.max(i,r)*pn(t.r1,0),n.x1+pn(t.x2,.5)*i,n.y1+pn(t.y2,.5)*r,Math.max(i,r)*pn(t.r2,.5));else{const o=pn(t.x1,0),a=pn(t.y1,0),u=pn(t.x2,1),l=pn(t.y2,0);if(o===u||a===l||i===r)s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=or(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=Hb(f.createLinearGradient(o,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return Hb(s,t.stops)}function Q2(e,t,n){return Im(n)?a5(e,n,t.bounds):n}function Ql(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=Q2(e,t,t.fill),!0):!1}var u5=[];function co(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=Q2(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||u5),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function l5(e,t){return e.zindex-t.zindex||e.index-t.index}function Wm(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r<s;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(l5)}function Cn(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=Wm(e);if(s&&s.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=s}for(i=0,r=n.length;i<r;++i)t(n[i])}function Zl(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=Wm(e);for(s&&s.length&&(n=s),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Gm(e){return function(t,n,i){Cn(n,r=>{(!i||i.intersects(r.bounds))&&Z2(e,t,r,r)})}}function c5(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&Z2(e,t,n.items[0],n.items)}}function Z2(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(lo(t,n),n.fill&&Ql(t,n,r)&&t.fill(),n.stroke&&co(t,n,r)&&t.stroke()))}function af(e){return e=e||sn,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,Zl(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function wu(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function Hm(e){return af(wu(e))}function Hr(e,t){return"translate("+e+","+t+")"}function Vm(e){return"rotate("+e+")"}function f5(e,t){return"scale("+e+","+t+")"}function ek(e){return Hr(e.x||0,e.y||0)}function d5(e){return Hr(e.x||0,e.y||0)+(e.angle?" "+Vm(e.angle):"")}function h5(e){return Hr(e.x||0,e.y||0)+(e.angle?" "+Vm(e.angle):"")+(e.scaleX||e.scaleY?" "+f5(e.scaleX||1,e.scaleY||1):"")}function Xm(e,t,n){function i(o,a){o("transform",d5(a)),o("d",t(null,a))}function r(o,a){return t(Eu(o,a.angle),a),_i(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=cr),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Gm(s),pick:Hm(s),isect:n||jm(s)}}var p5=Xm("arc",JL);function g5(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<s&&(s=a,o=e[r]));return o}function m5(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,s,o;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o<n))return e[i];return null}function y5(e,t){for(var n=e.length,i,r,s;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s<i*i))return e[n];return null}function Ym(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Eu(u),c),_i(u,c[0]))}function s(u,l){u.beginPath(),t(u,l)}const o=wu(s);function a(u,l,c,f,d,p){var h=l.items,g=l.bounds;return!h||!h.length||g&&!g.contains(d,p)?null:(c*=u.pixelRatio,f*=u.pixelRatio,o(u,h,c,f)?h[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:c5(s),pick:a,isect:qm,tip:n}}var b5=Ym("area",QL,g5);function x5(e,t){var n=t.clip;e.save(),ie(n)?(e.beginPath(),n(e),e.clip()):tk(e,t.group)}function tk(e,t){e.beginPath(),Bm(t)?Bo(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function nk(e){const t=pn(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function v5(e,t){e("transform",ek(t))}function ik(e,t){const n=nk(t);e("d",Bo(null,t,n,n))}function E5(e,t){e("class","background"),e("aria-hidden",!0),ik(e,t)}function w5(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?ik(e,t):e("d","")}function S5(e,t,n){const i=t.clip?Um(n,t,t):null;e("clip-path",i)}function k5(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),_i(e,t),e.translate(t.x||0,t.y||0)}function Ha(e,t,n,i){const r=nk(t);e.beginPath(),Bo(e,t,(n||0)+r,(i||0)+r)}const $5=wu(Ha),A5=wu(Ha,!1),C5=wu(Ha,!0);function F5(e,t,n,i){Cn(t,r=>{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(Ha(e,r,s,o),lo(e,r),r.fill&&Ql(e,r,u)&&e.fill(),r.stroke&&!a&&co(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&tk(e,r),n&&n.translate(-s,-o),Cn(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(Ha(e,r,s,o),lo(e,r),co(e,r,u)&&e.stroke())})}function O5(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return Zl(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const p=c+(u.width||0),h=f+(u.height||0),g=u.clip;if(g&&(r<c||r>p||s<f||s>h))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Bm(u)&&!C5(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&A5(e,u,o,a)?(e.restore(),u):(l=Zl(u,b=>D5(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&$5(e,u,o,a)&&(l=u),e.restore(),l||null)})}function D5(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var R5={type:"group",tag:"g",nested:!1,attr:v5,bound:k5,draw:F5,pick:O5,isect:K2,content:S5,background:E5,foreground:w5},Va={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Km(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function Jm(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 Qm(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 uf(e,t){return e==="center"?t/2:e==="right"?t:0}function lf(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function _5(e,t,n){const i=Km(t,n),r=Jm(t,i),s=Qm(t,i),o=(t.x||0)-uf(t.align,r),a=(t.y||0)-lf(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Va["xmlns:xlink"],"xlink:href"),e("transform",Hr(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function T5(e,t){const n=t.image,i=Jm(t,n),r=Qm(t,n),s=(t.x||0)-uf(t.align,i),o=(t.y||0)-lf(t.baseline,r);return e.set(s,o,s+i,o+r)}function N5(e,t,n){Cn(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=Km(i,this);let s=Jm(i,r),o=Qm(i,r);if(s===0||o===0)return;let a=(i.x||0)-uf(i.align,s),u=(i.y||0)-lf(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=s/c,u+=(o-d)/2,o=d):(d=o*c,a+=(s-d)/2,s=d))),(r.complete||r.toDataURL)&&(lo(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,s,o))})}var M5={type:"image",tag:"image",nested:!1,attr:_5,bound:T5,draw:N5,pick:af(),isect:sn,get:Km,xOffset:uf,yOffset:lf},L5=Ym("line",ZL,m5);function P5(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",h5(t)),e("d",t.path)}function Dl(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*cr,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=uo(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),Ga(e,u,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):Ga(e,u,i,r,s,o)}function I5(e,t){return Dl(Eu(e,t.angle),t)?e.set(0,0,0,0):_i(e,t,!0)}var z5={type:"path",tag:"path",nested:!1,attr:P5,bound:I5,draw:Gm(Dl),pick:Hm(Dl),isect:jm(Dl)};function B5(e,t){e("d",Bo(null,t))}function U5(e,t){var n,i;return _i(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function Vb(e,t){e.beginPath(),Bo(e,t)}var j5={type:"rect",tag:"path",nested:!1,attr:B5,bound:U5,draw:Gm(Vb),pick:Hm(Vb),isect:K2};function q5(e,t){e("transform",ek(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function W5(e,t){var n,i;return _i(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function rk(e,t,n){var i,r,s,o;return t.stroke&&co(e,t,n)?(i=t.x||0,r=t.y||0,s=t.x2!=null?t.x2:i,o=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0):!1}function G5(e,t,n){Cn(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&rk(e,i,r)&&(lo(e,i),e.stroke())}})}function H5(e,t,n,i){return e.isPointInStroke?rk(e,t,1)&&e.isPointInStroke(n,i):!1}var V5={type:"rule",tag:"line",nested:!1,attr:q5,bound:W5,draw:G5,pick:af(H5),isect:J2},X5=Xm("shape",e5),Y5=Xm("symbol",t5,qm);const Xb=Ww();var jt={height:oi,measureWidth:Zm,estimateWidth:ec,width:ec,canvas:sk};sk(!0);function sk(e){jt.width=e&&ar?Zm:ec}function ec(e,t){return ok(dr(e,t),oi(e))}function ok(e,t){return~~(.8*e.length*t)}function Zm(e,t){return oi(e)<=0||!(t=dr(e,t))?0:ak(t,cf(e))}function ak(e,t){const n=`(${t}) ${e}`;let i=Xb.get(n);return i===void 0&&(ar.font=t,i=ar.measureText(e).width,Xb.set(n,i)),i}function oi(e){return e.fontSize!=null?+e.fontSize||0:11}function fr(e){return e.lineHeight!=null?e.lineHeight:oi(e)+2}function K5(e){return F(e)?e.length>1?e:e[0]:e}function Su(e){return K5(e.lineBreak&&e.text&&!F(e.text)?e.text.split(e.lineBreak):e.text)}function e0(e){const t=Su(e);return(F(t)?t.length-1:0)*fr(e)}function dr(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?Q5(e,n):n}function J5(e){if(jt.width===Zm){const t=cf(e);return n=>ak(n,t)}else if(jt.width===ec){const t=oi(e);return n=>ok(n,t)}else return t=>jt.width(e,t)}function Q5(e,t){var n=+e.limit,i=J5(e);if(i(t)<n)return t;var r=e.ellipsis||"â¦",s=e.dir==="rtl",o=0,a=t.length,u;if(n-=i(r),s){for(;o<a;)u=o+a>>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o<a;)u=1+(o+a>>>1),i(t.slice(0,u))<n?o=u:a=u-1;return t.slice(0,o)+r}}function ku(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function cf(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+oi(e)+"px "+ku(e,t)}function t0(e){var t=e.baseline,n=oi(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*fr(e):t==="line-bottom"?.29*n-.5*fr(e):0)}const Z5={left:"start",center:"middle",right:"end"},_a=new Ue;function ff(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-jr,t+=i*Math.cos(r),n+=i*Math.sin(r)),_a.x1=t,_a.y1=n,_a}function e3(e,t){var n=t.dx||0,i=(t.dy||0)+t0(t),r=ff(t),s=r.x1,o=r.y1,a=t.angle||0,u;e("text-anchor",Z5[t.align]||"start"),a?(u=Hr(s,o)+" "+Vm(a),(n||i)&&(u+=" "+Hr(n,i))):u=Hr(s+n,o+i),e("transform",u)}function n0(e,t,n){var i=jt.height(t),r=t.align,s=ff(t),o=s.x1,a=s.y1,u=t.dx||0,l=(t.dy||0)+t0(t)-Math.round(.8*i),c=Su(t),f;if(F(c)?(i+=fr(t)*(c.length-1),f=c.reduce((d,p)=>Math.max(d,jt.width(t,p)),0)):f=jt.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*cr,o,a);else if(n===2)return e.rotatedPoints(t.angle*cr,o,a);return e}function t3(e,t,n){Cn(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=cf(i),e.textAlign=i.align||"left",s=ff(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*cr),o=a=0),o+=i.dx||0,a+=(i.dy||0)+t0(i),c=Su(i),lo(e,i),F(c))for(l=fr(i),u=0;u<c.length;++u)f=dr(i,c[u]),i.fill&&Ql(e,i,r)&&e.fillText(f,o,a),i.stroke&&co(e,i,r)&&e.strokeText(f,o,a),a+=l;else f=dr(i,c),i.fill&&Ql(e,i,r)&&e.fillText(f,o,a),i.stroke&&co(e,i,r)&&e.strokeText(f,o,a);i.angle&&e.restore()}})}function n3(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=ff(t),a=o.x1,u=o.y1,l=n0(_a,t,1),c=-t.angle*cr,f=Math.cos(c),d=Math.sin(c),p=f*r-d*s+(a-f*a+d*u),h=d*r+f*s+(u-d*a-f*u);return l.contains(p,h)}function i3(e,t){const n=n0(_a,e,2);return Hs(t,n[0],n[1],n[2],n[3])||Hs(t,n[0],n[1],n[4],n[5])||Hs(t,n[4],n[5],n[6],n[7])||Hs(t,n[2],n[3],n[6],n[7])}var r3={type:"text",tag:"text",nested:!1,attr:e3,bound:n0,draw:t3,pick:af(n3),isect:i3},s3=Ym("trail",n5,y5),Xt={arc:p5,area:b5,group:R5,image:M5,line:L5,path:z5,rect:j5,rule:V5,shape:X5,symbol:Y5,text:r3,trail:s3};function tp(e,t,n){var i=Xt[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new Ue),e,n)}var Yb={mark:null};function uk(e,t,n){var i=Xt[e.marktype],r=i.bound,s=e.items,o=s&&s.length,a,u,l,c;if(i.nested)return o?l=s[0]:(Yb.mark=e,l=Yb),c=tp(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new Ue,o)for(a=0,u=s.length;a<u;++a)t.union(tp(s[a],r,n));return e.bounds=t}const o3=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function lk(e,t){return JSON.stringify(e,o3,t)}function ck(e){const t=typeof e=="string"?JSON.parse(e):e;return fk(t)}function fk(e){var t=e.marktype,n=e.items,i,r,s;if(n)for(r=0,s=n.length;r<s;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&fk(n[r]);return t&&uk(e),e}class dk{constructor(t){arguments.length?this.root=ck(t):(this.root=Kb({marktype:"group",name:"root",role:"frame"}),this.root.items=[new sf(this.root)])}toJSON(t){return lk(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=Kb(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function Kb(e,t){const n={bounds:new Ue,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function Ji(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function i0(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function qe(e,t,n,i){var r=e.childNodes[t],s;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(s=r||null,r=Ji(e.ownerDocument,n,i),e.
2insertBefore(r,s)),r}function Qt(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function hk(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function df(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function a3(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=Xt[r.marktype]).tip){for(o=df(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let r0=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||Bc(),this._tooltip=n||u3}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=Ji(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=a3(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function u3(e,t,n,i){e.element().setAttribute("title",i||"")}class $u{constructor(t){this._el=null,this._bgcolor=null,this._loader=new Y2(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const l3="keydown",c3="keypress",f3="keyup",pk="dragenter",Rl="dragleave",gk="dragover",np="pointerdown",d3="pointerup",tc="pointermove",_l="pointerout",mk="pointerover",ip="mousedown",h3="mouseup",yk="mousemove",nc="mouseout",bk="mouseover",ic="click",p3="dblclick",g3="wheel",xk="mousewheel",rc="touchstart",sc="touchmove",oc="touchend",m3=[l3,c3,f3,pk,Rl,gk,np,d3,tc,_l,mk,ip,h3,yk,nc,bk,ic,p3,g3,xk,rc,sc,oc],rp=tc,Ta=nc,sp=ic;class Au extends r0{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=m3,this.pointermove=Qb([tc,yk],[mk,bk],[_l,nc]),this.dragover=Qb([gk],[pk],[Rl]),this.pointerout=Zb([_l,nc]),this.dragleave=Zb([Rl])}initialize(t,n,i){return this._canvas=t&&i0(t,"canvas"),[ic,ip,np,tc,_l,Rl].forEach(r=>Jb(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(xk,t)}pointerdown(t){this._down=this._active,this.fire(np,t)}mousedown(t){this._down=this._active,this.fire(ip,t)}click(t){this._down===this._active&&(this.fire(ic,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(rc,t,!0)}touchmove(t){this.fire(sc,t,!0)}touchend(t){this.fire(oc,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===sp&&r&&r.href?this.handleHref(n,r,r.href):(t===rp||t===Ta)&&this.handleTooltip(n,r,t!==Ta),s)for(let o=0,a=s.length;o<a;++o)s[o].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(Jb(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&r.splice(s,1),this}pickEvent(t){const n=df(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return Xt[t.marktype].pick.call(this,o,t,n,i,r,s)}}const y3=e=>e===rc||e===sc||e===oc?[rc,sc,oc]:[e];function Jb(e,t){y3(t).forEach(n=>b3(e,n))}function b3(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function $a(e,t,n){t.forEach(i=>
2e.fire(i,n))}function Qb(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?$a(this,e,i):((!r||!r.exit)&&$a(this,n,i),this._active=s,$a(this,t,i),$a(this,e,i))}}function Zb(e){return function(t){$a(this,e,t),this._active=null}}function x3(){return typeof window<"u"&&window.devicePixelRatio||1}function v3(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?x3():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class ac extends $u{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new Ue,this._tempb=new Ue}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:or(1,1,this._options.type),t&&this._canvas&&(Qt(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)v3(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||A("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=E3(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):w3(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=Xt[n.marktype];n.clip&&x5(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const E3=(e,t,n)=>new Ue().set(0,0,t,n).translate(-e[0],-e[1]);
2function w3(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class vk extends r0{constructor(t,n){super(t,n);const i=this;i._hrefHandler=_d(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=_d(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Ta)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(sp,this._hrefHandler),r.removeEventListener(rp,this._tooltipHandler),r.removeEventListener(Ta,this._tooltipHandler)),this._svg=r=t&&i0(t,"svg"),r&&(r.addEventListener(sp,this._hrefHandler),r.addEventListener(rp,this._tooltipHandler),r.addEventListener(Ta,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:_d(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const _d=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},Ek="aria-hidden",s0="aria-label",o0="role",a0="aria-roledescription",wk="graphics-object",u0="graphics-symbol",Sk=(e,t,n)=>({[o0]:e,[a0]:t,[s0]:n||void 0}),S3=$n(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),ex={axis:{desc:"axis",caption:A3},legend:{desc:"legend",caption:C3},"title-text":{desc:"title",caption:e=>`Title text '${nx(e)}'`}
2,"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${nx(e)}'`}},tx={ariaRole:o0,ariaRoleDescription:a0,description:s0};function kk(e,t){const n=t.aria===!1;if(e(Ek,n||void 0),n||t.description==null)for(const i in tx)e(tx[i],void 0);else{const i=t.mark.marktype;e(s0,t.description),e(o0,t.ariaRole||(i==="group"?wk:u0)),e(a0,t.ariaRoleDescription||`${i} mark`)}}function $k(e){return e.aria===!1?{[Ek]:!0}:S3[e.role]?null:ex[e.role]?$3(e,ex[e.role]):k3(e)}function k3(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return Sk(n?wk:u0,`${t} mark container`,e.description)}function $3(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return Sk(t.role||u0,t.desc,n.description||i(n))}catch{return null}}function nx(e){return q(e.text).join(" ")}function A3(e){const t=e.datum,n=e.orient,i=t.title?Ak(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${ao(a)?"discrete":a} scale with ${B2(o,s,e)}`}function C3(e){const t=e.datum,n=t.title?Ak(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return O3(i)+(n?` titled '${n}'`:"")+` for ${F3(s)} with ${B2(u,a,e)}`}function Ak(e){try{return q(ue(e.items).items[0].text).join(" ")}catch{return null}}function F3(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+ue(e)}function O3(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const Ck=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),D3=e=>Ck(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function l0(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${D3(l)}"`),a),a={open(u,...l){s(u),t="<"+u;for(const c of l)for(const f in c)o(f,c[f]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:o,text:u=>(n+=Ck(u),a),toString:()=>e};return a}const Fk=e=>Ok(l0(),e)+"";function Ok(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):Ok(e,i)}return e.close()}const uc={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},lc={blend:"mix-blend-mode"},Dk={fill:"none","stroke-miterlimit":10},ra=0,ix="http://www.w3.org/2000/xmlns/",je=Va.xmlns;class c0 extends $u{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,s){return this._defs={},this._clearDefs(),t&&(this._svg=qe(t,0,"svg",je),this._svg.setAttributeNS(ix,"xmlns",je),this._svg.setAttributeNS(ix,"xmlns:xlink",Va["xmlns:xlink"]),this._svg.setAttribute("version",Va.version),this._svg.setAttribute("class","marks"),Qt(t,1),this._root=qe(this._svg,ra,"g",je),Qi(this._root,Dk),Qt(this._svg,ra+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,s)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(Qi(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=qe(t,ra,"rect",je),Qi(i,{width:this._width,height:this._height,fill:n}));const r=Fk(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Qt(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,s,o,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==s&&(s=r.marktype,o=Xt[s]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,rx(i,n),r.items.forEac
vendor: 5,712 bytes, lines 2-3
2h(c=>{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,rx(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=Xt[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=sx(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Qt(c,0),n._svg;c.setAttribute("class",hk(n));const f=$k(n);for(const g in f)Et(c,g,f[g]);l||Et(c,"pointer-events",u),Et(c,"clip-path",n.clip?Um(this,n,n.group):null);let d=null,p=0;const h=g=>{const m=this.isDirty(g),y=sx(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&T3(this,y,g,r)),d=y,++p};return a.nested?n.items.length&&h(n.items[0]):Cn(n,h),Qt(c,p),c}_update(t,n,i){Ei=n,ct=n.__values__,kk(Na,i),t.attr(Na,i,this);const r=M3[t.type];r&&r.call(this,t,n,i),Ei&&this.style(Ei,i)}style(t,n){if(n!=null){for(const i in uc){let r=i==="font"?ku(n):n[i];if(r===ct[i])continue;const s=uc[i];r==null?t.removeAttribute(s):(Im(r)&&(r=j2(r,this._defs.gradient,Rk())),t.setAttribute(s,r+"")),ct[i]=r}for(const i in lc)Tl(t,lc[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=qe(t,ra+1,"defs",je)),r=R3(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=qe(t,ra+1,"defs",je)),r=_3(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Qt(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function rx(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 R3(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=qe(e,n++,"pattern",je);Qi(o,{id:Jl+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=qe(o,0,"rect",je),Qi(o,{width:1,height:1,fill:`url(${Rk()}#${t.id})`}),e=qe(e,n++,"radialGradient",je),Qi(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=qe(e,n++,"linearGradient",je),Qi(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=qe(e,i,"stop",je),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return Qt(e,i),n}function _3(e,t,n){let i;return e=qe(e,n,"clipPath",je),e.setAttribute("id",t.id),t.path?(i=qe(e,0,"path",je),i.setAttribute("d",t.path)):(i=qe(e,0,"rect",je),Qi(i,{x:0,y:0,width:t.width,height:t.height})),Qt(e,1),n+1}function T3(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;Cn(n,o=>{r=e.mark(t,o,r,i),++s}),Qt(t,1+s)}function sx(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=Ji(o,i,je),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=Ji(o,"path",je);s.appendChild(a),a.__data__=e;const u=Ji(o,"g",je);s.appendChild(u),u.__data__=e;const l=Ji(o,"path",je);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||N3(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function N3(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Ei=null,ct=null;const M3={group(e,t,n){const i=Ei=t.childNodes[2];ct=i.__values__,e.foreground(Na,n,this),ct=t.__values__,Ei=t.childNodes[1],e.content(Na,n,this);const r=Ei=t.childNodes[0];e.background(Na,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==ct.events&&(Et(i,"pointer-events",s),Et(r,"pointer-events",s),ct.events=s),n.strokeForeground&&n.stroke){const o=n.fill;Et(i,"display",null),this.style(r,n),Et(r,"stroke",null),o&&(n.fill=null),ct=i.__values__,this.style(i,n),o&&(n.fill=o),Ei=null}else Et(i,"display","none")},image(e,t,n){n.smooth===!1?(Tl(t,"image-rendering","optimizeSpeed"),Tl(t,"image-rendering","pixelated")):Tl(t,"image-rendering",null)},text(e,t,n){const i=Su(n);let r,s,o,a;F(i)?(s=i.map(u=>dr(n,u)),r=s.join(` 3`),r!==ct.text&&(Qt(t,0),o=t.ownerDocument,a=fr(n),s.forEach((u,l)=>{const c=Ji(o,"tspan",je);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),ct.text=r)):(s=dr(n,i),s!==ct.text&&(t.textContent=s,ct.text=s)),Et(t,"font-family",ku(n)),Et(t,"font-size",oi(n)+"px"),Et(t,"font-style",n.fontStyle),Et(t,"font-variant",n.fontVariant),Et(t,"font-weight",n.fontWeight)}};function Na(e,t,n){t!==ct[e]&&(n?L3(Ei,e,t,n):Et(Ei,e,t),ct[e]=t)}function Tl(e,t,n){n!==ct[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),ct[t]=n)}function Qi(e,t){for(const n in t)Et(e,n,t[n])}function Et(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function L3(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function Rk(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class _k extends $u{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=l0();n.open("svg",re({},Va,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",Dk,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Xt[n.marktype],r=i.tag,s=[kk,i.attr];t.open("g",{class:hk(n),"clip-path":n.clip?Um(this,n,n.group):null},$k(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Su(a);if(F(l)){const c={x:0,dy:fr(a)};for(let f=0;f<l.length;
3++f)t.open("tspan",f?c:null).text(dr(a,l[f])).close()}else t.text(dr(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),Cn(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):Cn(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&P3(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:Jl+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const s in i){const o=i[s];t.open("clipPath",{id:s}),o.path?t.open("path",{d:o.path}).close():t.open("rect",{x:0,y:0,width:o.width,height:o.height}).close(),t.close()}t.close()}}}function P3(e,t,n,i,r){let s;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=ku(t),e["font-size"]=oi(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const o in uc){let a=t[o];const u=uc[o];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Im(a)&&(a=j2(a,r.gradient,"")),e[u]=a)}for(const o in lc){const a=t[o];a!=null&&(s=s||[],s.push(`${lc[o]}: ${a};`))}return s&&(e.style=s.join(" ")),e}const mn={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function I3(e){mn.svgMarkTypes=e.svgMarkTypes??["text"],mn.svgOnTop=e.svgOnTop??!0,mn.debug=e.debug??!1}class op extends $u{constructor(t){super(t),this._svgRenderer=new c0(t),this._canvasRenderer=new ac(t)}initialize(t,n,i,r,s){this._root_el=qe(t,0,"div");const o=qe(this._root_el,0,"div"),a=qe(this._root_el,1,"div");return this._root_el.style.position="relative",mn.debug||(o.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=mn.svgOnTop?a:o,this._canvasEl=mn.svgOnTop?o:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,s),this._svgRenderer.initialize(this._svgEl,n,i,r,s),super.initialize(t,n,i,r,s)}dirty(t){return mn.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(s=>!mn.svgMarkTypes.includes(s));this._svgRenderer.render(t,mn.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return mn.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class Tk extends Au{constructor(t,n){super(t,n)}initialize(t,n,i){const r=qe(qe(t,0,"div"),mn.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const Nk="canvas",Mk="hybrid",Lk="png",Pk="svg",Ik="none",Zi={Canvas:Nk,PNG:Lk,SVG:Pk,Hybrid:Mk,None:Ik},ts={};ts[Nk]=ts[Lk]={renderer:ac,headless:ac,handler:Au};ts[Pk]={renderer:c0,headless:_k,handler:vk};ts[Mk]={renderer:op,headless:op,handler:Tk};ts[Ik]={};function hf(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(ts[e]=t,this):ts[e]}
vendor: 80,785 bytes, line 3
3function zk(e,t,n){const i=[],r=new Ue().union(t),s=e.marktype;return s?Bk(e,r,n,i):s==="group"?Uk(e,r,n,i):A("Intersect scene must be mark node or group item.")}function Bk(e,t,n,i){if(z3(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a<o;++a)Uk(r[a],t,n,i);else for(const u=Xt[s].isect;a<o;++a){const l=r[a];jk(l,t,u)&&i.push(l)}}return i}function z3(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function Uk(e,t,n,i){n&&n(e.mark)&&jk(e,t,Xt.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const o=e.x||0,a=e.y||0;t.translate(-o,-a);for(let u=0;u<s;++u)Bk(r[u],t,n,i);t.translate(o,a)}return i}function jk(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const Td=new Ue;function qk(e){const t=e.clip;if(ie(t))t(Eu(Td.clear()));else if(t)Td.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(Td)}const B3=1e-9;function f0(e,t,n){return e===t?!0:n==="path"?Wk(e,t):e instanceof Date&&t instanceof Date?+e==+t:de(e)&&de(t)?Math.abs(e-t)<=B3:!e||!t||!U(e)&&!U(t)?e==t:U3(e,t)}function Wk(e,t){return f0(uo(e),uo(t))}function U3(e,t){var n=Object.keys(e),i=Object.keys(t),r,s;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),s=n.length-1;s>=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!f0(e[r],t[r],r))return!1;return typeof e==typeof t}function j3(){i5(),fL()}const fo="top",xn="left",vn="right",hr="bottom",q3="top-left",W3="top-right",G3="bottom-left",H3="bottom-right",d0="start",ap="middle",wt="end",V3="x",X3="y",pf="group",h0="axis",p0="title",Y3="frame",K3="scope",g0="legend",Gk="row-header",Hk="row-footer",Vk="row-title",Xk="column-header",Yk="column-footer",Kk="column-title",J3="padding",Q3="symbol",Jk="fit",Qk="fit-x",Zk="fit-y",Z3="pad",m0="none",el="all",up="each",y0="flush",er="column",tr="row";function e$(e){$.call(this,null,e)}z(e$,$,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=Xt[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=tl(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===pf||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(tl(l,o))),i.role){case h0:case g0:case p0:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(tl(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(tl(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return qk(i),t.modifies("bounds")}});function tl(e,t,n){return t(e.bounds.clear(),e,n)}const ox=":vega_identifier:";function b0(e){$.call(this,0,e)}b0.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};z(b0,$,{transform(e,t){const n=eP(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function eP(e){return e._signals[ox]||(e._signals[ox]=e.add(0))}function t$(e){$.call(this,null,e)}z(t$,$,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,tP(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===pf?sf:rf;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function tP(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 n$(e){$.call(this,null,e)}const ax={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!i$(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},i$=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),ux=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(i$(r,s=e[n].bounds,t))return!0},nP=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},iP=(e,t,n)=>{var i=e.range(),r=new Ue;return t===fo||t===hr?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},lx=e=>(e.forEach(t=>t.opacity=1),e),cx=(e,t)=>e.reflow(t.modified()).modifies("opacity");z(n$,$,{transform(e,t){const n=ax[e.method]||ax.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(lx(r),t=cx(t,e)),t;if(r=r.filter(nP),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=lx(r),t=cx(t,e),s.length>=3&&ux(s,i)){do s=n(s,i);while(s.length>=3&&ux(s,i));s.length<3&&!ue(r).opacity&&(s.length>1&&(ue(s).opacity=0),ue(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=iP(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function r$(e){$.call(this,null,e)}z(r$,$,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const lt=new Ue;function Vs(e,t,n){return e[t]===n?0:(e[t]=n,1)}function rP(e){var t=e.items[0].orient;return t===xn||t===vn}function sP(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function oP(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=sP(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,p=r.maxExtent,h=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=h&&e0(h),b=0,v=0,w,E;switch(lt.clear().union(m),m.clear(),(w=u[0])>-1&&m.union(r.items[w].bounds),(w=u[1])>-1&&m.union(r.items[w].bounds),a){case fo:b=f||0,v=-c,E=Math.max(d,Math.min(p,-m.y1)),m.add(0,-E).add(l,0),h&&nl(e,h,E,g,y,0,-1,m);break;case xn:b=-c,v=f||0,E=Math.max(d,Math.min(p,-m.x1)),m.add(-E,0).add(0,l),h&&nl(e,h,E,g,y,1,-1,m);break;case vn:b=n+c,v=f||0,E=Math.max(d,Math.min(p,m.x2)),m.add(0,0).add(E,l),h&&nl(e,h,E,g,y,1,1,m);break;case hr:b=f||0,v=i+c,E=Math.max(d,Math.min(p,m.y2)),m.add(0,0).add(l,E),h&&nl(e,h,E,g,0,0,1,m);break;default:b=r.x,v=r.y}return _i(m.translate(b,v),r),Vs(r,"x",b+o)|Vs(r,"y",v+o)&&(r.bounds=lt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function nl(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const fx=(e,t)=>Math.floor(Math.min(e,t)),dx=(e,t)=>Math.ceil(Math.max(e,t));function aP(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],s=r.items,r.marktype===pf)switch(r.role){case h0:case g0:case p0:break;case Gk:o.rowheaders.push(...s);break;case Hk:o.rowfooters.push(...s);break;case Xk:o.colheaders.push(...s);break;case Yk:o.colfooters.push(...s);break;case Vk:o.rowtitle=s[0];break;case Kk:o.coltitle=s[0];break;default:o.marks.push(...s)}return o}function uP(e){return new Ue().set(0,0,e.width||0,e.height||0)}function lP(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Fe(e,t,n){const i=U(e)?e[t]:e;return i??(n!==void 0?n:0)}function hx(e){return e<0?Math.ceil(-e):0}function s$(e,t,n){var i=!n.nodirty,r=n.bounds===y0?uP:lP,s=lt.set(0,0,0,0),o=Fe(n.align,er),a=Fe(n.align,tr),u=Fe(n.padding,er),l=Fe(n.padding,tr),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,p=Array(d),h=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),w=Array(d),E=Array(d),S,x,k,D,P,K,ee,ce,T,O,I;for(x=0;x<c;++x)h[x]=0;for(x=0;x<f;++x)y[x]=0;for(x=0;x<d;++x)K=t[x],P=E[x]=r(K),K.x=K.x||0,v[x]=0,K.y=K.y||0,w[x]=0,k=x%c,D=~~(x/c),g=Math.max(g,ee=Math.ceil(P.x2)),b=Math.max(b,ce=Math.ceil(P.y2)),h[k]=Math.max(h[k],ee),y[D]=Math.max(y[D],ce),p[x]=u+hx(P.x1),m[x]=l+hx(P.y1),i&&e.dirty(t[x]);for(x=0;x<d;++x)x%c===0&&(p[x]=0),x<c&&(m[x]=0);if(o===up)for(k=1;k<c;++k){for(I=0,x=k;x<d;x+=c)I<p[x]&&(I=p[x]);for(x=k;x<d;x+=c)p[x]=I+h[k-1]}else if(o===el){for(I=0,x=0;x<d;++x)x%c&&I<p[x]&&(I=p[x]);for(x=0;x<d;++x)x%c&&(p[x]=I+g)}else for(o=!1,k=1;k<c;++k)for(x=k;x<d;x+=c)p[x]+=h[k-1];if(a===up)for(D=1;D<f;++D){for(I=0,x=D*c,S=x+c;x<S;++x)I<m[x]&&(I=m[x]);for(x=D*c;x<S;++x)m[x]=I+y[D-1]}else if(a===el){for(I=0,x=c;x<d;++x)I<m[x]&&(I=m[x]);for(x=c;x<d;++x)m[x]=I+b}else for(a=!1,D=1;D<f;++D)for(x=D*c,S=x+c;x<S;++x)m[x]+=y[D-1];for(T=0,x=0;x<d;++x)T=p[x]+(x%c?T:0),v[x]+=T-t[x].x;for(k=0;k<c;++k)for(O=0,x=k;x<d;x+=c)O+=m[x],w[x]+=O-t[x].y;if(o&&Fe(n.center,er)&&f>1)for(x=0;x<d;++x)P=o===el?g:h[x%c],T=P-E[x].x2-t[x].x-v[x],T>0&&(v[x]+=T/2);if(a&&Fe(n.center,tr)&&c!==1)for(x=0;x<d;++x)P=a===el?b:y[~~(x/c)],O=P-E[x].y2-t[x].y-w[x],O>0&&(w[x]+=O/2);for(x=0;x<d;++x)s.union(E[x].translate(v[x],w[x]));switch(T=Fe(n.anchor,V3),O=Fe(n.anchor,X3),Fe(n.anchor,er)){case wt:T-=s.width();break;case ap:T-=s.width()/2}switch(Fe(n.anchor,tr)){case wt:O-=s.height();break;case ap:O-=s.height()/2}for(T=Math.round(T),O=Math.round(O),s.clear(),x=0;x<d;++x)t[x].mark.bounds.clear();for(x=0;x<d;++x)K=t[x],K.x+=v[x]+=T,K.y+=w[x]+=O,s.union(K.mark.bounds.union(K.bounds.translate(v[x],w[x]))),i&&e.dirty(K);return s}function cP(e,t,n){var i=aP(t),r=i.marks,s=n.bounds===y0?fP:dP,o=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,p,h,g,m;const y=s$(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=Fe(n.headerBand,tr,null),c=il(e,i.rowheaders,r,a,u,-Fe(o,"rowHeader"),fx,0,s,"x1",0,a,1,g)),i.colheaders&&(g=Fe(n.headerBand,er,null),f=il(e,i.colheaders,r,a,a,-Fe(o,"columnHeader"),fx,1,s,"y1",0,1,a,g)),i.rowfooters&&(g=Fe(n.footerBand,tr,null),d=il(e,i.rowfooters,r,a,u,Fe(o,"rowFooter"),dx,0,s,"x2",a-1,a,1,g)),i.colfooters&&(g=Fe(n.footerBand,er,null),p=il(e,i.colfooters,r,a,a,Fe(o,"columnFooter"),dx,1,s,"y2",l-a,1,a,g)),i.rowtitle&&(h=Fe(n.titleAnchor,tr),m=Fe(o,"rowTitle"),m=h===wt?d+m:c-m,g=Fe(n.titleBand,tr,.5),px(e,i.rowtitle,m,0,y,g)),i.coltitle&&(h=Fe(n.titleAnchor,er),m=Fe(o,"columnTitle"),m=h===wt?p+m:f-m,g=Fe(n.titleBand,er,.5),px(e,i.coltitle,m,1,y,g))}function fP(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function dP(e,t){return e.bounds[t]}function il(e,t,n,i,r,s,o,a,u,l,c,f,d,p){var h=n.length,g=0,m=0,y,b,v,w,E,S,x,k,D;if(!h)return g;for(y=c;y<h;y+=f)n[y]&&(g=o(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,w=t.length;b<w;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,w=t.length;b<w;++b,y+=f){for(S=t[b],E=S.mark.bounds,v=y;v>=0&&(x=n[v])==null;v-=d);a?(k=p==null?x.x:Math.round(x.bounds.x1+p*x.bounds.width()),D=g):(k=g,D=p==null?x.y:Math.round(x.bounds.y1+p*x.bounds.height())),E.union(S.bounds.translate(k-(S.x||0),D-(S.y||0))),S.x=k,S.y=D,e.dirty(S),m=o(m,E[l])}return m}function px(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function hP(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function pP(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function gP(e,t,n,i,r,s,o){const a=hP(n,t),u=pP(e,a("offset",0)),l=a("anchor",d0),c=l===wt?1:l===ap?.5:0,f={align:up,bounds:a("bounds",y0),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case xn:f.anchor={x:Math.floor(i.x1)-u,column:wt,y:c*(o||i.height()+2*i.y1),row:l};break;case vn:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case fo:f.anchor={y:Math.floor(r.y1)-u,row:wt,x:c*(s||r.width()+2*r.x1),column:l};break;case hr:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case q3:f.anchor={x:u,y:u};break;case W3:f.anchor={x:s-u,y:u,column:wt};break;case G3:f.anchor={x:u,y:o-u,row:wt};break;case H3:f.anchor={x:s-u,y:o-u,column:wt,row:wt};break}return f}function mP(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),bP(e,n,n.items[0].items[0]),s=yP(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===Q3&&xP(n.items[0].items[0].items[0].items),r!==m0&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,_i(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function yP(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function bP(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&sa(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case xn:r+=Math.ceil(o.bounds.width())+u;break;case vn:case hr:break;default:s+=o.bounds.height()+u}switch((r||s)&&sa(e,n,r,s),o.orient){case xn:c+=Ls(t,n,o,a,1,1);break;case vn:l+=Ls(t,n,o,wt,0,0)+u,c+=Ls(t,n,o,a,1,1);break;case hr:l+=Ls(t,n,o,a,0,0),c+=Ls(t,n,o,wt,-1,0,1)+u;break;default:l+=Ls(t,n,o,a,0,0)}(l||c)&&sa(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(sa(e,n,-l,0),sa(e,o,-l,0))}}function Ls(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,p=r<=0?0:e0(n);return Math.round(i===d0?f:i===wt?d-p:.5*(c-p))}function sa(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function xP(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function vP(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],p=a===xn||a===vn?i:n,h=0,g=0,m=0,y=0,b=0,v;if(o!==pf?a===xn?(h=r.y2,p=r.y1):a===vn?(h=r.y1,p=r.y2):(h=r.x1,p=r.x2):a===xn&&(h=i,p=0),v=u===d0?h:u===wt?p:(h+p)/2,d&&d.text){switch(a){case fo:case hr:b=f.bounds.height()+c;break;case xn:y=f.bounds.width()+c;break;case vn:y=-f.bounds.width()-c;break}lt.clear().union(d.bounds),lt.translate(y-(d.x||0),b-(d.y||0)),Vs(d,"x",y)|Vs(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(lt),d.mark.bounds.clear().union(lt),e.dirty(d)),lt.clear().union(d.bounds)}else lt.clear();switch(lt.union(f.bounds),a){case fo:g=v,m=r.y1-lt.height()-l;break;case xn:g=r.x1-lt.width()-l,m=v;break;case vn:g=r.x2+lt.width()+l,m=v;break;case hr:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return Vs(s,"x",g)|Vs(s,"y",m)&&(lt.translate(g,m),e.dirty(s),s.bounds.clear().union(lt),t.bounds.clear().union(lt),e.dirty(s)),s.bounds}function o$(e){$.call(this,null,e)}z(o$,$,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&cP(n,i,e.layout),wP(n,i,e)}),EP(e.mark.group)?t.reflow():t}});function EP(e){return e&&e.mark.role!=="legend-entry"}function wP(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new Ue().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,p,h,g;for(h=0,g=i.length;h<g;++h)switch(f=i[h],f.role){case h0:p=rP(f)?a:u,p.union(oP(e,f,r,s));break;case p0:c=f;break;case g0:l.push(mP(e,f));break;case Y3:case K3:case Gk:case Hk:case Vk:case Xk:case Yk:case Kk:a.union(f.bounds),u.union(f.bounds);break;default:o.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||vn,d!==m0&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];s$(e,b,gP(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===Jk||n.autosize.type===Qk||n.autosize.type===Zk))switch(y.orient){case xn:case vn:o.add(b.x1,0).add(b.x2,0);break;case fo:case hr:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(vP(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),SP(e,t,o,n)}function SP(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),p=Math.max(0,Math.ceil(n.y2-c));if(r.contains===J3){const h=e.padding();o-=h.left+h.right,a-=h.top+h.bottom}s===m0?(l=0,f=0,u=o,c=a):s===Jk?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-p)):s===Qk?(u=Math.max(0,o-l-d),a=c+f+p):s===Zk?(o=u+l+d,c=Math.max(0,a-f-p)):s===Z3&&(o=u+l+d,a=c+f+p),e._resizeView(o,a,u,c,[l,f],r.resize)}const kP=Object.freeze(Object.defineProperty({__proto__:null,bound:e$,identifier:b0,mark:t$,overlap:n$,render:r$,viewlayout:o$},Symbol.toStringTag,{value:"Module"}));function a$(e){$.call(this,null,e)}z(a$,$,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=Lm(s,o,e.minstep),u=e.format||M2(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?N2(s,e.values,a):Pm(s,a);return r&&(i.rem=r),r=l.map((c,f)=>ge({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(ge({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function u$(e){$.call(this,null,e)}function $P(){return ge({})}function AP(e){const t=Mo().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}z(u$,$,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||$P,s=e.key||Q,o=this.value;return F(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&A("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=AP(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function l$(e){$.call(this,null,e)}z(l$,$,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(F(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||ji,u=r.enter||ji,l=r.exit||ji,c=(s&&!o?r[s]:a)||ji;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==ji&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ji&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==ji){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const p=u(d,e)||i;(c(d,e)||p)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function c$(e){$.call(this,[],e)}z(c$,$,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||$l,o=e.scale,a=+e.limit,u=Lm(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===$l,c=e.format||z2(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||I2(o,u),d,p,h,g,m;return r&&(i.rem=r),s===$l?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ie(h=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,h(b,e)),0)):h=xt(g=h||8),r=r.map((y,b)=>ge({index:b,label:c(y,b,r),value:y,offset:g,size:h(y,e)})),m&&(m=f[r.length],r.push(ge({index:r.length,label:`â¦${f.length-r.length} entries`,value:m,offset:g,size:h(m,e)})))):s===QM?(d=o.domain(),p=R2(o,d[0],ue(d)),f.length<3&&!e.values&&d[0]!==ue(d)&&(f=[d[0],ue(d)]),r=f.map((y,b)=>ge({index:b,label:c(y,b,f),value:y,perc:p(y)}))):(h=f.length-1,p=lL(o),r=f.map((y,b)=>ge({index:b,label:c(y,b,f),value:y,perc:b?p(y):0,perc2:b===h?1:p(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const CP=e=>e.source.x,FP=e=>e.source.y,OP=e=>e.target.x,DP=e=>e.target.y;function x0(e){$.call(this,{},e)}x0.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"}]};z(x0,$,{transform(e,t){var n=e.sourceX||CP,i=e.sourceY||FP,r=e.targetX||OP,s=e.targetY||DP,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=gx.get(u+"-"+a)||gx.get(u);return l||A("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const f$=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,RP=(e,t,n,i)=>f$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),d$=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},_P=(e,t,n,i)=>d$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),h$=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},TP=(e,t,n,i)=>h$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),NP=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,MP=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,LP=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},PP=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},IP=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},zP=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a},gx=Mo({line:f$,"line-radial":RP,arc:d$,"arc-radial":_P,curve:h$,"curve-radial":TP,"orthogonal-horizontal":NP,"orthogonal-vertical":MP,"orthogonal-radial":LP,"diagonal-horizontal":PP,"diagonal-vertical":IP,"diagonal-radial":zP});function v0(e){$.call(this,null,e)}v0.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"]}]};z(v0,$,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||Ro,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/yw(l),p=ys(c),h,g,m;for(e.sort&&p.sort((y,b)=>l[y]-l[b]),h=0;h<c;++h)m=l[p[h]],g=u[p[h]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const BP=5;function UP(e){const t=e.type;return!e.bins&&(t===so||t===pu||t===gu)}function p$(e){return Tm(e)&&e!==Yn}const jP=$n(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function g$(e){$.call(this,null,e),this.modified(!0)}z(g$,$,{transform(e,t){var n=t.dataflow,i=this.value,r=qP(e);(!i||r!==i.type)&&(this.value=i=he(r)());for(r in e)if(!jP[r]){if(r==="padding"&&p$(i.type))continue;ie(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return YP(i,e,XP(i,e,GP(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function qP(e){var t=e.type,n="",i;return t===Yn?Yn+"-"+so:(WP(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Yn+"-":i===3?zo+"-":""),(n+t||so).toLowerCase())}function WP(e){const t=e.type;return Tm(t)&&t!==Zr&&t!==es&&(e.scheme||e.range&&e.range.length&&e.range.every(j))}function GP(e,t,n){const i=HP(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&UP(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return p$(s)&&t.padding&&r[0]!==ue(r)&&(r=VP(s,r,t.range,t.padding,t.exponent,t.constant)),e.domain(m$(s,r,n)),s===Om&&e.unknown(t.domainImplicit?z_:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&Lm(e,t.nice)||null),r.length}function HP(e,t,n){return t?(e.domain(m$(e.type,t,n)),t.length):-1}function VP(e,t,n,i,r,s){var o=Math.abs(ue(n)-n[0]),a=o/(o-2*i),u=e===Fi?Eg(t,null,a):e===gu?Vl(t,null,a,.5):e===pu?Vl(t,null,a,r||1):e===Qc?wg(t,null,a,s||1):vg(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function m$(e,t,n){if(A2(e)){var i=Math.abs(t.reduce((r,s)=>r+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+L(t))}return t}function XP(e,t,n){let i=t.bins;if(i&&!F(i)){const r=e.domain(),s=r[0],o=ue(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||A("Scale bins parameter missing step property."),u<s&&(u=a*Math.ceil(s/a)),l>o&&(l=a*Math.floor(o/a)),i=ys(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Dm&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function YP(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=KP(i,t,n);else if(t.scheme&&(s=JP(i,t,n),ie(s))){if(e.interpolator)return e.interpolator(s);A(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&C2(i))return e.interpolator(tf(lp(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Nm(t.interpolate,t.interpolateGamma)):ie(e.round)?e.round(r):ie(e.rangeRound)&&e.interpolate(r?y_:b_),s&&e.range(lp(s,t.reverse))}function KP(e,t,n){e!==v2&&e!==Xh&&A("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Xh?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Fm(n,r,i)]}function JP(e,t,n){var i=t.schemeExtent,r,s;return F(t.scheme)?s=tf(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=Mm(r),s||A(`Unrecognized scheme name: ${t.scheme}`)),n=e===ef?n+1:e===Dm?n-1:e===oo||e===Zc?+t.schemeCount||BP:n,C2(e)?mx(s,i,t.reverse):ie(s)?D2(mx(s,i),n):e===Om?s:s.slice(0,n)}function mx(e,t,n){return ie(e)&&(t||n)?O2(e,lp(t||[0,1],n)):e}function lp(e,t){return t?e.slice().reverse():e}function y$(e){$.call(this,null,e)}z(y$,$,{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(xs(e.sort)),this.modified(n),t}});const yx="zero",b$="center",x$="normalize",v$=["y0","y1"];function E0(e){$.call(this,null,e)}E0.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:yx,values:[yx,b$,x$]},{name:"as",type:"string",array:!0,length:2,default:v$}]};z(E0,$,{transform(e,t){var n=e.as||v$,i=n[0],r=n[1],s=xs(e.sort),o=e.field||Ro,a=e.offset===b$?QP:e.offset===x$?ZP:eI,u,l,c,f;for(u=tI(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,o,i,r);return t.reflow(e.modified()).modifies(n)}});function QP(e,t,n,i,r){for(var s=(t-e.sum)/2,o=e.length,a=0,u;a<o;++a)u=e[a],u[i]=s,u[r]=s+=Math.abs(n(u))}function ZP(e,t,n,i,r){for(var s=1/e.sum,o=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=o,c[r]=o=s*(l+=Math.abs(n(c)))}function eI(e,t,n,i,r){for(var s=0,o=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=o,c[r]=o+=l):(c[i]=s,c[r]=s+=l)}function tI(e,t,n,i){var r=[],s=g=>g(c),o,a,u,l,c,f,d,p,h;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(s),d=o[f],d||(o[f]=d=[],r.push(d)),d.push(c);for(f=0,h=0,l=r.length;f<l;++f){for(d=r[f],a=0,p=0,u=d.length;a<u;++a)p+=Math.abs(i(d[a]));d.sum=p,p>h&&(h=p),n&&d.sort(n)}return r.max=h,r}const nI=Object.freeze(Object.defineProperty({__proto__:null,axisticks:a$,datajoin:u$,encode:l$,legendentries:c$,linkpath:x0,pie:v0,scale:g$,sortitems:y$,stack:E0},Symbol.toStringTag,{value:"Module"})),iI=bw(),cp=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function rI(e,t){return function n(){const i=t();return i.type=e,i.path=bw().projection(i),i.copy=i.copy||function(){const r=n();return cp.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},k2(i)}}function w0(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(cc[e]=rI(e,t),this):cc[e]||null}function E$(e){return e&&e.path||iI}const cc={albers:jR,albersusa:UR,azimuthalequalarea:BR,azimuthalequidistant:zR,conicconformal:IR,conicequalarea:PR,conicequidistant:LR,equalEarth:MR,equirectangular:NR,gnomonic:TR,identity:_R,mercator:RR,mollweide:DR,naturalEarth1:OR,orthographic:FR,stereographic:CR,transversemercator:AR};for(const e in cc)w0(e,cc[e]);function sI(){}const mi=[[],[[[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 w$(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),oI(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var p=0,h=c.length,g;p<h;++p)if(aI((g=c[p])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=[],d=[],p,h,g,m,y,b;for(p=h=-1,m=u[0]>=l,mi[m<<1].forEach(v);++p<e-1;)g=m,m=u[p+1]>=l,mi[g|m<<1].forEach(v);for(mi[m<<0].forEach(v);++h<t-1;){for(p=-1,m=u[h*e+e]>=l,y=u[h*e]>=l,mi[m<<1|y<<2].forEach(v);++p<e-1;)g=m,m=u[h*e+e+p+1]>=l,b=y,y=u[h*e+p+1]>=l,mi[g|m<<1|y<<2|b<<3].forEach(v);mi[m|y<<3].forEach(v)}for(p=-1,y=u[h*e]>=l,mi[y<<2].forEach(v);++p<e-1;)b=y,y=u[h*e+p+1]>=l,mi[y<<2|b<<3].forEach(v);mi[y<<3].forEach(v);function v(w){var E=[w[0][0]+p,w[0][1]+h],S=[w[1][0]+p,w[1][1]+h],x=o(E),k=o(S),D,P;(D=d[x])?(P=f[k])?(delete d[D.end],delete f[P.start],D===P?(D.ring.push(S),c(D.ring)):f[D.start]=d[P.end]={start:D.start,end:P.end,ring:D.ring.concat(P.ring)}):(delete d[D.end],D.ring.push(S),d[D.end=k]=D):(D=f[k])?(P=d[x])?(delete f[D.start],delete d[P.end],D===P?(D.ring.push(S),c(D.ring)):f[P.start]=d[D.end]={start:P.start,end:D.end,ring:P.ring.concat(D.ring)}):(delete f[D.start],D.ring.unshift(E),f[D.start=x]=D):f[x]=d[k]={start:x,end:k,ring:[E,S]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],p=f[1],h=d|0,g=p|0,m,y=l[g*e+h];d>0&&d<e&&h===d&&(m=l[g*e+h-1],f[0]=d+(c-m)/(y-m)-.5),p>0&&p<t&&g===p&&(m=l[(g-1)*e+h],f[1]=p+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||A("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:sI,i):n===a},i}function oI(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function aI(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=uI(e,t[n]))return r;return 0}function uI(e,t){for(var n=t[0],i=t[1],r=-1,s=0,o=e.length,a=o-1;s<o;a=s++){var u=e[s],l=u[0],c=u[1],f=e[a],d=f[0],p=f[1];if(lI(u,f,t))return 0;c>i!=p>i&&n<(d-l)*(i-c)/(p-c)+l&&(r=-r)}return r}function lI(e,t,n){var i;return cI(e,t,n)&&fI(e[i=+(e[0]===t[0])],n[i],t[i])}function cI(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function fI(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function S$(e,t,n){return function(i){var r=Zn(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Ua(s,o,e):a/(e+1);return ys(s+u,o,u)}}function S0(e){$.call(this,null,e)}S0.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"}]};z(S0,$,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||bt,s=w$().smooth(e.smooth!==!1),o=e.thresholds||dI(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,F(o)?o:o(c.values));hI(f,c,l,e),f.forEach(d=>{u.push(qc(l,ge(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function dI(e,t,n){const i=S$(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Ra(t(r).values)))}function hI(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(ie(r)&&(r=r(n,i)),ie(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(de(r)?r:r[0])||1,a=(de(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(k$(t,o,a,u,l))}function k$(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function bx(e,t,n){const i=e>=0?e:jg(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Nd(e){return ie(e)?e:xt(+e)}function $$(){var e=u=>u[0],t=u=>u[1],n=Ro,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=bx(i[0],u,e)>>o,f=bx(i[1],u,t)>>o,d=c?c+2:0,p=f?f+2:0,h=2*d+(r>>o),g=2*p+(s>>o),m=new Float32Array(h*g),y=new Float32Array(h*g);let b=m;u.forEach(w=>{const E=d+(+e(w)>>o),S=p+(+t(w)>>o);E>=0&&E<h&&S>=0&&S<g&&(m[E+S*h]+=+n(w))}),c>0&&f>0?(Ps(h,g,m,y,c),Is(h,g,y,m,f),Ps(h,g,m,y,c),Is(h,g,y,m,f),Ps(h,g,m,y,c),Is(h,g,y,m,f)):c>0?(Ps(h,g,m,y,c),Ps(h,g,y,m,c),Ps(h,g,m,y,c),b=y):f>0&&(Is(h,g,m,y,f),Is(h,g,y,m,f),Is(h,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/yw(b);for(let w=0,E=h*g;w<E;++w)b[w]*=v;return{values:b,scale:1<<o,width:h,height:g,x1:d,y1:p,x2:d+(r>>o),y2:p+(s>>o)}}return a.x=function(u){return arguments.length?(e=Nd(u),a):e},a.y=function(u){return arguments.length?(t=Nd(u),a):t},a.weight=function(u){return arguments.length?(n=Nd(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||A("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||A("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<<o},a.bandwidth=function(u){return arguments.length?(u=q(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&A("invalid bandwidth"),i=u,a):i},a}function Ps(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<t;++o)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+o*e]),a>=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function Is(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<e;++o)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[o+a*e]),a>=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function k0(e){$.call(this,null,e)}k0.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 pI=["x","y","weight","size","cellSize","bandwidth"];function A$(e,t){return pI.forEach(n=>t[n]!=null?e[n](t[n]):0),e}z(k0,$,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=gI(i,e.groupby),s=(e.groupby||[]).map(Me),o=A$($$(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<s.length;++d)c[s[d]]=f[d];return c}return u=r.map(c=>ge(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function gI(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function $0(e){$.call(this,null,e)}$0.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};z($0,$,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=w$().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||S$(e.count||10,e.nice,!!r),o=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=A$($$(),e)(r,!0),u=k$(a,a.scale||1,a.scale||1,0,0),o=[a.width,a.height],r=a.values),s=F(s)?s:s(r),r=i.size(o)(r,s),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(ge),n}});const fp="Feature",A0="FeatureCollection",mI="MultiPoint";function C0(e){$.call(this,null,e)}C0.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};z(C0,$,{transform(e,t){var n=this._features,i=this._points,r=e.fields,s=r&&r[0],o=r&&r[1],a=e.geojson||!r&&bt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(pt(a))||s&&t.modified(pt(s))||o&&t.modified(pt(o)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:fp,geometry:{type:mI,coordinates:i}})),this.value={type:A0,features:n}}});function F0(e){$.call(this,null,e)}F0.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"}]};z(F0,$,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||bt,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=E$(e.projection),n.materialize().reflow()):o=r===bt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=yI(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function yI(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function O0(e){$.call(this,null,e)}O0.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"]}]};z(O0,$,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function D0(e){$.call(this,null,e)}D0.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"}]};z(D0,$,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=bI(E$(e.projection),e.field||rn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function bI(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function R0(e){$.call(this,[],e),this.generator=qR()}R0.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}]};z(R0,$,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)ie(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(FS(n[0],r)):t.add.push(ge(r)),n[0]=r,t}});function _0(e){$.call(this,null,e)}_0.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"}]};z(_0,$,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||bt,s=vI(e.opacity,e),o=xI(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Ra(n.map(l=>Ra(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=re({},l,u);i||(f.$max=Ra(c.values||[])),l[a]=EI(c,f,o.dep?o:xt(o(f)),s.dep?s:xt(s(f)))}),t.reflow(!0).modifies(a)}});function xI(e,t){let n;return ie(e)?(n=i=>Gl(e(i,t)),n.dep=C$(e)):n=xt(Gl(e||"#888")),n}function vI(e,t){let n;return ie(e)?(n=i=>e(i,t),n.dep=C$(e)):e?n=xt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function C$(e){if(!ie(e))return!1;const t=$n(pt(e));return t.$x||t.$y||t.$value||t.$max}function EI(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:Yi,d=or(u-o,l-a),p=d.getContext("2d"),h=p.getImageData(0,0,u-o,l-a),g=h.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=o,v=m*r;b<u;++b,y+=4){t.$x=b-o,t.$value=f(b+v);const w=n(t);g[y+0]=w.r,g[y+1]=w.g,g[y+2]=w.b,g[y+3]=~~(255*i(t))}}return p.putImageData(h,0,0),d}function F$(e){$.call(this,null,e),this.modified(!0)}z(F$,$,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=SI(e.type),cp.forEach(i=>{e[i]!=null&&xx(n,i,e[i])})):cp.forEach(i=>{e.modified(i)&&xx(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&wI(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function wI(e,t){const n=kI(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function SI(e){const t=w0((e||"mercator").toLowerCase());return t||A("Unrecognized projection type: "+e),t()}function xx(e,t,n){ie(e[t])&&e[t](n)}function kI(e){return e=q(e),e.length===1?e[0]:{type:A0,features:e.reduce((t,n)=>t.concat($I(n)),[])}}function $I(e){return e.type===A0?e.features:q(e).filter(t=>t!=null).map(t=>t.type===fp?t:{type:fp,geometry:t})}const AI=Object.freeze(Object.defineProperty({__proto__:null,contour:$0,geojson:C0,geopath:F0,geopoint:O0,geoshape:D0,graticule:R0,heatmap:_0,isocontour:S0,kde2d:k0,projection:F$},Symbol.toStringTag,{value:"Module"})),vx={center:KR,collide:YR,nbody:XR,link:VR,x:HR,y:GR},Aa="forces",dp=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],CI=["static","iterations"],O$=["x","y","vx","vy"];function T0(e){$.call(this,null,e)}T0.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:O$}]};z(T0,$,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(dp),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&D$(n,e,0,t)):(this.value=n=OI(t.source,e),n.on("tick",FI(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(CI)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==Aa||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,s=i.length,o;r<s;++r)if(i[r].name==="links"&&(o=i[r].op.source)){n.pulse(o,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(O$)}});function FI(e,t){return()=>e.touch(t).run()}function OI(e,t){const n=WR(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),D$(n,t,!0).on("end",()=>s=!0)}function D$(e,t,n,i){var r=q(t.forces),s,o,a,u;for(s=0,o=dp.length;s<o;++s)a=dp[s],a!==Aa&&t.modified(a)&&e[a](t[a]);for(s=0,o=r.length;s<o;++s)u=Aa+s,a=n||t.modified(Aa,s)?RI(r[s]):i&&DI(r[s],i)?e.force(u):null,a&&e.force(u,a);for(o=e.numForces||0;s<o;++s)e.force(Aa+s,null);return e.numForces=r.length,e}function DI(e,t){var n,i;for(n in e)if(ie(i=e[n])&&t.modified(pt(i)))return 1;return 0}function RI(e){var t,n;G(vx,e.force)||A("Unrecognized force: "+e.force),t=vx[e.force]();for(n in e)ie(t[n])&&_I(t[n],e[n],e);return t}function _I(e,t,n){e(ie(t)?i=>t(i,n):t)}const TI=Object.freeze(Object.defineProperty({__proto__:null,force:T0},Symbol.toStringTag,{value:"Module"}));function hp(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function N0(e){$.call(this,null,e)}N0.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const NI=e=>e.values;z(N0,$,{transform(e,t){t.source||A("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&jc(o.data)&&r.rem.push(o.data)}),this.value=s=aT({values:q(e.keys).reduce((o,a)=>(o.key(a),o),MI()).entries(r.source)},NI),n&&s.each(o=>{o.children&&(o=ge(o.data),r.add.push(o),r.source.push(o))}),hp(s,Q,Q)),r.source.root=s,r}});function MI(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,p;for(;++c<o;)f=a(d=r[c])+"",(p=u[f])?p.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],s);return l}function i(r,s){if(++s>e.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Ti(e){$.call(this,null,e)}const LI=(e,t)=>e.parent===t.parent?1:2;z(Ti,$,{transform(e,t){(!t.source||!t.source.root)&&A(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(xs(e.sort,o=>o.data)),PI(n,this.params,e),n.separation&&n.separation(e.separation!==!1?LI:Ro);try{this.value=n(r)}catch(o){A(o)}return r.each(o=>II(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function PI(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}function II(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}const pp=["x","y","r","depth","children"];function M0(e){Ti.call(this,e)}M0.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:pp.length,default:pp}]};z(M0,Ti,{layout:JR,params:["radius","size","padding"],fields:pp});const gp=["x0","y0","x1","y1","depth","children"];function L0(e){Ti.call(this,e)}L0.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:gp.length,default:gp}]};z(L0,Ti,{layout:QR,params:["size","round","padding"],fields:gp});function P0(e){$.call(this,null,e)}P0.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};z(P0,$,{transform(e,t){t.source||A("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?hp(db().id(e.key).parentId(e.parentKey)(r.source),e.key,sn):hp(db()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const Ex={tidy:e_,cluster:ZR},mp=["x","y","depth","children"];function I0(e){Ti.call(this,e)}I0.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:mp.length,default:mp}]};z(I0,Ti,{layout(e){const t=e||"tidy";if(G(Ex,t))return Ex[t]();A("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:mp});function z0(e){$.call(this,[],e)}z0.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};z(z0,$,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||A("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,o=>s[Q(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[Q(a)]&&s[Q(u)]&&r.add.push(ge({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[Q(o)]=1),n.forEach(o=>{(s[Q(o.source)]||s[Q(o.target)])&&r.mod.push(o)})),r}});const wx={binary:i_,dice:fT,slice:cT,slicedice:n_,squarify:lT,resquarify:t_},yp=["x0","y0","x1","y1","depth","children"];function B0(e){Ti.call(this,e)}B0.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:yp.length,default:yp}]};z(B0,Ti,{layout(){const e=uT();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{G(wx,t)?e.tile(wx[t]):A("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:yp});const zI=Object.freeze(Object.defineProperty({__proto__:null,nest:N0,pack:M0,partition:L0,stratify:P0,tree:I0,treelinks:z0,treemap:B0},Symbol.toStringTag,{value:"Module"})),Md=4278190080;function BI(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function UI(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=or(s,o).getContext("2d"),l=or(s,o).getContext("2d"),c=a&&or(s,o).getContext("2d");n.forEach(k=>Nl(u,k,!1)),Nl(l,t,!1),a&&Nl(c,t,!0);const f=Ld(u,s,o),d=Ld(l,s,o),p=a&&Ld(c,s,o),h=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,w,E,S,x;for(y=0;y<o;++y)for(m=0;m<s;++m)w=y*s+m,E=f[w]&Md,x=d[w]&Md,S=a&&p[w]&Md,(E||S||x)&&(b=e(m),v=e(y),!r&&(E||x)&&h.set(b,v),a&&(E||S)&&g.set(b,v));return[h,g]}function Ld(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function Nl(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>Nl(e,s.items,n))}):Xt[i].draw(e,{items:n?t.map(jI):t})}function jI(e){const t=qc(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const yi=5,vt=31,Xa=32,Vi=new Uint32Array(Xa+1),bn=new Uint32Array(Xa+1);bn[0]=0;Vi[0]=~bn[0];for(let e=1;e<=Xa;++e)bn[e]=bn[e-1]<<1|1,Vi[e]=~bn[e];function qI(e,t){const n=new Uint32Array(~~((e*t+Xa)/Xa));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>yi]&1<<(a&vt)},set:(s,o)=>{const a=o*e+s;i(a>>>yi,1<<(a&vt))},clear:(s,o)=>{const a=o*e+s;r(a>>>yi,~(1<<(a&vt)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,p;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>yi,p=f>>>yi,d===p){if(n[d]&Vi[c&vt]&bn[(f&vt)+1])return!0}else{if(n[d]&Vi[c&vt]||n[p]&bn[(f&vt)+1])return!0;for(let h=d+1;h<p;++h)if(n[h])return!0}return!1},setRange:(s,o,a,u)=>{let l,c,f,d,p;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>yi,d=c>>>yi,f===d)i(f,Vi[l&vt]&bn[(c&vt)+1]);else for(i(f,Vi[l&vt]),i(d,bn[(c&vt)+1]),p=f+1;p<d;++p)i(p,4294967295)},clearRange:(s,o,a,u)=>{let l,c,f,d,p;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>yi,d=c>>>yi,f===d)r(f,bn[l&vt]|Vi[(c&vt)+1]);else for(r(f,bn[l&vt]),r(d,Vi[(c&vt)+1]),p=f+1;p<d;++p)r(p,0)},outOfBounds:(s,o,a,u)=>s<0||o<0||u>=t||a>=e}}function WI(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>qI(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function GI(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=jt.width(o.datum,o.datum.text);let f=0,d,p,h,g,m,y,b;for(let v=0;v<u;++v)d=a[v].x,h=a[v].y,p=a[v].x2===void 0?d:a[v].x2,g=a[v].y2===void 0?h:a[v].y2,m=(d+p)/2,y=(h+g)/2,b=Math.abs(p-d+g-h),b>=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,p=o.x+m,h=o.y-y,g=o.y+y,o.align="center",d<0&&p<=r?o.align="left":0<=d&&r<p&&(o.align="right"),o.baseline="middle",h<0&&g<=s?o.baseline="top":0<=h&&s<g&&(o.baseline="bottom"),!0}}function fc(e,t,n,i,r,s){let o=n/2;return e-o<0||e+o>r||t-(o=i/2)<0||t+o>s}function nr(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function HI(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,p){const h=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!fc(h,g,d,p,r,s)&&!nr(e,h,g,p,d,m,o,a)&&!nr(e,h,g,p,d,p,o,null)){for(;y-m>=1;)b=(m+y)/2,nr(e,h,g,p,d,b,o,a)?y=b:m=b;if(m>f)return[h,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,p=jt.width(l.datum,l.datum.text);let h=n?d:0,g=!1,m=!1,y=0,b,v,w,E,S,x,k,D,P,K,ee,ce,T,O,I,W,V;for(let H=0;H<f;++H){for(b=c[H].x,w=c[H].y,v=c[H].x2===void 0?b:c[H].x2,E=c[H].y2===void 0?w:c[H].y2,b>v&&(V=b,b=v,v=V),w>E&&(V=w,w=E,E=V),P=e(b),ee=e(v),K=~~((P+ee)/2),ce=e(w),O=e(E),T=~~((ce+O)/2),k=K;k>=P;--k)for(D=T;D>=ce;--D)W=u(k,D,h,p,d),W&&([l.x,l.y,h,g]=W);for(k=K;k<=ee;++k)for(D=T;D<=O;++D)W=u(k,D,h,p,d),W&&([l.x,l.y,h,g]=W);!g&&!n&&(I=Math.abs(v-b+E-w),S=(b+v)/2,x=(w+E)/2,I>=y&&!fc(S,x,p,d,r,s)&&!nr(e,S,x,d,p,d,o,null)&&(y=I,l.x=S,l.y=x,m=!0))}return g||m?(S=p/2,x=d/2,o.setRange(e(l.x-S),e(l.y-x),e(l.x+S),e(l.y+x)),l.align="center",l.baseline="middle",!0):!1}}const VI=[-1,-1,1,1],XI=[-1,1,-1,1];function YI(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,p=jt.width(l.datum,l.datum.text),h=[];let g=n?d:0,m=!1,y=!1,b=0,v,w,E,S,x,k,D,P,K,ee,ce,T;for(let O=0;O<f;++O){for(v=c[O].x,E=c[O].y,w=c[O].x2===void 0?v:c[O].x2,S=c[O].y2===void 0?E:c[O].y2,h.push([e((v+w)/2),e((E+S)/2)]);h.length;)if([D,P]=h.pop(),!(o.get(D,P)||a.get(D,P)||u.get(D,P))){u.set(D,P);for(let I=0;I<4;++I)x=D+VI[I],k=P+XI[I],u.outOfBounds(x,k,x,k)||h.push([x,k]);if(x=e.invert(D),k=e.invert(P),K=g,ee=s,!fc(x,k,p,d,r,s)&&!nr(e,x,k,d,p,K,o,a)&&!nr(e,x,k,d,p,d,o,null)){for(;ee-K>=1;)ce=(K+ee)/2,nr(e,x,k,d,p,ce,o,a)?ee=ce:K=ce;K>g&&(l.x=x,l.y=k,g=K,m=!0)}}!m&&!n&&(T=Math.abs(w-v+S-E),x=(v+w)/2,k=(E+S)/2,T>=b&&!fc(x,k,p,d,r,s)&&!nr(e,x,k,d,p,d,o,null)&&(b=T,l.x=x,l.y=k,y=!0))}return m||y?(x=p/2,k=d/2,o.setRange(e(l.x-x),e(l.y-k),e(l.x+x),e(l.y+k)),l.align="center",l.baseline="middle",!0):!1}}const KI=["right","center","left"],JI=["bottom","middle","top"];function QI(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,p,h,g,m,y,b,v,w,E,S,x,k,D,P,K;for(let ee=0;ee<u;++ee){if(p=(n[ee]&3)-1,h=(n[ee]>>>2&3)-1,g=p===0&&h===0||i[ee]<0,m=p&&h?Math.SQRT1_2:1,y=i[ee]<0?-1:1,b=c[1+p]+i[ee]*p*m,x=c[4+h]+y*f*h/2+i[ee]*h*m,w=x-f/2,E=x+f/2,k=e(b),P=e(w),K=e(E),!d)if(Sx(k,k,P,K,o,a,b,b,w,E,c,g))d=jt.width(l.datum,l.datum.text);else continue;if(S=b+y*d*p/2,b=S-d/2,v=S+d/2,k=e(b),D=e(v),Sx(k,D,P,K,o,a,b,v,w,E,c,g))return l.x=p?p*y<0?v:b:S,l.y=h?h*y<0?E:w:x,l.align=KI[p*y+1],l.baseline=JI[h*y+1],o.setRange(k,P,D,K),!0}return!1}}function Sx(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const Pd=0,Id=4,zd=8,Bd=0,Ud=1,jd=2,ZI={"top-left":Pd+Bd,top:Pd+Ud,"top-right":Pd+jd,left:Id+Bd,middle:Id+Ud,right:Id+jd,"bottom-left":zd+Bd,bottom:zd+Ud,"bottom-right":zd+jd},ez={naive:GI,"reduced-search":HI,floodfill:YI};function tz(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=nz(i,f),p=iz(r,f),h=rz(e[0].datum),g=h==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=sz(h,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let w=-1,E=-1;const S=e.map(P=>{const K=b?jt.width(P,P.text):void 0;return w=Math.max(w,K),E=Math.max(E,P.fontSize),{datum:P,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(P),textWidth:K}});l=l===null||l===1/0?Math.max(w,E)+Math.max(...i):l;const x=WI(t[0],t[1],l);let k;if(!v){n&&S.sort((ee,ce)=>n(ee.datum,ce.datum));let P=!1;for(let ee=0;ee<p.length&&!P;++ee)P=p[ee]===5||d[ee]<0;const K=(h&&o||m)&&e.map(ee=>ee.datum);k=s.length||K?UI(x,K||[],s,P,m):BI(x,o&&S)}const D=m?ez[c](x,k,o,u):QI(x,k,p,d);return S.forEach(P=>P.opacity=+D(P)),S}function nz(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function iz(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=ZI[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function rz(e){return e&&e.mark&&e.mark.marktype}function sz(e,t,n,i){const r=s=>[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const bp=["x","y","opacity","align","baseline"],R$=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function U0(e){$.call(this,null,e)}U0.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:R$},{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:bp.length,default:bp}]};z(U0,$,{transform(e,t){function n(s){const o=e[s];return ie(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&A("Size parameter should be specified as a [width, height] array.");const r=e.as||bp;return tz(t.materialize(t.SOURCE).source||[],e.size,e.sort,q(e.offset==null?1:e.offset),q(e.anchor||R$),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const oz=Object.freeze(Object.defineProperty({__proto__:null,label:U0},Symbol.toStringTag,{value:"Module"}));function _$(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function j0(e){$.call(this,null,e)}j0.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};z(j0,$,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=_$(i,e.groupby),s=(e.groupby||[]).map(Me),o=s.length,a=e.as||[Me(e.x),Me(e.y)],u=[];r.forEach(l=>{HS(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<o;++d)f[s[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(ge(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const xp={constant:em,linear:tm,log:jS,exp:qS,pow:WS,quad:nm,poly:GS},az=(e,t)=>e==="poly"?t:e==="quad"?2:1;function q0(e){$.call(this,null,e)}q0.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(xp)},{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}]};z(q0,$,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=_$(i,e.groupby),s=(e.groupby||[]).map(Me),o=e.method||"linear",a=e.order==null?3:e.order,u=az(o,a),l=e.as||[Me(e.x),Me(e.y)],c=xp[o],f=[];let d=e.extent;G(xp,o)||A("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(p=>{if(p.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(p,e.x,e.y,a);if(e.params){f.push(ge({keys:p.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Zn(p,e.x),y=b=>{const v={};for(let w=0;w<s.length;++w)v[s[w]]=p.dims[w];v[l[0]]=b[0],v[l[1]]=b[1],f.push(ge(v))};o==="linear"||o==="constant"?m.forEach(b=>y([b,g.predict(b)])):Kc(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const uz=Object.freeze(Object.defineProperty({__proto__:null,loess:j0,regression:q0},Symbol.toStringTag,{value:"Module"}));function W0(e){$.call(this,null,e)}W0.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const lz=[-1e5,-1e5,1e5,1e5];z(W0,$,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:lz;const s=this.value=r_.from(i,e.x,e.y).voronoi(r);for(let o=0,a=i.length;o<a;++o){const u=s.cellPolygon(o);i[o][n]=u&&!fz(u)?cz(u):null}return t.reflow(e.modified()).modifies(n)}});function cz(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function fz(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const dz=Object.freeze(Object.defineProperty({__proto__:null,voronoi:W0},Symbol.toStringTag,{value:"Module"}));var qd=Math.PI/180,Ca=64,Ml=2048;function hz(){var e=[256,256],t,n,i,r,s,o,a,u=T$,l=[],c=Math.random,f={};f.layout=function(){for(var h=d(or()),g=xz((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],w=l.map(S=>({text:t(S),font:n(S),style:r(S),weight:s(S),rotate:o(S),size:~~(i(S)+1e-14),padding:a(S),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:S})).sort((S,x)=>x.size-S.size);++b<y;){var E=w[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,pz(h,E,w,b),E.hasText&&p(g,E,m)&&(v.push(E),m?mz(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(h){h.width=h.height=1;var g=Math.sqrt(h.getContext("2d").getImageData(0,0,1,1).data.length>>2);h.width=(Ca<<5)/g,h.height=Ml/g;var m=h.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function p(h,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),w=u(e),E=c()<.5?1:-1,S=-E,x,k,D;(x=w(S+=E))&&(k=~~x[0],D=~~x[1],!(Math.min(Math.abs(k),Math.abs(D))>=v));)if(g.x=y+k,g.y=b+D,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!gz(g,h,e[0]))&&(!m||yz(g,m))){for(var P=g.sprite,K=g.width>>5,ee=e[0]>>5,ce=g.x-(K<<4),T=ce&127,O=32-T,I=g.y1-g.y0,W=(g.y+g.y0)*ee+(ce>>5),V,H=0;H<I;H++){V=0;for(var Z=0;Z<=K;Z++)h[W+Z]|=V<<O|(Z<K?(V=P[H*K+Z])>>>T:0);W+=ee}return g.sprite=null,!0}return!1}return f.words=function(h){return arguments.length?(l=h,f):l},f.size=function(h){return arguments.length?(e=[+h[0],+h[1]],f):e},f.font=function(h){return arguments.length?(n=Dr(h),f):n},f.fontStyle=function(h){return arguments.length?(r=Dr(h),f):r},f.fontWeight=function(h){return arguments.length?(s=Dr(h),f):s},f.rotate=function(h){return arguments.length?(o=Dr(h),f):o},f.text=function(h){return arguments.length?(t=Dr(h),f):t},f.spiral=function(h){return arguments.length?(u=vz[h]||h,f):u},f.fontSize=function(h){return arguments.length?(i=Dr(h),f):i},f.padding=function(h){return arguments.length?(a=Dr(h),f):a},f.random=function(h){return arguments.length?(c=h,f):c},f}function pz(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Ca<<5)/s,Ml/s);var o=0,a=0,u=0,l=n.length,c,f,d,p,h;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,c=r.measureText(t.text+"m").width*s,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*qd),m=Math.cos(t.rotate*qd),y=c*m,b=c*g,v=d*m,w=d*g;c=Math.max(Math.abs(y+w),Math.abs(y-w))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=Ca<<5&&(o=0,a+=u,u=0),a+d>=Ml)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*qd),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var E=r.getImageData(0,0,(Ca<<5)/s,Ml/s).data,S=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,p=0;p<d*f;p++)S[p]=0;if(o=t.xoff,o==null)return;a=t.yoff;var x=0,k=-1;for(h=0;h<d;h++){for(p=0;p<c;p++){var D=f*h+(p>>5),P=E[(a+h)*(Ca<<5)+(o+p)<<2]?1<<31-p%32:0;S[D]|=P,x|=P}x?k=h:(t.y0++,d--,h--,a++)}t.y1=t.y0+k,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function gz(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>o:0))&t[l+d])return!0;l+=n}return!1}function mz(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function yz(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function T$(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function bz(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var o=s<0?-1:1;switch(Math.sqrt(1+4*o*s)-o&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function xz(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Dr(e){return typeof e=="function"?e:function(){return e}}var vz={archimedean:T$,rectangular:bz};const N$=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Ez=["text","font","rotate","fontSize","fontStyle","fontWeight"];function G0(e){$.call(this,hz(),e)}G0.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:N$}]};z(G0,$,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&A("Wordcloud size dimensions must be non-zero.");function n(h){const g=e[h];return ie(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||Ez.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,o=e.as||N$;let a=e.fontSize||14,u;if(ie(a)?u=e.fontSizeRange:a=xt(a),u){const h=a,g=he("sqrt")().domain(Zn(r,h)).range(u);a=m=>g(h(m))}r.forEach(h=>{h[o[0]]=NaN,h[o[1]]=NaN,h[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(an).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,p=l.length;for(let h=0,g,m;h<p;++h)g=l[h],m=g.datum,m[o[0]]=g.x+f,m[o[1]]=g.y+d,m[o[2]]=g.font,m[o[3]]=g.size,m[o[4]]=g.style,m[o[5]]=g.weight,m[o[6]]=g.rotate;return t.reflow(i).modifies(o)}});const wz=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:G0},Symbol.toStringTag,{value:"Module"})),Sz=e=>new Uint8Array(e),kz=e=>new Uint16Array(e),Ma=e=>new Uint32Array(e);function $z(){let e=8,t=[],n=Ma(0),i=rl(0,e),r=rl(0,e);return{data:()=>t,seen:()=>n=Az(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;o<u;++o)l=s[o],l._index=a++,t.push(l)},remove(s,o){const a=t.length,u=Array(a-s),l=t;let c,f,d;for(f=0;!o[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],o[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=rl(s,e,i),r=rl(s,e))}}}function Az(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function rl(e,t,n){const i=(t<257?Sz:t<65537?kz:Ma)(e);return n&&i.set(n),i}function kx(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,s){const o=this,a=o.bisect(o.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)s[u[d]]|=i;for(d=c;d<f;++d)s[u[d]]|=i;return o}}}function $x(){let e=Ma(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Ma(f);let p=Array(f),h,g,m;for(m=0;m<f;++m)p[m]=a(u[m]),d[m]=m;if(p=Cz(p,d),c)h=t,g=e,t=Array(c+f),e=Ma(c+f),Fz(l,h,g,c,p,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=p,e=d}return n=c+f,{index:d,value:p}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function s(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function o(a,u){let l;return u?l=u.length:(u=t,l=n),[x_(u,a[0],0,l),Wl(u,a[1],0,l)]}return{insert:i,remove:r,bisect:o,reindex:s,index:()=>e,size:()=>n}}function Cz(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return r<s?-1:r>s?1:0}),s_(e,t)}function Fz(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;l<i&&c<o;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=s[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<o;++c,++f)a[f]=r[c],u[f]=s[c]+e}function H0(e){$.call(this,$z(),e),this._indices=null,this._dims=null}H0.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};z(H0,$,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a<o;++a)u=n[a].fname,l=r[u]||(r[u]=$x()),s.push(kx(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,o=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,p=r.length,h={};let g,m,y,b,v,w,E,S,x;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(w={},b=t.mod,E=0,S=b.length;E<S;++E)w[b[E]._index]=1;for(E=0;E<p;++E)x=i[E],(!o[E]||e.modified("fields",E)||t.modified(x.fields))&&(y=x.fname,(g=h[y])||(s[y]=m=$x(),h[y]=g=m.insert(x,t.source,0)),o[E]=kx(m,E,r[E]).onAdd(g,u));for(E=0,S=a.data().length;E<S;++E)v[E]||(l[E]!==u[E]?f.push(E):w[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<p)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,s=this._dims,o=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=s.length;let d=r.size(),p,h,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(p=0;p<f;++p)h=a[p].fname,g=u[h]||(u[h]=o[h].insert(a[p],i,d)),s[p].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),s=i.all(),o=e.mod;let a,u,l;for(a=0,u=o.length;a<u;++a)l=o[a]._index,r[l]!==s&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),o=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,p,h;for(f=0,d=c.length;f<d;++f)p=c[f]._index,u[p]=1,o[p]=h=s[p],s[p]=a,h!==a&&l.push(p);for(p in i)i[p].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;l<o;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<o;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),o=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],p=l[0],h=l[1],g=e.one;let m,y,b;if(f<p)for(m=f,y=Math.min(p,d);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(f>p)for(m=p,y=Math.min(f,h);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;if(d>h)for(m=Math.max(f,h),y=d;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(d<h)for(m=Math.max(p,d),y=h;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,s=r.curr(),o=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],p=e.one;let h,g,m;if(l<f)for(h=l,g=Math.min(f,c);h<g;++h)m=o[h],s[m]^=p,n.push(m);else if(l>f)for(h=f,g=Math.min(l,d);h<g;++h)m=o[h],s[m]^=p,i.push(m);if(c>d)for(h=Math.max(l,d),g=c;h<g;++h)m=o[h],s[m]^=p,n.push(m);else if(c<d)for(h=Math.max(f,c),g=d;h<g;++h)m=o[h],s[m]^=p,i.push(m);e.range=t.slice()}});function V0(e){$.call(this,null,e)}V0.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};z(V0,$,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if((r&n)===0)return t.StopPropagation;const s=t.fork(t.ALL),o=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const Oz=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:H0,resolvefilter:V0},Symbol.toStringTag,{value:"Module"})),Dz="RawCode",ns="Literal",Rz="Property",_z="Identifier",Tz="ArrayExpression",Nz="BinaryExpression",M$="CallExpression",Mz="ConditionalExpression",Lz="LogicalExpression",Pz="MemberExpression",Iz="ObjectExpression",zz="UnaryExpression";function _n(e){this.type=e}_n.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Bz(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function Bz(e){switch(e.type){case Tz:return e.elements;case Nz:case Lz:return[e.left,e.right];case M$:return[e.callee].concat(e.arguments);case Mz:return[e.test,e.consequent,e.alternate];case Pz:return[e.object,e.property];case Iz:return e.properties;case Rz:return[e.key,e.value];case zz:return[e.argument];case _z:case ns:case Dz:default:return[]}}var ai,X,C,mt,be,gf=1,Cu=2,is=3,vr=4,mf=5,ws=6,Ct=7,Fu=8,Uz=9;ai={};ai[gf]="Boolean";ai[Cu]="<end>";ai[is]="Identifier";ai[vr]="Keyword";ai[mf]="Null";ai[ws]="Numeric";ai[Ct]="Punctuator";ai[Fu]="String";ai[Uz]="RegularExpression";var jz="ArrayExpression",qz="BinaryExpression",Wz="CallExpression",Gz="ConditionalExpression",L$="Identifier",Hz="Literal",Vz="LogicalExpression",Xz="MemberExpression",Yz="ObjectExpression",Kz="Property",Jz="UnaryExpression",Ye="Unexpected token %0",Qz="Unexpected number",Zz="Unexpected string",e6="Unexpected identifier",t6="Unexpected reserved word",n6="Unexpected end of input",vp="Invalid regular expression",Wd="Invalid regular expression: missing /",P$="Octal literals are not allowed in strict mode.",i6="Duplicate data property in object literal not allowed in strict mode",rt="ILLEGAL",Ya="Disabled.",r6=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\\u
30AE1\\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]"),s6
vendor: 5,882 bytes, line 3
3=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
vendor: 13,472 bytes, lines 3-5
3yf(e,t){if(!e)throw new Error("ASSERT: "+t)}function vi(e){return e>=48&&e<=57}function X0(e){return"0123456789abcdefABCDEF".includes(e)}function La(e){return"01234567".includes(e)}function o6(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Ka(e){return e===10||e===13||e===8232||e===8233}function Ou(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&r6.test(String.fromCharCode(e))}function dc(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&s6.test(String.fromCharCode(e))}const a6={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 I$(){for(;C<mt;){const e=X.charCodeAt(C);if(o6(e)||Ka(e))++C;else break}}function Ep(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)C<mt&&X0(X[C])?(i=X[C++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):fe({},Ye,rt);return String.fromCharCode(r)}function u6(){var e,t,n,i;for(e=X[C],t=0,e==="}"&&fe({},Ye,rt);C<mt&&(e=X[C++],!!X0(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&fe({},Ye,rt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function z$(){var e,t;for(e=X.charCodeAt(C++),t=String.fromCharCode(e),e===92&&(X.charCodeAt(C)!==117&&fe({},Ye,rt),++C,e=Ep("u"),(!e||e==="\\"||!Ou(e.charCodeAt(0)))&&fe({},Ye,rt),t=e);C<mt&&(e=X.charCodeAt(C),!!dc(e));)++C,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),X.charCodeAt(C)!==117&&fe({},Ye,rt),++C,e=Ep("u"),(!e||e==="\\"||!dc(e.charCodeAt(0)))&&fe({},Ye,rt),t+=e);return t}function l6(){var e,t;for(e=C++;C<mt;){if(t=X.charCodeAt(C),t===92)return C=e,z$();if(dc(t))++C;else break}return X.slice(e,C)}function c6(){var e,t,n;return e=C,t=X.charCodeAt(C)===92?z$():l6(),t.length===1?n=is:a6.hasOwnProperty(t)?n=vr:t==="null"?n=mf:t==="true"||t==="false"?n=gf:n=is,{type:n,value:t,start:e,end:C}}function Gd(){var e=C,t=X.charCodeAt(C),n,i=X[C],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++C,{type:Ct,value:String.fromCharCode(t),start:e,end:C};default:if(n=X.charCodeAt(C+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return C+=2,{type:Ct,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:C};case 33:case 61:return C+=2,X.charCodeAt(C)===61&&++C,{type:Ct,value:X.slice(e,C),start:e,end:C}}}if(o=X.substr(C,4),o===">>>=")return C+=4,{type:Ct,value:o,start:e,end:C};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return C+=3,{type:Ct,value:s,start:e,end:C};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return C+=2,{type:Ct,value:r,start:e,end:C};if(r==="//"&&fe({},Ye,rt),"<>=!+-*%&|^/".includes(i))return++C,{type:Ct,value:i,start:e,end:C};fe({},Ye,rt)}function f6(e){let t="";for(;C<mt&&X0(X[C]);)t+=X[C++];return t.length===0&&fe({},Ye,rt),Ou(X.charCodeAt(C))&&fe({},Ye,rt),{type:ws,value:parseInt("0x"+t,16),start:e,end:C}}function d6(e){let t="0"+X[C++];for(;C<mt&&La(X[C]);)t+=X[C++];return(Ou(X.charCodeAt(C))||vi(X.charCodeAt(C)))&&fe({},Ye,rt),{type:ws,value:parseInt(t,8),octal:!0,start:e,end:C}}function Ax(){var e,t,n;if(n=X[C],yf(vi(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=C,e="",n!=="."){if(e=X[C++],n=X[C],e==="0"){if(n==="x"||n==="X")return++C,f6(t);if(La(n))return d6(t);n&&vi(n.charCodeAt(0))&&fe({},Ye,rt)}for(;vi(X.charCodeAt(C));)e+=X[C++];n=X[C]}if(n==="."){for(e+=X[C++];vi(X.charCodeAt(C));)e+=X[C++];n=X[C]}if(n==="e"||n==="E")if(e+=X[C++],n=X[C],(n==="+"||n==="-")&&(e+=X[C++]),vi(X.charCodeAt(C)))for(;vi(X.charCodeAt(C));)e+=X[C++];else fe({},Ye,rt);return Ou(X.charCodeAt(C))&&fe({},Ye,rt),{type:ws,value:parseFloat(e),start:t,end:C}}function h6(){var e="",t,n,i,r,s=!1;for(t=X[C],yf(t==="'"||t==='"',"String literal must starts with a quote"),n=C,++C;C<mt;)if(i=X[C++],i===t){t="";break}else if(i==="\\")if(i=X[C++],!i||!Ka(i.charCodeAt(0)))switch(i){case"u":case"x":X[C]==="{"?(++C,e+=u6()):e+=Ep(i);break;case"n":e+=` 4`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:La(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),C<mt&&La(X[C])&&(s=!0,r=r*8+"01234567".indexOf(X[C++]),"0123".includes(i)&&C<mt&&La(X[C])&&(r=r*8+"01234567".indexOf(X[C++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&X[C]===` 5`&&++C;else{if(Ka(i.charCodeAt(0)))break;e+=i}return t!==""&&fe({},Ye,rt),{type:Fu,value:e,octal:s,start:n,end:C}}function p6(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";fe({},vp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{fe({},vp)}try{return new RegExp(e,t)}catch{return null}}function g6(){var e,t,n,i,r;for(e=X[C],yf(e==="/","Regular expression literal must start with a slash"),t=X[C++],n=!1,i=!1;C<mt;)if(e=X[C++],t+=e,e==="\\")e=X[C++],Ka(e.charCodeAt(0))&&fe({},Wd),t+=e;else if(Ka(e.charCodeAt(0)))fe({},Wd);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||fe({},Wd),r=t.substr(1,t.length-2),{value:r,literal:t}}function m6(){var e,t,n;for(t="",n="";C<mt&&(e=X[C],!!dc(e.charCodeAt(0)));)++C,e==="\\"&&C<mt?fe({},Ye,rt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&fe({},vp,n),{value:n,literal:t}}function y6(){var e,t,n,i;return be=null,I$(),e=C,t=g6(),n=m6(),i=p6(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:C}}function b6(e){return e.type===is||e.type===vr||e.type===gf||e.type===mf}function B$(){if(I$(),C>=mt)return{type:Cu,start:C,end:C};const e=X.charCodeAt(C);return Ou(e)?c6():e===40||e===41||e===59?Gd():e===39||e===34?h6():e===46?vi(X.charCodeAt(C+1))?Ax():Gd():vi(e)?Ax():Gd()}function Ft(){const e=be;return C=e.end,be=B$(),C=e.end,e}function U$(){const e=C;be=B$(),C=e}function x6(e){const t=new _n(jz);return t.elements=e,t}function Cx(e,t,n){const i=new _n(e==="||"||e==="&&"?Vz:qz);return i.operator=e,i.left=t,i.right=n,i}function v6(e,t){const n=new _n(Wz);return n.callee=e,n.arguments=t,n}function E6(e,t,n){const i=new _n(Gz);return i.test=e,i.consequent=t,i.alternate=n,i}function Y0(e){const t=new _n(L$);return t.name=e,t}function Fa(e){const t=new _n(Hz);return t.value=e.value,t.raw=X.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function Fx(e,t,n){const i=new _n(Xz);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function w6(e){const t=new _n(Yz);return t.properties=e,t}function Ox(e,t,n){const i=new _n(Kz);return i.key=t,i.value=n,i.kind=e,i}function S6(e,t){const n=new _n(Jz);return n.operator=e,n.argument=t,n.prefix=!0,n}function fe(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(yf(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=C,n.description=r,n}function bf(e){e.type===Cu&&fe(e,n6),e.type===ws&&fe(e,Qz),e.type===Fu&&fe(e,Zz),e.type===is&&fe(e,e6),e.type===vr&&fe(e,t6),fe(e,Ye,e.value)}function yt(e){const t=Ft();(t.type!==Ct||t.value!==e)&&bf(t)}function Ae(e){return be.type===Ct&&be.value===e}function Hd(e){return be.type===vr&&be.value===e}function k6(){const e=[];for(C=be.start,yt("[");!Ae("]");)Ae(",")?(Ft(),e.push(null)):(e.push(rs()),Ae("]")||yt(","));return Ft(),x6(e)}function Dx(){C=be.start;const e=Ft();return e.type===Fu||e.type===ws?(e.octal&&fe(e,P$),Fa(e)):Y0(e.value)}function $6(){var e,t,n,i;if(C=be.start,e=be,e.type===is)return n=Dx(),yt(":"),i=rs(),Ox("init",n,i);if(e.type===Cu||e.type===Ct)bf(e);else return t=Dx(),yt(":"),i=rs(),Ox("init",t,i)}function A6(){var e=[],t,n,i,r={},s=String;for(C=be.start,yt("{");!Ae("}");)t=$6(),t.key.type===L$?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?fe({},i6):r[i]=!0,e.push(t),Ae("}")||yt(",");return yt("}"),w6(e)}function C6(){yt("(");const e=K0();return yt(")"),e}const F6={if:1};function O6(){var e,t,n;if(Ae("("))return C6();if(Ae("["))return k6();if(Ae("{"))return A6();if(e=be.type,C=be.start,e===is||F6[be.value])n=Y0(Ft().value);else if(e===Fu||e===ws)be.octal&&fe(be,P$),n=Fa(Ft());else{if(e===vr)throw new Error(Ya);e===gf?(t=Ft(),t.value=t.value==="true",n=Fa(t)):e===mf?(t=Ft(),t.value=null,n=Fa(t)):Ae("/")||Ae("/=")?(n=Fa(y6()),U$()):bf(Ft())}return n}function D6(){const e=[];if(yt("("),!Ae(")"))for(;C<mt&&(e.push(rs()),!Ae(")"));)yt(",");return yt(")"),e}function R6(){C=be.start;const e=Ft();return b6(e)||bf(e),Y0(e.value)}function _6(){return yt("."),R6()}function T6(){yt("[");const e=K0();return yt("]"),e}function N6(){var e,t,n;for(e=O6();;)if(Ae("."))n=_6(),e=Fx(".",e,n);else if(Ae("("))t=D6(),e=v6(e,t);else if(Ae("["))n=T6(),e=Fx("[",e,n);else break;return e}function Rx(){const e=N6();if(be.type===Ct&&(Ae("++")||Ae("--")))throw new Error(Ya);return e}function Ll(){var e,t;if(be.type!==Ct&&be.type!==vr)t=Rx();else{if(Ae("++")||Ae("--"))throw new Error(Ya);if(Ae("+")||Ae("-")||Ae("~")||Ae("!"))e=Ft(),t=Ll(),t=S6(e.value,t);else{if(Hd("delete")||Hd("void")||Hd("typeof"))throw new Error(Ya);t=Rx()}}return t}function _x(e){let t=0;if(e.type!==Ct&&e.type!==vr)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function M6(){var e,t,n,i,r,s,o,a,u,l;if(e=be,u=Ll(),i=be,r=_x(i),r===0)return u;for(i.prec=r,Ft(),t=[e,be],o=Ll(),s=[u,i,o];(r=_x(be))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=Cx(a,u,o),s.push(n);i=Ft(),i.prec=r,s.push(i),t.push(be),n=Ll(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=Cx(s[l-1].value,s[l-2],n),l-=2;return n}function rs(){var e,t,n;return e=M6(),Ae("?")&&(Ft(),t=rs(),yt(":"),n=rs(),e=E6(e,t,n)),e}function K0(){const e=rs();if(Ae(","))throw new Error(Ya);return e}function J0(e){X=e,C=0,mt=X.length,be=null,U$();const t=K0();if(be.type!==Cu)throw new Error("Unexpect token after expression.");return t}var j$={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 q$(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&A("Missing arguments to clamp function."),o.length>3&&A("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",regexp:s,test:n("test",s),if:function(o){o.length<3&&A("Missing arguments to if function."),o.length>3&&A("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function L6(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function W$(e){e=e||{};const t=e.allowed?$n(e.allowed):{},n=e.forbidden?$n(e.forbidden):{},i=e.constants||j$,r=(e.functions||q$)(f),s=e.globalvar,o=e.fieldvar,a=ie(s)?s:h=>`${s}["${h}"]`;[...Object.getOwnPropertyNames(Object.prototype).filter(h=>typeof Object.prototype[h]=="function")];let u={},l={},c=0;function f(h){if(j(h))return h;const g=d[h.type];return g==null&&A("Unsupported type: "+h.type),g(h)}const d={Literal:h=>h.raw,Identifier:h=>{const g=h.name;return c>0?g:G(n,g)?A("Illegal identifier: "+g):G(i,g)?i[g]:G(t,g)?g:(u[g]=1,a(g))},MemberExpression:h=>{const g=!h.computed,m=f(h.object);g&&(c+=1);const y=f(h.property);return m===o&&(l[L6(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")}
vendor: 4,082 bytes, line 5
5,CallExpression:h=>{h.callee.type!=="Identifier"&&A("Illegal callee type: "+h.callee.type);const g=h.callee.name,m=h.arguments,y=G(r,g)&&r[g];return y||A("Unrecognized function: "+g),ie(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:h=>"["+h.elements.map(f).join(",")+"]",BinaryExpression:h=>"("+f(h.left)+" "+h.operator+" "+f(h.right)+")",UnaryExpression:h=>"("+h.operator+f(h.argument)+")",ConditionalExpression:h=>"("+f(h.test)+"?"+f(h.consequent)+":"+f(h.alternate)+")",LogicalExpression:h=>"("+f(h.left)+h.operator+f(h.right)+")",ObjectExpression:h=>{for(const g of h.properties){const m=g.key.name;yg.has(m)&&A("Illegal property: "+m)}return"{"+h.properties.map(f).join(",")+"}"},Property:h=>{c+=1;const g=f(h.key);return c-=1,g+":"+f(h.value)}};function p(h){const g={code:f(h),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return p.functions=r,p.constants=i,p}const Tx=Symbol("vega_selection_getter");function G$(e){return(!e.getter||!e.getter[Tx])&&(e.getter=rn(e.field),e.getter[Tx]=!0),e.getter}const Q0="intersect",Nx="union",P6="vlMulti",I6="vlPoint",Mx="or",z6="and",Hn="_vgsid_",Ja=rn(Hn),B6="E",U6="R",j6="R-E",q6="R-LE",W6="R-RE",G6="E-LT",H6="E-LTE",V6="E-GT",X6="E-GTE",Y6="E-VALID",K6="E-ONE",hc="index:unit";function Lx(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s<r;++s)if(a=n[s],o=G$(a)(e),rr(o)&&(o=dt(o)),rr(i[s])&&(i[s]=dt(i[s])),F(i[s])&&rr(i[s][0])&&(i[s]=i[s].map(dt)),a.type===B6){if(F(i[s])?!i[s].includes(o):o!==i[s])return!1}else if(a.type===U6){if(!Gs(o,i[s]))return!1}else if(a.type===W6){if(!Gs(o,i[s],!0,!1))return!1}else if(a.type===j6){if(!Gs(o,i[s],!1,!1))return!1}else if(a.type===q6){if(!Gs(o,i[s],!1,!0))return!1}else if(a.type===G6){if(o>=i[s])return!1}else if(a.type===H6){if(o>i[s])return!1}else if(a.type===V6){if(o<=i[s])return!1}else if(a.type===X6){if(o<i[s])return!1}else if(a.type===Y6){if(o===null||isNaN(o))return!1}else if(a.type===K6&&i[s].indexOf(o)===-1)return!1;return!0}function J6(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[hc]&&i[hc].value:void 0,o=n===Q0,a=r.length,u=0,l,c,f,d,p;u<a;++u)if(l=r[u],s&&o){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(p=Lx(t,l),c[d]=p?-1:++f,p&&s.size===1)return!0;if(!p&&f===s.get(d).count)return!1}else if(p=Lx(t,l),o^p)return p;return a&&o}const H$=gg(Ja),Q6=H$.left,Z6=H$.right;function e8(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[hc]&&i[hc].value:void 0,o=n===Q0,a=Ja(t),u=Q6(r,a);if(u===r.length||Ja(r[u])!==a)return!1;if(s&&o){if(s.size===1)return!0;if(Z6(r,a)-u<s.size)return!1}return!0}function t8(e,t){return F(e)||A("First argument to selectionTuples must be an array."),U(t)||A("Second argument to selectionTuples must be an object."),e.map(n=>re(t.fields?{values:t.fields.map(i=>G$(i)(n.datum))}:{[Hn]:Ja(n.datum)},t))}function n8(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,p,h,g,m,y,b,v=s.length,w=0,E,S;w<v;++w)if(l=s[w],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,S=c.length;E<S;++E)p=c[E],g=o[p.field]||(o[p.field]={}),m=g[d]||(g[d]=[]),u[p.field]=y=p.type.charAt(0),b=Vd[`${y}_union`],g[d]=b(m,q(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(q(f).reduce((x,k,D)=>(x[c[D].field]=k,x),{})))}else p=Hn,h=Ja(l),g=o[p]||(o[p]={}),m=g[d]||(g[d]=[]),m.push(h),n&&(m=a[d]||(a[d]=[]),m.push({[Hn]:h}));if(t=t||Nx,o[Hn]?o[Hn]=Vd[`${Hn}_${t}`](...Object.values(o[Hn])):Object.keys(o).forEach(x=>{o[x]=Object.keys(o[x]).map(k=>o[x][k]).reduce((k,D)=>k===void 0?D:Vd[`${u[x]}_${t}`](k,D))}),s=Object.keys(a),n&&s.length){const x=i?I6:P6;o[x]=t===Nx?{[Mx]:s.reduce((k,D)=>(k.push(...a[D]),k),[])}:{[z6]:s.map(k=>({[Mx]:a[k]}))}}return o}var Vd={[`${Hn}_union`]:a_,[`${Hn}_intersect`]:o_,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.includes(t[n])||e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.includes(n)):t},R_union:function(e,t){var n=dt(t[0]),i=dt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=dt(t[0]),i=dt(t[1]);return n>
vendor: 33,878 bytes, lines 5-9
5i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const i8=":",r8="@";function Z0(e,t,n,i){t[0].type!==ns&&A("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&ue(t).value,o="unit",a=r8+o,u=i8+r;s===Q0&&!G(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),G(i,u)||(i[u]=n.getData(r).tuplesRef())}function V$(e){const t=this.context.data[e];return t?t.values.value:[]}function s8(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function o8(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(sn).insert(t)),1}function a8(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const Du=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},u8=Du("format"),X$=Du("timeFormat"),l8=Du("utcFormat"),c8=Du("timeParse"),f8=Du("utcParse"),sl=new Date(2e3,0,1);function xf(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(sl.setYear(2e3),sl.setMonth(e),sl.setDate(t),X$.call(this,sl,n))}function d8(e){return xf.call(this,e,1,"%B")}function h8(e){return xf.call(this,e,1,"%b")}function p8(e){return xf.call(this,0,2+e,"%A")}function g8(e){return xf.call(this,0,2+e,"%a")}const m8=":",y8="@",wp="%",Y$="$";function ey(e,t,n,i){t[0].type!==ns&&A("First argument to data functions must be a string literal.");const r=t[0].value,s=m8+r;if(!G(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function b8(e,t,n,i){t[0].type!==ns&&A("First argument to indata must be a string literal."),t[1].type!==ns&&A("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=y8+s;G(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function kt(e,t,n,i){if(t[0].type===ns)Px(n,i,t[0].value);else for(e in n.scales)Px(n,i,e)}function Px(e,t,n){const i=wp+n;if(!G(t,i))try{t[i]=e.scaleRef(n)}catch{}}function ui(e,t){if(j(e)){const n=t.scales[e];return n&&_b(n.value)?n.value:void 0}else if(ie(e))return _b(e)?e:void 0}function x8(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=kt,n._range=kt,n._scale=kt;const i=r=>"_["+(r.type===ns?L(wp+r.value):L(wp)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function ty(e,t){return function(n,i,r){if(n){const s=ui(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const v8=ty("area",u_),E8=ty("bounds",l_),w8=ty("centroid",c_);function S8(e,t){const n=ui(e,(t||this).context);return n&&n.scale()}function k8(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 ny(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function $8(){return ny(this.context.dataflow,"warn",arguments)}function A8(){return ny(this.context.dataflow,"info",arguments)}function C8(){return ny(this.context.dataflow,"debug",arguments)}function Xd(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Sp(e){const t=Gl(e),n=Xd(t.r),i=Xd(t.g),r=Xd(t.b);return .2126*n+.7152*i+.0722*r}function F8(e,t){const n=Sp(e),i=Sp(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function O8(){const e=[].slice.call(arguments);return e.unshift({}),re(...e)}function K$(e,t){return e===t||e!==e&&t!==t?!0:F(e)?F(t)&&e.length===t.length?D8(e,t):!1:U(e)&&U(t)?J$(e,t):!1}function D8(e,t){for(let n=0,i=e.length;n<i;++n)if(!K$(e[n],t[n]))return!1;return!0}function J$(e,t){for(const n in e)if(!K$(e[n],t[n]))return!1;return!0}function Ix(e){return t=>J$(e,t)}function R8(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=o.changeset(),c.stamp=l,o.runAfter(()=>{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?sn:F(n)||jc(n)?n:Ix(n),c.remove(f)),t&&c.insert(t),i&&(f=Ix(i),u.value.some(f)?c.remove(f):c.insert(i)),r){if(ie(r))throw Error("modify parameter must be a data tuple, not a function");for(d in s)c.modify(r,d,s[d])}return 1}function _8(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function T8(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const zx={};function N8(e,t){const n=zx[t]||(zx[t]=rn(t));return F(e)?e.map(n):n(e)}function vf(e){return F(e)||ArrayBuffer.isView(e)?e:null}function iy(e){return vf(e)||(j(e)?e:null)}function M8(e,...t){return vf(e).join(...t)}function L8(e,...t){return iy(e).indexOf(...t)}function P8(e,...t){return iy(e).lastIndexOf(...t)}function I8(e,...t){return iy(e).slice(...t)}function z8(e,t,n){return ie(n)&&A("Function argument passed to replace."),!j(t)&&!$g(t)&&A("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function B8(e){return vf(e).slice().reverse()}function U8(e){return vf(e).slice().sort(No)}function j8(e,t,n){return Fm(e||0,t||0,n||0)}function q8(e,t){const n=ui(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function W8(e,t){const n=ui(e,(t||this).context);return n?n.copy():void 0}function G8(e,t){const n=ui(e,(t||this).context);return n?n.domain():[]}function H8(e,t,n){const i=ui(e,(n||this).context);return i?F(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function V8(e,t){const n=ui(e,(t||this).context);return n&&n.range?n.range():[]}function X8(e,t,n){const i=ui(e,(n||this).context);return i?i(t):void 0}function Y8(e,t,n,i,r){e=ui(e,(r||this).context);const s=q2(t,n);let o=e.domain(),a=o[0],u=ue(o),l=bt;return u-a?l=R2(e,a,u):e=(e.interpolator?he("sequential")().interpolator(e.interpolator()):he("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),u!==ue(o)&&o.push(u)),o.forEach(c=>s.stop(l(c),e(c))),s}function K8(e,t,n){const i=ui(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function J8(e){let t=null;return function(n){return n?Ga(n,t=t||uo(e)):e}}const Q$=e=>e.data;function Z$(e,t){const n=V$.call(t,e);return n.root&&n.root.lookup||{}}function Q8(e,t,n){const i=Z$(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(Q$):void 0}function Z8(e,t){const n=Z$(e,this)[t];return n?n.ancestors().map(Q$):void 0}const eA=()=>typeof window<"u"&&window||null;function e4(){const e=eA();return e?e.screen:{}}function t4(){const e=eA();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function n4(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function tA(e,t,n){if(!e)return[];const[i,r]=e,s=new Ue().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return zk(o,s,i4(t))}function i4(e){let t=null;if(e){const n=q(e.marktype),i=q(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function r4(e,t,n,i=5){e=q(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function s4(e){return q(e).reduce((t,[n,i],r)=>t+=r==0?`M ${n},${i} `:r===e.length-1?" Z":`L ${n},${i} `,"")}function o4(e,t,n){const{x:i,y:r,mark:s}=n,o=new Ue().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<o.x1&&(o.x1=u),u>o.x2&&(o.x2=u),l<o.y1&&(o.y1=l),l>o.y2&&(o.y2=l);return o.translate(i,r),tA([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>a4(u.x,u.y,t))}function a4(e,t,n){let i=0;for(let r=0,s=n.length-1;r<n.length;s=r++){const[o,a]=n[s],[u,l]=n[r];l>t!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const Qa={random(){return an()},cumulativeNormal:Vc,cumulativeLogNormal:Xg,cumulativeUniform:Qg,densityNormal:qg,densityLogNormal:Vg,densityUniform:Jg,quantileNormal:Xc,quantileLogNormal:Yg,quantileUniform:Zg,sampleNormal:Hc,sampleLogNormal:Hg,sampleUniform:Kg,isArray:F,isBoolean:bs,isDate:rr,isDefined(e){return e!==void 0},isNumber:de,isObject:U,isRegExp:$g,isString:j,isTuple:jc,isValid(e){return e!=null&&e===e},toBoolean:Cg,toDate(e){return Fg(e)},toNumber:dt,toString:Og,indexof:L8,join:M8,lastindexof:P8,replace:z8,reverse:B8,sort:U8,slice:I8,flush:Uw,lerp:qw,merge:O8,pad:Hw,peek:ue,pluck:N8,span:cu,inrange:Gs,truncate:Vw,rgb:Gl,lab:N_,hcl:T_,hsl:sT,luminance:Sp,contrast:F8,sequence:ys,format:u8,utcFormat:l8,utcParse:f8,utcOffset:oS,utcSequence:lS,timeFormat:X$,timeParse:c8,timeOffset:sS,timeSequence:uS,timeUnitSpecifier:Xw,monthFormat:d8,monthAbbrevFormat:h8,dayFormat:p8,dayAbbrevFormat:g8,quarter:Pw,utcquarter:Iw,week:Kw,utcweek:Zw,dayofyear:Yw,utcdayofyear:Qw,warn:$8,info:A8,debug:C8,extent(e){return Zn(e)},inScope:k8,intersect:tA,clampRange:zw,pinchDistance:_8,pinchAngle:T8,screen:e4,containerSize:n4,windowSize:t4,bandspace:j8,setdata:o8,pathShape:J8,panLinear:Tw,panLog:Nw,panPow:Mw,panSymlog:Lw,zoomLinear:vg,zoomLog:Eg,zoomPow:Vl,zoomSymlog:wg,encode:a8,modify:R8,lassoAppend:r4,lassoPath:s4,intersectLasso:o4},u4=["view","item","group","xy","x","y"],l4="event.vega.",nA="this.",ry={},iA={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${L(Y$+e)}]`,functions:c4,constants:j$,visitors:ry},kp=W$(iA);function c4(e){const t=q$(e);u4.forEach(n=>t[n]=l4+n);for(const n in Qa)t[n]=nA+n;return re(t,x8(e,Qa,ry)),t}function ze(e,t,n){return arguments.length===1?Qa[e]:(Qa[e]=t,n&&(ry[e]=n),kp&&(kp.functions[e]=nA+e),this)}ze("bandwidth",q8,kt);ze("copy",W8,kt);ze("domain",G8,kt);ze("range",V8,kt);ze("invert",H8,kt);ze("scale",X8,kt);ze("gradient",Y8,kt);ze("geoArea",v8,kt);ze("geoBounds",E8,kt);ze("geoCentroid",w8,kt);ze("geoShape",K8,kt);ze("geoScale",S8,kt);ze("indata",s8,b8);ze("data",V$,ey);ze("treePath",Q8,ey);ze("treeAncestors",Z8,ey);ze("vlSelectionTest",J6,Z0);ze("vlSelectionIdTest",e8,Z0);ze("vlSelectionResolve",n8,Z0);ze("vlSelectionTuples",t8);function ti(e,t){const n={};let i;try{e=j(e)?e:L(e)+"",i=J0(e)}catch{A("Expression parse error: "+e)}i.visit(s=>{if(s.type!==M$)return;const o=s.callee.name,a=iA.visitors[o];a&&a(o,s.arguments,t,n)});const r=kp(i);return r.globals.forEach(s=>{const o=Y$+s;!G(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:re({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function f4(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const d4=$n(["rule"]),Bx=$n(["group","image","rect"]);function h4(e,t){let n="";return d4[t]||(e.x2&&(e.x?(Bx[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?(Bx[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 sy(e){return(e+"").toLowerCase()}function p4(e){return sy(e)==="operator"}function g4(e){return sy(e)==="collect"}function oa(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function m4(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} 6 : (u > v || v == null) && u != null ? ${i} 7 : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} 8 : v !== v && u === u ? ${i} : `}var y4={operator:(e,t)=>oa(e,["_"],t.code),parameter:(e,t)=>oa(e,["datum","_"],t.code),event:(e,t)=>oa(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return oa(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+L(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=h4(i,n),r+="return m;",oa(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(L).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),m4(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function b4(e){const t=this;p4(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function x4(e){const t=this;if(e.params){const n=t.get(e.id);n||A("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function v4(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=F(r)?r.map(s=>Ux(s,n,t)):Ux(r,n,t)}return t}function Ux(e,t,n){if(!e||!U(e))return e;for(let i=0,r=jx.length,s;i<r;++i)if(s=jx[i],G(e,s.key))return s.parse(e,t,n);return e}var jx=[{key:"$ref",parse:E4},{key:"$key",parse:S4},{key:"$expr",parse:w4},{key:"$field",parse:k4},{key:"$encode",parse:A4},{key:"$compare",parse:$4},{key:"$context",parse:C4},{key:"$subflow",parse:F4},{key:"$tupleid",parse:O4}];function E4(e,t){return t.get(e.$ref)||A("Operator not defined: "+e.$ref)}function w4(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=Mt(t.parameterExpression(e.$expr),e.$fields))}function S4(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=Ag(e.$key,e.$flat,t.expr.codegen))}function k4(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=rn(e.$field,e.$name,t.expr.codegen))}function $4(e,t){const n="c:"+e.$compare+"_"+e.$order,i=q(e.$compare).map(r=>r&&r.$tupleid?Q:r);return t.fn[n]||(t.fn[n]=Sg(i,e.$order,t.expr.codegen))}function A4(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=Mt(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function C4(e,t){return t}function F4(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function O4(){return Q}function D4(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&A("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function R4(e){var t=this,n=U(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||A("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const _4={skip:!0};function T4(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function N4(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],_4)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(sn).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function rA(e,t,n,i){return new sA(e,t,n,i)}function sA(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||y4,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function qx(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)}sA.prototype=qx.prototype={fork(){const e=new qx(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),g4(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[sy(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:f4,parseOperator:b4,parseOperatorParameters:x4,parseParameters:v4,parseStream:D4,parseUpdate:R4,getState:T4,setState:N4};function M4(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),oA(t,e.description()))}function oA(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function L4(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const Yd="default";function P4(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:Yd,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?j(r)?r:r.user:Yd,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return j(i)||(r=i.item,i=i.user),$p(e,i&&i!==Yd?i:r||i),r},{cursor:t})}function $p(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 pc(e,t){var n=e._runtime.data;return G(n,t)||A("Unrecognized data set: "+t),n[t]}function I4(e,t){return arguments.length<2?pc(this,e).values.value:Ef.call(this,e,vs().remove(sn).insert(t))}function Ef(e,t){OS(t)||A("Second argument to changes must be a changeset.");const n=pc(this,e);return n.modified=!0,this.pulse(n.input,t)}function z4(e,t){return Ef.call(this,e,vs().insert(t))}function B4(e,t){return Ef.call(this,e,vs().remove(t))}function aA(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function uA(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function wf(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function U4(e){var t=wf(e),n=aA(e),i=uA(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function j4(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=wf(e),o=t.changedTouches?t.changedTouches[0]:t,s=df(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=q4(e,n,s),t}function q4(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;j(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:xt(e),item:xt(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const Wx="view",W4="timer",G4="window",H4={trap:!1};function V4(e){const t=re({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{F(i[s])&&(i[s]=$n(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function lA(e,t,n,i){e._eventListeners.push({type:n,sources:q(t),handler:i})}function X4(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function ol(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||U(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function Y4(e,t,n){var i=this,r=new Gc(n),s=function(l,c){i.runAsync(null,()=>{e===Wx&&X4(i,t)&&l.preventDefault(),r.receive(j4(i,l,c))})},o;if(e===W4)ol(i,"timer",t)&&i.timer(s,t);else if(e===Wx)ol(i,"view",t)&&i.addEventListener(t,s,H4);else if(e===G4?ol(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&ol(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a<u;++a)o[a].addEventListener(t,s);lA(i,o,t,s)}return r}function Gx(e){return e.item}function Hx(e){return e.item.mark.source}function Vx(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function K4(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",Gx),Hx,Vx(e)),this.on(this.events("view","pointerout",Gx),Hx,Vx(t)),this}function J4(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,s,o,a,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function qt(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const Q4="vega-bind",Z4="vega-bind-name",e9="vega-bind-radio";function t9(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=kg(i.debounce,r.update))),(i.input==null&&i.element?n9:r9)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function n9(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),lA(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(i9(r))}}function i9(e){return typeof Event<"u"?new Event(e):{type:e}}function r9(e,t,n,i){const r=i.signal(n.signal),s=qt("div",{class:Q4}),o=n.input==="radio"?s:s.appendChild(qt("label"));o.appendChild(qt("span",{class:Z4},n.name||n.signal)),t.appendChild(s);let a=s9;switch(n.input){case"checkbox":a=o9;break;case"select":a=a9;break;case"radio":a=u9;break;case"range":a=l9;break}a(e,o,n,r)}function s9(e,t,n,i){const r=qt("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function o9(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=qt("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function a9(e,t,n,i){const r=qt("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};gc(o,i)&&(u.selected=!0),r.appendChild(qt("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a<u;++a)if(gc(n.options[a],o)){r.selectedIndex=a;return}}}function u9(e,t,n,i){const r=qt("span",{class:e9}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((o,a)=>{const u={type:"radio",name:n.signal,value:o};gc(o,i)&&(u.checked=!0);const l=qt("input",u);l.addEventListener("change",()=>e.update(o));const c=qt("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)gc(a[l].value,o)&&(a[l].checked=!0)}}function l9(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,s=n.min||Math.min(0,r,+i)||0,o=n.step||Ua(s,r,100),a=qt("input",{type:"range",name:n.signal,min:s,max:r,step:o});a.value=i;const u=qt("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function gc(e,t){return e===t||e+""==t+""}function cA(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,aA(e),uA(e),wf(e),r,s).background(e.background())}function oy(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function c9(e,t,n,i){const r=new i(e.loader(),oy(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,wf(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function f9(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=hf(i);e=n._el=e?Kd(n,e,!0):null,M4(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Au,a=e?s.renderer:s.headless;return n._renderer=a?cA(n,n._renderer,e,a):null,n._handler=c9(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=Kd(n,t,!0):e.appendChild(qt("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=Kd(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{t9(n,u.element||t,u)})),n}function Kd(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const aa=e=>+e||0,d9=e=>({top:e,bottom:e,left:e,right:e});function Xx(e){return U(e)?{top:aa(e.top),bottom:aa(e.bottom),left:aa(e.left),right:aa(e.right)}:d9(aa(e))}async function ay(e,t,n,i){const r=hf(t),s=r&&r.headless;return s||A("Unrecognized renderer type: "+t),await e.runAsync(),cA(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function h9(e,t){e!==Zi.Canvas&&e!==Zi.SVG&&e!==Zi.PNG&&A("Unrecognized image type: "+e);const n=await ay(this,e,t);return e===Zi.SVG?p9(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function p9(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function g9(e,t){return(await ay(this,Zi.Canvas,e,t)).canvas()}async function m9(e){return(await ay(this,Zi.SVG,e)).svg()}function y9(e,t,n){return rA(e,ro,Qa,n).parse(t)}function b9(e){var t=this._runtime.scales;return G(t,e)||A("Unrecognized scale or projection: "+e),t[e].value}var fA="width",dA="height",uy="padding",Yx={skip:!0};function hA(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===uy?i.left+i.right:0)}function pA(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===uy?i.top+i.bottom:0)}function x9(e){var t=e._signals,n=t[fA],i=t[dA],r=t[uy];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=hA(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=pA(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function v9(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(fA,n,Yx),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(dA,i,Yx),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function E9(e){return this._runtime.getState(e||{data:w9,signals:S9,recurse:!0})}function w9(e,t){return t.modified&&F(t.input.value)&&!e.startsWith("_:vega:_")}function S9(e,t){return!(e==="parent"||t instanceof ro.proxy)}function k9(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function $9(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(f_(n,t))}function A9(e,t,n,i){const r=e.element();r&&r.setAttribute("title",C9(i))}function C9(e){return e==null?"":F(e)?gA(e):U(e)&&!rr(e)?F9(e):e+""}function F9(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(F(n)?gA(n):mA(n))}).join(` 9`)}function gA(e){return"["+e.map(mA).join(", ")+"]"}function mA(e){return F(e)?"[â¦]":U(e)&&!rr(e)?"{â¦}":e}function O9(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e?.();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function yA(e,t){const n=this;if(t=t||{},Ks.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 s=re({},e.locale,t.locale);n.locale(xS(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Zi.Canvas,n._scenegraph=new dk;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||A9,n._redraw=!0,n._handler=new Au().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=V4(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=y9(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:re({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=hA(n,n._width),n._viewHeight=pA(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,x9(n),L4(n),P4(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function al(e,t){return G(e._signals,t)?e._signals[t]:A("Unrecognized signal name: "+L(t))}function bA(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function Kx(e,t,n,i){let r=bA(n,i);return r||(r=oy(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function Jx(e,t,n){const i=bA(t,n);return i&&t._targets.remove(i),e}z(yA,Ks,{async evaluate(e,t,n){if(await Ks.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,U4(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Sl(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&&oA(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 i=al(this,e);return arguments.length===1?i.value:this.update(i,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",Xx(e)):Xx(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?(hf(e)||A("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&&(Ks.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(al(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:v9,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=oy(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||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 Kx(this,e,al(this,e),t)},removeSignalListener(e,t){return Jx(this,al(this,e),t)},addDataListener(e,t){return Kx(this,e,pc(this,e).values,t)},removeDataListener(e,t){return Jx(this,pc(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=$p(this,null);this._globalCursor=!!e,t&&$p(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:$9,events:Y4,finalize:J4,hover:K4,data:I4,change:Ef,insert:z4,remove:B4,scale:b9,initialize:f9,toImageURL:h9,toCanvas:g9,toSVG:m9,getState:E9,setState:k9,_watchPixelRatio:O9});const D9="view",mc="[",yc="]",xA="{",vA="}
9",R9=":",EA=",",_9="@",T9=">",N9=/[[\]{}]/,M9={"*":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 wA,SA;function Er(e,t,n){return wA=t||D9,SA=n||M9,kA(e.trim()).map(Ap)}function L9(e){return SA[e]}function Pa(e,t,n,i,r){const s=e.length;let o=0,a;for(;t<s;++t){if(a=e[t],!o&&a===n)return t;r&&r.includes(a)?--o:i&&i.includes(a)&&++o}return t}function kA(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Pa(e,r,EA,mc+xA,yc+vA),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function Ap(e){return e[0]==="["?P9(e):I9(e)}function P9(e){const t=e.length;let n=1,i;if(n=Pa(e,n,yc,mc,yc),n===t)throw"Empty between selector: "+e;if(i=kA(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==T9)throw"Expected '>' after between selector: "+e;i=i.map(Ap);const r=Ap(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function I9(e){const t={source:wA},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===vA){if(a=e.lastIndexOf(xA),a>=0){try{i=z9(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===_9&&(r=++a),u=Pa(e,a,R9),u<o&&(n.push(e.substring(s,u).trim()),s=a=++u),a=Pa(e,a,mc),a===o)n.push(e.substring(s,o).trim());else if(n.push(e.substring(s,a).trim()),l=[],s=++a,s===o)throw"Unmatched left bracket: "+e;for(;a<o;){if(a=Pa(e,a,yc),a===o)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,a).trim()),a<o-1&&e[++a]!==mc)throw"Expected left bracket: "+e;s=++a}if(!(o=n.length)||N9.test(n[o-1]))throw"Invalid event selector: "+e;return o>1?(t.type=n[1],r?t.markname=n[0].slice(1):L9(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)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function z9(e){const t=e.split(EA);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function B9(e){return U(e)?e:{type:e||"pad"}}const ua=e=>+e||0,U9=e=>({top:e,bottom:e,left:e,right:e});function j9(e){return U(e)?e.signal?e:{top:ua(e.top),bottom:ua(e.bottom),left:ua(e.left),right:ua(e.right)}:U9(ua(e))}const Ke=e=>U(e)&&!F(e)?re({},e):{value:e};function Qx(e,t,n,i){return n!=null?(U(n)&&!F(n)||F(n)&&n.length&&U(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function ot(e,t,n){for(const i in t)Qx(e,i,t[i]);for(const i in n)Qx(e,i,n[i],"update")}function Uo(e,t,n){for(const i in t)n&&G(n,i)||(e[i]=re(e[i]||{},t[i]));return e}function qs(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const ly="mark",cy="frame",fy="scope",q9="axis",W9="axis-domain",G9="axis-grid",H9="axis-label",V9="axis-tick",X9="axis-title",Y9="legend",K9="legend-band",J9="legend-entry",Q9="legend-gradient",$A="legend-label",Z9="legend-symbol",e7="legend-title",t7="title",n7="title-text",i7="title-subtitle";function r7(e,t,n,i,r){const s={},o={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!qs(u,e)&&Jd(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===cy?r.group:n===ly?re({},r.mark,r[t]):null;for(u in c)l=qs(u,e)||(u==="fill"||u==="stroke")&&(qs("fill",e)||qs("stroke",e)),l||Jd(s,u,c[u]);q(i).forEach(f=>{const d=r.style&&r.style[f];for(const p in d)qs(p,e)||Jd(s,p,d[p])}),e=re({},e);for(u in s)c=s[u],c.signal?(a=a||{})[u]=c:o[u]=c;return e.enter=re(o,e.enter),a&&(e.update=re(a,e.update)),e}function Jd(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const AA=e=>j(e)?L(e):e.signal?`(${e.signal})`:CA(e);function Sf(e){if(e.gradient!=null)return o7(e);let t=e.signal?`(${e.signal})`:e.color?s7(e.color):e.field!=null?CA(e.field):e.value!==void 0?L(e.value):void 0;return e.scale!=null&&(t=a7(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${Pl(e.exponent)})`),e.mult!=null&&(t+=`*${Pl(e.mult)}`),e.offset!=null&&(t+=`+${Pl(e.offset)}`),e.round&&(t=`round(${t})`),t}const ul=(e,t,n,i)=>`(${e}(${[t,n,i].map(Sf).join(",")})+'')`;function s7(e){return e.c?ul("hcl",e.h,e.c,e.l):e.h||e.s?ul("hsl",e.h,e.s,e.l):e.l||e.a?ul("lab",e.l,e.a,e.b):e.r||e.g||e.b?ul("rgb",e.r,e.g,e.b):null}function o7(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:L(n));for(;t.length&&ue(t)==null;)t.pop();return t.unshift(AA(e.gradient)),`gradient(${t.join(",")})`}function Pl(e){return U(e)?"("+Sf(e)+")":e}function CA(e){return FA(U(e)?e:{datum:e})}function FA(e){let t,n,i;if(e.signal)t="datum",i=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?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):A("Invalid field reference: "+L(e));return e.signal||(i=j(i)?si(i).map(L).join("]["):FA(i)),t+"["+i+"]"}function a7(e,t){const n=AA(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}
9)`+(+e.band==1?"":"*"+Pl(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function u7(e){let t="";return e.forEach(n=>{const i=Sf(n);t+=n.test?`(${n.test})?${i}:`:i}),ue(t)===":"&&(t+="null"),t}function OA(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=r7(e,t,n,i,r.config);for(const a in e)o[a]=l7(e[a],t,s,r);return s}function l7(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=f7(c7(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function c7(e){return F(e)?u7(e):Sf(e)}function f7(e,t,n,i){const r=ti(e,t);return r.$fields.forEach(s=>i[s]=1),re(n,r.$params),r.$expr}const d7="outer",h7=["value","update","init","react","bind"];function Zx(e,t){A(e+' for "outer" push: '+L(t))}function DA(e,t){const n=e.name;if(e.push===d7)t.signals[n]||Zx("No prior signal definition",n),h7.forEach(i=>{e[i]!==void 0&&Zx("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function Cp(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function kf(e,t,n,i){return new Cp(e,t,n,i)}function bc(e,t){return kf("operator",e,t)}function J(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Za(e,t){return t?{$field:e,$name:t}:{$field:e}}const Fp=Za("key");function ev(e,t){return{$compare:e,$order:t}}function p7(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const g7="ascending",m7="descending";function y7(e){return U(e)?(e.order===m7?"-":"+")+$f(e.op,e.field):""}function $f(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const dy="scope",Op="view";function He(e){return e&&e.signal}function b7(e){return e&&e.expr}function Il(e){if(He(e))return!0;if(U(e)){for(const t in e)if(Il(e[t]))return!0}return!1}function yn(e,t){return e??t}function Vr(e){return e&&e.signal||e}const tv="timer";function eu(e,t){return(e.merge?v7:e.stream?E7:e.type?w7:A("Invalid stream specification: "+L(e)))(e,t)}function x7(e){return e===dy?Op:e||Op}function v7(e,t){const n=e.merge.map(r=>eu(r,t)),i=hy({merge:n},e,t);return t.addStream(i).id}function E7(e,t){const n=eu(e.stream,t),i=hy({stream:n},e,t);return t.addStream(i).id}function w7(e,t){let n;e.type===tv?(n=t.event(tv,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(x7(e.source),e.type);const i=hy({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function hy(e,t,n){let i=t.between;return i&&(i.length!==2&&A('Stream "between" parameter must have 2 entries: '+L(t)),e.between=[eu(i[0],n),eu(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(S7(t.marktype,t.markname,t.markrole)),t.source===dy&&i.push("inScope(event.item)"),i.length&&(e.filter=ti("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function S7(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const k7={code:"_.$value",ast:{type:"Identifier",value:"value"}};function $7(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||A("Signal update missing events specification."),j(s)&&(s=Er(s,t.isSubscope()?dy:Op)),s=q(s).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[C7(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&A("Signal encode and update are mutually exclusive."),o="encode(item(),"+L(i)+")"),r.update=j(o)?ti(o,t):o.expr!=null?ti(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:k7,$params:{$value:t.signalRef(o.signal)}}:A("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(re(A7(u,t),r)))}function A7(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):eu(e,t)}}function C7(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function F7(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?A("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=ti(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>$7(r,t,n.id))}const Ee=e=>(t,n,i)=>kf(e,n,t||void 0,i),RA=Ee("aggregate"),O7=Ee("axisticks"),_A=Ee("bound"),Tn=Ee("collect"),nv=Ee("compare"),D7=Ee("datajoin"),TA=Ee("encode"),R7=Ee("expression"),_7=Ee("facet"),T7=Ee("field"),N7=Ee("key"),M7=Ee("legendentries"),L7=Ee("load"),P7=Ee("mark"),I7=Ee("multiextent"),z7=Ee("multivalues"),B7=Ee("overlap"),U7=Ee("params"),NA=Ee("prefacet"),j7=Ee("projection"),q7=Ee("proxy"),W7=Ee("relay"),MA=Ee("render"),G7=Ee("scale"),Ss=Ee("sieve"),H7=Ee("sortitems"),LA=Ee("viewlayout"),V7=Ee("values");let X7=0;const PA={min:"min",max:"max",count:"sum"};function Y7(e,t){const n=e.type||"linear";$2(n)||A("Unrecognized scale type: "+L(n)),t.addScale(e.name,{type:n,domain:void 0})}function K7(e,t){const n=t.getScale(e.name).params;let i;n.domain=IA(e.domain,e,t),e.range!=null&&(n.range=BA(e,t,n)),e.interpolate!=null&&oB(e.interpolate,n),e.nice!=null&&(n.nice=sB(e.nice,t)),e.bins!=null&&(n.bins=rB(e.bins,t));for(i in e)G(n,i)||i==="name"||(n[i]=Zt(e[i],t))}function Zt(e,t){return U(e)?e.signal?t.signalRef(e.signal):A("Unsupported object: "+L(e)):e}function zl(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Zt(n,t))}function Af(e){A("Can not find data set: "+L(e))}function IA(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&A("No scale domain defined for domainMin/d
9omainMax to override.");return}return e.signal?n.signalRef(e.signal):(F(e)?J7:e.fields?Z7:Q7)(e,t,n)}function J7(e,t,n){return e.map(i=>Zt(i,n))}function Q7(e,t,n){const i=n.getData(e.data);return i||Af(e.data),ao(t.type)?i.valuesRef(n,e.field,zA(e.sort,!1)):F2(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Z7(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=j(o)?{data:i,field:o}:F(o)||o.signal?eB(o,n):o,s.push(o),s),[]);return(ao(t.type)?tB:F2(t.type)?nB:iB)(e,n,r)}function eB(e,t){const n="_:vega:_"+X7++,i=Tn({});if(F(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+L(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,Ss({})]),{data:n,field:"data"}}function tB(e,t,n){const i=zA(e.sort,!0);let r,s;const o=n.map(l=>{const c=t.getData(l.data);return c||Af(l.data),c.countsRef(t,l.field,i)}),a={groupby:Fp,pulse:o};i&&(r=i.op||"count",s=i.field?$f(r,i.field):"count",a.ops=[PA[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(RA(a));const u=t.add(Tn({pulse:J(r)}));return s=t.add(V7({field:Fp,sort:t.sortRef(i),pulse:J(u)})),J(s)}function zA(e,t){return e&&(!e.field&&!e.op?U(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?A("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!PA[e.op]&&A("Multiple domain scales can not be sorted using "+e.op)),e}function nB(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||Af(r.data),s.domainRef(t,r.field)});return J(t.add(z7({values:i})))}function iB(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||Af(r.data),s.extentRef(t,r.field)});return J(t.add(I7({extents:i})))}function rB(e,t){return e.signal||F(e)?zl(e,t):t.objectProperty(e)}function sB(e,t){return e.signal?t.signalRef(e.signal):U(e)?{interval:Zt(e.interval),step:Zt(e.step)}:Zt(e)}function oB(e,t){t.interpolate=Zt(e.type||e),e.gamma!=null&&(t.interpolateGamma=Zt(e.gamma))}function BA(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(j(r)){if(i&&G(i,r))return e=re({},e,{range:i[r]}),BA(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=ao(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:A("Unrecognized scale range value: "+L(r))}else if(r.scheme){n.scheme=F(r.scheme)?zl(r.scheme,t):Zt(r.scheme,t),r.extent&&(n.schemeExtent=zl(r.extent,t)),r.count&&(n.schemeCount=Zt(r.count,t));return}else if(r.step){n.rangeStep=Zt(r.step,t);return}else{if(ao(e.type)&&!F(r))return IA(r,e,t);F(r)||A("Unsupported range type: "+L(r))}return r.map(s=>(F(s)?zl:Zt)(s,t))}function aB(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=Dp(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=Dp(n[r],r,t));t.addProjection(e.name,i)}function Dp(e,t,n){return F(e)?e.map(i=>Dp(i,t,n)):U(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:A("Unsupported parameter object: "+L(e)):e}const Nn="top",jo="left",qo="right",pr="bottom",UA="center",uB="vertical",lB="start",cB="middle",fB="end",Rp="index",py="label",dB="offset",ho="perc",hB="perc2",tn="value",Ru="guide-label",gy="guide-title",pB="group-title",gB="group-subtitle",iv="symbol",Bl="gradient",_p="discrete",Tp="size",mB="shape",yB="fill",bB="stroke",xB="strokeWidth",vB="strokeDash",EB="opacity",my=[Tp,mB,yB,bB,xB,vB,EB],_u={name:1,style:1,interactive:1},le={value:0},nn={value:1},Cf="group",jA="rect",yy="rule",wB="symbol",ks="text";function tu(e){return e.type=Cf,e.interactive=e.interactive||!1,e}function Lt(e,t){const n=(i,r)=>yn(e[i],yn(t[i],r));return n.isVertical=i=>uB===yn(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>yn(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>yn(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>yn(e.columns,yn(t.columns,+n.isVertical(!0))),n}function qA(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 SB(e,t,n){const i=t.config.style[n];return i&&i[e]}function Ff(e,t,n){return`item.anchor === '${lB}' ? ${e} : item.anchor === '${fB}' ? ${t} : ${n}`}const by=Ff(L(jo),L(qo),L(UA));function kB(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},U(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function WA(e,t){return t?e?U(e)?Object.assign({},e,{offset:WA(e.offset,t)}):{value:e,offset:t}:t:e}function Yt(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Uo(e.encode,t,_u)):e.interactive=!1,e}function $B(e,t,n,i){const r=Lt(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=o,d=a):(l=[0,0],c=[1,0],f=a,d=o);const p={enter:u={opacity:le,x:le,y:le,width:Ke(f),height:Ke(d)},update:re({},u,{opacity:nn,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:le}};return ot(p,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Yt({type:jA,role:Q9,encode:p},i)}function AB(e,t,n,i,r){const s=Lt(e,n),o=s.isVertical(),a=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,p="";o?(l="y",f="y2",c="x",d="width",p="1-"):(l="x",f="x2",c="y",d="height");const h={opacity:le,fill:{scale:t,field:tn}};h[l]={signal:p+"datum."+ho,mult:u},h[c]=le,h[f]={signal:p+"datum."+hB,mult:u},h[d]=Ke(a);const g={enter:h,update:re({}
vendor: 3,441 bytes, line 9
9,h,{opacity:nn}),exit:{opacity:le}};return ot(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),Yt({type:jA,role:K9,key:tn,from:r,encode:g},i)}const CB=`datum.${ho}<=0?"${jo}":datum.${ho}>=1?"${qo}":"${UA}"`,FB=`datum.${ho}<=0?"${pr}":datum.${ho}>=1?"${Nn}":"${cB}"`;function rv(e,t,n,i){const r=Lt(e,t),s=r.isVertical(),o=Ke(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,p="";const h={enter:l={opacity:le},update:c={opacity:nn,text:{field:py}},exit:{opacity:le}};return ot(h,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:yn(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:FB},f="y",d="x",p="1-"):(l.align=c.align={signal:CB},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:p+"datum."+ho,mult:a},l[d]=c[d]=o,o.offset=yn(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+Rp}:void 0,Yt({type:ks,role:$A,style:Ru,key:tn,from:i,encode:h,overlap:u},n)}function OB(e,t,n,i,r){const s=Lt(e,t),o=n.entries,a=!!(o&&o.interactive),u=o?o.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${dB} : datum.${Tp}`,p=l?Ke(l):{field:Tp},h=`datum.${Rp}`,g=`max(1, ${r})`;let m,y,b,v,w;p.mult=.5,m={enter:y={opacity:le,x:{signal:d,mult:.5,offset:c},y:p},update:b={opacity:nn,x:y.x,y:y.y},exit:{opacity:le}};let E=null,S=null;e.fill||(E=t.symbolBaseFillColor,S=t.symbolBaseStrokeColor),ot(m,{fill:s("symbolFillColor",E),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",S),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),my.forEach(P=>{e[P]&&(b[P]=y[P]={scale:e[P],field:tn})});const x=Yt({type:wB,role:Z9,key:tn,from:f,clip:l?!0:void 0,encode:m},n.symbols),k=Ke(c);k.offset=s("labelOffset"),m={enter:y={opacity:le,x:{signal:d,offset:k},y:p},update:b={opacity:nn,text:{field:py},x:y.x,y:y.y},exit:{opacity:le}},ot(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const D=Yt({type:ks,role:$A,style:Ru,key:tn,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:le,height:l?Ke(l):le,opacity:le},exit:{opacity:le},update:b={opacity:nn,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${h}%${v}`,b.column.signal=`floor(${h} / ${v})`,w={field:["row",h]}):(b.row.signal=`floor(${h} / ${g})`,b.column.signal=`${h} % ${g}`,w={field:h}),b.column.signal=`(${r})?${b.column.signal}:${h}`,i={facet:{data:i,name:"value",groupby:Rp}},tu({role:fy,from:i,encode:Uo(m,o,_u),marks:[x,D],name:u,interactive:a,sort:w})}function DB(e,t){const n=Lt(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const xy='item.orient === "left"',vy='item.orient === "right"',Of=`(${xy} || ${vy})`,RB=`datum.vgrad && ${Of}`,_B=Ff('"top"','"bottom"','"middle"'),TB=Ff('"right"','"left"','"center"'),NB=`datum.vgrad && ${vy} ? (${TB}) : (${Of} && !(datum.vgrad && ${xy})) ? "left" : ${by}
9`,MB=`item._anchor || (${Of} ? "middle" : "start")`,LB=`${RB} ? (${xy} ? -90 : 90) : 0`,PB=`${Of} ? (datum.vgrad ? (${vy} ? "bottom" : "top") : ${_B}) : "top"`;function IB(e,t,n,i){const r=Lt(e,t),s={enter:{opacity:le},update:{opacity:nn,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:le}};return ot(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:MB},angle:{signal:LB},align:{signal:NB},baseline:{signal:PB},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),Yt({type:ks,role:e7,style:gy,from:i,encode:s},n)}function zB(e,t){let n;return U(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+sv(e.path)+")":e.sphere&&(n="geoShape("+sv(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function sv(e){return U(e)&&e.signal?e.signal:L(e)}function GA(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===Cf?fy:t||ly}function BB(e){return{marktype:e.type,name:e.name||void 0,role:e.role||GA(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function UB(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function Ey(e,t){const n=_S(e.type);n||A("Unrecognized transform type: "+L(e.type));const i=kf(n.type.toLowerCase(),null,HA(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function HA(e,t,n){const i={},r=e.params.length;for(let s=0;s<r;++s){const o=e.params[s];i[o.name]=jB(o,t,n)}return i}function jB(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return qB(e,t,n);if(r===void 0){e.required&&A("Missing required "+L(t.type)+" parameter: "+L(e.name));return}else{if(i==="param")return WB(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!He(r)?r.map(s=>ov(e,s,n)):ov(e,r,n)}function ov(e,t,n){const i=e.type;if(He(t))return uv(i)?A("Expression references can not be signals."):Qd(i)?n.fieldRef(t):lv(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||Qd(i);return r&&GB(t)?n.exprRef(t.expr,t.as):r&&HB(t)?Za(t.field,t.as):uv(i)?ti(t,n):VB(i)?J(n.getData(t).values):Qd(i)?Za(t):lv(i)?n.compareRef(t):t}}function qB(e,t,n){return j(t.from)||A('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function WB(e,t,n){const i=t[e.name];return e.array?(F(i)||A("Expected an array of sub-parameters. Instead: "+L(i)),i.map(r=>av(e,r,n))):av(e,i,n)}function av(e,t,n){const i=e.params.length;let r;for(let o=0;o<i;++o){r=e.params[o];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||A("Unsupported parameter: "+L(t));const s=re(HA(r,t,n),r.key);return J(n.add(U7(s)))}const GB=e=>e&&e.expr,HB=e=>e&&e.field,VB=e=>e==="data",uv=e=>e==="expr",Qd=e=>e==="field",lv=e=>e==="compare";function XB(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||A("Only group marks can be faceted."),i.field!=null?o=a=Ul(i,n):(e.data?a=J(n.getData(e.data).aggregate):(s=Ey(re({type:"aggregate",groupby:q(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=Ul(i,n),o=a=J(n.add(s))),r=n.keyRef(i.groupby,!0))):o=J(n.add(Tn(null,[{}]))),o||(o=Ul(e,n)),{key:r,pulse:o,parent:a}}function Ul(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:J(t.getData(e.data).output)}function ss(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}ss.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=J(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(o=t[a]);return new ss(e,s,r,i,o)};function VA(e){return j(e)?e:null}function cv(e,t,n){const i=$f(n.op,n.field);let r;if(t.ops){for(let s=0,o=t.as.length;s<o;++s)if(t.as[s]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function la(e,t,n,i,r,s,o){const a=t[n]||(t[n]={}),u=y7(s);let l=VA(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=s?{field:Fp,pulse:t.countsRef(e,r,s)}:{field:e.fieldRef(r),pulse:J(t.output)};u&&(d.sort=e.sortRef(s)),f=e.add(kf(i,void 0,d)),o&&(t.index[r]=f),c=J(f),l!=null&&(a[l]=c)}return c}ss.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),s=VA(t);let o,a,u;return s!=null&&(e=i.scope,o=r[s]),o?n&&n.field&&cv(e,o.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:J(i.output)},n&&n.field&&cv(e,u,n),a=e.add(RA(u)),o=e.add(Tn({pulse:J(a)})),o={agg:a,ref:J(o)},s!=null&&(r[s]=o)),o.ref},tuplesRef(){return J(this.values)},extentRef(e,t){return la(e,this,"extent","extent",t,!1)},domainRef(e,t){return la(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return la(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return la(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return la(e,this,"indata","tupleindex",t,!0,!0)}};function YB(e,t,n){const i=e.from.facet,r=i.name,s=Ul(i,t);let o;i.name||A("Facet must have a name: "+L(i)),i.data||A("Facet must reference a data set: "+L(i)),i.field?o=t.add(NA({field:t.fieldRef(i.field),pulse:s})):i.groupby?o=t.add(_7({key:t.keyRef(i.groupby),group:J(t.proxy(n.parent)),pulse:s})):A("Facet must specify groupby or field: "+L(i));const a=t.fork(),u=a.add(Tn()),l=a.add(Ss({pulse:J(u)}));a.addData(r,new ss(a,u,u,l)),a.addSignal("parent",null),o.params.subflow={$subflow:a.parse(e).toRuntime()}}function KB(e,t,n){const i=t.add(NA({pulse:n.pulse}
vendor: 8,013 bytes, line 9
9)),r=t.fork();r.add(Ss()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function XA(e,t,n){const i=e.remove,r=e.insert,s=e.toggle,o=e.modify,a=e.values,u=t.add(bc()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,s,o,a].map(f=>f??"null").join(",")+"),0)",c=ti(l,t);u.update=c.$expr,u.params=c.$params}function Df(e,t){const n=GA(e),i=e.type===Cf,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===fy||n===cy,a,u,l,c,f,d,p;const h=n===ly||o||r,g=XB(e.from,i,t);u=t.add(D7({key:g.key||(e.key?Za(e.key):void 0),pulse:g.pulse,clean:!i}));const m=J(u);u=l=t.add(Tn({pulse:m})),u=t.add(P7({markdef:BB(e),interactive:UB(e.interactive,t),clip:zB(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:J(u)}));const y=J(u);u=c=t.add(TA(OA(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(S=>{const x=Ey(S,t),k=x.metadata;(k.generates||k.changes)&&A("Mark transforms should not generate new data."),k.nomod||(c.params.mod=!0),x.params.pulse=J(u),t.add(u=x)}),e.sort&&(u=t.add(H7({sort:t.compareRef(e.sort),pulse:J(u)})));const b=J(u);(r||o)&&(o=t.add(LA({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=J(o));const v=t.add(_A({mark:y,pulse:d||b}));p=J(v),i&&(h&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||p,m),r?YB(e,t,g):h?KB(e,t,g):t.parse(e),t.popState(),h&&(o&&a.push(o),a.push(v))),s&&(p=JB(s,p,t));const w=t.add(MA({pulse:p})),E=t.add(Ss({pulse:J(w)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new ss(t,l,w,E)),e.on&&e.on.forEach(S=>{(S.insert||S.remove||S.toggle)&&A("Marks only support modify triggers."),XA(S,t,f)}))}function JB(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:He(s)?n.signalRef(s.signal):s,method:He(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=He(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return J(n.add(B7(o)))}function QB(e,t){const n=t.config.legend,i=e.encode||{},r=Lt(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,u=s.style,l={};let c=0,f,d,p;my.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||A("Missing valid scale for legend.");const h=ZB(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:h,vgrad:h!=="symbol"&&r.isVertical()},m=J(t.add(Tn(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=J(t.add(M7(d={type:h,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return h===Bl?(p=[$B(e,c,n,i.gradient),rv(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Vr(r.gradientLength())})/100))`)):h===_p?p=[AB(e,c,n,i.gradient,b),rv(e,n,i.labels,b)]:(f=DB(e,n),p=[OB(e,n,i,b,Vr(f.columns))],d.size=nU(e,t,p[0].marks)),p=[tu({role:J9,from:m,encode:y,marks:p,layout:f,interactive:a})],g.title&&p.push(IB(e,n,i.title,m)),Df(tu({role:Y9,from:m,encode:Uo(tU(r,e,n),s,_u),marks:p,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:u}),t)}function ZB(e,t){let n=e.type||iv;return!e.type&&eU(e)===1&&(e.fill||e.stroke)&&(n=Tm(t)?Bl:Yh(t)?_p:iv),n!==Bl?n:Yh(t)?_p:Bl}function eU(e){return my.reduce((t,n)=>t+(e[n]?1:0),0)}function tU(e,t,n){const i={enter:{},update:{}};return ot(i,{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}),i}function nU(e,t,n){const i=Vr(fv("size",e,n)),r=Vr(fv("strokeWidth",e,n)),s=Vr(iU(n[1].encode,t,Ru));return ti(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function fv(e,t,n){return t[e]?`scale("${t[e]}",datum)`:qA(e,n[0].encode)}function iU(e,t,n){return qA("fontSize",e)||SB("fontSize",t,n)}const rU=`item.orient==="${jo}"?-90:item.orient==="${qo}"?90:0`;function sU(e,t){e=j(e)?{text:e}:e;const n=Lt(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,u=[],l={},c=J(t.add(Tn(null,[l])));return u.push(uU(e,n,oU(e),c)),e.subtitle&&u.push(lU(e,n,i.subtitle,c)),Df(tu({role:t7,from:c,encode:aU(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function oU(e){const t=e.encode;return t&&t.title||re({name:e.name,interactive:e.interactive,style:e.style},t)}function aU(e,t){const n={enter:{},update:{}};return ot(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:by},angle:{signal:rU},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Uo(n,t,_u)}function uU(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return ot(o,{text:s,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")}),Yt({type:ks,role:n7,style:pB,from:i,encode:o},n)}function lU(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return ot(o,{text:s,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")}),Yt({type:ks,role:i7,style:gB,from:i,encode:o},n)}function cU(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(Ey(i,t))}),e.on&&e.on.forEach(i=>{XA(i,t,e.name)}),t.addDataPipeline(e.name,fU(e,t,n))}function fU(e,t,n){const i=[];let r=null,s=!1,o=!1,a,u,l,c,f;for(e.values?He(e.values)||Il(e.format)?(i.push(dv(t,e)),i.push(r=Rr())):i.push(r=Rr({$ingest:e.values,$format:e.format})):e.url?Il(e.url)||Il(e.format)?(i.push(dv(t,e)),i.push(r=Rr())):i.push(r=Rr({$request:e.url,$format:e.format})):e.source&&(r=a=q(e.source).map(d=>J(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=Rr()),i.push(c),f.generates&&(o=!0),f.modifies&&!o&&(s=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=W7({derive:s,pulse:l?a:a[0]}),(s||l)&&i.splice(1,0,Rr())),r||i.push(Rr()),i.push(Ss({})),i}function Rr(e){const t=Tn({},e);return t.metadata={source:!0},t}function dv(e,t){return L7({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const YA=e=>e===pr||e===Nn,Rf=(e,t,n)=>He(e)?gU(e.signal,t,n):e===jo||e===Nn?t:n,Je=(e,t,n)=>He(e)?hU(e.signal,t,n):YA(e)?t:n,Sn=(e,t,n)=>He(e)?pU(e.signal,t,n):YA(e)?n:t,KA=(e,t,n)=>He(e)?mU(e.signal,t,n):e===Nn?{value:t}:{value:n},dU=(e,t,n)=>He(e)?yU(e.signal,t,n):e===qo?{value:t}:{value:n},hU=(e,t,n)=>JA(`${e} === '${Nn}' || ${e} === '${pr}'`,t,n),pU=(e,t,n)=>JA(`${e} !== '${Nn}' && ${e} !== '${pr}'`,t,n),gU=(e,t,n)=>wy(`${e} === '${jo}' || ${e} === '${Nn}'`,t,n),mU=(e,t,n)=>wy(`${e} === '${Nn}'`,t,n),yU=(e,t,n)=>wy(`${e} === '${qo}'`,t,n),JA=(e,t,n)=>(t=t!=null?Ke(t):t,n=n!=null?Ke(n):n,hv(t)&&hv(n)?(t=t?t.signal||L(t.value):null,n=n?n.signal||L(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[re({test:e},t)].concat(n||[])),hv=e=>e==null||Object.keys(e).length===1,wy=(e,t,n)=>({signal:`${e} ? (${Xs(t)}) : (${Xs(n)})`}),bU=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${jo}' ? (${Xs(i)}) : `:"")+(n!=null?`${e} === '${pr}' ? (${Xs(n)}) : `:"")+(r!=null?`${e} === '${qo}' ? (${Xs(r)}
9) : `:"")+(t!=null?`${e} === '${Nn}' ? (${Xs(t)}) : `:"")+"(null)"}),Xs=e=>He(e)?e.signal:e==null?null:L(e),xU=(e,t)=>t===0?0:He(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Js=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function zs(e,t,n,i){let r;if(t&&G(t,e))return t[e];if(G(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[gy][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Ru][r]}return null}function pv(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function vU(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,u,l;if(He(o)){const f=pv([n.axisX,n.axisY]),d=pv([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=Je(o,zs(l,n.axisX,r,i),zs(l,n.axisY,r,i));u={};for(l of d)u[l]=bU(o.signal,zs(l,n.axisTop,r,i),zs(l,n.axisBottom,r,i),zs(l,n.axisLeft,r,i),zs(l,n.axisRight,r,i))}else a=o===Nn||o===pr?n.axisX:n.axisY,u=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||u||s?re({},r,a,u,s):r}function EU(e,t,n,i){const r=Lt(e,t),s=e.orient;let o,a;const u={enter:o={opacity:le},update:a={opacity:nn},exit:{opacity:le}};ot(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=gv(e,0),c=gv(e,1);return o.x=a.x=Je(s,l,le),o.x2=a.x2=Je(s,c),o.y=a.y=Sn(s,l,le),o.y2=a.y2=Sn(s,c),Yt({type:yy,role:W9,from:i,encode:u},n)}function gv(e,t){return{scale:e.scale,range:t}}function wU(e,t,n,i,r){const s=Lt(e,t),o=e.orient,a=e.gridScale,u=Rf(o,1,-1),l=SU(e.offset,u);let c,f,d;const p={enter:c={opacity:le},update:d={opacity:nn},exit:f={opacity:le}};ot(p,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const h={scale:e.scale,field:tn,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=Je(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:re(g,{mult:u,offset:l});return c.x=d.x=Je(o,h,m),c.y=d.y=Sn(o,h,m),c.x2=d.x2=Sn(o,y),c.y2=d.y2=Je(o,y),f.x=Je(o,h),f.y=Sn(o,h),Yt({type:yy,role:G9,key:tn,from:i,encode:p},n)}function SU(e,t){if(t!==1)if(!U(e))e=He(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=re({},e);for(;n.mult!=null;)if(U(n.mult))n=n.mult=re({},n.mult);else return n.mult=He(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function kU(e,t,n,i,r,s){const o=Lt(e,t),a=e.orient,u=Rf(a,-1,1);let l,c,f;const d={enter:l={opacity:le},update:f={opacity:nn},exit:c={opacity:le}};ot(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const p=Ke(r);p.mult=u;const h={scale:e.scale,field:tn,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=l.y=Je(a,le,h),f.y2=l.y2=Je(a,p),c.x=Je(a,h),f.x=l.x=Sn(a,le,h),f.x2=l.x2=Sn(a,p),c.y=Sn(a,h),Yt({type:yy,role:V9,ke
vendor: 16,311 bytes, line 9
9y:tn,from:i,encode:d},n)}function Zd(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function $U(e,t,n,i,r,s){const o=Lt(e,t),a=e.orient,u=e.scale,l=Rf(a,-1,1),c=Vr(o("labelFlush")),f=Vr(o("labelFlushOffset")),d=o("labelAlign"),p=o("labelBaseline");let h=c===0||!!c,g;const m=Ke(r);m.mult=l,m.offset=Ke(o("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:tn,band:.5,offset:WA(s.offset,o("labelOffset"))},b=Je(a,h?Zd(u,c,'"left"','"right"','"center"'):{value:"center"},dU(a,"left","right")),v=Je(a,KA(a,"bottom","top"),h?Zd(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),w=Zd(u,c,`-(${f})`,f,0);h=h&&f;const E={opacity:le,x:Je(a,y,m),y:Sn(a,y,m)},S={enter:E,update:g={opacity:nn,text:{field:py},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:le,x:E.x,y:E.y}};ot(S,{dx:!d&&h?Je(a,w):null,dy:!p&&h?Sn(a,w):null}),ot(S,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:p});const x=o("labelBound");let k=o("labelOverlap");return k=k||x?{separation:o("labelSeparation"),method:k,order:"datum.index",bound:x?{scale:u,orient:a,tolerance:x}:null}:void 0,g.align!==b&&(g.align=Js(g.align,b)),g.baseline!==v&&(g.baseline=Js(g.baseline,v)),Yt({type:ks,role:H9,style:Ru,key:tn,from:i,encode:S,overlap:k},n)}function AU(e,t,n,i){const r=Lt(e,t),s=e.orient,o=Rf(s,-1,1);let a,u;const l={enter:a={opacity:le,anchor:Ke(r("titleAnchor",null)),align:{signal:by}},update:u=re({},a,{opacity:nn,text:Ke(e.title)}),exit:{opacity:le}},c={signal:`lerp(range("${e.scale}"), ${Ff(0,1,.5)})`};return u.x=Je(s,c),u.y=Sn(s,c),a.angle=Je(s,le,xU(o,90)),a.baseline=Je(s,KA(s,pr,Nn),{value:pr}),u.angle=a.angle,u.baseline=a.baseline,ot(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),CU(r,s,l,n),l.update.align=Js(l.update.align,a.align),l.update.angle=Js(l.update.angle,a.angle),l.update.baseline=Js(l.update.baseline,a.baseline),Yt({type:ks,role:X9,style:gy,from:i,encode:l},n)}function CU(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=Js(Ke(a),n.update[u]),!1):!qs(u,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?Ke(o):Je(t,Ke(o),Ke(s))}function FU(e,t){const n=vU(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,u=Lt(e,n),l=kB(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=J(t.add(Tn({},[c]))),d=J(t.add(O7({scale:t.scaleRef(e.scale),extra:t.property(l.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)}))),p=[];let h;return c.grid&&p.push(wU(e,n,i.grid,d,l)),c.ticks&&(h=u("tickSize"),p.push(kU(e,n,i.ticks,d,h,l))),c.labels&&(h=c.ticks?h:0,p.push($U(e,n,i.labels,d,h,l))),c.domain&&p.push(EU(e,n,i.domain,f)),c.title&&p.push(AU(e,n,i.title,f)),Df(tu({role:q9,from:f,encode:Uo(OU(u,e),r,_u),marks:p,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:o,style:a}),t)}function OU(e,t){const n={enter:{},update:{}};return ot(n,{orient:e("orient"),offset:e("offset")||0,position:yn(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 QA(e,t,n){const i=q(e.signals),r=q(e.scales);return n||i.forEach(s=>DA(s,t)),q(e.projections).forEach(s=>aB(s,t)),r.forEach(s=>Y7(s,t)),q(e.data).forEach(s=>cU(s,t)),r.forEach(s=>K7(s,t)),(n||i).forEach(s=>F7(s,t)),q(e.axes).forEach(s=>FU(s,t)),q(e.marks).forEach(s=>Df(s,t)),q(e.legends).forEach(s=>QB(s,t)),e.title&&sU(e.title,t),t.parseLambdas(),t}const DU=e=>Uo({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function RU(e,t){const n=t.config,i=J(t.root=t.add(bc())),r=_U(e,n);r.forEach(l=>DA(l,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 s=t.add(Tn()),o=t.add(TA(OA(DU(e.encode),Cf,cy,e.style,t,{pulse:J(s)}))),a=t.add(LA({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:J(o)}));t.operators.pop(),t.pushState(J(o),J(a),null),QA(e,t,r),t.operators.push(a);let u=t.add(_A({mark:i,pulse:J(a)}));return u=t.add(MA({pulse:J(u)})),u=t.add(Ss({pulse:J(u)})),t.addData("root",new ss(t,s,s,u)),t}function ca(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function _U(e,t){const n=o=>yn(e[o],t[o]),i=[ca("background",n("background")),ca("autosize",B9(n("autosize"))),ca("padding",j9(n("padding"))),ca("width",n("width")||0),ca("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return q(e.signals).forEach(o=>{G(r,o.name)?o=re(r[o.name],o):i.push(o),s[o.name]=o}),q(t.signals).forEach(o=>{!G(s,o.name)&&!G(r,o.name)&&i.push(o)}),i}function ZA(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 mv(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}ZA.prototype=mv.prototype={parse(e){return QA(e,this)},fork(){return new mv(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 Cp?J(e):e;return this.add(q7({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(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}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 i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(J(this.add(Ss({pulse:e})))),this._parent.push(t),this._lookup.push(n?J(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return ue(this._parent)},encode(){return ue(this._encode)},lookup(){return ue(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(j(e))return Za(e,t);e.signal||A("Unsupported field reference: "+L(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=J(this.add(T7(r)))}return i},compareRef(e){let t=!1;const n=s=>He(s)?(t=!0,this.signalRef(s.signal)):b7(s)?(t=!0,this.exprRef(s.expr)):s,i=q(e.field).map(n),r=q(e.order).map(n);return t?J(this.add(nv({fields:i,orders:r}))):ev(i,r)},keyRef(e,t){let n=!1;const i=s=>He(s)?(n=!0,J(r[s.signal])):s,r=this.signals;return e=q(e).map(i),n?J(this.add(N7({fields:e,flat:t}))):p7(e,t)},sortRef(e){if(!e)return e;const t=$f(e.op,e.field),n=e.order||g7;return n.signal?J(this.add(nv({fields:t,orders:this.signalRef(n.signal)}))):ev(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return G(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&A("Duplicate signal name: "+L(e));const n=t instanceof Cp?t:this.add(bc(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||A("Unrecognized signal name: "+L(e)),this.signals[e]},signalRef(e){return this.signals[e]?J(this.signals[e]):(G(this.lambdas,e)||(this.lambdas[e]=this.add(bc(null))),J(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=ti(i,this),s=this.lambdas[i];s.params=r.$params,s.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!U(e)?e:this.signalRef(e.signal||Sy(e))},exprRef(e,t){const n={expr:ti(e,this)};return t&&(n.expr.$name=t),J(this.add(R7(n)))},addBinding(e,t){this.bindings||A("Nested signals do not support binding: "+L(e)),this.bindings.push(re({signal:e},t))},addScaleProj(e,t){G(this.scales,e)&&A("Duplicate scale or projection name: "+L(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,G7(t))},addProjection(e,t){this.addScaleProj(e,j7(t))},getScale(e){return this.scales[e]||A("Unrecognized scale name: "+L(e)),this.scales[e]},scaleRef(e){return J(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return G(this.data,e)&&A("Duplicate data set name: "+L(e)),this.data[e]=t},getData(e){return this.data[e]||A("Undefined data set name: "+L(e)),this.data[e]},addDataPipeline(e,t){return G(this.data,e)&&A("Duplicate data set name: "+L(e)),this.addData(e,ss.fromEntries(this,t))}};function Sy(e){return(F(e)?TU:NU)(e)}function TU(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(U(r)?r.signal||Sy(r):L(r))}return n+"]"}function NU(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+L(i)+":"+(U(r)?r.signal||Sy(r):L(r));return t+"}"}function MU(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,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:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,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:o,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:s,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 LU(e,t,n){return U(e)||A("Input Vega specification must be an object."),t=_o(MU(),t,e.config),RU(e,new ZA(t,n)).toRuntime()}var PU="6.2.0";re(ro,LM,kP,nI,AI,TI,oz,zI,uz,dz,wz,Oz);const IU=PU,zU=Object.freeze(Object.defineProperty({__proto__:null,Bounds:Ue,CanvasHandler:Au,CanvasRenderer:ac,DATE:Rt,DAY:ft,DAYOFYEAR:ei,Dataflow:Ks,Debug:Fw,DisallowedObjectProperties:yg,Error:bg,EventStream:Gc,Gradient:q2,GroupItem:sf,HOURS:Ht,Handler:r0,HybridHandler:Tk,HybridRenderer:op,Info:Cw,Item:rf,MILLISECONDS:An,MINUTES:Vt,MONTH:gt,Marks:Xt,MultiPulse:Ig,None:Aw,Operator:we,Parameters:Wc,Pulse:sr,QUARTER:Dt,RenderType:Zi,Renderer:$u,ResourceLoader:Y2,SECONDS:on,SVGHandler:vk,SVGRenderer:c0,SVGStringRenderer:_k,Scenegraph:dk,TIME_UNITS:Dg,Transform:$,View:yA,WEEK:We,Warn:xg,YEAR:st,accessor:Mt,accessorFields:pt,accessorName:Me,array:q,ascending:No,bandwidthNRD:jg,bin:MS,bootstrapCI:LS,boundClip:qk,boundContext:Eu,boundItem:tp,boundMark:uk,boundStroke:_i,changeset:vs,clampRange:zw,codegenExpression:W$,compare:Sg,constant:xt,cumulativeLogNormal:Xg,cumulativeNormal:Vc,cumulativeUniform:Qg,dayofyear:Yw,debounce:kg,defaultLocale:Tg,definition:_S,densityLogNormal:Vg,densityNormal:qg,densityUniform:Jg,domChild:qe,domClear:Qt,domCreate:Ji,domFind:i0,dotbin:PS,error:A,expressionFunction:ze,extend:re,extent:Zn,extentIndex:Bw,falsy:ji,fastmap:Mo,field:rn,flush:Uw,font:cf,fontFamily:ku,fontSize:oi,format:wl,formatLocale:Xl,formats:Lg,hasOwnProperty:G,id:lu,identity:bt,inferType:ES,inferTypes:wS,ingest:ge,inherits:z,inrange:Gs,interpolate:Nm,interpolateColors:tf,interpolateRange:O2,intersect:zk,intersectBoxLine:Hs,intersectPath:jm,intersectPoint:qm,intersectRule:J2,isArray:F,isBoolean:bs,isDate:rr,isFunction:ie,isIterable:jw,isNumber:de,isObject:U,isRegExp:$g,isString:j,isTuple:jc,key:Ag,lerp:qw,lineHeight:fr,loader:Bc,locale:xS,logger:Lc,lruCache:Ww,markup:l0,merge:Gw,mergeConfig:_o,multiLineOffset:e0,one:Ro,pad:Hw,panLinear:Tw,panLog:Nw,panPow:Mw,panSymlog:Lw,parse:LU,parseExpression:J0,parseSelector:Er,path:mg,pathCurves:zm,pathEqual:Wk,pathParse:uo,pathRectangle:H2,pathRender:Ga,pathSymbols:G2,pathTrail:V2,peek:ue,point:df,projection:w0,quantileLogNormal:Yg,quantileNormal:Xc,quantileUniform:Zg,quantiles:Bg,quantizeInterpolator:D2,quarter:Pw,quartiles:Ug,get random(){return an},randomInteger:BN,randomKDE:Gg,randomLCG:zN,randomLogNormal:zS,randomMixture:BS,randomNormal:Wg,randomUniform:US,read:$S,regressionConstant:em,regressionExp:qS,regressionLinear:tm,regressionLoess:HS,regressionLog:jS,regressionPoly:GS,regressionPow:WS,regressionQuad:nm,renderModule:hf,repeat:ya,resetDefaultLocale:PT,resetSVGDefIds:j3,responseType:kS,runtimeContext:rA,sampleCurve:Kc,sampleLogNormal:Hg,sampleNormal:Hc,sampleUniform:Kg,scale:he,sceneEqual:f0,sceneFromJSON:ck,scenePickVisit:Zl,sceneToJSON:lk,sceneVisit:Cn,sceneZOrder:Wm,scheme:Mm,serializeXML:Fk,setHybridRendererOptions:I3,setRandom:PN,span:cu,splitAccessPath:si,stringValue:L,textMetrics:jt,timeBin:dS,timeFloor:nS,timeFormatLocale:ja,timeInterval:Lo,timeOffset:sS,timeSequence:uS,timeUnitSpecifier:Xw,timeUnits:Rg,toBoolean:Cg,toDate:Fg,toNumber:dt,toSet:$n,toString:Og,transform:TS,transforms:ro,truncate:Vw,truthy:sn,tupleid:Q,typeParsers:Hh,utcFloor:iS,utcInterval:Po,utcOffset:oS,utcSequence:lS,utcdayofyear:Qw,utcquarter:Iw,utcweek:Zw,version:IU,visitArray:Gi,week:Kw,writeConfig:To,zero:Yi,zoomLinear:vg,zoomLog:Eg,zoomPow:Vl,zoomSymlog:wg},Symbol.toStringTag,{value:"Module"}));function BU(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),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&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.he
9ight||0)/2)}var UU={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},jU={"*":(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>=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>>t,">>>":(e,t)=>e>>>t},qU={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const WU=Array.prototype.slice,_r=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,WU.call(t,1))},GU=(e,t=0,n=1,i=0,r=0,s=0,o=0)=>j(e)?new Date(e):new Date(e,t,n,i,r,s,o);var HU={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:GU,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 _r("join",arguments)},indexof:function(){return _r("indexOf",arguments)},lastindexof:function(){return _r("lastIndexOf",arguments)},slice:function(){return _r("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(No),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return _r("substring",arguments,String)},split:function(){return _r("split",arguments,String)},replace:function(){return _r("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const VU=["view","item","group","xy","x","y"],Np=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Np.add(setImmediate);const XU={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:UU[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),Np.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||HU[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>jU[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>qU[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,i)=>{e.memberDepth+=1;const r=e(i.key);e.memberDepth-=1;const s=e(i.value);return yg.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):Np.has(s)?console.error(`Prevented interpretation of method "${r}" which could lead to insecure code execution`):n[r]=s,n},{})};function fa(e,t,n,i,r,s){const o=a=>XU[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,VU.forEach(a=>o.fn[a]=(...u)=>r.vega[a](...u)),o(e)}var YU={operator(e,t){const n=t.ast,i=e.functions;return r=>fa(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>fa(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>fa(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return fa(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const u=o.datum;let l=0,c;for(const f in i)c=fa(i[f].ast,r,a,u,void 0,o),o[f]!==c&&(o[f]=c,l=1);return n!=="rule"&&BU(o,i,s),l}}},KU="6.4.2",JU={version:KU};function ky(e){return _(e,"or")}function $y(e){return _(e,"and")}function Ay(e){return _(e,"not")}function jl(e,t){if(Ay(e))jl(e.not,t);else if($y(e))for(const n of e.and)jl(n,t);else if(ky(e))for(const n of e.or)jl(n,t);else t(e)}function Qs(e,t){return Ay(e)?{not:Qs(e.not,t)}:$y(e)?{and:e.and.map(n=>Qs(n,t))}:ky(e)?{or:e.or.map(n=>Qs(n,t))}:t(e)}const te=structuredClone;function eC(e){throw new Error(e)}function po(e,t){const n={};for(const i of t)G(e,i)&&(n[i]=e[i]);return n}function Wt(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>xe(e)).join(",")})`};function se(e){if(de(e))return e;const t=j(e)?e:xe(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function Mp(e){return e===!1||e===null}function ae(e,t){return e.includes(t)}function go(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function Cy(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function tC(e,...t){for(const n of t)QU(e,n??{});return e}function QU(e,t){for(const n of R(t))To(e,n,t[n],!0)}function zt(e,t){const n=[],i={};let r;
9for(const s of e)r=t(s),!(r in i)&&(i[r]=1,n.push(s));return n}function ZU(e,t){const n=R(e),i=R(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function nC(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Fy(e,t){for(const n of e)if(t.has(n))return!0;return!1}function Lp(e){const t=new Set;for(const n of e){const r=si(n).map((o,a)=>a===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function Oy(e,t){return e===void 0||t===void 0?!0:Fy(Lp(e),Lp(t))}function Se(e){return R(e).length===0}const R=Object.keys,Be=Object.values,gr=Object.entries;function mo(e){return e===!0||e===!1}function xc(e){return j(e)||de(e)||mo(e)}function De(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Ia(e,t){return Ay(e)?`!(${Ia(e.not,t)})`:$y(e)?`(${e.and.map(n=>Ia(n,t)).join(") && (")})`:ky(e)?`(${e.or.map(n=>Ia(n,t)).join(") || (")})`:t(e)}function vc(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&vc(e[n],t)&&delete e[n],Se(e)}function Tu(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Dy(e,t="datum"){const n=si(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(L).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function iC(e,t="datum"){return`${t}[${L(si(e).join("."))}]`}function ye(e){return`datum['${e.replaceAll("'","\\'")}']`}function rC(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function ej(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function un(e){return`${si(e).map(ej).join("\\.")}`}function os(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Wo(e){return`${si(e).join(".")}`}function yo(e){return e?si(e).length:0}function Pe(...e){return e.find(t=>t!==void 0)}let sC=42;function oC(e){const t=++sC;return e?String(e)+t:t}function tj(){sC=42}function aC(e){return uC(e)?e:`__${e}`}function uC(e){return e.startsWith("__")}function nu(e){if(e!==void 0)return(e%360+360)%360}function _f(e){return de(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const yv=Object.getPrototypeOf(structuredClone({}));function Bt(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,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Bt(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!Bt(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])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!==yv.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==yv.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!Bt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xe(e){const t=[];return(function n(i){if(i?.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?`${i}`:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;r<i.length;r++)r&&(s+=","),s+=n(i[r])||"null";return`${s}]`}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const o=t.push(i)-1,a=Object.keys(i).sort();for(s="",r=0;r<a.length;r++){const u=a[r],l=n(i[u]);l&&(s&&(s+=","),s+=`${JSON.stringify(u)}:${l}`)}return t.splice(o,1),`{${s}}`})(e)}function _(e,t){return U(e)&&G(e,t)&&e[t]!==void 0}const Si="row",ki="column",Tf="facet",Re="x",Ze="y",Mn="x2",li="y2",wr="xOffset",Go="yOffset",Ln="radius",Ni="radius2",fn="theta",Mi="theta2",Pn="latitude",In="longitude",zn="latitude2",ln="longitude2",Sr="time",_t="color",ci="fill",fi="stroke",Tt="shape",Li="size",$s="angle",Pi="opacity",kr="fillOpacity",$r="strokeOpacity",Ar="strokeWidth",Cr="strokeDash",Nu="text",bo="order",Mu="detail",Nf="key",as="tooltip",Mf="href",Lf="url",Pf="description",nj={x:1,y:1,x2:1,y2:1},lC={theta:1,theta2:1,radius:1,radius2:1};function cC(e){return G(lC,e)}const Ry={longitude:1,longitude2:1,latitude:1,latitude2:1};function fC(e){switch(e){case Pn:return"y";case zn:return"y2";case In:return"x";case ln:return"x2"}}function dC(e){return G(Ry,e)}const ij=R(Ry),_y={...nj,...lC,...Ry,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time:1,op
9acity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function Zs(e){return e===_t||e===ci||e===fi}const hC={row:1,column:1,facet:1},en=R(hC),Ty={..._y,...hC},rj=R(Ty),{order:RQ,detail:_Q,tooltip:TQ,...sj}=Ty,{row:NQ,column:MQ,facet:LQ,...oj}=sj;function aj(e){return G(oj,e)}function pC(e){return G(Ty,e)}const uj=[Mn,li,zn,ln,Mi,Ni];function gC(e){return As(e)!==e}function As(e){switch(e){case Mn:return Re;case li:return Ze;case zn:return Pn;case ln:return In;case Mi:return fn;case Ni:return Ln}return e}function mr(e){if(cC(e))switch(e){case fn:return"startAngle";case Mi:return"endAngle";case Ln:return"outerRadius";case Ni:return"innerRadius"}return e}function di(e){switch(e){case Re:return Mn;case Ze:return li;case Pn:return zn;case In:return ln;case fn:return Mi;case Ln:return Ni}}function Nt(e){switch(e){case Re:case Mn:return"width";case Ze:case li:return"height"}}function mC(e){switch(e){case Re:return"xOffset";case Ze:return"yOffset";case Mn:return"x2Offset";case li:return"y2Offset";case fn:return"thetaOffset";case Ln:return"radiusOffset";case Mi:return"theta2Offset";case Ni:return"radius2Offset"}}function Ny(e){switch(e){case Re:return"xOffset";case Ze:return"yOffset"}}function lj(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const cj=R(_y),{x:PQ,y:IQ,x2:zQ,y2:BQ,xOffset:UQ,yOffset:jQ,latitude:qQ,longitude:WQ,latitude2:GQ,longitude2:HQ,theta:VQ,theta2:XQ,radius:YQ,radius2:KQ,...My}=_y,fj=R(My),Ly={x:1,y:1},Ii=R(Ly);function Ie(e){return G(Ly,e)}const Py={theta:1,radius:1},dj=R(Py);function If(e){return e==="width"?Re:Ze}const yC={xOffset:1,yOffset:1};function Lu(e){return G(yC,e)}const hj={time:1};function eh(e){return e in hj}const{text:JQ,tooltip:QQ,href:ZQ,url:eZ,description:tZ,detail:nZ,key:iZ,order:rZ,...bC}=My,pj=R(bC);function gj(e){return G(My,e)}function mj(e){switch(e){case _t:case ci:case fi:case Li:case Tt:case Pi:case Ar:case Cr:return!0;case kr:case $r:case $s:case Sr:return!1}}const xC={...Ly,...Py,...yC,...bC},Iy=R(xC);function hi(e){return G(xC,e)}function yj(e,t){return xj(e)[t]}const vC={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:sZ,...bj}=vC;function xj(e){switch(e){case _t:case ci:case fi:case Pf:case Mu:case Nf:case as:case Mf:case bo:case Pi:case kr:case $r:case Ar:case Tf:case Si:case ki:return vC;case Re:case Ze:case wr:case Go:case Pn:case In:case Sr:return bj;case Mn:case li:case zn:case ln:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Li:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Cr:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Tt:return{point:"always",geoshape:"always"};case Nu:return{text:"always"};case $s:return{point:"always",square:"always",text:"always"};case Lf:return{image:"always"};case fn:return{text:"always",arc:"always"};case Ln:return{text:"always",arc:"always"};case Mi:case Ni:return{arc:"always"}}}function th(e){switch(e){case Re:case Ze:case fn:case Ln:case wr:case Go:case Li:case $s:case Ar:case Pi:case kr:case $r:case Sr:case Mn:case li:case Mi:case Ni:return;case Tf:case Si:case ki:case Tt:case Cr:case Nu:case as:case Mf:case Lf:case Pf:return"discrete";case _t:case ci:case fi:return"flexible";case Pn:case In:case zn:case ln:case Mu:case Nf:case bo:return}}const vj={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Ej={count:1,min:1,max:1};function Oi(e){return _(e,"argmin")}function Fr(e){return _(e,"argmax")}function zy(e){return j(e)&&G(vj,e)}const wj=new Set(["count","valid","missing","distinct"]);function zf(e){return j(e)&&wj.has(e)}function Sj(e){return j(e)&&ae(["min","max"],e)}const kj=new Set(["count","sum","distinct","valid","missing"]),$j=new Set(["mean","average","median","q1","q3","min","max"]);function EC(e){return bs(e)&&(e=Jf(e,void 0)),`bin${R(e).map(t=>Bf(e[t])?De(`_${t}_${gr(e[t])}`):De(`_${t}_${e[t]}`)).join("")}`}function $e(e){return e===!0||Cs(e)&&!e.binned}function et(e){return e==="binned"||Cs(e)&&e.binned===!0}function Cs(e){return U(e)}function Bf(e){return _(e,"param")}function bv(e){switch(e){case Si:case ki:case Li:case _t:case ci:case fi:case Ar:case Pi:case kr:case $r:case Tt:return 6;case Cr:return 4;default:return 10}}function Pu(e){return _(e,"expr")}function tt(e,{level:t}={level:0}){const n=R(e||{}),i={};for(const r of n)i[r]=t===0?It(e[r]):tt(e[r],{level:t-1});return i}function wC(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:u,subtitleFont:l,subt
9itleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:p,subtitlePadding:h,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...p?{subtitleLineHeight:p}:{},...h?{subtitlePadding:h}:{}},v=po(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function Xi(e){return j(e)||F(e)&&j(e[0])}function Y(e){return _(e,"signal")}function Fs(e){return _(e,"step")}function SC(e){return F(e)?!1:_(e,"fields")&&!_(e,"data")}function Aj(e){return F(e)?!1:_(e,"fields")&&_(e,"data")}function wi(e){return F(e)?!1:_(e,"field")&&_(e,"data")}const Cj={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},Fj=R(Cj),Oj={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Pp=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],Dj=" â ";function kC(e){const t=F(e.condition)?e.condition.map(xv):xv(e.condition);return{...It(e),condition:t}}function It(e){if(Pu(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function xv(e){if(Pu(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ce(e){if(Pu(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Y(e)?e:e!==void 0?{value:e}:void 0}function Rj(e){return Y(e)?e.signal:L(e)}function vv(e){return Y(e)?e.signal:L(e.value)}function En(e){return Y(e)?e.signal:e==null?null:L(e)}function _j(e,t,n){for(const i of n){const r=ni(i,t.markDef,t.config);r!==void 0&&(e[i]=Ce(r))}return e}function $C(e){return[].concat(e.type,e.style??[])}function me(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&_(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:ni(e,t,n,i)}function ni(e,t,n,{vgChannel:i}={}){const r=Ip(e,t,n.style);return Pe(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Ip(e,t,n){return AC(e,$C(t),n)}function AC(e,t,n){t=q(t);let i;for(const r of t){const s=n[r];_(s,e)&&(i=s[e])}return i}function CC(e,t){return q(e).reduce((n,i)=>(n.field.push(B(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function FC(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Bt(r,i))return;n.push(i)}),n}function OC(e,t){return Bt(e,t)||!t?e:e?[...q(e),...q(t)].join(", "):t}function DC(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Xi(n)||Y(n))&&(Xi(i)||Y(i)))return{explicit:e.explicit,value:OC(n,i)};if(Xi(n)||Y(n))return{explicit:e.explicit,value:n};if(Xi(i)||Y(i))return{explicit:e.explicit,value:i};if(!Xi(n)&&!Y(n)&&!Xi(i)&&!Y(i))return{explicit:e.explicit,value:FC(n,i)};throw new Error("It should never reach here")}function By(e){return`Invalid specification ${xe(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Tj='Autosize "fit" only works for single views and layered views.';function Ev(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function wv(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 Sv(e){return e?`Dropping "fit-${e}" because spec has discrete ${Nt(e)}.`:'Dropping "fit" because spec has discrete size.'}function Uy(e){return`Unknown field for ${e}. Cannot calculate view size.`}function kv(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Nj(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Mj(e){return`The "nearest" transform is not supported for ${e} marks.`}function RC(e){return`Selection not supported for ${e} yet.`}function Lj(e){return`Cannot find a selection named "${e}".`}const Pj="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Ij="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",zj="Legend bindings are only supported for selections over an individual field or encoding channel.";function Bj(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Uj(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const jj="The same selection must be used to override scale domains in a layered view.",qj='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Wj(e){return`Unknown repeated value "${e}".`}function $v(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Gj="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",jy="Animation involving facet, layer, or concat is currently unsupported.";function Hj(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${L(e)}.`}function Vj(e,t,n,i){return`${e.length?"Multiple ":"No "}matching ${L(t)} encoding found for selection ${L(n.param)}. Using "field": ${L(i)}.`}const Xj="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Yj(e){return`Unrecognized parse "${e}".`}function Av(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Kj="Attempt to add the same child twice.";
vendor: 16,303 bytes, line 9
9function Jj(e){return`Ignoring an invalid transform: ${xe(e)}.`}const Qj='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 Cv(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Zj(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${xe(t)} is overridden by a child projection ${xe(n)}.`}const eq="Arc marks uses theta channel rather than angle, replacing angle with theta.";function tq(e){return`${e}Offset dropped because ${e} is continuous`}function nq(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${xe(n)}}.`}function _C(e){return`Invalid field type "${e}".`}function iq(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function rq(e){return`Invalid aggregation operator "${e}".`}function TC(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function sq(e){return`Position range does not support relative band size for ${e}.`}function zp(e,t){return`Dropping ${xe(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const oq="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Uf(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function aq(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function uq(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function lq(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function cq(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function nh(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function fq(e){return`The ${e} for range marks cannot be an expression`}function dq(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 hq(e,t){return`Specified orient "${e}" overridden with "${t}".`}function pq(e){return`Cannot use the scale property "${e}" with non-color channel.`}function gq(e){return`Cannot use the relative band size with ${e} scale.`}function mq(e){return`Using unaggregated domain with raw field has no effect (${xe(e)}).`}function yq(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function bq(e){return`Unaggregated domain is currently unsupported for log scale (${xe(e)}).`}function xq(e){return`Cannot apply size to non-oriented mark "${e}".`}function vq(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Eq(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function NC(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function MC(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function wq(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${xe(n)} and ${xe(i)}). Using ${xe(n)}.`}function Sq(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${xe(n)} and ${xe(i)}). Using the union of the two domains.`}function kq(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 $q(e){return`Dropping sort property ${xe(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const Fv="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Aq="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.",Cq="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.",Fq="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 Oq(e,t){return`Unioning discrete legend values from ${e} and ${t}.`}function Dq(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Rq(e){return`Stack is applied to a non-linear scale (${e}).`}function _q(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Ec(e,t){return`Invalid ${e}: ${xe(t)}.`}function Tq(e){return`Dropping day from datetime ${xe(e)} as day cannot be combined with other units.`}function Nq(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Mq(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Lq(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function Ov(e){return`1D error band does not support ${e}.`}function LC(e){return`Channel ${e} is required for "binned" bin.`}function Pq(e){return`Channel ${e} should not be used with "binned" bin.`}function Iq(e){return`Domain for ${e} is required for threshold scale.`}const PC=Lc(xg);let us=PC;function zq(e){return us=e,us}function Bq(){return us=PC,us}function qy(...e){us.error(...e)}function N(...e){us.warn(...e)}function Uq(...e){us.debug(...e)}function Os(e){if(e&&U(e)){for(const t of Gy)if(_(e,t))return!0}return!1}const IC=["january","february","march","april","may","june","july","august","september","october","november","december"],jq=IC.map(e=>e.substr(0,3)),zC=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],qq=zC.map(e=>e.substr(0,3));function Wq(e){if(_f(e)&&(e=+e),de(e))return e>4&&N(Ec("quarter",e)),e-1;throw new Error(Ec("quarter",e))}function Gq(e){if(_f(e)&&(e=+e),de(e))return e-1;{const t=e.toLowerCase(),n=IC.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=jq.indexOf(i);if(r!==-1)return r;throw new Error(Ec("month",e))}}function Hq(e){if(_f(e)&&(e=+e),de(e))return e%7;{const t=e.toLowerCase(),n=zC.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=qq.indexOf(i);if(r!==-1)return r;throw new Error(Ec("day",e))}}function Wy(e,t){const n=[];if(t&&e.day!==void 0&&R(e).length>1&&(N(Tq(e)),e=te(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Gq(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Wq(e.quarter):e.quarter;n.push(de(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?Hq(e.day):e.day;n.push(de(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function ls(e){const n=Wy(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Vq(e){const n=Wy(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Xq(e){const t=Wy(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const BC={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Gy=R(BC);function Yq(e){return G(BC,e)}function Ds(e){return U(e)?e.binned:UC(e)}function UC(e){return e?.startsWith("binned")}function Hy(e){return e.startsWith("utc")}function Kq(e){return e.substring(3)}const Jq={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function jf(e){return Gy.filter(t=>qC(e,t))}function jC(e){const t=jf(e);return t[t.length-1]}function qC(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 Qq(e,t,{end:n}={end:!1}){const i=Dy(t),r=Hy(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let o;const a={};for(const u of Gy)qC(e,u)&&(a[u]=s(u),o=u);return n&&(a[o]+="+1"),Vq(a)}function WC(e){if(!e)return;const t=jf(e);return`timeUnitSpecifier(${xe(t)}, ${xe(Jq)})`}function Zq(e,t,n){if(!e)return;const i=WC(e);return`${n||Hy(e)?"utc":"time"}Format(${t}, ${i})`}function Qe(e){if(!e)return;let t;return j(e)?UC(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:U(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Hy(t.unit)&&(t.utc=!0,t.unit=Kq(t.unit)),t}function eW(e){const{utc:t,...n}=Qe(e);return n.unit?(t?"utc":"")+R(n).map(i=>De(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):`${t?"utc":""}timeunit${R(n).map(i=>De(`_${i}_${n[i]}`)).join("")}`}function GC(e,t=n=>n){const n=Qe(e),i=jC(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=HC(i,n.step),a={...r,[o]:+r[o]+s};return`${t(ls(a))} - ${t(ls(r))}`}}const tW={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function nW(e){return G(tW,e)}function HC(e,t=1){if(nW(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 iW(e){return _(e,"param")}function Vy(e){return!!e?.field&&e.equal!==void 0}function Xy(e){return!!e?.field&&e.lt!==void 0}function Yy(e){return!!e?.field&&e.lte!==void 0}function Ky(e){return!!e?.field&&e.gt!==void 0}function Jy(e){return!!e?.field&&e.gte!==void 0}function Qy(e){if(e?.field){if(F(e.range)&&e.range.length===2)return!0;if(Y(e.range))return!0}return!1}function Zy(e){return!!e?.field&&(F(e.oneOf)||F(e.in))}function rW(e){return!!e?.field&&e.valid!==void 0}function VC(e){return Zy(e)||Vy(e)||Qy(e)||Xy(e)||Ky(e)||Yy(e)||Jy(e)}function jn(e,t){return Qf(e,{timeUnit:t,wrapTime:!0})}function sW(e,t){return e.map(n=>jn(n,t))}function XC(e,t=!0){const{field:n}=e,i=Qe(e.timeUnit),{unit:r,binned:s}=i||{},o=B(e,{expr:"datum"}),a=r?`time(${s?o:Qq(r,n)})`:o;if(Vy(e))return`${a}===${jn(e.equal,r)}`;if(Xy(e)){const u=e.lt;return`${a}<${jn(u,r)}`}else if(Ky(e)){const u=e.gt;return`${a}>${jn(u,r)}`}else if(Yy(e)){const u=e.lte;return`${a}<=${jn(u,r)}`}else if(Jy(e)){const u=e.gte;return`${a}>=${jn(u,r)}`}else{if(Zy(e))return`indexof([${sW(e.oneOf,r).join(",")}], ${a}) !== -1`;if(rW(e))return qf(a,e.valid);if(Qy(e)){const{range:u}=tt(e),l=Y(u)?{signal:`${u.signal}[0]`}:u[0],c=Y(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return`inrange(${a}, [${jn(l,r)}, ${jn(c,r)}])`;const f=[];return l!==null&&f.push(`${a} >= ${jn(l,r)}`),c!==null&&f.push(`${a} <= ${jn(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${xe(e)}`)}function qf(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function oW(e){return VC(e)&&e.timeUnit?{...e,timeUnit:Qe(e.timeUnit)}:e}const Iu={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function aW(e){return e==="quantitative"||e==="temporal"}function e1(e){return e==="ordinal"||e==="nominal"}const cs=Iu.quantitative,t1=Iu.ordinal,xo=Iu.temporal,n1=Iu.nominal,Ho=Iu.geojson;function uW(e){if(e)switch(e=e.toLowerCase(),e){case"q":case cs:return"quantitative";case"t":case xo:return"temporal";case"o":case t1:return"ordinal";case"n":case n1:return"nominal";case Ho:return"geojson"}}const nt={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},Bp={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 lW(e,t){const n=Bp[e],i=Bp[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const cW={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 Dv(e){return cW[e]}const YC=new Set(["linear","log","pow","sqrt","symlog"]),KC=new Set([...YC,"time","utc"]);function JC(e){return YC.has(e)}const QC=new Set(["quantile","quantize","threshold"]),fW=new Set([...KC,...QC,"sequential","identity"]),dW=new Set(["ordinal","bin-ordinal","point","band"]);function Le(e){return dW.has(e)}function Fn(e){return fW.has(e)}function Xn(e){return KC.has(e)}function vo(e){return QC.has(e)}const hW={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function pW(e){return!j(e)&&_(e,"name")}function ZC(e){return _(e,"param")}function gW(e){return _(e,"unionWith")}function mW(e){return U(e)&&"field"in e}const yW={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:oZ,domain:aZ,range:uZ,rangeMax:lZ,rangeMin:cZ,scheme:fZ,...bW}=yW,xW=R(bW);function Up(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 Xn(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Xn(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 Xn(e);case"nice":return Xn(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Fn(e)&&!ae(["log","time","utc","threshold","quantile"],e)}}function eF(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Zs(e)?void 0:pq(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 vW(e,t){return ae([t1,n1],t)?e===void 0||Le(e):t===xo?ae([nt.TIME,nt.UTC,void 0],e):t===cs?JC(e)||vo(e)||e===void 0:!0}function EW(e,t,n=!1){if(!hi(e))return!1;switch(e){case Re:case Ze:case wr:case Go:case fn:case Ln:return Xn(t)||t==="band"?!0:t==="point"?!n:!1;case Sr:return ae(["linear","band"],t);case Li:case Ar:case Pi:case kr:case $r:case $s:return Xn(t)||vo(t)||ae(["band","point","ordinal"],t);case _t:case ci:case fi:return t!=="band";case Cr:case Tt:return t==="ordinal"||vo(t)}}function wW(e){return U(e)&&"value"in e}const At={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"},tF=At.arc,Wf=At.area,Gf=At.bar,SW=At.image,Hf=At.line,Vf=At.point,kW=At.rect,wc=At.rule,nF=At.text,i1=At.tick,$W=At.trail,r1=At.circle,s1=At.square,iF=At.geoshape;function Or(e){return["line","area","trail"].includes(e)}function iu(e){return["rect","bar","image","arc","tick"].includes(e)}const AW=new Set(R(At));function ii(e){return _(e,"type")}const CW=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],FW=["fill","fillOpacity"],OW=[...CW,...FW],DW={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},Rv=R(DW),ih=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],RW={area:["line","point"],bar:ih,rect:ih,line:["point"],tick:["bandSize","thickness",...ih]}
9,_W={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},TW={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},rF=R(TW);function fs(e){return _(e,"band")}const NW={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},MW=5,o1={binSpacing:0,continuousBandSize:MW,minBandSize:.25,timeUnitBandPosition:.5},LW={...o1,binSpacing:1},PW={...o1,thickness:1};function IW(e){return ii(e)?e.type:e}function sF(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function a1({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){if(!i||!Fn(i)||r)return"always-valid";const s=sF(me("invalid",e,t),{isPath:Or(e.type)});return t.scale?.invalid?.[n]!==void 0?"show":s}function zW(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function oF({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function aF({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){const o=n?.get("type"),a=Dn(t),u=zf(a?.aggregate),l=a1({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:u});if(a&&l==="show"){const c=s.scale.invalid?.[e]??"zero-or-min";return{test:qf(B(a,{expr:"datum"}),!1),...BW(c,n,i)}}}function BW(e,t,n){if(wW(e)){const{value:i}=e;return Y(i)?{signal:i.signal}:{value:i}}return oF({scale:t,scaleName:n,mode:"zeroOrMin"})}function u1(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=As(t),u=l1(e),l=aF({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return l!==void 0?[l,u]:u}function UW(e){const{datum:t}=e;return Os(t)?ls(t):`${xe(t)}`}function Xr(e,t,n,i){const r={};if(t&&(r.scale=t),pi(e)){const{datum:s}=e;Os(s)?r.signal=ls(s):Y(s)?r.signal=s.signal:Pu(s)?r.signal=s.expr:r.value=s}else r.field=B(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function Sc({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!Y(o)&&0<o&&o<1?"datum":void 0,u=B(t,{expr:a,suffix:r}),l=n!==void 0?B(n,{expr:a}):B(t,{suffix:s,expr:a}),c={};if(o===0||o===1){c.scale=e;const f=o===0?u:l;c.field=f}else{const f=Y(o)?`(1-${o.signal}) * ${u} + ${o.signal} * ${l}`:`${1-o} * ${u} + ${o} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function jW({scaleName:e,fieldDef:t}){const n=B(t,{expr:"datum"}),i=B(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function l1({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(ne(t)){const f=o?.get("type");if($t(t)){c??=yr({fieldDef:t,fieldDef2:n,markDef:i,config:r});const{bin:d,timeUnit:p,type:h}=t;if($e(d)||c&&p&&h===xo)return a?.impute?Xr(t,s,{binSuffix:"mid"},{offset:u}):c&&!Le(f)?Sc({scaleName:s,fieldOrDatumDef:t,bandPosition:c,offset:u}):Xr(t,s,qu(t,e)?{binSuffix:"range"}:{},{offset:u});if(et(d)){if(M(n))return Sc({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});N(LC(e===Re?Mn:li))}}return Xr(t,s,Le(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(On(t)){const f=t.value,d=u?{offset:u}:{};return{...za(e,f),...d}}}return ie(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function za(e,t){return ae(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:ae(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ce(t)}function ds(e){return e&&e!=="number"&&e!=="time"}function uF(e,t,n){return`${e}(${t}${n?`, ${xe(n)}`:""})`}function c1({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){if(ds(n))return wn({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const o=lF(e,i,r),a=Eo(e);if(t===void 0&&n===void 0&&s.customFormatTypes){if(a==="quantitative"){if(r&&s.normalizedNumberFormatType)return wn({fieldOrDatumDef:e,format:s.normalizedNumberFormat,formatType:s.normalizedNumberFormatType,expr:i,config:s});if(s.numberFormatType)return wn({fieldOrDatumDef:e,format:s.numberFormat,formatType:s.numberFormatType,expr:i,config:s})}if(a==="temporal"&&s.timeFormatType&&M(e)&&e.timeUnit===void 0)return wn({fieldOrDatumDef:e,format:s.timeFormat,formatType:s.timeFormatType,expr:i,config:s})}function u(l){return M(l)?Qe(l.timeUnit)||{}:{unit:void 0,utc:void 0}}if(ko(e)){const{unit:l,utc:c}=u(e),f=WW({field:o,timeUnit:l,format:t,formatType:s.timeFormatType,rawTimeFormat:s.timeFormat,isUTCScale:c||Rs(e)&&e.scale?.type===nt.UTC});return f?{signal:f}:void 0}if(t=jp({type:a,specifiedFormat:t,config:s,normalizeStack:r}),M(e)&&$e(e.bin)){const l=B(e,{expr:i,binSuffix:"end"});return{signal:zu(o,l,t,n,s)}}else return t||Eo(e)==="quantitative"?{signal:`${dF(o,t)}`}:{signal:`isValid(${o}) ? ${o} : ""+${o}`}}function lF(e,t,n){return M(e)?n?`${B(e,{expr:t,suffix:"end"})}-${B(e,{expr:t,suffix:"start"})}`:B(e,{expr:t}):UW(e)}function wn({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:o}
vendor: 5,830 bytes, line 9
9){if(o??=lF(e,i,r),o!=="datum.value"&&M(e)&&$e(e.bin)){const a=B(e,{expr:i,binSuffix:"end"});return{signal:zu(o,a,t,n,s)}}return{signal:uF(n,o,t)}}function cF(e,t,n,i,r,s){if(!(j(i)&&ds(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&Eo(e)==="quantitative"&&(r.normalizedNumberFormatType&&wo(e)&&e.stack==="normalize"||r.numberFormatType))){if(wo(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return jp({type:"quantitative",config:r,normalizeStack:!0});if(ko(e)){const o=M(e)?Qe(e.timeUnit)?.unit:void 0;return o===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:qW({specifiedFormat:n,timeUnit:o,config:r,omitTimeFormatConfig:s})}return jp({type:t,specifiedFormat:n,config:r})}}function fF(e,t,n){if(e&&(Y(e)||e==="number"||e==="time"))return e;if(ko(t)&&n!=="time"&&n!=="utc")return M(t)&&Qe(t?.timeUnit)?.utc?"utc":"time"}function jp({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(j(t))return t;if(e===cs)return i?n.normalizedNumberFormat:n.numberFormat}function qW({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:WC(t)}:i?void 0:n.timeFormat)}function dF(e,t){return`format(${e}, "${t||""}")`}function _v(e,t,n,i){return ds(n)?uF(n,e,t):dF(e,(j(t)?t:void 0)??i.numberFormat)}function zu(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return zu(e,t,r.numberFormat,r.numberFormatType,r);const s=_v(e,n,i,r),o=_v(t,n,i,r);return`${qf(e,!1)} ? "null" : ${s} + "${Dj}" + ${o}`}function WW({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:s}){return!t||n?!t&&i?`${i}(${e}, ${xe(n)})`:(n=j(n)?n:r,`${s?"utc":"time"}Format(${e}, ${xe(n)})`):Zq(t,e,s)}const Xf="min",GW={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function Tv(e){return G(GW,e)}function HW(e){return _(e,"encoding")}function $i(e){return e&&(e.op==="count"||_(e,"field"))}function hF(e){return e&&F(e)}function Bu(e){return _(e,"row")||_(e,"column")}function f1(e){return _(e,"header")}function Yf(e){return _(e,"facet")}function VW(e){return _(e,"param")}function XW(e){return!j(e)&&_(e,"repeat")}function Nv(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function d1(e){return _(e,"sort")}function yr({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(ne(e)&&e.bandPosition!==void 0)return e.bandPosition;if(M(e)){const{timeUnit:r,bin:s}=e;if(r&&!t)return ni("timeUnitBandPosition",n,i);if($e(s))return .5}}function pF({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:s,useVlSizeChannel:o}){const a=Nt(e),u=me(o?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(M(t)){const{timeUnit:l,bin:c}=t;if(l&&!n)return{band:ni("timeUnitBandSize",i,r)};if($e(c)&&!Le(s))return{band:1}}if(iu(i.type))return s?Le(s)?r[i.type]?.discreteBandSize||{band:1}:r[i.type]?.continuousBandSize:r[i.type]?.discreteBandSize}function gF(e,t,n,i){return $e(e.bin)||e.timeUnit&&$t(e)&&e.type==="temporal"?yr({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function mF(e){return _(e,"sort")&&!_(e,"field")}function Uu(e){return _(e,"condition")}function Kf(e){const t=e?.condition;return!!t&&!F(t)&&M(t)}function ju(e){const t=e?.condition;return!!t&&!F(t)&&ne(t)}function YW(e){const t=e?.condition;return!!t&&(F(t)||On(t))}function M(e){return _(e,"field")||e?.aggregate==="count"}function Eo(e){return e?.type}function pi(e){return _(e,"datum")}function ir(e){return $t(e)&&!$c(e)||kc(e)}function Mv(e){return $t(e)&&e.type==="quantitative"&&!e.bin||kc(e)}function kc(e){return pi(e)&&de(e.datum)}function ne(e){return M(e)||pi(e)}function $t(e){return e&&(_(e,"field")||e.aggregate==="count")&&_(e,"type")}function On(e){return _(e,"value")}function Rs(e){return _(e,"scale")||_(e,"sort")}function wo(e){return _(e,"axis")||_(e,"stack")||_(e,"impute")}function yF(e){return _(e,"legend")}function bF(e){return _(e,"format")||_(e,"formatType")}function KW(e){return Wt(e,["legend","axis","header","scale"])}function JW(e){return _(e,"op")}function B(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,s="";if(ZW(e))n=aC("count");else{let o;if(!t.nofn)if(JW(e))o=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;$e(a)?(o=EC(a),r=(t.binSuffix??"")+(t.suffix??"")):u?Fr(u)?(s=`["${n}"]`,n=`argmax_${u.argmax}`):Oi(u)?(s=`["${n}"]`,n=`argmin_${u.argmin}`):o=String(u):l&&!Ds(l)&&(o=eW(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}o&&(n=n?`${o}_${n}`:o)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?Wo(n):t.expr?iC(n,t.expr)+s:un(n)+s}function $c(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return M(e)&&!!e.bin;case"temporal":return!1}throw new Error(_C(e.type))}function QW(e){return Rs(e)&&vo(e.scale?.type)}function ZW(e){return e.aggregate==="count"}function eG(e,t){const{field:n,bin:i,timeUnit:r,aggregate:s}=e;if(s==="count")return t.countTitle;if($e(i))return`${n} (binned)`;if(r&&!Ds(r)){const o=Qe(r)?.unit;if(o)return`${n} (${jf(o).join("-")})`}else if(s)return Fr(s)?`${n} for max ${s.argmax}`:Oi(s)?`${n} for min ${s.argmin}`:`${Tu(s)} of ${n}`;return n}function tG(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Fr(t))return`${r} for argmax(${t.argmax})`;if(Oi(t))return`${r} for argmin(${t.argmin})`;const s=i&&!Ds(i)?Qe(i):void 0,o=t||s?.unit||s?.maxbins&&"timeunit"||$e(n)&&"bin";return o?`${o.toUpperCase()}(${r})`:r}const xF=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return tG(e);default:return eG(e,t)}};let vF=xF;function EF(e){vF=e}function nG(){EF(xF)}function eo(e,t,{allowDisabling:n,includeDefault:i=!0}){const r=h1(e)?.title;if(!M(e))return r??e.title;const s=e,o=i?p1(s,t):void 0;return n?Pe(r,s.title,o):r??s.title??o}function h1(e){if(wo(e)&&e.axis)return e.axis;
vendor: 9,549 bytes, line 9
9if(yF(e)&&e.legend)return e.legend;if(f1(e)&&e.header)return e.header}function p1(e,t){return vF(e,t)}function So(e){if(bF(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=h1(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function iG(e,t){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(d1(e)&&F(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Fr(n)&&!Oi(n))return"quantitative";if(Rs(e)&&e.scale?.type)switch(Bp[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Dn(e){if(M(e))return e;if(Kf(e))return e.condition}function Ge(e){if(ne(e))return e;if(ju(e))return e.condition}function wF(e,t,n,i={}){if(xc(e)){const r=j(e)?"string":de(e)?"number":"boolean";return N(nq(t,r,e)),{value:e}}return ne(e)?Ac(e,t,n,i):ju(e)?{...e,condition:Ac(e.condition,t,n,i)}:e}function Ac(e,t,n,i){if(bF(e)){const{format:r,formatType:s,...o}=e;if(ds(s)&&!n.customFormatTypes)return N(Cv(t)),Ac(o,t,n,i)}else{const r=wo(e)?"axis":yF(e)?"legend":f1(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(ds(o)&&!n.customFormatTypes)return N(Cv(t)),Ac({...e,[r]:a},t,n,i)}}return M(e)?g1(e,t,i):rG(e)}function rG(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=de(n)?"quantitative":j(n)?"nominal":Os(n)?"temporal":void 0,{...e,type:t}}function g1(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!zy(i)&&!Fr(i)&&!Oi(i)&&(N(rq(i)),delete a.aggregate),r&&(a.timeUnit=Qe(r)),o&&(a.field=`${o}`),$e(s)&&(a.bin=Jf(s,t)),et(s)&&!Ie(t)&&N(Pq(t)),$t(a)){const{type:u}=a,l=uW(u);u!==l&&(a.type=l),u!=="quantitative"&&zf(i)&&(N(iq(u,i)),a.type="quantitative")}else if(!gC(t)){const u=iG(a,t);a.type=u}if($t(a)){const{compatible:u,warning:l}=sG(a,t)||{};u===!1&&N(l)}if(d1(a)&&j(a.sort)){const{sort:u}=a;if(Tv(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&Tv(l))return{...a,sort:{encoding:l,order:"descending"}}}if(f1(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function Jf(e,t){return bs(e)?{maxbins:bv(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:bv(t)}:e}const Bs={compatible:!0};function sG(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 Si:case ki:case Tf:return $c(e)?Bs:{compatible:!1,warning:uq(t)};case Re:case Ze:case wr:case Go:case _t:case ci:case fi:case Nu:case Mu:case Nf:case as:case Mf:case Lf:case $s:case fn:case Ln:case Pf:return Bs;case In:case ln:case Pn:case zn:return n!==cs?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Bs;case Pi:case kr:case $r:case Ar:case Li:case Mi:case Ni:case Mn:case li:case Sr:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Bs;case Tt:case Cr:return!$c(e)&&!QW(e)?{compatible:!1,warning:lq(t)}:Bs;case bo:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Bs}}function ko(e){const{formatType:t}=So(e);return t==="time"||!t&&oG(e)}function oG(e){return e&&(e.type==="temporal"||M(e)&&!!e.timeUnit)}function Qf(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const s=t&&Qe(t)?.unit;let o=s||n==="temporal",a;return Pu(e)?a=e.expr:Y(e)?a=e.signal:Os(e)?(o=!0,a=ls(e)):(j(e)||de(e))&&o&&(a=`datetime(${xe(e)})`,Yq(s)&&(de(e)&&e<1e4||j(e)&&isNaN(Date.parse(e)))&&(a=ls({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:xe(e)}function SF(e,t){const{type:n}=e;return t.map(i=>{const r=M(e)&&!Ds(e.timeUnit)?e.timeUnit:void 0,s=Qf(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function qu(e,t){return $e(e.bin)?hi(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const Lv={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 Wu(e){return e?.condition}const kF=["domain","grid","labels","ticks","title"],aG={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"},$F={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},uG={...$F,style:1,labelExpr:1,encoding:1};function Pv(e){return G(uG,e)}const lG={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},AF=R(lG);function zi(e){return _(e,"mark")}class Zf{name;run;constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return zi(t)?IW(t.mark)===this.name:!1}}function Yr(e,t){const n=e?.[t];return n?F(n)?go(n,i=>!!i.field):M(n)||Kf(n):!1}function CF(e,t){const n=e?.[t];return n?F(n)?go(n,i=>!!i.field):M(n)||pi(n)||ju(n):!1}function FF(e,t){if(Ie(t)){const n=e[t];if((M(n)||pi(n))&&(e1(n.type)||M(n)&&n.timeUnit)){const i=Ny(t);return CF(e,i)}}return!1}function OF(e){return go(rj,t=>{if(Yr(e,t)){const n=e[t];if(F(n))return go(n,i=>!!i.aggregate);{const i=Dn(n);return i&&!!i.aggregate}}return!1})}function DF(e,t){const n=[],i=[],r=[],s=[],o={};return m1(e,(a,u)=>{if(M(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...p}=a;if(c||d||f){const g=h1(a)?.title;let m=B(a,{forAs:!0});const y={...g?[]:{title:eo(a,t,{allowDisabling:!0})},...p,field:m};if(c){let b;if(Fr(c)?(b="argmax",m=B({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):Oi(c)?(b="argmin",m=B({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),s.push(v)}}else if(n.push(m),$t(a)&&$e(f)){if(i.push({bin:f,field:l,as:m}),n.push(B(a,{binSuffix:"end"})),qu(a,u)&&n.push(B(a,{binSuffix:"range"})),Ie(u)){const b={field:`${m}_end`};o[`${u}2`]=b}y.bin="binned",gC(u)||(y.type=cs)}else if(d&&!Ds(d)){r.push({timeUnit:d,field:l,as:m});const b=$t(a)&&a.type!==xo&&"time";b&&(u===Nu||u===as?y.formatType=b:gj(u)?y.legend={formatType:b,...y.legend}:Ie(u)&&(y.axis={formatType:b,...y.axis}
vendor: 6,120 bytes, line 9
9))}o[u]=y}else n.push(l),o[u]=e[u]}else o[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function cG(e,t,n){const i=yj(t,n);if(i){if(i==="binned"){const r=e[t===Mn?Re:Ze];return!!(M(r)&&M(e[t])&&et(r.bin))}}else return!1;return!0}function fG(e,t,n,i){const r={};for(const s of R(e))pC(s)||N(aq(s));for(let s of cj){if(!e[s])continue;const o=e[s];if(Lu(s)){const a=lj(s),u=r[a];if(M(u)&&aW(u.type)&&M(o)&&!u.timeUnit){N(tq(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(N(eq),s=fn),!cG(e,s,t)){N(Uf(s,t));continue}if(s===Li&&t==="line"&&Dn(e[s])?.aggregate){N(oq);continue}if(s===_t&&(n?"fill"in e:"stroke"in e)){N(TC("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Mu||s===bo&&!F(o)&&!On(o)||s===as&&F(o)){if(o){if(s===bo){const a=e[s];if(mF(a)){r[s]=a;continue}}r[s]=q(o).reduce((a,u)=>(M(u)?a.push(g1(u,s)):N(zp(u,s)),a),[])}}else{if(s===as&&o===null)r[s]=null;else if(!M(o)&&!pi(o)&&!On(o)&&!Uu(o)&&!Y(o)){N(zp(o,s));continue}r[s]=wF(o,s,i)}}return r}function ed(e,t){const n={};for(const i of R(e)){const r=wF(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function dG(e){const t=[];for(const n of R(e))if(Yr(e,n)){const i=e[n],r=q(i);for(const s of r)M(s)?t.push(s):Kf(s)&&t.push(s.condition)}return t}function m1(e,t,n){if(e)for(const i of R(e)){const r=e[i];if(F(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function hG(e,t,n,i){return e?R(e).reduce((r,s)=>{const o=e[s];return F(o)?o.reduce((a,u)=>t.call(i,a,u,s),r):t.call(i,r,o,s)},n):n}function RF(e,t){return R(t).reduce((n,i)=>{switch(i){case Re:case Ze:case Mf:case Pf:case Lf:case Mn:case li:case wr:case Go:case fn:case Mi:case Ln:case Ni:case Sr:case Pn:case In:case zn:case ln:case Nu:case Tt:case $s:case as:return n;case bo:if(e==="line"||e==="trail")return n;case Mu:case Nf:{const r=t[i];if(F(r)||M(r))for(const s of q(r))s.aggregate||n.push(B(s,{}));return n}case Li:if(e==="trail")return n;case _t:case ci:case fi:case Pi:case kr:case $r:case Cr:case Ar:{const r=Dn(t[i]);return r&&!r.aggregate&&n.push(B(r,{})),n}}},[])}function pG(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(F(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return F(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function qp(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const u=i?` of ${y1(t)}`:"";return{field:o+t.field,type:t.type,title:Y(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),s=dG(n).map(KW);return{tooltip:[...r,...zt(s,se)]}}function y1(e){const{title:t,field:n}=e;return Pe(t,n)}function b1(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=y1(n);return _F(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...j(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function _F(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...ii(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...bs(e[t])?{}:e[t]}}]:[]}function TF(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:ll(s,n),continuousAxisChannelDef2:ll(o,n),continuousAxisChannelDefError:ll(a,n),continuousAxisChannelDefError2:ll(u,n),continuousAxis:r}}function ll(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&N(Lq(n,t)),i}else return e}function NF(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(ii(n)&&n.orient)return n.orient;if(ir(r)){if(ir(s)){const o=M(r)&&r.aggregate,a=M(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return ko(s)&&!ko(r)?"horizontal":"vertical"}return"horizontal"}else{if(ir(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Cc="boxplot",gG=["box","median","outliers","rule","ticks"],mG=new Zf(Cc,LF);function MF(e){return de(e)?"tukey":e}function LF(e,{config:t}){e={...e,encoding:ed(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=ii(n)?n:{type:n};r&&N(RC("boxplot"));const u=a.extent??t.boxplot.extent,l=me("size",a,t),c=a.invalid,f=MF(u),{bins:d,timeUnits:p,transform:h,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:w,boxOrient:E,customTooltipWithoutAggregatedField:S}=yG(e,u,t),x=Wo(g.field),{color:k,size:D,...P}=v,K=qD=>b1(a,m,g,qD,t.boxplot),ee=K(P),ce=K(v),T=(U(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",O=K({...P,...D?{size:D}:{},color:{condition:{test:`${ye(`lower_box_${g.field}`)} >= ${ye(`upper_box_${g.field}`)}`,...k||{value:T}}}}),I=qp([{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,v),W={type:"tick",color:"black",opacity:1,orient:w,invalid:c,aria:!1},V=f==="min-max"?I:qp([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),H=[...ee({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:V}),...ee({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:V}),...ee({partName:"ticks",mark:W,positionPrefix:"lower_whisker",extraEncoding:V}),...ee({partName:"ticks",mark:W,positionPrefix:"upper_whisker",extraEncoding:V})],Z=[...f!=="tukey"?H:[],...ce({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:I}
vendor: 13,051 bytes, line 9
9),...O({partName:"median",mark:{type:"tick",invalid:c,...U(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:I})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(h),layer:Z};const pe=ye(`lower_box_${g.field}`),oe=ye(`upper_box_${g.field}`),ke=`(${oe} - ${pe})`,ut=`${pe} - ${u} * ${ke}`,_e=`${oe} + ${u} * ${ke}`,Bn=ye(g.field),UD={joinaggregate:PF(g.field),groupby:y},sb={transform:[{filter:`(${ut} <= ${Bn}) && (${Bn} <= ${_e})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${x}`},{op:"max",field:g.field,as:`upper_whisker_${x}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${x}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${x}`},...b],groupby:y}],layer:H},{tooltip:mQ,...jD}=P,{scale:ob,axis:ab}=g,ub=y1(g),lb=_F(a,"outliers",t.boxplot,{transform:[{filter:`(${Bn} < ${ut}) || (${Bn} > ${_e})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...ub!==void 0?{title:ub}:{},...ob!==void 0?{scale:ob}:{},...ab!==void 0?{axis:ab}:{}},...jD,...k?{color:k}:{},...S?{tooltip:S}:{}}})[0];let Xu;const cb=[...d,...p,UD];return lb?Xu={transform:cb,layer:[lb,sb]}:(Xu=sb,Xu.transform.unshift(...cb)),{...o,layer:[Xu,{transform:h,layer:Z}]}}function PF(e){const t=Wo(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function yG(e,t,n){const i=NF(e,Cc),{continuousAxisChannelDef:r,continuousAxis:s}=TF(e,i,Cc),o=r.field,a=Wo(o),u=MF(t),l=[...PF(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${ye(`upper_box_${a}`)} - ${ye(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${ye(`upper_box_${a}`)} + ${ye(`iqr_${a}`)} * ${t}, ${ye(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${ye(`lower_box_${a}`)} - ${ye(`iqr_${a}`)} * ${t}, ${ye(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:h}=pG(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=DF(h,n),w=i==="vertical"?"horizontal":"vertical",E=i,S=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:S,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:w,boxOrient:E,customTooltipWithoutAggregatedField:p}}const x1="errorbar",bG=["ticks","rule"],xG=new Zf(x1,IF);function IF(e,{config:t}){e={...e,encoding:ed(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:u,tooltipEncoding:l}=zF(e,x1,t);delete s.size;const c=b1(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,p={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},h=[...c({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...h.length>1?{layer:h}:{...h[0]}}}function vG(e,t){const{encoding:n}=e;if(EG(n))return{orient:NF(e,t),inputType:"raw"};const i=wG(n),r=SG(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(ne(a)&&ne(u))throw new Error(`${t} cannot have both x2 and y2`);if(ne(a)){if(ir(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(ne(u)){if(ir(o))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,u=n.xError2,l=n.yError,c=n.yError2;if(ne(u)&&!ne(a))throw new Error(`${t} cannot have xError2 without xError`);if(ne(c)&&!ne(l))throw new Error(`${t} cannot have yError2 without yError`);if(ne(a)&&ne(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(ne(a)){if(ir(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(ne(l)){if(ir(o))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 EG(e){return(ne(e.x)||ne(e.y))&&!ne(e.x2)&&!ne(e.y2)&&!ne(e.xError)&&!ne(e.xError2)&&!ne(e.yError)&&!ne(e.yError2)}function wG(e){return ne(e.x2)||ne(e.y2)}function SG(e){return ne(e.xError)||ne(e.xError2)||ne(e.yError)||ne(e.yError2)}function zF(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,u=ii(i)?i:{type:i};s&&N(RC(t));const{orient:l,inputType:c}=vG(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:h,continuousAxis:g}=TF(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=kG(u,f,d,p,h,c,t,n),{[g]:w,[g==="x"?"x2":"y2"]:E,[g==="x"?"xError":"yError"]:S,[g==="x"?"xError2":"yError2"]:x,...k}=r,{bins:D,timeUnits:P,aggregate:K,groupby:ee,encoding:ce}=DF(k,n),T=[...K,...m],O=c!=="raw"?[]:ee,I=qp(b,f,ce,v);return{transform:[...a.transform??[],...D,...P,...T.length===0?[]:[{aggregate:T,groupby:O}],...y],groupby:O,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:ce,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:I}}function kG(e,t,n,i,r,s,o,a){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const p=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,h=e.extent?e.extent:p==="mean"?"stderr":"iqr";if(p==="median"!=(h==="iqr")&&N(Mq(p,h,o)),h==="stderr"||h==="stdev")u=[{op:h,field:c,as:`extent_${c}`},{op:p,field:c,as:`center_${c}`}],l=[{calculate:`${ye(`center_${c}`)} + ${ye(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${ye(`center_${c}`)} - ${ye(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Tu(p)},{fieldPrefix:"upper_",titlePrefix:Iv(p,h,"+")},{fieldPrefix:"lower_",titlePrefix:Iv(p,h,"-")}],d=!0;else{let g,m,y;h==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{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:eo({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:eo({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:eo({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&N(Nq(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:ye(n.field),as:`upper_${c}`},{calculate:ye(c),as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${ye(c)} + ${ye(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${ye(c)} + ${ye(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${ye(c)} - ${ye(i.field)}`,as:`lower_${c}`}));for(const p of l)f.push({fieldPrefix:p.as.substring(0,6),titlePrefix:os(os(p.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function Iv(e,t,n){return`${Tu(e)} ${n} ${t}`}const v1="errorband",$G=["band","borders"],AG=new Zf(v1,BF);function BF(e,{config:t}){e={...e,encoding:ed(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:u}=zF(e,v1,t),l=o,c=b1(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},p={type:f?"line":"rule"};const h={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...h,ariaRoleDescription:"errorband"},p={...p,...h,aria:!1}):l.interpolate?N(Ov("interpolate")):l.tension&&N(Ov("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:u})]}}const UF={};function E1(e,t,n){const i=new Zf(e,t);UF[e]={normalizer:i,parts:n}}function CG(){return R(UF)}E1(Cc,LF,gG);E1(x1,IF,bG);E1(v1,BF,$G);const FG=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],jF={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"},qF={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"},OG=R(jF),DG=R(qF),RG={header:1,headerRow:1,headerColumn:1,headerFacet:1},WF=R(RG),GF=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],_G={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},TG={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},Rn="_vgsid_",NG={point:{on:"click",fields:[Rn],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 w1(e){return e==="legend"||!!e?.legend}function rh(e){return w1(e)&&U(e)}function S1(e){return!!e?.select}function HF(e){const t=[];for(const n of e||[]){if(S1(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function MG(e){return td(e)||$1(e)||k1(e)}function k1(e){return _(e,"concat")}function td(e){return _(e,"vconcat")}function $1(e){return _(e,"hconcat")}function VF({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function ri(e){return _(e,"step")}function zv(e){return _(e,"view")||_(e,"width")||_(e,"height")}const Bv=20,LG={align:1,bounds:1,center:1,columns:1,spacing:1},PG=R(LG);function IG(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(Yf(e)&&!Bu(e.facet)||k1(e))&&(r.columns=o),td(e)&&(r.columns=1);for(const a of PG)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=de(u)?u:{row:u.row??s,column:u.column??s}}else r[a]=e[a];return r}function Wp(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Gp(e,t){const n=Fc(e,t);return ri(n)?n.step:XF}function Fc(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Pe(n,{step:e.step})}const XF=20,zG={continuousWidth:300,continuousHeight:300,step:XF},BG={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:zG,mark:_W,arc:{},area:{},bar:LW,circle:{},geoshape:{},image:{},line:{},point:{},rect:o1,rule:{color:"black"},square:{},text:{color:"black"},tick:PW,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:hW,projection:{},legend:_G,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:NG,style:{},title:{},facet:{spacing:Bv},concat:{spacing:Bv},normalizedNumberFormat:".0%"},bi=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Uv={text:11,guideL
vendor: 9,854 bytes, line 9
9abel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},jv={blue:bi[0],orange:bi[1],red:bi[2],teal:bi[3],green:bi[4],yellow:bi[5],purple:bi[6],pink:bi[7],brown:bi[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 UG(e={}){return{signals:[{name:"color",value:U(e)?{...jv,...e}:jv}],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 jG(e){return{signals:[{name:"fontSize",value:U(e)?{...Uv,...e}:Uv}],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 qG(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function YF(e){const t=R(e||{}),n={};for(const i of t){const r=e[i];n[i]=Wu(r)?kC(r):It(r)}return n}function WG(e){const t=R(e),n={};for(const i of t)n[i]=YF(e[i]);return n}const GG=[...rF,...AF,...WF,"background","padding","legend","lineBreak","scale","style","title","view"];function KF(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=_o({},te(BG),n?qG(n):{},t?UG(t):{},i?jG(i):{},s||{});r&&To(o,"selection",r,!0);const a=Wt(o,GG);for(const u of["background","lineBreak","padding"])o[u]&&(a[u]=It(o[u]));for(const u of rF)o[u]&&(a[u]=tt(o[u]));for(const u of AF)o[u]&&(a[u]=YF(o[u]));for(const u of WF)o[u]&&(a[u]=tt(o[u]));if(o.legend&&(a.legend=tt(o.legend)),o.scale){const{invalid:u,...l}=o.scale,c=tt(u,{level:1});a.scale={...tt(l),...R(c).length>0?{invalid:c}:{}}}return o.style&&(a.style=WG(o.style)),o.title&&(a.title=tt(o.title)),o.view&&(a.view=tt(o.view)),a}const HG=new Set(["view",...AW]),VG=["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"],XG={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...RW};function YG(e){e=te(e);for(const t of VG)delete e[t];if(e.axis)for(const t in e.axis)Wu(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of FG)delete e.legend[t];if(e.mark){for(const t of Rv)delete e.mark[t];e.mark.tooltip&&U(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(HF(e.params)),delete e.params);for(const t of HG){for(const i of Rv)delete e[t][i];const n=XG[t];if(n)for(const i of n)delete e[t][i];JG(e,t)}for(const t of CG())delete e[t];KG(e);for(const t in e)U(e[t])&&Se(e[t])&&delete e[t];return Se(e)?void 0:e}function KG(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=wC(e.title);Se(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Se(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Se(i)?delete e.title:e.title=i}function JG(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};Se(s)||(e.style[n??t]=s),delete e[t]}function nd(e){return _(e,"layer")}function QG(e){return _(e,"repeat")}function ZG(e){return!F(e.repeat)&&_(e.repeat,"layer")}class A1{map(t,n){return Yf(t)?this.mapFacet(t,n):QG(t)?this.mapRepeat(t,n):$1(t)?this.mapHConcat(t,n):td(t)?this.mapVConcat(t,n):k1(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(nd(t))return this.mapLayer(t,n);if(zi(t))return this.mapUnit(t,n);throw new Error(By(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const eH={zero:1,center:1,normalize:1};function tH(e){return G(eH,e)}const nH=new Set([tF,Gf,Wf,wc,Vf,r1,s1,Hf,nF,i1]),iH=new Set([Gf,Wf,tF]);function Us(e){return M(e)&&Eo(e)==="quantitative"&&!e.bin}function qv(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(M(o)&&M(a))if(Us(o)&&Us(a)){if(o.stack)return t;if(a.stack)return r;const u=M(o)&&!!o.aggregate,l=M(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Us(o))return t;if(Us(a))return r}else{if(Us(o))return s&&n==="vertical"?void 0:t;if(Us(a))return s&&n==="horizontal"?void 0:r}}function rH(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function JF(e,t){const n=ii(e)?e:{type:e},i=n.type;if(!nH.has(i))return null;const r=qv(t,"x",n)||qv(t,"theta",n);if(!r)return null;const s=t[r],o=M(s)?B(s,{}):void 0,a=rH(r),u=[],l=new Set;if(t[a]){const g=t[a],m=M(g)?B(g,{}):void 0;m&&m!==o&&(u.push(a),l.add(m))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=M(f)?B(f,{}):void 0;d&&d!==o&&(u.push(c),l.add(d));const p=fj.reduce((g,m)=>{if(m!=="tooltip"&&Yr(t,m)){const y=t[m];for(const b of q(y)){const v=Dn(b);if(v.aggregate)continue;const w=B(v,{});(!w||!l.has(w))&&g.push({channel:m,fieldDef:v})}}return g},[]);let h;return s.stack!==void 0?bs(s.stack)?h=s.stack?"zero":null:h=s.stack:iH.has(i)&&(h="zero"),!h||!tH(h)||OF(t)&&p.length===0?null:(s?.scale?.type&&s?.scale?.type!==nt.LINEAR&&s?.stack&&N(Rq(s.scale.type)),ne(t[di(r)])?(s.stack!==void 0&&N(Dq(r)),null):(M(s)&&s.aggregate&&!kj.has(s.aggregate)&&N(_q(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:Or(i),stackBy:p,offset:h}))}function QF(e,t,n){const i=tt(e),r=me("orient",i,n);if(i.orient=uH(i.type,t,r),r!==void 0&&r!==i.orient&&N(hq(i.orient,r)),i.type==="bar"&&i.orient){const u=me("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:NW[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=me("opacity",i,n),o=me("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=oH(i.type,t)),me("cursor",i,n)===void 0&&(i.cursor=sH(i,t,n)),i}function sH(e,t,n){return t.href||e.href||me("href",e,n)?"pointer":e.cursor}const ZF=.7;function oH(e,t){if(ae([Vf,i1,r1,s1],e)&&!OF(t))return ZF}function aH(e,t,{graticule:n}){if(n)return!1;const i=ni("filled",e,t),r=e.type;return Pe(i,r!==Vf&&r!==Hf&&r!==wc)}function uH(e,t,n){switch(e){case Vf:case r1:case s1:case kW:case SW:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case nF:case Gf:if(M(i)&&(et(i.bin)||M(r)&&r.aggregate&&!i.aggregate))return"vertical";if(M(r)&&(et(r.bin)||M(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(M(i)&&i.type===cs&&!$e(i.bin)||kc(i))&&M(r)&&et(r.bin)?"horizontal":"vertical";if(!o)return(M(r)&&r.type===cs&&!$e(r.bin)||kc(r))&&M(i)&&et(i.bin)?"vertical":"horizontal"}case wc:if(s&&!(M(i)&&et(i.bin))&&o&&!(M(r)&&et(r.bin)))return;case Wf:if(o)return M(r)&&et(r.bin)?"horizontal":"vertical";if(s)return M(i)&&et(i.bin)?"vertical":"horizontal";if(e===wc){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Hf:case i1:{const a=Mv(i),u=Mv(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=$t(i)&&i.type===xo,c=$t(r)&&r.type===xo;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function lH(e){const{point:t,line:n,...i}=e;return R(i).length>1?i:i.type}function cH(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Wt(e[t],["point","line"])});return e}function sh(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?U(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?U(t.point)?t.point:{}:void 0}function Wv(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 fH{name="path-overlay";hasMatchingType(t,n){if(zi(t)){const{mark:i,encoding:r}=t,s=ii(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!sh(s,n[s.type],r);case"area":return!!sh(s,n[s.type],r)||!!Wv(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:u,encoding:l,...c}=t,f=ed(l,r),d=ii(a)?a:{type:a},p=sh(d,r[d.type],f),h=d.type==="area"&&Wv(d,r[d.type]),g=[{name:u,...s?{params:s}:{},mark:lH({...d.type==="area"&&me("opacity",d,r)==null&&me("fillOpacity",d,r)==null?{opacity:ZF}:{},...d}),encoding:Wt(f,["shape"])}],m=JF(QF(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=Wt(y,["y2","x2"]),h&&g.push({...o?{projection:o}:{},mark:{type:"line",...po(d,["clip","interpolate","tension","tooltip"]),...h},encoding:y}),p&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...po(d,["clip","tooltip"]),...p},encoding:y}),i({...c,layer:g}
vendor: 8,435 bytes, line 9
9,{...n,config:cH(r)})}}function dH(e,t){return t?Bu(e)?tO(e,t):eO(e,t):e}function oh(e,t){return t?tO(e,t):e}function Hp(e,t,n){const i=t[e];if(XW(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};N(Wj(i.repeat));return}return t}function eO(e,t){if(e=Hp("field",e,t),e!==void 0){if(e===null)return null;if(d1(e)&&$i(e.sort)){const n=Hp("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function Gv(e,t){if(M(e))return eO(e,t);{const n=Hp("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function Hv(e,t){if(ne(e)){const n=Gv(e,t);if(n)return n;if(Uu(e))return{condition:e.condition}}else{if(ju(e)){const n=Gv(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function tO(e,t){const n={};for(const i in e)if(_(e,i)){const r=e[i];if(F(r))n[i]=r.map(s=>Hv(s,t)).filter(s=>s);else{const s=Hv(r,t);s!==void 0&&(n[i]=s)}}return n}class hH{name="RuleForRangedLine";hasMatchingType(t){if(zi(t)){const{encoding:n,mark:i}=t;if(i==="line"||ii(i)&&i.type==="line")for(const r of uj){const s=As(r),o=n[s];if(n[r]&&(M(o)&&!et(o.bin)||pi(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return N(dq(!!r.x2,!!r.y2)),i({...t,mark:U(s)?{...s,type:"rule"}:"rule"},n)}}class pH extends A1{nonFacetUnitNormalizers=[mG,xG,AG,new fH,new hH];map(t,n){if(zi(t)){const i=Yr(t.encoding,Si),r=Yr(t.encoding,ki),s=Yr(t.encoding,Tf);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=oh(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(o,n.config))return u.run(o,n,a);return o}mapRepeat(t,n){return ZG(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...s,layer:u.map(f=>{const d={...l,layer:f},p=`${(r.name?`${r.name}_`:"")+c}child__layer_${De(f)}`,h=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:p});return h.name=p,h})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!F(i)&&t.columns&&(t=Wt(t,["columns"]),N($v("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!F(i)&&i.row||[u?u.row:null],f=!F(i)&&i.column||[u?u.column:null],d=F(i)&&i||[u?u.repeat:null];for(const h of d)for(const g of c)for(const m of f){const y={repeat:h,row:g,column:m,layer:u.layer},b=`${(r.name?`${r.name}_`:"")+l}child__${F(i)?`${De(h)}`:(i.row?`row_${De(g)}`:"")+(i.column?`column_${De(m)}`:"")}`,v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(Wt(v,["data"]))}const p=F(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:p,concat:a}}mapFacet(t,n){const{facet:i}=t;return Bu(i)&&t.columns&&(t=Wt(t,["columns"]),N($v("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,u=Xv({parentProjection:o,projection:r}),l=Vv({parentEncoding:s,encoding:oh(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:p,...h}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=oh(o,n.repeater);return this.mapFacet({...h,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&N(cq([...i?[Si]:[],...r?[ki]:[]]));const o={},a={};for(const u of[Si,ki]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:p,...h}=l;o[u]=h;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??={},a[g][u]=l[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:u,columns:l,...c}=s;return{facetMapping:dH(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,u={...r,parentEncoding:Vv({parentEncoding:n,encoding:s,layer:!0}),parentProjection:Xv({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function Vv({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...R(e),...R(t)]);for(const s of r){const o=t[s],a=e[s];if(ne(o)){const u={...a,...o};i[s]=u}else ju(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||On(a)||Y(a)||ne(a)||F(a))&&(i[s]=a)}}else i=t;return!i||Se(i)?void 0:i}function Xv(e){const{parentProjection:t,projection:n}=e;return t&&n&&N(Zj({parentProjection:t,projection:n})),n??t}function C1(e){return _(e,"filter")}function gH(e){return _(e,"stop")}function nO(e){return _(e,"lookup")}function mH(e){return _(e,"data")}function yH(e){return _(e,"param")}function bH(e){return _(e,"pivot")}function xH(e){return _(e,"density")}function vH(e){return _(e,"quantile")}function EH(e){return _(e,"regression")}function wH(e){return _(e,"loess")}function SH(e){return _(e,"sample")}function kH(e){return _(e,"window")}function $H(e){return _(e,"joinaggregate")}function AH(e){return _(e,"flatten")}function CH(e){return _(e,"calculate")}function iO(e){return _(e,"bin")}function FH(e){return _(e,"impute")}function OH(e){return _(e,"timeUnit")}function DH(e){return _(e,"aggregate")}function RH(e){return _(e,"stack")}function _H(e){return _(e,"fold")}function TH(e){return _(e,"extent")&&!_(e,"density")&&!_(e,"regression")}function NH(e){return e.map(t=>C1(t)?{filter:Qs(t.filter,oW)}:t)}class MH extends A1{map(t,n){return n.emptySelections??={},n.selectionPredicates??={},t=Yv(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=Yv(t,n),t.encoding){const i={};for(const[r,s]of gr(t.encoding))i[r]=rO(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:gr(i).map(([s,o])=>{const{init:a,bind:u,empty:l,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of Be(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:a,select:c,bind:u}})}:t}}function Yv(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(C1(s))return{filter:Vp(s,t)};if(iO(s)&&Cs(s.bin))return{...s,bin:sO(s.bin)};if(nO(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function rO(e,t){const n=te(e);if(M(n)&&Cs(n.bin)&&(n.bin=sO(n.bin)),Rs(n)&&n.scale?.domain?.selection){const{selection:i,...r}=n.scale.domain;n.scale.domain={...r,...i?{param:i}:{}}}if(Uu(n))if(F(n.condition))n.condition=n.condition.map(i=>{const{selection:r,param:s,test:o,...a}=i;return s?i:{...a,test:Vp(i,t)}});else{const{selection:i,param:r,test:s,...o}=rO(n.condition,t);n.condition=r?n.condition:{...o,test:Vp(n.condition,t)}}return n}function sO(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Vp(e,t){const n=i=>Qs(i,r=>{const s=t.emptySelections[r]??!0,o={param:r,empty:s};return t.selectionPredicates[r]??=[],t.selectionPredicates[r].push(o),o});return e.selection?n(e.selection):Qs(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Xp extends A1{map(t,n){const i=n.selections??[];if(t.params&&!zi(t)){const r=[];for(const s of t.params)S1(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(j(a)&&(a===t.name||r.includes(a))||F(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Xp.prototype[e];Xp.prototype[e]=function(n,i){return t.call(this,n,LH(n,i))}}function LH(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}
9:t}function oO(e,t){t===void 0&&(t=KF(e.config));const n=BH(e,t),{width:i,height:r}=e,s=UH(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const PH=new pH,IH=new MH,zH=new Xp;function BH(e,t={}){const n={config:t};return zH.map(PH.map(IH.map(e,n),n),n)}function Kv(e){return j(e)?{type:e}:e??{}}function UH(e,t,n){let{width:i,height:r}=t;const s=zi(e)||nd(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(N(Ev("width")),i=void 0),r=="container"&&(N(Ev("height")),r=void 0));const a={type:"pad",...o,...n?Kv(n.autosize):{},...Kv(e.autosize)};if(a.type==="fit"&&!s&&(N(Tj),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&N(wv("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&N(wv("height")),!Bt(a,{type:"pad"}))return a}function jH(e){return["fit","fit-x","fit-y"].includes(e)}function qH(e){return e?`fit-${If(e)}`:"fit"}const WH=["background","padding"];function Jv(e,t){const n={};for(const i of WH)e&&e[i]!==void 0&&(n[i]=It(e[i]));return t&&(n.params=e.params),n}class Bi{explicit;implicit;constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Bi(te(this.explicit),te(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Pe(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:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of R(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Gn(e){return{explicit:!0,value:e}}function Pt(e){return{explicit:!1,value:e}}function aO(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:id(t,n,i,r)}}function id(e,t,n,i){return e.explicit&&t.explicit&&N(wq(n,i,e.value,t.value)),e}function br(e,t,n,i,r=id){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Bt(e.value,t.value)?e:r(e,t,n,i)}class GH extends Bi{explicit;implicit;parseNothing;constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function $o(e){return _(e,"url")}function ru(e){return _(e,"values")}function uO(e){return _(e,"name")&&!$o(e)&&!ru(e)&&!ur(e)}function ur(e){return e&&(lO(e)||cO(e)||F1(e))}function lO(e){return _(e,"sequence")}function cO(e){return _(e,"sphere")}function F1(e){return _(e,"graticule")}var Te;(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",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Te||(Te={}));function fO({invalid:e,isPath:t}){switch(sF(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function HH(e){const{marks:t,scales:n}=fO(e);return t===n?Te.Main:n==="include-invalid-values"?Te.PreFilterInvalid:Te.PostFilterInvalid}class ve{debugName;_children=[];_parent=null;_hash;constructor(t,n){this.debugName=n,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)){N(Kj);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 r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class Ot extends ve{type;refCounts;_source;_name;clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}
9`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,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 ${oC()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function ah(e){return e.as!==void 0}function Qv(e){return`${e}_end`}class Kn extends ve{timeUnits;clone(){return new Kn(null,te(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:u}=s;if(u){let l;if(Ds(u)){if(Oe(n)){const{mark:c,markDef:f,config:d}=n,p=yr({fieldDef:s,markDef:f,config:d});(iu(c)||p)&&(l={timeUnit:Qe(u),field:a})}}else l={as:B(s,{forAs:!0}),field:a,timeUnit:u};if(Oe(n)){const{mark:c,markDef:f,config:d}=n,p=yr({fieldDef:s,markDef:f,config:d});iu(c)&&Ie(o)&&p!==.5&&(l.rectBandPosition=p)}l&&(r[se(l)]=l)}return r},{});return Se(i)?null:new Kn(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=Qe(i),o={...r,timeUnit:s};return new Kn(t,{[se(o)]:o})}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[i,r]of gr(this.timeUnits)){const s=ah(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(Be(this.timeUnits).map(t=>ah(t)?t.as:Qv(t.field)))}dependentFields(){return new Set(Be(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${se(this.timeUnits)}`}assemble(){const t=[];for(const n of Be(this.timeUnits)){const{rectBandPosition:i}=n,r=Qe(n.timeUnit);if(ah(n)){const{field:s,as:o}=n,{unit:a,utc:u,...l}=r,c=[o,`${o}_end`];t.push({field:un(s),type:"timeunit",...a?{units:jf(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...Zv(c,i,r))}else if(n){const{field:s}=n,o=rC(s),a=dO({timeUnit:r,field:o}),u=Qv(o);t.push({type:"formula",expr:a,as:u}),t.push(...Zv([o,u],i,r))}}return t}}const rd="offsetted_rect_start",sd="offsetted_rect_end";function dO({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=jC(i),{part:o,step:a}=HC(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', ${ye(t)}, ${n?-a:a})`}function Zv([e,t],n,i){if(n!==void 0&&n!==.5){const r=ye(e),s=ye(t);return[{type:"formula",expr:eE([dO({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${rd}`},{type:"formula",expr:eE([r,s],n+.5),as:`${e}_${sd}`}]}return[]}function eE([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Gu="_tuple_fields";class VH{hasChannel;hasField;hasSelectionId;timeUnit;items;constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const XH={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??=new VH,s={},o={},a=new Set,u=(h,g)=>{const m=g==="visual"?h.channel:h.field;let y=De(`${i}_${m}`);for(let b=1;a.has(y);b++)y=De(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?q(n.value):null;let{fields:d,encodings:p}=U(n.select)?n.select:{};
9if(!d&&!p&&f){for(const h of f)if(U(h))for(const g of R(h))aj(g)?(p||(p=[])).push(g):l==="interval"?(N(qj),p=c.encodings):(d??=[]).push(g)}!d&&!p&&(p=c.encodings,"fields"in c&&(d=c.fields));for(const h of p??[]){const g=e.fieldDef(h);if(g){let m=g.field;if(g.aggregate){N(Nj(h,g.aggregate));continue}else if(!m){N(kv(h));continue}if(g.timeUnit&&!Ds(g.timeUnit)){m=e.vgField(h);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[se(y)]=y}if(!s[m]){const y=l==="interval"&&hi(h)&&Fn(e.getScaleComponent(h).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:h,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Rn,dC(h)?(b.geoChannel=h,b.channel=fC(h),r.hasChannel[b.channel]=s[m]):r.hasChannel[h]=s[m]}}else N(kv(h))}for(const h of d??[]){if(r.hasField[h])continue;const g={type:"E",field:h,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[h]=g,r.hasSelectionId=r.hasSelectionId||h===Rn}f&&(t.init=f.map(h=>r.items.map(g=>U(h)?h[g.geoChannel||g.channel]!==void 0?h[g.geoChannel||g.channel]:h[g.field]:h))),Se(o)||(r.timeUnit=new Kn(null,o))},signals:(e,t,n)=>{const i=t.name+Gu;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(mO)})}},hO="_curr",ql="anim_value",Ws="anim_clock",Yp="eased_anim_clock",pO="min_extent",gO="max_range_extent",uh="last_tick_at",lh="is_playing",YH=1/60*1e3,KH=(e,t)=>[{name:Yp,update:Ws},{name:`${e}_domain`,init:`domain('${t}')`},{name:pO,init:`extent(${e}_domain)[0]`},{name:gO,init:`extent(range('${t}'))[1]`},{name:ql,update:`invert('${t}', ${Yp})`}],JH={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(Jn(t)&&(n=n.concat([{name:Ws,init:"0",on:[{events:{type:"timer",throttle:YH},update:`${lh} ? (${Ws} + (now() - ${uh}) > ${gO} ? 0 : ${Ws} + (now() - ${uh})) : ${Ws}`}]},{name:uh,init:"now()",on:[{events:[{signal:Ws},{signal:lh}],update:"now()"}]},{name:lh,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+Gu,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=Be(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+to):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Kr(e)}, `;if(t.project.hasSelectionId)l+=`${Rn}: ${o}[${L(Rn)}]`;else if(Jn(t))l+=`fields: ${r}, values: [${ql} ? ${ql} : ${pO}]`;else{const c=s.items.map(f=>e.fieldDef(f.channel)?.bin?`[${o}[${L(e.vgField(f.channel,{}))}], ${o}[${L(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${o}[${L(f.field)}]`).join(", ");l+=`fields: ${r}, values: [${c}]`}if(Jn(t))return n.concat(KH(t.name,e.scaleName(Sr)),[{name:i+Ri,on:[{events:[{signal:Yp},{signal:ql}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+Ri,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function mO(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=un(r.field),r}function hs(e,t=!0,n=bt){if(F(e)){const i=e.map(r=>hs(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Os(e))return n(t?ls(e):Xq(e));return t?n(xe(e)):e}function QH(e,t){for(const n of Be(e.component.selection??{})){const i=n.name;let r=`${i}${Ri}, ${n.resolve==="global"?"true":`{unit: ${Kr(e)}}`}`;for(const s of od)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+$V,on:[{events:{signal:n.name+Ri},update:`modify(${L(n.name+ps)}, ${r})`}]})}return O1(t)}function ZH(e,t){if(e.component.selection&&R(e.component.selection).length){const n=L(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Er("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return O1(t)}function eV(e,t){let n=!1;for(const i of Be(e.component.selection??{})){const r=i.name,s=L(r+ps);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${NO}(${s}, ${L(a)}${u}`})}n=!0;for(const a of od)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),O1(t)}function tV(e,t){const n=[],i=[],r=Kr(e,{escape:!1});for(const s of Be(e.component.selection??{})){const o={name:s.name+ps};if(s.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Rn}}]),s.init){const u=s.project.items.map(mO);o.values=s.project.hasSelectionId?s.init.map(l=>({unit:r,[Rn]:hs(l,!1)[0]})):s.init.map(l=>({unit:r,fields:u,values:hs(l,!1)}))}if([...n,...t].filter(u=>u.name===s.name+ps).length||n.push(o),Jn(s)&&t.length){const u=e.lookupDataSource(e.getDataName(Te.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);const f={name:l.name+hO,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function yO(e,t){for(const n of Be(e.component.selection??{}))for(const i of od)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function nV(e,t){for(const n of e.children)Oe(n)&&(t=yO(n,t));return t}function iV(e,t,n,i){const r=zO(e,t.param,t);return{signal:Fn(n.get("type"))&&F(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function O1(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const Ai={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!hi(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&N(Ij),!s||!Fn(o)){N(Pj);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||Jp(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(NO))r.update=`{${i.map(o=>`${L(un(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${L(un(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Jp(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);
vendor: 4,596 bytes, line 9
9r.push="outer",delete r.value,delete r.update}return n}};function Kp(e,t){return`domain(${L(e.scaleName(t))})`}function Jp(e){return e.parent&&Jo(e.parent)&&(!e.parent.parent||Jp(e.parent.parent))}const to="_brush",bO="_scale_trigger",da="geo_interval_init_tick",xO="_init",rV="_center",sV={defined:e=>e.type==="interval",parse:(e,t,n)=>{if(e.hasProjection){const i={...U(n.select)?n.select:{}};i.fields=[Rn],i.encodings||(i.encodings=n.value?R(n.value):[In,Pn]),n.select={type:"interval",...i}}if(t.translate&&!Ai.defined(t)){const i=`!event.item || event.item.mark.name !== ${L(t.name+to)}`;for(const r of t.events){if(!r.between){N(`${r} is not an ordered event stream for interval selections.`);continue}const s=q(r.between[0].filter??=[]);s.includes(i)||s.push(i)}}},signals:(e,t,n)=>{const i=t.name,r=i+Ri,s=Be(t.project.hasChannel).filter(a=>a.channel===Re||a.channel===Ze),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,u)=>a.concat(oV(e,t,u,o?.[u.index])),[])),e.hasProjection){const a=L(e.projectionName()),u=e.projectionName()+rV,{x:l,y:c}=t.project.hasChannel,f=l?.signals.visual,d=c?.signals.visual,p=l?o?.[l.index]:`${u}[0]`,h=c?o?.[c.index]:`${u}[1]`,g=E=>e.getSizeSignalRef(E).signal,m=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:g("width")}, ${d?`${d}[1]`:g("height")}]]`;o&&(n.unshift({name:i+xO,init:`[scale(${a}, [${l?p[0]:p}, ${c?h[0]:h}]), scale(${a}, [${l?p[1]:p}, ${c?h[1]:h}])]`}),(!l||!c)&&(n.find(S=>S.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${L(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Kr(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,w=s.map(E=>E.signals.visual);return n.concat({name:r,on:[{events:[...w.length?[{signal:w.join(" || ")}]:[],...o?[{signal:da}]:[]],update:v}]})}else{if(!Ai.defined(t)){const l=i+bO,c=s.map(f=>{const d=f.channel,{data:p,visual:h}=f.signals,g=L(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Fn(m)?"+":"";return`(!isArray(${p}) || (${y}invert(${g}, ${h})[0] === ${y}${p}[0] && ${y}invert(${g}, ${h})[1] === ${y}${p}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:`${c.join(" && ")} ? ${l} : {}`}]})}const a=s.map(l=>l.signals.data),u=`unit: ${Kr(e)}, fields: ${i+Gu}, values`;return n.concat({name:r,...o?{init:`{${u}: ${hs(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Oe(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===da).length||n.unshift({name:da,value:null,on:[{events:"timer{1}",update:`${da} === null ? {} : ${da}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r?.signals.visual,a=s?.signals.visual,u=`data(${L(t.name+ps)})`;if(Ai.defined(t)||!r&&!s)return n;const l={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of R(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Kr(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...p}=t.mark,h=R(p).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:p[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+to}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+to,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...h}}}]}};function oV(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=L(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(s===Re?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,p)=>[...d,{events:p.between[0],update:`[${c}, ${c}]`},{events:p,update:`[${o}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,p=Ai.defined(t),h=e.getScaleComponent(s),g=h?h.get("type"):void 0,m=i?{init:hs(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+bO},update:Fn(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),p?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:hs(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===Re?0:1,p=t.name+xO,h=i?{init:`[${p}[0][${d}], ${p}[1][${d}]]`}:{value:[]};return[{name:o,...h,on:f}]}}function Vo({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=Uu(t)&&t.condition;let o=[];
9s&&(o=q(s).map(l=>{const c=r(l);if(VW(l)){const{param:f,empty:d}=l;return{test:IO(e,{param:f,empty:d}),...c}}else return{test:Rc(e,l.test),...c}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function D1(e,t="text"){const n=e.encoding[t];return Vo({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>R1(i,e.config),invalidValueRef:void 0})}function R1(e,t,n="datum"){if(e){if(On(e))return Ce(e.value);if(ne(e)){const{format:i,formatType:r}=So(e);return c1({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function vO(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(F(o))return{tooltip:tE({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Vo({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:l=>{const c=wO(l,r,a);if(c)return c;if(l===null)return;let f=me("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),j(f))return{value:f};if(U(f))return Y(f)?f:f.content==="encoding"?tE(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function EO(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function u(c,f){const d=As(f),p=$t(c)?c:{...c,type:e[d].type},h=p.title||p1(p,r),g=q(h).join(", ").replaceAll(/"/g,'\\"');let m;if(Ie(f)){const y=f==="x"?"x2":"y2",b=Dn(e[y]);if(et(p.bin)&&b){const v=B(p,{expr:o}),w=B(b,{expr:o}),{format:E,formatType:S}=So(p);m=zu(v,w,E,S,r),s.add(y)}}if((Ie(f)||f===fn||f===Ln)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=So(p);m=c1({fieldOrDatumDef:p,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??=wO(p,r,o).signal,a.push({channel:f,key:g,value:m})}m1(e,(c,f)=>{M(c)?u(c,f):Kf(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!s.has(c)&&!l[f]&&(l[f]=d);return l}function tE(e,t,n,{reactiveGeom:i}={}){const r=EO(e,t,n,{reactiveGeom:i}),s=gr(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function wO(e,t,n="datum"){if(M(e)&&e1(e.type)&&!So(e).format&&!So(e).formatType){const i=`${n}["${e.field}"]`;return{signal:`isValid(${i}) ? isArray(${i}) ? join(${i}, '\\n') : ${i} : ""+${i}`}}return R1(e,t,n)}function aV(e){const{markDef:t,config:n}=e,i=me("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...uV(e),...lV(e)}}function uV(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=me("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:G(Oj,t)?{}:{ariaRoleDescription:{value:t}}}function lV(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Vo({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>R1(u,e.config),invalidValueRef:void 0});const o=me("description",n,i);if(o!=null)return{description:Ce(o)};if(i.aria===!1)return{};const a=EO(t,r,i);if(!Se(a))return{description:{signal:gr(a).filter(([u])=>!u.startsWith("_")).map(([u,l])=>[u,l.replaceAll("\\n"," ")]).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function it(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??=me(e,i,s,{vgChannel:o,ignoreVgConfig:!Uu(l)}),u!==void 0&&(a=Ce(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=aF({...c,scaleChannel:e,channelDef:l});return Vo({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:f,mainRefFn:p=>l1({...c,channel:e,channelDef:p,stack:null,defaultRef:a})})}function SO(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??me("filled",n,r),a=ae(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=me(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,l=me(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...u?{fill:Ce(u)}:{},...l?{stroke:Ce(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&N(TC("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...it("color",e,{vgChannel:c,defaultValue:o?u:l}),...it("fill",e,{defaultValue:i.fill?u:void 0}),...it("stroke",e,{defaultValue:i.stroke?l:void 0})}}function cV(e){const{encoding:t,mark:n}=e,i=t.order;return!Or(n)&&On(i)?Vo({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ce(r.value),invalidValueRef:void 0}):{}}function Ao({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:l1({channel:s,channelDef:a,markDef:t,config:i?.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:Ce(o),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function St(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,u=r[e],l=r[di(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:p}=Ao({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),h=_1({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&Ie(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:fV({channel:e,channelDef:u,channel2Def:l,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:h,bandPosition:p==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function fV(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(ne(n)&&r&&t===r.fieldChannel){if(M(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Sc({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Xr(n,i,{suffix:"end"},{offset:s})}return u1(e)}function _1({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=As(n),u=mr(n),l=me(n,s,o,{vgChannel:u});if(l!==void 0)return za(n,l);switch(t){case"zeroOrMin":return nE({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return nE({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[Nt(n)],mult:.5}}}}function nE({mainChannel:e,config:t,...n}){const i=oF(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const dV={left:"x",center:"xc",right:"x2"},hV={top:"y",middle:"yc",bottom:"y2"};function kO(e,t,n,i="middle"){if(e==="radius"||e==="theta")return mr(e);const r=e==="x"?"align":"baseline",s=me(r,t,n);let o;return Y(s)?(N(fq(r)),o=void 0):o=s,e==="x"?dV[o||(i==="top"?"left":"center")]:hV[o||i]}function Oc(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?$O(e,t,{defaultPos:n,defaultPos2:i}):St(e,t,{defaultPos:n})}function $O(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=di(e),a=Nt(e),u=pV(t,i,o),l=u[a]?kO(e,r,s):mr(e);return{...St(e,t,{defaultPos:n,vgChannel:l}),...u}}function pV(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,u=As(n),l=Nt(n),c=mr(n),f=i[u],d=e.scaleName(u),p=e.getScaleComponent(u),{offset:h}=n in i||n in s?Ao({channel:n,markDef:s,encoding:i,model:e}):Ao({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=Nt(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=gV({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:p,stack:o,offset:h,defaultRef:void 0});return g!==void 0?{[c]:g}:cl(n,s)||cl(n,{[n]:Ip(n,s,a.style),[l]:Ip(l,s,a.style)})||cl(n,a[r])||cl(n,a.mark)||{[c]:_1({model:e,defaultPos:t,channel:n,scaleName:d,scale:p})()}}function gV({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l}){return ne(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Xr(t,s,{suffix:"start"},{offset:u}):u1({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function cl(e,t){const n=Nt(e),i=mr(e);if(t[i]!==void 0)return{[i]:za(e,t[i])};if(t[e]!==void 0)return{[i]:za(e,t[e])};if(t[n]){const r=t[n];if(fs(r))N(sq(n));else return{[n]:za(e,r)}}}function Di(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=di(t),a=Nt(t),u=i[t],l=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,p=i[a]??i.size??me("size",r,n,{vgChannel:a}),h=mC(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return M(u)&&($e(u.bin)||et(u.bin)||u.timeUnit&&!l)&&!(p&&!fs(p))&&!i[h]&&!Le(f)?bV({fieldDef:u,fieldDef2:l,channel:t,model:e}):(ne(u)&&Le(f)||g)&&!l?yV(u,t,e):$O(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function mV(e,t,n,i,r,s,o){if(fs(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=ni("minBandSize",{type:o},i);return{signal:c?`max(${En(c)}, ${l})`:l}}else r.band!==1&&(N(gq(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(Y(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(Fs(u)&&de(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=Pe(u,o==="tick"?f:o==="bar"?l:c);if(Y(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(de(d))return{signal:`${1-d} * ${e}`}}return{value:Gp(i.view,e)-2}}function yV(e,t,n){const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=Nt(t),f=di(t),d=mC(t),p=n.scaleName(d),h=n.getScaleComponent(Ny(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=it("size",n,{vgChannel:c,defaultRef:Ce(i.size)}):N(xq(i.type)));const y=!!m,b=pF({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(l||h)?.get("type"),useVlSizeChannel:g});m=m||{[c]:mV(c,p||u,h||l,s,b,!!e,i.type)};const v=(l||h)?.get("type")==="band"&&fs(b)&&!y?"top":"middle",w=kO(t,i,s,v),E=w==="xc"||w==="yc",{offset:S,offsetType:x}=Ao({channel:t,markDef:i,encoding:r,model:n,bandPosition:E?.5:0}),k=u1({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:o,offset:S,defaultRef:_1({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:E?x==="encoding"?0:.5:Y(b)?{signal:`(1-${b})/2`}:fs(b)?(1-b.band)/2:0});if(c)return{[w]:k,...m};{const D=mr(f),P=m[c],K=S?{...P,offset:S}:P;return{[w]:k,[D]:F(k)?[k[0],{...k[1],offset:K}]:{...k,offset:K}}}}function iE(e,t,n,i,r,s,o){if(cC(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(Y(n)||Y(r)||Y(i)||s){const l=En(n),c=En(r),f=En(i),d=En(s),h=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${h})`:h;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function bV({fieldDef:e,fieldDef2:t,channel:n,model:i}){const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=pF({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),p=i.component.axes[n]?.[0]?.get("translate")??.5,h=Ie(n)?me("binSpacing",s,r)??0:0,g=di(n),m=mr(n),y=mr(g),b=ni("minBandSize",s,r),{offset:v}=Ao({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:w}=Ao({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),E=jW({fieldDef:e,scaleName:u}),S=iE(n,h,c,p,v,b,E),x=iE(g,h,c,p,w??v,b,E),k=Y(f)?{signal:`(1-${f.signal})/2`}:fs(f)?(1-f.band)/2:.5,D=yr({fieldDef:e,fieldDef2:t,markDef:s,config:r});if($e(e.bin)||e.timeUnit){const P=e.timeUnit&&D!==.5;return{[y]:rE({fieldDef:e,scaleName:u,bandPosition:k,offset:x,useRectOffsetField:P}),[m]:rE({fieldDef:e,scaleName:u,bandPosition:Y(k)?{signal:`1-${k.signal}`}:1-k,offset:S,useRectOffsetField:P})}}else if(et(e.bin)){const P=Xr(e,u,{},{offset:x});if(M(t))return{[y]:P,[m]:Xr(t,u,{},{offset:S})};if(Cs(e.bin)&&e.bin.step)return{[y]:P,[m]:{signal:`scale("${u}", ${B(e,{expr:"datum"})} + ${e.bin.step})`,offset:S}}}N(LC(g))}function rE({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Sc({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:rd,endSuffix:sd}:{}})}const xV=new Set(["aria","width","height"]);function dn(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?SO(e):{};return{...vV(e.markDef,t),...sE("fill",n),...sE("stroke",i),...it("opacity",e),...it("fillOpacity",e),...it("strokeOpacity",e),...it("strokeWidth",e),...it("strokeDash",e),...cV(e),...vO(e),...D1(e,"href"),...aV(e)}}function sE(e,t){return t?{[e]:t}:{}}function vV(e,t){return Fj.reduce((n,i)=>(!xV.has(i)&&_(e,i)&&t[i]!=="ignore"&&(n[i]=Ce(e[i])),n),{})}function T1(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{let o;if(!hi(s)||!(o=e.getScaleType(s)))return;const a=zf(r.aggregate),u=a1({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(zW(u)){const l=e.vgField(s,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});l&&i.add(l)}}),i.size>0)return{defined:{signal:[...i].map(s=>qf(s,!0)).join(" && ")}}}function oE(e,t){if(t!==void 0)return{[e]:Ce(t)}}const ch="voronoi",AO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(ch)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Or(s))return N(Mj(s)),n;const o={name:e.getName(ch),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...vO(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;
vendor: 4,554 bytes, line 9
9return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(ch)&&(u=!0)}),u||n.splice(a+1,0,o),n}},CO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!w1(e.bind),parse:(e,t,n)=>MO(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init?.[0],a=AO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=De(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:hs(o[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${L(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(l=>l.name===i+Ri),o=i+Gu,a=r.items.map(l=>De(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(s.update=`${u} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},Dc="_toggle",FO={defined:e=>e.type==="point"&&!Jn(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Dc,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Ri,i=t.name+Dc;return`${i} ? null : ${n}, ${t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Kr(e)}}, `}${i} ? ${n} : null`}},EV={defined:e=>e.clear!==void 0&&e.clear!==!1&&!Jn(e),parse:(e,t)=>{t.clear&&(t.clear=j(t.clear)?Er(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(CO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===De(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+Ri);i(r,"null"),FO.defined(t)&&(r=n.findIndex(s=>s.name===t.name+Dc),i(r,"false"))}return n}},OO={defined:e=>{const t=e.resolve==="global"&&e.bind&&w1(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Rn;return t&&!n&&N(zj),t&&n},parse:(e,t,n)=>{const i=te(n);if(i.select=j(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},MO(t,i),U(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=q(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=rh(t.bind)?t.bind.legend:"click",s=j(r)?Er(r,"view"):q(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=rh(t.bind)&&t.bind.legend,s=o=>a=>{const u=te(a);return u.markname=o,u};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${De(o.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+Ri),o=i+Gu,a=r.items.filter(d=>d.hasLegend).map(d=>De(`${i}_${De(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+Dc),f=rh(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function wV(e,t,n){const i=e.fieldDef(t)?.field;for(const r of Be(e.component.selection??{})){const s=r.project.hasField[i]??r.project.hasChannel[t];if(s&&OO.defined(r)){const o=n.get("selections")??[];o.push(r.name),n.set("selections",o,!1),s.hasLegend=!0}}}const DO="_translate_anchor",RO="_translate_delta",SV={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Ai.defined(t),s=i+DO,{x:o,y:a}=t.project.hasChannel;let u=Er(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+to,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:`{x: x(unit), y: y(unit)${o!==void 0?`, extent_x: ${r?Kp(e,Re):`slice(${o.signals.visual})`}`:""}${a!==void 0?`, extent_y: ${r?Kp(e,Ze):`slice(${a.signals.visual})`}`:""}}`}]},{name:i+RO,value:{},on:[{events:u,update:`{x: ${s}
9.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&aE(e,t,o,"width",n),a!==void 0&&aE(e,t,a,"height",n),n}};function aE(e,t,n,i,r){const s=t.name,o=s+DO,a=s+RO,u=n.channel,l=Ai.defined(t),c=r.find(E=>E.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),p=d?.get("type"),h=d?.get("reverse"),g=l?u===Re?h?"":"-":h?"-":"":"",m=`${o}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":p==="log"?"panLog":p==="symlog"?"panSymlog":p==="pow"?"panPow":"panLinear",v=l?p==="pow"?`, ${d.get("exponent")??1}`:p==="symlog"?`, ${d.get("constant")??1}`:"":"",w=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?w:`clampRange(${w}, 0, ${f})`})}const _O="_zoom_anchor",TO="_zoom_delta",kV={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Ai.defined(t),s=i+TO,{x:o,y:a}=t.project.hasChannel,u=L(e.scaleName(Re)),l=L(e.scaleName(Ze));let c=Er(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+to,f))),n.push({name:i+_O,on:[{events:c,update:r?`{${[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&uE(e,t,o,"width",n),a!==void 0&&uE(e,t,a,"height",n),n}};function uE(e,t,n,i,r){const s=t.name,o=n.channel,a=Ai.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c?.get("type"),d=a?Kp(e,o):u.name,p=s+TO,h=`${s}${_O}.${o}`,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}, ${h}, ${p}${m})`;u.on.push({events:{signal:p},update:a?y:`clampRange(${y}, 0, ${l})`})}const ps="_store",Ri="_tuple",$V="_modify",NO="vlSelectionResolve",od=[JH,sV,XH,FO,CO,Ai,OO,EV,SV,kV,AO];function AV(e){let t=e.parent;for(;t&&!Gt(t);)t=t.parent;return t}function Kr(e,{escape:t}={escape:!0}){let n=t?L(e.name):e.name;const i=AV(e);if(i){const{facet:r}=i;for(const s of en)r[s]&&(n+=` + '__facet_${s}_' + (facet[${L(i.vgField(s))}])`)}return n}function N1(e){return Be(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function MO(e,t){(j(t.select)||!t.select.on)&&delete e.events,(j(t.select)||!t.select.clear)&&delete e.clear,(j(t.select)||!t.select.toggle)&&delete e.toggle}function Jn(e){return e.events?.find(t=>"type"in t&&t.type==="timer")}function Qp(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Qp(e.object)),t.push(...Qp(e.property))),t)}function LO(e){return e.object.type==="MemberExpression"?LO(e.object):e.object.name==="datum"}function PO(e){const t=J0(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&LO(i)&&n.add(Qp(i).slice(1).join("."))}),n}class Xo extends ve{model;filter;expr;_dependentFields;clone(){return new Xo(null,this.model,te(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=Rc(this.model,this.filter,this),this._dependentFields=PO(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function CV(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const o=De(s.name),a=s.select,u=j(a)?a:a.type,l=U(a)?te(a):{type:u},c=i[u];for(const p in c)p==="fields"||p==="encodings"||(p==="mark"&&(l.mark={...c.mark,...l.mark}),(l[p]===void 0||l[p]===!0)&&(l[p]=te(c[p]??l[p])));const f=n[o]={...l,name:o,type:u,init:s.value,bind:s.bind,events:j(l.on)?Er(l.on,"scope"):q(te(l.on))};if(Jn(f)&&(r++,r>1)){delete n[o];continue}const d=te(s);for(const p of od)p.defined(f)&&p.parse&&p.parse(e,f,d)}return r>1&&N(Gj),n}function IO(e,t,n,i="datum"){const r=j(t)?t:t.param,s=De(r),o=L(s+ps);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,p=a.project.timeUnit.clone();d.parent?p.insertAsParentOf(d):d.parent=p}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${L(a.resolve)})`,c=`${u}${o}
9, ${i}${l}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function zO(e,t,n){const i=De(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&N(Hj(s));else if(r&&!s){const a=o.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,N(Vj(a,r,n,s))):s=a[0].field}return`${o.name}[${L(un(s))}]`}function FV(e,t){for(const[n,i]of gr(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new Ot(new Xo(t,e,{param:n}),r,Te.Lookup,e.component.data.outputNodeRefCounts)}}function Rc(e,t,n){return Ia(t,i=>j(i)?i:iW(i)?IO(e,i,n):XC(i))}function OV(e,t){if(e)return F(e)&&!Xi(e)?e.map(n=>p1(n,t)).join(", "):e}function fh(e,t,n,i){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=i}function Oa(e,t,n,i={header:!1}){const{disable:r,orient:s,scale:o,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const f in c){const d=f,p=aG[d],h=c[d];if(p&&p!==t&&p!=="both")delete c[d];else if(Wu(h)){const{condition:g,...m}=h,y=q(g),b=Lv[d];if(b){const{vgProp:v,part:w}=b,E=[...y.map(S=>{const{test:x,...k}=S;return{test:Rc(null,x),...k}}),m];fh(c,w,v,E),delete c[d]}else if(b===null){const v={signal:y.map(w=>{const{test:E,...S}=w;return`${Rc(null,E)} ? ${vv(S)} : `}).join("")+vv(m)};c[d]=v}}else if(Y(h)){const g=Lv[d];if(g){const{vgProp:m,part:y}=g;fh(c,y,m,h),delete c[d]}}ae(["labelAlign","labelBaseline"],d)&&c[d]===null&&delete c[d]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:f}=c.encode;c.encode={...f?{grid:f}:{}},Se(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Pe(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let d=a;c.encode?.labels?.update&&Y(c.encode.labels.update.text)&&(d=os(a,"datum.label",c.encode.labels.update.text.signal)),fh(c,"labels","text",{signal:d})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const d of kF)e.hasAxisPart(d)||delete c.encode[d];Se(c.encode)&&delete c.encode}const f=OV(u,n);return{scale:o,orient:s,grid:!1,...f?{title:f}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Pe(l,0)}}}}function BO(e){const{axes:t}=e.component,n=[];for(const i of Ii)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function DV(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Oa(r,"grid",t)),...i.map(r=>Oa(r,"grid",t)),...n.map(r=>Oa(r,"main",t)),...i.map(r=>Oa(r,"main",t))].filter(r=>r)}function lE(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...R(o),...R(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${En(o[c])} : ${En(a[c])}`};return l}return t[r]})])}function RV(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:JC(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=Y(n)?"axisOrient":`axis${Tu(n)}`,a=[...r,...r.map(l=>s+l.substr(4))],u=["axis",o,s];return{vlOnlyAxisConfig:lE(a,i,e,n),vgAxisConfig:lE(u,i,e,n),axisConfigStyle:_V([...u,...a],i)}}function _V(e,t){const n=[{}];for(const i of e){let r=t[i]?.style;if(r){r=q(r);for(const s of r)n.push(t.style[s])}}return Object.assign.apply(null,n)}function Zp(e,t,n,i={}){const r=AC(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(i[s]?.[e]!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const cE={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??TV(n,e),gridScale:({model:e,channel:t})=>NV(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||jO(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||UO(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??LV(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??PV(t.type,n,M(t)&&!!t.timeUnit,M(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??zV({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??BV({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=qO(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return FC(r?[Nv(r)]:[],M(o)?[Nv(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>UV(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??jV(n,t)};
vendor: 3,431 bytes, line 9
9function TV(e,t){return!Le(e)&&M(t)&&!$e(t?.bin)&&!et(t?.bin)}function NV(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function MV(e,t,n,i,r){const s=t?.labelAngle;if(s!==void 0)return Y(s)?s:nu(s);{const{configValue:o}=Zp("labelAngle",i,t?.style,r);return o!==void 0?nu(o):n===Re&&ae([n1,t1],e.type)&&!(M(e)&&e.timeUnit)?270:void 0}}function eg(e){return`(((${e.signal} % 360) + 360) % 360)`}function UO(e,t,n,i){if(e!==void 0)if(n==="x"){if(Y(e)){const r=eg(e),s=Y(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(Y(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(Y(e)){const r=eg(e),s=Y(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${s} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(Y(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function jO(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,s=i?"bottom":"left";if(Y(e)){const o=eg(e),a=Y(t)?`(${t.signal} === "${s}")`:t===s;return{signal:`(${r?`(${o} + 90)`:o} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${o} && ${o} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(Y(t)){const o=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${o} "${s}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===s)?"left":"right"}function LV(e,t){if(t==="x"&&ae(["quantitative","temporal"],e))return!0}function PV(e,t,n,i){if(n&&!U(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function IV(e){return e==="x"?"bottom":"left"}function zV({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){if(!i&&!Le(t)&&t!=="log"){if(M(e)){if($e(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&ae(["month","hours","day","quarter"],Qe(e.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function BV({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(M(t)){const{timeUnit:n}=t;if(n){const i=GC(n);if(i)return{signal:i}}}}function qO(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),s=i?i.title:void 0,o=r?r.title:void 0;if(s&&o)return OC(s,o);if(s)return s;if(o)return o;if(s!==void 0)return s;if(o!==void 0)return o}function UV(e,t){const n=e.values;if(F(n))return SF(t,n);if(Y(n))return n}function jV(e,t){return e==="rect"&&$c(t)?1:0}class Co extends ve{transform;_dependentFields;clone(){return new Co(null,te(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=PO(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(Rs(i)&&hF(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,u=a.map((l,c)=>`${XC({field:s,timeUnit:o,equal:l})} ? ${c} : `).join("")+a.length;t=new Co(t,{calculate:u,as:Fo(i,r,{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 ${se(this.transform)}`}}
vendor: 1,107 bytes, line 9
9function Fo(e,t,n){return B(e,{prefix:t,suffix:"sort_index",...n})}function ad(e,t){return ae(["top","bottom"],t)?"column":ae(["left","right"],t)||e==="row"?"row":"column"}function Oo(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return Pe((t||{})[e],r[e],n.header[e])}function ud(e,t,n,i){const r={};for(const s of e){const o=Oo(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const M1=["row","column"],L1=["header","footer"];function qV(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=ud(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=ad(t,a),l=nu(o);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...GO(l,u),...WO(u,l,s),...HO(i,r,t,OG,jF)}}}function WO(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=jO(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}
vendor: 8,866 bytes, line 9
9function GO(e,t){const n=UO(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function WV(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of L1)if(n[r])for(const s of n[r]){const o=HV(e,t,r,n,s);o!=null&&i.push(o)}return i}function GV(e,t){const{sort:n}=e;return $i(n)?{field:B(n,{expr:"datum"}),order:n.order??"ascending"}:F(n)?{field:Fo(e,t,{expr:"datum"}),order:"ascending"}:{field:B(e,{expr:"datum"}),order:n??"ascending"}}function tg(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:u}=ud(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=c1({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=ad(t,a);return{text:{signal:u?os(os(u,"datum.label",l),"datum.value",B(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...GO(s,c),...WO(c,s,o),...HO(n,e,t,DG,qF)}}function HV(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=ud(["labelOrient"],o.header,a,t);(t==="row"&&!ae(["top","bottom"],f)||t==="column"&&!ae(["left","right"],f))&&(s=tg(o,t,a))}const u=Gt(e)&&!Bu(e.facet),l=r.axes,c=l?.length>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:GV(o,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const VV={column:{start:0,end:1},row:{start:1,end:0}};function XV(e,t){return VV[t][e]}function YV(e,t){const n={};for(const i of en){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:s,titleOrient:o}=ud(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=ad(i,o),u=XV(s,a);u!==void 0&&(n[a]=u)}}return Se(n)?void 0:n}function HO(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=Oo(o,t?.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function P1(e){return[...fl(e,"width"),...fl(e,"height"),...fl(e,"childWidth"),...fl(e,"childHeight")]}function fl(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(i==null||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(Le(o)&&Fs(a)){const u=e.scaleName(n);return Gt(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[fE(u,a)]:[fE(u,a),{name:r,update:VO(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Wp(e.config.view,s?"width":"height"),u=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function fE(e,t){const n=`${e}_step`;return Y(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function VO(e,t,n){const i=t.get("type"),r=t.get("padding"),s=Pe(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${En(o)}, ${En(s)}) * ${e}_step`}function XO(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function YO(e,t){return R(e).reduce((n,i)=>({...n,...Vo({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ce(r.value),invalidValueRef:void 0})}),{})}function KO(e,t){if(Gt(t))return e==="theta"?"independent":"shared";if(Jo(t))return"shared";if(W1(t))return Ie(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function I1(e,t){const n=e.scale[t],i=Ie(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&N(kq(t)),"independent"):e[i][t]||"shared"}const KV={...TG,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},JO=R(KV);class JV extends Bi{}const dE={symbols:QV,gradient:ZV,labels:eX,entries:tX};function QV(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:u,mark:l}=n,c=o.filled&&l!=="trail";let f={..._j({},n,OW),...SO(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,p=r.get("symbolFillColor")??u.legend.symbolFillColor,h=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?QO(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===_t)delete f.fill;else if(_(f.fill,"field"))p?delete f.fill:(f.fill=Ce(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ce(g??1));else if(F(f.fill)){const m=ng(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=Ce(m))}}if(f.stroke){if(i==="stroke"||!c&&i===_t)delete f.stroke;else if(_(f.stroke,"field")||h)delete f.stroke;else if(F(f.stroke)){const m=Pe(ng(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==Pi){const m=M(t)&&eD(n,r,t);m?f.opacity=[{test:m,...Ce(g??1)},Ce(u.legend.unselectedOpacity)]:g&&(f.opacity=Ce(g))}return f={...f,...e},Se(f)?void 0:f}function ZV(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?QO(o.opacity)||s.opacity:void 0;return l&&(a.opacity=Ce(l)),a={...a,...e},Se(a)?void 0:a}function eX(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=M(t)?eD(n,r,t):void 0,u=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;ds(c)?f=wn({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:o}):l===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=wn({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&M(t)&&t.timeUnit===void 0&&(f=wn({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Se(d)?void 0:d}function tX(e,{legendCmpt:t}){return t.get("selections")?.length?{...e,fill:{value:"transparent"}}:e}function QO(e){return ZO(e,(t,n)=>Math.max(t,n.value))}function ng(e){return ZO(e,(t,n)=>Pe(t,n.value))}function ZO(e,t){if(YW(e))return q(e.condition).reduce(t,e.value);if(On(e))return e.value}function eD(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=L(n.field);return i.map(s=>`(!length(data(${L(De(s)+ps)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const hE={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return cF(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return fF(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??uX(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??lX(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??iX(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>eo(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Zs(n)&&Xn(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>nX(t,e)};function nX(e,t){const n=e.values;if(F(n))return SF(t,n);if(Y(n))return n}function iX(e,t,n,i){if(t!=="shape"){const r=ng(n)??i;if(r)return r}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 rX(e){const{legend:t}=e;return Pe(t.type,sX(e))}function sX({channel:e,timeUnit:t,scaleType:n}){if(Zs(e)){if(ae(["quarter","month","day"],t))return"symbol";if(Xn(n))return"gradient"}return"symbol"}function oX({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??aX(n,t)}function aX(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 uX({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(Xn(r))return n==="horizontal"?i==="top"||i==="bottom"?pE(t,"width",o,s):o:pE(t,"height",u,a)}function pE(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function lX(e){if(ae(["quantile","threshold","log","symlog"],e))return"greedy"}function tD(e){const t=Oe(e)?cX(e):pX(e);return e.component.legends=t,t}function cX(e){const{encoding:t}=e,n={};for(const i of[_t,...GF]){const r=Ge(t[i]);
vendor: 5,823 bytes, line 9
9!r||!e.getScaleComponent(i)||i===Tt&&M(r)&&r.type===Ho||(n[i]=hX(e,i))}return n}function fX(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 dX(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===i?.title)return!0}return e===(n||{})[t]}function hX(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new JV({},fX(e,t));wV(e,t,a);const u=n!==void 0?!n:o.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=Ge(r[t]),f=M(c)?Qe(c.timeUnit)?.unit:void 0,d=n.orient||s.legend.orient||"right",p=rX({legend:n,channel:t,timeUnit:f,scaleType:l}),h=oX({legend:n,legendType:p,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:l,orient:d,legendType:p,direction:h};for(const w of JO){if(p==="gradient"&&w.startsWith("symbol")||p==="symbol"&&w.startsWith("gradient"))continue;const E=w in hE?hE[w](g):n[w];if(E!==void 0){const S=dX(E,w,n,e.fieldDef(t));(S||s.legend[w]===void 0)&&a.set(w,E,S)}}const m=n?.encoding??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:p};for(const w of["labels","legend","title","symbols","gradient","entries"]){const E=YO(m[w]??{},e),S=w in dE?dE[w](E,v):E;S!==void 0&&!Se(S)&&(b[w]={...y?.length&&M(c)?{name:`${De(c.field)}_legend_${w}`}:{},...y?.length?{interactive:!0}:{},update:y?.length?{...S,cursor:{value:"pointer"}}:S})}return Se(b)||a.set("encode",b,!!n?.encoding),a}function pX(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){tD(i);for(const r of R(i.component.legends))n.legend[r]=I1(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=nD(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of R(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function nD(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const s of JO){const o=br(e.getWithExplicit(s),t.getWithExplicit(s),s,"legend",(a,u)=>{switch(s){case"symbolType":return gX(a,u);case"title":return DC(a,u);case"type":return r=!0,Pt("symbol")}return id(a,u,s,"legend")});e.setWithExplicit(s,o)}return r&&(e.implicit?.encode?.gradient&&vc(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&vc(e.explicit,["encode","gradient"])),e}function gX(e,t){return t.value==="circle"?t:e}function mX(e,t,n,i){if(qu(t,n)){const r=Oe(e)?e.axis(n)??e.legend(n)??{}:{},s=B(t,{expr:"datum"}),o=B(t,{expr:"datum",binSuffix:"end"});return{formulaAs:B(t,{binSuffix:"range",forAs:!0}),formula:zu(s,o,r.format,r.formatType,i)}}return{}}function iD(e,t){return`${EC(e)}_${t}`}function yX(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function z1(e,t,n){const i=Jf(n,void 0)??{},r=iD(i,t);return e.getName(`${r}_bins`)}function bX(e){return"as"in e}function gE(e,t,n){let i,r;bX(e)?i=j(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[B(e,{forAs:!0}),B(e,{binSuffix:"end",forAs:!0})];const s={...Jf(t,void 0)},o=iD(s,e.field),{signal:a,extentSignal:u}=yX(n,o);if(Bf(s.extent)){const c=s.extent;r=zO(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:o,binComponent:l}}class Qn extends ve{bins;clone(){return new Qn(null,te(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if($t(s)&&$e(s.bin)){const{key:a,binComponent:u}=gE(s,s.bin,n);r[a]={...u,...r[a],...mX(n,s,o,n.config)}}return r},{});return Se(i)?null:new Qn(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=gE(n,n.bin,i);return new Qn(t,{[r]:s})}merge(t,n){for(const i of R(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=zt([...this.bins[i].as,...t.bins[i].as],se)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(Be(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(Be(this.bins).map(t=>t.field))}hash(){return`Bin ${se(this.bins)}`}assemble(){return Be(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:un(t.field),as:i,signal:t.signal,...Bf(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:un(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:B({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function xX(e,t,n,i){const r=Oe(i)?i.encoding[di(t)]:void 0;if($t(n)&&Oe(i)&&gF(n,r,i.markDef,i.config)){e.add(B(n,{})),e.add(B(n,{suffix:"end"}));const{mark:s,markDef:o,config:a}=i,u=yr({fieldDef:n,markDef:o,config:a});iu(s)&&u!==.5&&Ie(t)&&(e.add(B(n,{suffix:rd})),e.add(B(n,{suffix:sd}))),n.bin&&qu(n,t)&&e.add(B(n,{binSuffix:"range"}))}else if(dC(t)){const s=fC(t);e.add(i.getName(s))}else e.add(B(n));return Rs(n)&&mW(n.scale?.range)&&e.add(n.scale.range.field),e}function vX(e,t){for(const n of R(t)){const i=t[n];for(const r of R(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class kn extends ve{dimensions;measures;clone(){return new kn(null,new Set(this.dimensions),te(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;
9n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:u,field:l}=o;if(u)if(u==="count")r["*"]??={},r["*"].count=new Set([B(o,{forAs:!0})]);else{if(Oi(u)||Fr(u)){const c=Oi(u)?"argmin":"argmax",f=u[c];r[f]??={},r[f][c]=new Set([B({op:c,field:f},{forAs:!0})])}else r[l]??={},r[l][u]=new Set([B(o,{forAs:!0})]);hi(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??={},r[l].min=new Set([B({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([B({field:l,aggregate:"max"},{forAs:!0})]))}else xX(s,a,o,n)}),s.size+R(r).length===0)?null:new kn(t,s,r)}static makeFromTransform(t,n){const i=new Set,r={};for(const s of n.aggregate){const{op:o,field:a,as:u}=s;o&&(o==="count"?(r["*"]??={},r["*"].count=new Set([u||B(s,{forAs:!0})])):(r[a]??={},r[a][o]??=new Set,r[a][o].add(u||B(s,{forAs:!0}))))}for(const s of n.groupby??[])i.add(s);return i.size+R(r).length===0?null:new kn(t,i,r)}merge(t){return nC(this.dimensions,t.dimensions)?(vX(this.measures,t.measures),!0):(Uq("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...R(this.measures)])}producedFields(){const t=new Set;for(const n of R(this.measures))for(const i of R(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${se({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of R(this.measures))for(const o of R(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:un(s));return{type:"aggregate",groupby:[...this.dimensions].map(un),ops:t,fields:n,as:i}}}class Yo extends ve{model;name;data;column;row;facet;childModel;constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of en){const o=n.facet[s];if(o){const{bin:a,sort:u}=o;this[s]={name:n.getName(`${s}_domain`),fields:[B(o),...$e(a)?[B(o,{binSuffix:"end"})]:[]],...$i(u)?{sortField:u}:F(u)?{sortIndexField:Fo(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of en)this[n]&&(t+=` ${n.charAt(0)}:${se(this[n])}`);return t}get fields(){const t=[];for(const n of en)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of en)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 Ii){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(Le(r)&&Fs(s)){const o=ms(this.childModel,n),a=q1(o);a?t[n]=a:N(Uy(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=Xf,field:f}=u;s.push(f),o.push(c),a.push(B(u,{forAs:!0}))}else l&&(s.push(l),o.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const u of M1){for(const l of L1){const c=i[u]?.[l]??[];for(const f of c)if(f.axes?.length>0){s[u]=!0;break}}if(s[u]){const l=`length(data("${this.facet.name}"))`,c=u==="row"?n?{signal:`ceil(${l} / ${n})`}:1:n?{signal:`min(${l}, ${n})`}:{signal:l};r.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:c}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}
vendor: 8,901 bytes, line 9
9for(const a of[ki,Si])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function mE(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function EX(e,t){const n=Dy(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 i=mE(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=mE(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return N(Yj(t)),null}function wX(e){const t={};return jl(e.filter,n=>{if(VC(n)){let i=null;Vy(n)?i=It(n.equal):Yy(n)?i=It(n.lte):Xy(n)?i=It(n.lt):Ky(n)?i=It(n.gt):Jy(n)?i=It(n.gte):Qy(n)?i=n.range[0]:Zy(n)&&(i=(n.oneOf??n.in)[0]),i&&(Os(i)?t[n.field]="date":de(i)?t[n.field]="number":j(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function SX(e){const t={};function n(i){ko(i)?t[i.field]="date":i.type==="quantitative"&&Sj(i.aggregate)?t[i.field]="number":yo(i.field)>1?i.field in t||(t[i.field]="flatten"):Rs(i)&&$i(i.sort)&&yo(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Oe(e)||Gt(e))&&e.forEachFieldDef((i,r)=>{if($t(i))n(i);else{const s=As(r),o=e.fieldDef(s);n({...i,type:o.type})}}),Oe(e)){const{mark:i,markDef:r,encoding:s}=e;if(Or(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];M(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function kX(e){const t={};if(Oe(e)&&e.component.selection)for(const n of R(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&yo(r.field)>1&&(t[r.field]="flatten")}return t}class ht extends ve{_parse;clone(){return new ht(null,te(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${se(this._parse)}`}static makeExplicit(t,n,i){let r={};const s=n.data;return!ur(s)&&s?.format?.parse&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of R(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:N(Av(a,i[a],u.value)))}for(const a of R(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:N(Av(a,n[a],u)))}const s=new Bi(n,i);r.copyAll(s);const o={};for(const a of R(s.combine())){const u=s.get(a);u!==null&&(o[a]=u)}return R(o).length===0||r.parseNothing?null:new ht(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of R(this._parse)){const i=this._parse[n];yo(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(R(this._parse))}dependentFields(){return new Set(R(this._parse))}assembleTransforms(t=!1){return R(this._parse).filter(n=>t?yo(n)>1:!0).map(n=>{const i=EX(n,this._parse[n]);return i?{type:"formula",expr:i,as:Wo(n)}:null}).filter(n=>n!==null)}}class xr extends ve{clone(){return new xr(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Rn])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Rn}}}class Hu extends ve{params;clone(){return new Hu(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${se(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class Vu extends ve{params;clone(){return new Vu(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 ${se(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class gs extends ve{_data;_name;_generator;constructor(t){super(null),t??={name:"source"};let n;if(ur(t)||(n=t.format?{...Wt(t.format,["parse"])}:{}),ru(t))this._data={values:t.values};else if($o(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];ae(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else cO(t)?this._data={values:[{type:"Sphere"}]}:(uO(t)||ur(t))&&(this._data={});this._generator=ur(t),t.name&&(this._name=t.name),n&&!Se(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:[]}}}function B1(e){return e instanceof gs||e instanceof Hu||e instanceof Vu}class U1{#e;constructor(){this.#e=!1}setModified(){this.#e=!0}get modifiedFlag(){return this.#e}}class _s extends U1{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class j1 extends U1{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class $X extends j1{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of R(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class AX extends j1{requiresSelectionId;constructor(t){super(),this.requiresSelectionId=t&&N1(t)}run(t){t instanceof xr&&(this.requiresSelectionId&&(B1(t.parent)||t.parent instanceof kn||t.parent instanceof ht)||(this.setModified(),t.remove()))}}class CX extends U1{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Kn&&(i=t.producedFields(),Fy(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class FX extends j1{constructor(){super()}run(t){t instanceof Ot&&!t.isRequired()&&(this.setModified(),t.remove())}}class OX extends _s{run(t){if(!B1(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof ht)if(t instanceof ht)this.setModified(),t.merge(n);else{if(Oy(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class DX extends _s{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof ht);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const u of R(a))u in r?r[u]!==a[u]&&s.add(u):r[u]=a[u]}for(const o of s)delete r[o];if(!Se(r)){this.setModified();const o=new ht(t,r);for(const a of n){if(a instanceof ht)for(const u of R(r))delete a.parse[u];t.removeChild(a),a.parent=o,a instanceof ht&&R(a.parse).length===0&&a.remove()}}}}}class RX extends _s{run(t){t instanceof Ot||t.numChildren()>0||t instanceof Yo||t instanceof gs||(this.setModified(),t.remove())}}class _X extends _s{run(t){const n=t.children.filter(r=>r instanceof Kn),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class TX extends _s{run(t){const n=t.children.filter(r=>r instanceof kn),i={};for(const r of n){const s=se(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of R(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class NX extends _s{model;constructor(t){super(),this.model=t}run(t){const n=!(B1(t)||t instanceof Xo||t instanceof ht||t instanceof xr),i=[],r=[];for(const s of t.children)s instanceof Qn&&(n&&!Oy(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Qn?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class MX extends _s{run(t){const n=[...t.children];if(!go(n,o=>o instanceof Ot)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof Ot){let a=o;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof Ot)a=u;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class Ts extends ve{transform;clone(){return new Ts(null,te(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=zt(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;
9return 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??B(t)}hash(){return`JoinAggregateTransform ${se(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Do extends ve{filter;clone(){return new Do(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:s}=n,{marks:o,scales:a}=i;if(o==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=hi(f)&&n.getScaleComponent(f);if(d){const p=d.get("type"),{aggregate:h}=c,g=a1({scaleChannel:f,markDef:s,config:r,scaleType:p,isCountAggregate:zf(h)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return R(u).length?new Do(t,u):null}dependentFields(){return new Set(R(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${se(this.filter)}`}assemble(){const t=R(this.filter).reduce((n,i)=>{const r=this.filter[i],s=B(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${ig(s)}))`):r.type==="quantitative"&&n.push(ig(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function ig(e){return`isValid(${e}) && isFinite(+${e})`}function LX(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=B(i);return r&&t.push(r),t},[])}function PX(e){return F(e)&&e.every(t=>j(t))&&e.length>1}class Ci extends ve{_stack;clone(){return new Ci(null,te(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(Pe(f.order,"ascending"));const l={field:a,order:u};let c;return PX(s)?c=s:j(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new Ci(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:u}=i,l=s.map(p=>{const h=r[p];return Dn(h)}).filter(p=>!!p),c=LX(n),f=n.encoding.order;let d;if(F(f)||M(f))d=CC(f);
vendor: 9,902 bytes, line 9
9else{const p=mF(f)?f.sort:o==="y"?"descending":"ascending";d=c.reduce((h,g)=>(h.field.includes(g)||(h.field.push(g),h.order.push(p)),h),{field:[],order:[]})}return new Ci(t,{dimensionFieldDefs:l,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{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 ${se(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[B(r,{binSuffix:"mid"})]:[B(r,{}),B(r,{binSuffix:"end"})]:[B(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const p=B(c,{expr:"datum"}),h=B(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${ig(p)} ? ${f}*${p}+${1-f}*${h} : ${p}`,as:B(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:B(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:l,offset:a}),t}}class Ko extends ve{transform;clone(){return new Ko(null,te(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=zt(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??B(t)}hash(){return`WindowTransform ${se(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>zy(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function IX(e){function t(n){if(!(n instanceof Yo)){const i=n.clone();if(i instanceof Ot){const r=sg+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof kn||i instanceof Ci||i instanceof Ko||i instanceof Ts)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function rg(e){if(e instanceof Yo)if(e.numChildren()===1&&!(e.children[0]instanceof Ot)){const t=e.children[0];(t instanceof kn||t instanceof Ci||t instanceof Ko||t instanceof Ts)&&t.addDimensions(e.fields),t.swapWithParent(),rg(e)}else{const t=e.model.component.data.main;rD(t);const n=IX(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(rg)}function rD(e){if(e instanceof Ot&&e.type===Te.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Yo||(t.swapWithParent(),rD(e))}}const sg="scale_",dl=5;function og(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!og(t.children))return!1}return!0}function hn(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function yE(e,t,n){let i=e.sources,r=!1;return r=hn(new FX,i)||r,r=hn(new AX(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=hn(new RX,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=hn(new OX,i)||r,r=hn(new NX(t),i)||r,r=hn(new CX,i)||r,r=hn(new DX,i)||r,r=hn(new TX,i)||r,r=hn(new _X,i)||r,r=hn(new $X,i)||r,r=hn(new MX,i)||r),e.sources=i,r}function zX(e,t){og(e.sources);let n=0,i=0;for(let r=0;r<dl&&yE(e,t,!0);r++)n++;e.sources.map(rg);for(let r=0;r<dl&&yE(e,t,!1);r++)i++;og(e.sources),Math.max(n,i)===dl&&N(`Maximum optimization runs(${dl}) reached.`)}class Xe{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}signal;static fromName(t,n){return new Xe(()=>t(n))}}function sD(e){Oe(e)?BX(e):UX(e)}function BX(e){const t=e.component.scales;for(const n of R(t)){const i=qX(e,n);if(t[n].setWithExplicit("domains",i),GX(e,n),e.component.data.isFaceted){let s=e;for(;!Gt(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)wi(a)&&(a.data=sg+a.data.replace(sg,""))}}}function UX(e){for(const n of e.children)sD(n);const t=e.component.scales;for(const n of R(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=br(i,o.getWithExplicit("domains"),"domains","scale",ag);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&N(jj),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function jX(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=bE(t,n);if(!r){N(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=bE(t,n);if(r)return"unaggregated"}return e}function qX(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=jX(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Ge(i.x2)?Ge(i.x)?br(Wi(n,r,e,"x"),Wi(n,r,e,"x2"),"domain","scale",ag):Wi(n,r,e,"x2"):t==="y"&&Ge(i.y2)?Ge(i.y)?br(Wi(n,r,e,"y"),Wi(n,r,e,"y2"),"domain","scale",ag):Wi(n,r,e,"y2"):Wi(n,r,e,t)}function WX(e,t,n){return e.map(i=>({signal:`{data: ${Qf(i,{timeUnit:n,type:t})}}`}))}function dh(e,t,n){const i=Qe(n)?.unit;return t==="temporal"||i?WX(e,t,i):[e]}function Wi(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:u}=n,l=Ge(r[i]),{type:c}=l,f=l.timeUnit,d=HH({invalid:ni("invalid",s,a),isPath:Or(o)});if(gW(t)){const g=Wi(e,void 0,n,i),m=dh(t.unionWith,c,f);return Gn([...m,...g.value])}else{if(Y(t))return Gn([t]);if(t&&t!=="unaggregated"&&!ZC(t))return Gn(dh(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Pt([[0,1]]);const g=n.requestDataName(d);return Pt([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const p=hi(i)&&M(l)?HX(n,i,e):void 0;if(pi(l)){const g=dh([l.datum],c,f);return Pt(g)}const h=l;if(t==="unaggregated"){const{field:g}=l;return Pt([{data:n.requestDataName(d),field:B({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:B({field:g,aggregate:"max"})}])}else if($e(h.bin)){if(Le(e))return Pt(e==="bin-ordinal"?[]:[{data:mo(p)?n.requestDataName(d):n.requestDataName(Te.Raw),field:n.vgField(i,qu(h,i)?{binSuffix:"range"}:{}),sort:p===!0||!U(p)?{field:n.vgField(i,{}),op:"min"}:p}]);{const{bin:g}=h;if($e(g)){const m=z1(n,h.field,g);return Pt([new Xe(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Pt([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(h.timeUnit&&ae(["time","utc"],e)){const g=r[di(i)];if(gF(h,g,s,a)){const m=n.requestDataName(d),y=yr({fieldDef:h,fieldDef2:g,markDef:s,config:a}),b=iu(o)&&y!==.5&&Ie(i);return Pt([{data:m,field:n.vgField(i,b?{suffix:rd}:{})},{data:m,field:n.vgField(i,{suffix:b?sd:"end"})}])}}return Pt(p?[{data:mo(p)?n.requestDataName(d):n.requestDataName(Te.Raw),field:n.vgField(i),sort:p}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function hh(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":Xf),...i?{field:un(i)}:{},...r?{order:r}:{}}}function GX(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,s=ZC(i)?i:void 0,o=Cs(r)&&Bf(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function HX(e,t,n){if(!Le(n))return;const i=e.fieldDef(t),r=i.sort;if(hF(r))return{op:"min",field:Fo(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if($i(r)){const a=s&&!o.has(r.field);return hh(r,a)}else if(HW(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=s&&!o.has(f);if(Oi(c)||Fr(c))return hh({field:B(l),order:u},d);if(zy(c)||!c)return hh({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(ae(["ascending",void 0],r))return!0}}function bE(e,t){const{aggregate:n,type:i}=e;return n?j(n)&&!$j.has(n)?{valid:!1,reason:yq(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:bq(e)}:{valid:!0}:{valid:!1,reason:mq(e)}}function ag(e,t,n,i){return e.explicit&&t.explicit&&N(Sq(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function VX(e){const t=zt(e.map(o=>{if(wi(o)){const{sort:a,...u}=o;return u}return o}),se),n=zt(e.map(o=>{if(wi(o)){const a=o.sort;return a!==void 0&&!mo(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),se);if(t.length===0)return;if(t.length===1){const o=e[0];if(wi(o)&&n.length>0){let a=n[0];if(n.length>1){N(Fv);const u=n.filter(l=>U(l)&&"op"in l&&l.op!=="min");n.every(l=>U(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(U(a)&&"field"in a){const u=a.field;o.field===u&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=zt(n.map(o=>mo(o)||!("op"in o)||j(o.op)&&G(Ej,o.op)?o:(N($q(o)),!0)),se);let r;i.length===1?r=i[0]:i.length>1&&(N(Fv),r=!0);const s=zt(e.map(o=>wi(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function q1(e){if(wi(e)&&j(e.field))return e.field;if(SC(e)){let t;
9for(const n of e.fields)if(wi(n)&&j(n.field)){if(!t)t=n.field;else if(t!==n.field)return N(Aq),t}return N(Cq),t}else if(Aj(e)){N(Fq);const t=e.fields[0];return j(t)?t:void 0}}function ms(e,t){const i=e.component.scales[t].get("domains").map(r=>(wi(r)&&(r.data=e.lookupDataSource(r.data)),r));return VX(i)}function XX(e,t,n,i){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=i}function oD(e,t){if(Oe(e)){const i=e.fieldDef(t);if(i?.field)return i.field}const n=(e.children??[]).map(i=>oD(i,t)).filter(i=>!!i);if(n.length>0){const i=zt(n,se);return i.length===1?i[0]:void 0}}function YX(e,t,n){if(t===n)return!0;const i=e.getScaleType(t),r=e.getScaleType(n);if(!i||!r)return!1;const s=Le(i),o=Le(r);return s===o}function KX(e,t){return e?`field:${e}`:`channel:${String(t)}`}function JX(e){if(F(e)){const t=e.filter(xc);return t.length>0?t:null}if(SC(e)){const t=[];if(t.push(...e.fields.flatMap(n=>F(n)?n.filter(xc):[])),t.length>0)return zt(t,se)}return null}function ug(e,t){try{const n=ms(e,t);return JX(n)}catch{return null}}function QX(e,t,n){const i=ug(e,t),r=ug(e,n);return i&&r?zt([...i,...r],se):null}function xE(e,t,n){t&&t.length>0&&(e.getWithExplicit("values")?.explicit||(n&&N(n),e.set("values",t,!1)))}function ZX(e,t,n){const i=e.getScaleComponent(t),r=e.getScaleComponent(n);if(!i||!r)return!1;const s=i.getWithExplicit("domains"),o=r.getWithExplicit("domains");if(!(s?.explicit&&o?.explicit))return!1;const a=ms(e,t),u=ms(e,n);return se(a)===se(u)}function aD(e){const t=e.component.legends,n={};for(const r of R(t)){const s=oD(e,r),o=KX(s,r);if(!n[o]){n[o]=[{channel:r,cmpt:t[r].clone()}];continue}let a=!1;for(const u of n[o]){if(!YX(e,u.channel,r))continue;if(nD(u.cmpt,t[r])){const c=e.getScaleType(u.channel),f=e.getScaleType(r);c&&f&&Le(c)&&Le(f)&&(ZX(e,u.channel,r)?xE(u.cmpt,ug(e,u.channel)):xE(u.cmpt,QX(e,u.channel,r),Oq(u.channel,r))),a=!0;break}}a||n[o].push({channel:r,cmpt:t[r].clone()})}return Be(n).flat().map(r=>eY(r.cmpt,e.config)).filter(r=>r!==void 0)}function eY(e,t){const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),s.encode?.symbols){const o=s.encode.symbols.update;o.fill&&o.fill.value!=="transparent"&&!o.stroke&&!s.stroke&&(o.stroke={value:"transparent"});for(const a of GF)s[a]&&delete o[a]}if(s.title||delete s.title,i!==void 0){let o=i;s.encode?.labels?.update&&Y(s.encode.labels.update.text)&&(o=os(i,"datum.label",s.encode.labels.update.text.signal)),XX(s,"labels","text",{signal:o})}return s}}function tY(e){return Jo(e)||W1(e)?nY(e):uD(e)}function nY(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),uD(e))}function uD(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const u=Y(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return ae(o,u)||o.push(u),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const iY=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class lD extends Bi{specifiedProjection;size;data;merged=!1;constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r}get isFit(){return!!this.data}}function cD(e){e.component.projection=Oe(e)?rY(e):aY(e)}function rY(e){if(e.hasProjection){const t=tt(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?sY(e):void 0,s=new lD(e.projectionName(!0),{...tt(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function sY(e){const t=[],{encoding:n}=e;for(const i of[[In,Pn],[ln,zn]])(Ge(n[i[0]])||Ge(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Tt)&&e.typedFieldDef(Tt).type===Ho&&t.pu
vendor: 35,396 bytes, line 9
9sh({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Te.Main)),t}function oY(e,t){const n=Cy(iY,r=>!!(!G(e.explicit,r)&&!G(t.explicit,r)||G(e.explicit,r)&&G(t.explicit,r)&&Bt(e.get(r),t.get(r))));if(Bt(e.size,t.size)){if(n)return e;if(Bt(e.explicit,{}))return t;if(Bt(t.explicit,{}))return e}return null}function aY(e){if(e.children.length===0)return;let t;for(const i of e.children)cD(i);const n=Cy(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=oY(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new lD(i,t.specifiedProjection,t.size,te(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function fD(e){return Jo(e)||W1(e)?e.children.reduce((t,n)=>t.concat(fD(n)),vE(e)):vE(e)}function vE(e){return R(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=uY(r.range,s,n,e),p=ms(e,n),h=a?iV(e,a,i,p):null;return t.push({name:s,type:o,...p?{domain:p}:{},...h?{domainRaw:h}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function uY(e,t,n,i){if(Ie(n)){if(Fs(e))return{step:{signal:`${t}_step`}}}else if(U(e)&&wi(e))return{...e,data:i.lookupDataSource(e.data)};return e}class dD extends Bi{merged=!1;constructor(t,n){super({},{name:t}),this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(ae([nt.LOG,nt.TIME,nt.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&ae([nt.LINEAR,nt.SQRT,nt.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,s=!1,o=!1;for(const a of i){if(F(a)){const u=a[0],l=a[a.length-1];if(de(u)&&de(l))if(u<=0&&l>=0){r=!0;continue}else{s=!0;continue}}o=!0}if(r)return"definitely";if(s&&!o)return"definitely-not"}return"maybe"}}const lY=["range","scheme"];function cY(e){const t=e.component.scales;for(const n of Iy){const i=t[n];if(!i)continue;const r=fY(n,e);i.setWithExplicit("range",r)}}function EE(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,s=Nt(t),o=e.getName(s);if(U(i)&&i.binned&&i.step!==void 0)return new Xe(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${u})`});if($e(i)){const a=z1(e,r,i);return new Xe(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(o)} / (${l})`})}}}function fY(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of lY)if(n[f]!==void 0){const d=Up(s,f),p=eF(e,f);if(!d)N(NC(s,f,e));else if(p)N(p);else switch(f){case"range":{const h=n.range;if(F(h)){if(Ie(e))return Gn(h.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return Xe.fromName(y,m)}return g}))}else if(U(h))return Gn({data:t.requestDataName(Te.Main),field:h.field,sort:{op:"min",field:t.vgField(e)}});return Gn(h)}case"scheme":return Gn(dY(n[f]))}}const o=e===Re||e==="xOffset"?"width":"height",a=i[o];if(ri(a)){if(Ie(e))if(Le(s)){const f=pD(a,t,e);if(f)return Gn({step:f})}else N(MC(o));else if(Lu(e)){const f=e===wr?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const h=gD(a,s);if(h)return Gn(h)}}}const{rangeMin:u,rangeMax:l}=n,c=hY(e,t);return(u!==void 0||l!==void 0)&&Up(s,"rangeMin")&&F(c)&&c.length===2?Gn([u??c[0],l??c[1]]):Pt(c)}function dY(e){return pW(e)?{scheme:e.name,...Wt(e,["name"])}:{scheme:e}}function hD(e,t,n,{center:i}={}){const r=Nt(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===Ze&&Fn(n)?i?[Xe.fromName(a=>`${o(a)}/2`,s),Xe.fromName(a=>`-${o(a)}/2`,s)]:[Xe.fromName(o,s),0]:i?[Xe.fromName(a=>`-${o(a)}/2`,s),Xe.fromName(a=>`${o(a)}/2`,s)]:[0,Xe.fromName(o,s)]}function hY(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=Ge(s[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case Re:case Ze:{if(ae(["point","band"],u)){const f=mD(e,n,i.view);if(ri(f))return{step:pD(f,t,e)}}return hD(e,t,u)}case wr:case Go:return pY(e,t,u);case Li:{const f=yY(r,i),d=bY(r,n,t,i);return vo(u)?mY(f,d,gY(u,i,l,e)):[f,d]}case fn:return[0,Math.PI*2];case $s:return[0,360];case Ln:return[0,new Xe(()=>{const f=t.getSignalName(Gt(t.parent)?"child_width":"width"),d=t.getSignalName(Gt(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Sr:return{step:1e3/i.scale.framesPerSecond};case Ar:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Cr:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Tt:return"symbol";case _t:case ci:case fi:return u==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Pi:case kr:case $r:return[i.scale.minOpacity,i.scale.maxOpacity]}}function pD(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=Ny(n),o=i[s];if(VF({step:e,offsetIsDiscrete:ne(o)&&e1(o.type)})==="offset"&&CF(i,s)){const u=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,p=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${p})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${Rj(f)})`}}else return e.step}function gD(e,t){if(VF({step:e,offsetIsDiscrete:Le(t)})==="offset")return{step:e.step}}function pY(e,t,n){const i=e===wr?"x":"y",r=t.getScaleComponent(i);if(!r)return hD(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:u}=t;if(s==="band"){const l=mD(i,t.size,t.config.view);if(ri(l)){const c=gD(l,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const l=t.encoding[i];if(M(l)&&l.timeUnit){const c=GC(l.timeUnit,h=>`scale('${o}', ${h})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=yr({fieldDef:l,markDef:a,config:u})-.5,p=d!==0?` + ${d}`:"";if(f){const h=Y(f)?`${f.signal}/2${p}`:`${f/2+d}`,g=Y(f)?`(1 - ${f.signal}/2)${p}`:`${1-f/2+d}`;return[{signal:`${h} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return eC(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function mD(e,t,n){const i=e===Re?"width":"height",r=t[i];return r!==void 0?r:Fc(n,i)}function gY(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&F(n)?n.length+1:(N(Iq(i)),3)}}function mY(e,t,n){const i=()=>{const r=En(t),s=En(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return Y(t)?new Xe(i):{signal:i()}}function yY(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(Uf("size",e))}const wE=.95;function bY(e,t,n,i){const r={x:EE(n,"x"),y:EE(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=SE(t,r,i.view);return de(s)?s-1:new Xe(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=SE(t,r,i.view);return de(s)?Math.pow(wE*s,2):new Xe(()=>`pow(${wE} * ${s.signal}, 2)`)}}throw new Error(Uf("size",e))}function SE(e,t,n){const i=ri(e.width)?e.width.step:Gp(n,"width"),r=ri(e.height)?e.height.step:Gp(n,"height");return t.x||t.y?new Xe(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function yD(e,t){Oe(e)?xY(e,t):xD(e,t)}function xY(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of R(n)){const u=o[a],l=n[a],c=e.getScaleComponent(a),f=Ge(r[a]),d=u[t],p=c.get("type"),h=c.get("padding"),g=c.get("paddingInner"),m=Up(p,t),y=eF(a,t);if(d!==void 0&&(m?y&&N(y):N(NC(p,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":Os(u[t])||v==="temporal"||b?l.set(t,{signal:Qf(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=_(kE,t)?kE[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:p,scalePadding:h,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:FF(r,a),hasSecondaryRangeChannel:!!r[di(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const kE={bins:({model:e,fieldOrDatumDef:t})=>M(t)?vY(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>EY(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>wY(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>SY(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>kY(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>$Y(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=M(e)?e.sort:void 0;return AY(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>CY(e,t,n,i,r,s.scale,o)};function bD(e){Oe(e)?cY(e):xD(e,"range")}function xD(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?bD(i):yD(i,t);for(const i of R(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=br(r,a,t,"scale",aO((u,l)=>t==="range"&&u.step&&l.step?u.step-l.step:0))}}n[i].setWithExplicit(t,r)}}function vY(e,t){const n=t.bin;if($e(n)){const i=z1(e,t.field,n);return new Xe(()=>e.getSignalName(i))}else if(et(n)&&Cs(n)&&n.step!==void 0)return{step:n.step}}function EY(e,t){if(ae([_t,ci,fi],e)&&t!=="nominal")return"hcl"}function wY(e,t,n,i,r,s){if(!(Dn(s)?.bin||F(n)||r!=null||i!=null||ae([nt.TIME,nt.UTC],e)))return Ie(t)?!0:void 0}function SY(e,t,n,i,r,s){if(Ie(e)){if(Xn(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(M(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===nt.POINT)return n.pointPadding}}function kY(e,t,n,i,r,s=!1){if(e===void 0){if(Ie(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:Pe(o,n==="bar"?a:n==="tick"?l:u)}else if(Lu(t)&&i===nt.BAND)return r.offsetBandPaddingInner}}function $Y(e,t,n,i,r,s=!1){if(e===void 0){if(Ie(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===nt.BAND)return Pe(o,Y(i)?{signal:`${i.signal}/2`}:i/2)}else if(Lu(t)){if(n===nt.POINT)return .5;if(n===nt.BAND)return r.offsetBandPaddingOuter}}}function AY(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Fn(e)&&t==="descending"?Y(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Fn(e)&&t==="descending")return!0}function CY(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Fn(r)){if(F(n)){const u=n[0],l=n[n.length-1];if(de(u)&&u<=0&&de(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!vo(r))return!0;if(!(M(t)&&t.bin)&&ae([...Ii,...dj],e)){const{orient:u,type:l}=i;return ae(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:ae(["bar","area"],l)&&!o?!0:s?.zero}return!1}function FY(e,t,n,i,r=!1){const s=OY(t,n,i,r),{type:o}=e;return hi(t)?o!==void 0?EW(t,o)?M(n)&&!vW(o,n.type)?(N(Eq(o,s)),s):o:(N(vq(t,o,s)),s):s:null}function OY(e,t,n,i){switch(t.type){case"nominal":case"ordinal":{if(Zs(e)||th(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&N(nh(e,"ordinal")),"ordinal";if(eh(e))return"band";if(Ie(e)||Lu(e)){if(ae(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in Py)return"band";const r=n[Nt(e)];return fs(r)||wo(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return Zs(e)?"time":th(e)==="discrete"?(N(nh(e,"temporal")),"ordinal"):M(t)&&t.timeUnit&&Qe(t.timeUnit).utc?"utc":eh(e)?"band":"time";case"quantitative":return Zs(e)?M(t)&&$e(t.bin)?"bin-ordinal":"linear":th(e)==="discrete"?(N(nh(e,"quantitative")),"ordinal"):eh(e)?"band":"linear";case"geojson":return}throw new Error(_C(t.type))}function DY(e,{ignoreRange:t}={}){vD(e),sD(e);for(const n of xW)yD(e,n);t||bD(e)}function vD(e){Oe(e)?e.component.scales=RY(e):e.component.scales=TY(e)}function RY(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of Iy){const o=Ge(t[s]);if(o&&n===iF&&s===Tt&&o.type===Ho)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??={};const u=FF(t,s),l=FY(a,s,o,i,u);r[s]=new dD(e.scaleName(`${s}`,!0),{value:l,explicit:a.type===l})}}return r}const _Y=aO((e,t)=>Dv(e)-Dv(t));function TY(e){const t=e.component.scales={},n={},i=e.component.resolve;for(const r of e.children){vD(r);for(const s of R(r.component.scales))if(i.scale[s]??=KO(s,e),i.scale[s]==="shared"){const o=n[s],a=r.component.scales[s].getWithExplicit("type");o?lW(o.value,a.value)?n[s]=br(o,a,"type","scale",_Y):(i.scale[s]="independent",delete n[s]):n[s]=a}}for(const r of R(n)){const s=e.scaleName(r,!0),o=n[r];t[r]=new dD(s,o);for(const a of e.children){const u=a.component.scales[r];u&&(a.renameScale(u.get("name"),s),u.merged=!0)}}return t}class ph{nameMap;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 Oe(e){return e?.type==="unit"}function Gt(e){return e?.type==="facet"}function W1(e){return e?.type==="concat"}function Jo(e){return e?.type==="layer"}class G1{type;parent;config;name;size;title;description;data;transforms;layout;scaleNameMap;projectionNameMap;signalNameMap;component;view;constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=tt(a),this.name=t.name??r,this.title=Xi(t.title)?{text:t.title}:t.title?tt(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new ph,this.projectionNameMap=i?i.projectionNameMap:new ph,this.signalNameMap=i?i.signalNameMap:new ph,this.data=t.data,this.description=t.description,this.transforms=NH(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:IG(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:Yf(t)||i?.component.data.isFaceted&&t.data===void 0},layoutSize:new Bi,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?te(o):{}},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(){DY(this)}parseProjection(){cD(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){tD(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of R(i)){const o=i[s];o!==void 0&&(r[s]=Ce(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ce(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Se(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=YV(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of en)t[i].title&&n.push(qV(this,i));for(const i of M1)n=n.concat(WV(this,i));return n}assembleAxes(){return DV(this.component.axes,this.config)}assembleLegends(){return aD(this)}assembleProjections(){return tY(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...wC(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return ae(["unit","layer"],this.type)?ae(["middle",void 0],i.anchor)&&(i.frame??="group"):i.anchor??="start",Se(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Gt(this.parent)?fD(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return De((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Te[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Gt(this.parent)){const n=XO(t),i=If(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(Le(s)&&Fs(o)){const a=r.get("name"),u=ms(this,i),l=q1(u);if(l){const c=B({aggregate:"distinct",field:l},{expr:"datum"});return{signal:VO(a,r,c)}}else return N(Uy(i)),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(pC(t)&&hi(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}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(Lj(n));return i}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class ED extends G1{vgField(t,n={}){const i=this.fieldDef(t);if(i)return B(i,n)}reduceFieldDef(t,n){return hG(this.getMapping(),(i,r,s)=>{const o=Dn(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){m1(this.getMapping(),(i,r)=>{const s=Dn(i);s&&t(s,r)},n)}}class ld extends ve{transform;clone(){return new ld(null,te(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=te(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${se(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class cd extends ve{transform;clone(){return new cd(null,te(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=te(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${se(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class fd extends ve{transform;clone(){return new fd(this.parent,te(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=te(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${se(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class dd extends ve{transform;clone(){return new dd(null,te(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=te(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${se(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class no extends ve{fields;geojson;signal;clone(){return new no(null,te(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[In,Pn],[ln,zn]]){const s=r.map(o=>{const a=Ge(n.encoding[o]);return M(a)?a.field:pi(a)?{expr:`${a.datum}`}:On(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new no(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Tt)){const r=n.typedFieldDef(Tt);r.type===Ho&&(t=new no(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(j);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${se(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 su extends ve{projection;fields;as;clone(){return new su(null,this.projection,te(this.fields),te(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[In,Pn],[ln,zn]]){const r=i.map(o=>{const a=Ge(n.encoding[o]);return M(a)?a.field:pi(a)?{expr:`${a.datum}`}:On(a)?{expr:`${a.value}`}:void 0}),s=i[0]===ln?"2":"";(r[0]||r[1])&&(t=new su(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(j))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${se(this.fields)} ${se(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Jr extends ve{transform;clone(){return new Jr(null,te(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:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Jr(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(M(r)&&M(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=o.impute,d=RF(n.mark,i);return new Jr(t,{impute:o.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${se(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:gH(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class hd extends ve{transform;clone(){return new hd(null,te(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=te(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[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 ${se(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class ou extends ve{transform;secondary;clone(){return new ou(null,te(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(mH(o)){let u=kD(o.data,s);u||(u=new gs(o.data),s.push(u));const l=n.getName(`lookup_${r}`);a=new Ot(u,l,Te.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(yH(o)){const u=o.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(De(u),u)}catch{throw new Error(Bj(u))}if(a=l.materialized,!a)throw new Error(Uj(u))}return new ou(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?q(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${se({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:q(this.transform.as)}:{}};else{let n=this.transform.as;j(n)||(N(Qj),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 pd extends ve{transform;clone(){return new pd(null,te(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=te(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${se(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class gd extends ve{transform;clone(){return new gd(null,te(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=te(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[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 ${se(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class md extends ve{transform;clone(){return new md(null,te(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=zt((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${se(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class yd extends ve{transform;clone(){return new yd(null,te(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${se(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function wD(e){let t=0;function n(i,r){if(i instanceof gs&&!i.isGenerator&&!$o(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof ht&&(i.parent instanceof gs&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Yo){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof Hu||i instanceof Vu||i instanceof Do||i instanceof Xo||i instanceof Co||i instanceof su||i instanceof kn||i instanceof ou||i instanceof Ko||i instanceof Ts||i instanceof dd||i instanceof fd||i instanceof ld||i instanceof hd||i instanceof pd||i instanceof gd||i instanceof xr||i instanceof yd||i instanceof md||i instanceof cd)&&r.transform.push(i.assemble()),(i instanceof Qn||i instanceof Kn||i instanceof Jr||i instanceof Ci||i instanceof no)&&r.transform.push(...i.assemble()),i instanceof Ot&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof Ot?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof Ot&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function NY(e){const t=[],n=wD(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function MY(e,t){const n=[],i=wD(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function LY(e){return e==="top"||e==="left"||Y(e)?"header":"footer"}function PY(e){for(const t of en)IY(e,t);$E(e,"x"),$E(e,"y")}function IY(e,t){const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const o=n[t],a=Oo("title",null,i,t);let u=eo(o,i,{allowDisabling:!0,includeDefault:a===void 0||!!a});r.component.layoutHeaders[t].title&&(u=F(u)?u.join(", "):u,u+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const l=Oo("labelOrient",o.header,i,t),c=o.header!==null?Pe(o.header?.labels,i.header.labels,!0):!1,f=ae(["bottom","right"],l)?"footer":"header";s.layoutHeaders[t]={title:o.header!==null?u:null,facetFieldDef:o,[f]:t==="facet"?[]:[SD(e,t,c)]}}}function SD(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function $E(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=I1(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const u=LY(a.get("orient"));o[u]??=[SD(e,s,!1)];const l=Oa(a,"main",e.config,{header:!0});l&&o[u][0].axes.push(l),a.mainExtracted=!0}}}}function zY(e){H1(e),_c(e,"width"),_c(e,"height")}function BY(e){H1(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";_c(e,t),_c(e,n)}function H1(e){for(const t of e.children)t.parseLayoutSize()}function _c(e,t){const n=XO(t),i=If(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??KO(i,e);if(l==="independent"&&u.value==="step"){o=void 0;break}if(o){if(l==="independent"&&o.value!==u.value){o=void 0;break}o=br(o,u,n,"")}else o=u}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function UY(e){const{size:t,component:n}=e;for(const i of Ii){const r=Nt(i);if(t[r]!=null&&t[r]!=null){const s=t[r];n.layoutSize.set(r,ri(s)?"step":s,!0)}else{const s=jY(e,r);n.layoutSize.set(r,s,!1)}}}function jY(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(Le(s)){const a=Fc(i.view,t);return Fs(o)||ri(a)?"step":a}else return Wp(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Wp(i.view,t);{const s=Fc(i.view,t);return ri(s)?s.step:s}}}function lg(e,t,n){return B(t,{suffix:`by_${B(e)}`,...n})}class Ba extends ED{facet;child;children;constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=J1(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Bu(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=R(t),i={};for(const r of n){if(![Si,ki].includes(r)){N(Uf(r,"facet"));break}const s=t[r];if(s.field===void 0){N(zp(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=g1(t,n);return i.header?i.header=tt(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return _(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=bd(this),this.child.parseData()}parseLayoutSize(){H1(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Be(this.component.selection).some(t=>Jn(t))&&qy(jy)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),PY(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 en)for(const i of L1){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=Oo("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const u=ad(n,a);t.titleAnchor??={},t.titleAnchor[u]="end"}}if(s?.[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??={},t[u][n]=.5),r.title&&(t.offset??={},t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Ba))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Ba?{...this.channelHasField("column")?{encode:{update:{columns:{field:B(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];
vendor: 1,881 bytes, line 9
9if(this.child instanceof Ba){if(this.child.channelHasField("column")){const r=B(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of Ii){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(Le(o)&&Fs(a)){const u=ms(this.child,r),l=q1(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):N(Uy(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of en){const f=this.facet[c];if(f){u.push(B(f));const{bin:d,sort:p}=f;if($e(d)&&u.push(B(f,{binSuffix:"end"})),$i(p)){const{field:h,op:g=Xf}=p,m=lg(f,p);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(h),o.push(g),a.push(m))}else if(F(p)){const h=Fo(f,c);s.push(h),o.push("max"),a.push(h)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||s.length>0?{aggregate:{...l?{cross:l}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?$i(i.sort)?[lg(i,i.sort,{expr:"datum"})]:F(i.sort)?[Fo(i,t,{expr:"datum"})]:[B(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[($i(r)?r.order:!F(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;if(t.facet)return tg(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const r of M1)if(t[r]){const s=Oo("labelOrient",t[r]?.header,n,r);if(i[r].includes(s))return tg(t[r],r,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=NY(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:en.map(u=>
9this.facetSortFields(u)).flat(),order:en.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(ZH(this,[]))}]}getMapping(){return this.facet}}function qY(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if($i(s.sort)){const{field:o,op:a=Xf}=s.sort;e=r=new Ts(e,{joinaggregate:[{op:a,field:o,as:lg(s,s.sort,{forAs:!0})}],groupby:[B(s)]})}return r}return null}function kD(e,t){for(const n of t){const i=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,s=i.format?.feature;if(r&&s)continue;const o=e.format?.feature;if((o||s)&&o!==s)continue;const a=i.format?.mesh;if(!((r||a)&&r!==a)){if(ru(e)&&ru(i)){if(Bt(e.values,i.values))return n}else if($o(e)&&$o(i)){if(e.url===i.url)return n}else if(uO(e)&&e.name===n.dataName)return n}}return null}function WY(e,t){if(e.data||!e.parent){if(e.data===null){const i=new gs({values:[]});return t.push(i),i}const n=kD(e.data,t);if(n)return ur(e.data)||(n.data.format=tC({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new gs(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function GY(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(CH(r))o=e=new Co(e,r),s="derived";else if(C1(r)){const a=wX(r);o=e=ht.makeWithAncestors(e,{},a,n)??e,e=new Xo(e,t,r.filter)}else if(iO(r))o=e=Qn.makeFromTransform(e,r,t),s="number";else if(OH(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new ht(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Kn.makeFromTransform(e,r);else if(DH(r))o=e=kn.makeFromTransform(e,r),s="number",N1(t)&&(e=new xr(e));else if(nO(r))o=e=ou.make(e,t,r,i++),s="derived";else if(kH(r))o=e=new Ko(e,r),s="number";else if($H(r))o=e=new Ts(e,r),s="number";else if(RH(r))o=e=Ci.makeFromTransform(e,r),s="derived";else if(_H(r))o=e=new dd(e,r),s="derived";else if(TH(r))o=e=new cd(e,r),s="derived";else if(AH(r))o=e=new fd(e,r),s="derived";else if(bH(r))o=e=new md(e,r),s="derived";else if(SH(r))e=new yd(e,r);else if(FH(r))o=e=Jr.makeFromTransform(e,r),s="derived";else if(xH(r))o=e=new ld(e,r),s="derived";else if(vH(r))o=e=new pd(e,r),s="derived";else if(EH(r))o=e=new gd(e,r),s="derived";else if(wH(r))o=e=new hd(e,r),s="derived";else{N(Jj(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function bd(e){let t=WY(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(ur(r)||$o(r)||ru(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new GH;ur(r)?(lO(r)?t=new Vu(t,r.sequence):F1(r)&&(t=new Hu(t,r.graticule)),o.parseNothing=!0):r?.format?.parse===null&&(o.parseNothing=!0),t=ht.makeExplicit(t,e,o)??t,t=new xr(t);const a=e.parent&&Jo(e.parent);(Oe(e)||Gt(e))&&a&&(t=Qn.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=GY(t,e,o));const u=kX(e),l=SX(e);t=ht.makeWithAncestors(t,{},{...u,...l},o)??t,Oe(e)&&(t=no.parseAll(t,e),t=su.parseAll(t,e)),(Oe(e)||Gt(e))&&(a||(t=Qn.makeFromEncoding(t,e)??t),t=Kn.makeFromEncoding(t,e)??t,t=Co.parseAllForSortIndex(t,e));const c=t=hl(Te.Raw,e,t);if(Oe(e)){const m=kn.makeFromEncoding(t,e);m&&(t=m,N1(e)&&(t=new xr(t))),t=Jr.makeFromEncoding(t,e)??t,t=Ci.makeFromEncoding(t,e)??t}let f,d;if(Oe(e)){const{markDef:m,mark:y,config:b}=e,v=me("invalid",m,b),{marks:w,scales:E}=d=fO({invalid:v,isPath:Or(y)});w!==E&&E==="include-invalid-values"&&(f=t=hl(Te.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=Do.make(t,e,d)??t)}const p=t=hl(Te.Main,e,t);let h;if(Oe(e)&&d){const{marks:m,scales:y}=d;m==="include-invalid-values"&&y==="exclude-invalid-values"&&(t=Do.make(t,e,d)??t,h=t=hl(Te.PostFilterInvalid,e,t))}Oe(e)&&FV(e,p);let g=null;if(Gt(e)){const m=e.getName("facet");t=qY(t,e.facet)??t,g=new Yo(t,e,m,p.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:p,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:h}}function hl(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new Ot(n,s,e,r);return i[s]=o,o}class HY extends G1{children;constructor(t,n,i,r){super(t,"concat",n,i,r,t.resolve),(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&N(Xj),this.children=this.getChildren(t).map((s,o)=>J1(s,this,this.getName(`concat_${o}`),void 0,r))}parseData(){this.component.data=bd(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 R(t.component.selection))this.component.selection[n]=t.component.selection[n]}Be(this.component.selection).some(t=>Jn(t))&&qy(jy)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return td(t)?t.vconcat:$1(t)?t.hconcat:t.concat}parseLayoutSize(){BY(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}
vendor: 6,221 bytes, line 9
9assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=P1(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function VY(e){return e===!1||e===null}const XY={disable:1,gridScale:1,scale:1,...$F,labelExpr:1,encode:1},$D=R(XY);class V1 extends Bi{explicit;implicit;mainExtracted;constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new V1(te(this.explicit),te(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!VY(this.get(t))}hasOrientSignalRef(){return Y(this.explicit.orient)}}function YY(e,t,n){const{encoding:i,config:r}=e,s=Ge(i[t])??Ge(i[di(t)]),o=e.axis(t)||{},{format:a,formatType:u}=o;if(ds(u))return{text:wn({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(Eo(s)==="quantitative"){if(wo(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:wn({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:wn({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(Eo(s)==="temporal"&&r.timeFormatType&&M(s)&&!s.timeUnit)return{text:wn({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function KY(e){return Ii.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[iK(n,e)]),t),{})}const JY={bottom:"top",top:"bottom",left:"right",right:"left"};function QY(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of R(r.component.axes))n.axis[s]=I1(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=ZY(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of Ii){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:u}=o.getWithExplicit("orient");if(!Y(a)){if(i[a]>0&&!u){const l=JY[a];i[a]>i[l]&&o.set("orient",l,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function ZY(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],s=t[i];if(!!r!=!!s)return;if(r&&s){const o=r.getWithExplicit("orient"),a=s.getWithExplicit("orient");if(o.explicit&&a.explicit&&o.value!==a.value)return;e[i]=eK(r,s)}}}else return t.map(n=>n.clone());return e}function eK(e,t){for(const n of $D){const i=br(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return DC(r,s);case"gridScale":return{explicit:r.explicit,value:Pe(r.value,s.value)}}return id(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function tK(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Y(n.labelAngle)?n.labelAngle:nu(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===qO(i,r))return!0}return e===n[t]}const nK=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function iK(e,t){let n=t.axis(e);const i=new V1,r=Ge(t.encoding[e]),{mark:s,config:o}=t,a=n?.orient||o[e==="x"?"axisX":"axisY"]?.orient||o.axis?.orient||IV(e),u=t.getScaleComponent(e).get("type"),l=RV(e,u,a,t.config),c=n!==void 0?!n:Zp("disable",o.style,n?.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=MV(r,n,e,o.style,l),d=fF(n.formatType,r,u),p=cF(r,r.type,n.format,n.formatType,o,!0),h={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:p,formatType:d,mark:s,config:o};for(const y of $D){const b=y in cE?cE[y](h):Pv(y)?n[y]:void 0,v=b!==void 0,w=tK(b,y,n,t,e);if(v&&w)i.set(y,b,w);else{const{configValue:E=void 0,configFrom:S=void 0}=Pv(y)&&y!=="values"?Zp(y,o.style,n.style,l):{},x=E!==void 0;v&&!x?i.set(y,b,w):(S!=="vgAxisConfig"||nK.has(y)&&x||Wu(E)||Y(E))&&i.set(y,E,!1)}}const g=n.encoding??{},m=kF.reduce((y,b)=>{if(!i.hasAxisPart(b))return y;const v=YO(g[b]??{},t),w=b==="labels"?YY(t,e,v):v;return w!==void 0&&!Se(w)&&(y[b]={update:w}),y},{});return Se(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function rK({encoding:e,size:t}){for(const n of Ii){const i=Nt(n);ri(t[i])&&ir(e[n])&&(delete t[i],N(MC(i)))}return t}const sK={vgMark:"arc",encodeEntry:e=>({...dn(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...St("x",e,{defaultPos:"mid"}),...St("y",e,{defaultPos:"mid"}),...Di(e,"radius"),...Di(e,"theta")})},oK={vgMark:"area",encodeEntry:e=>({...dn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Oc("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Oc("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...T1(e)})},aK={vgMark:"rect",encodeEntry:e=>({...dn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Di(e,"x"),...Di(e,"y")})},uK={vgMark:"shape",encodeEntry:e=>({...dn(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&&M(n)&&n.type===Ho?{field:B(n,{expr:"datum"})}:{}}
vendor: 4,138 bytes, line 9
9]}},lK={vgMark:"image",encodeEntry:e=>({...dn(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Di(e,"x"),...Di(e,"y"),...D1(e,"url")})},cK={vgMark:"line",encodeEntry:e=>({...dn(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...St("x",e,{defaultPos:"mid"}),...St("y",e,{defaultPos:"mid"}),...it("size",e,{vgChannel:"strokeWidth"}),...T1(e)})},fK={vgMark:"trail",encodeEntry:e=>({...dn(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...St("x",e,{defaultPos:"mid"}),...St("y",e,{defaultPos:"mid"}),...it("size",e),...T1(e)})};function X1(e,t){const{config:n}=e;return{...dn(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...St("x",e,{defaultPos:"mid"}),...St("y",e,{defaultPos:"mid"}),...it("size",e),...it("angle",e),...dK(e,n,t)}}function dK(e,t,n){return n?{shape:{value:n}}:it("shape",e)}const hK={vgMark:"symbol",encodeEntry:e=>X1(e)},pK={vgMark:"symbol",encodeEntry:e=>X1(e,"circle")},gK={vgMark:"symbol",encodeEntry:e=>X1(e,"square")},mK={vgMark:"rect",encodeEntry:e=>({...dn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Di(e,"x"),...Di(e,"y")})},yK={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...dn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Oc("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Oc("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...it("size",e,{vgChannel:"strokeWidth"})}}},bK={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...dn(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...St("x",e,{defaultPos:"mid"}),...St("y",e,{defaultPos:"mid"}),...D1(e),...it("size",e,{vgChannel:"fontSize"}),...it("angle",e),...oE("align",xK(e.markDef,n,t)),...oE("baseline",vK(e.markDef,n,t)),...St("radius",e,{defaultPos:null}),...St("theta",e,{defaultPos:null})}}};function xK(e,t,n){if(me("align",e,n)===void 0)return"center"}function vK(e,t,n){if(me("baseline",e,n)===void 0)return"middle"}const EK={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...dn(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Di(e,r),...St(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:Ce(me("thickness",n,t))}}},pl={arc:sK,area:oK,bar:aK,circle:pK,geoshape:uK,image:lK,line:cK,point:hK,rect:mK,rule:yK,square:gK,text:bK,tick:EK,trail:fK};function wK(e){if(ae([Hf,Wf,$W],e.mark)){const t=RF(e.mark,e.encoding);if(t.length>0)return SK(e,t)}else if(e.mark===Gf){const t=Pp.some(n=>me(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return kK(e)}return Y1(e)}const AE="faceted_path_";function SK(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:AE+e.requestDataName(Te.Main),data:e.requestDataName(Te.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Y1(e,{fromPrefix:AE})}]}const CE="stack_group_";function kK(e){const[t]=Y1(e,{fromPrefix:CE}),n=e.scaleName(e.stack.fieldChannel),i=(l={})=>e.vgField(e.stack.fieldChannel,l),r=(l,c)=>{const f=[i({prefix:"min",suffix:"start",expr:c}),i({prefix:"max",suffix:"start",expr:c}),i({prefix:"min",suffix:"end",expr:c}),i({prefix:"max",suffix:"end",expr:c})];return`${l}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...po(t.encode.update,["y","yc","y2","height",...Pp]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Wt(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}
9):(s={...po(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Wt(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of Pp){const c=ni(l,e.markDef,e.config);t.encode.update[l]?(s[l]=t.encode.update[l],delete t.encode.update[l]):c&&(s[l]=Ce(c)),c&&(t.encode.update[l]={value:0})}const a=[];if(e.stack.groupbyChannels?.length>0)for(const l of e.stack.groupbyChannels){const c=e.fieldDef(l),f=B(c);f&&a.push(f),(c?.bin||c?.timeUnit)&&a.push(B(c,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((l,c)=>{if(t.encode.update[c])return{...l,[c]:t.encode.update[c]};{const f=ni(c,e.markDef,e.config);return f!==void 0?{...l,[c]:Ce(f)}:l}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Te.Main),name:CE+e.requestDataName(Te.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function $K(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!F(o)&&On(o)&&Mp(o.value)||!o&&Mp(me("order",r,s)))){if((F(o)||M(o))&&!n)return CC(o,{expr:"datum"});if(Or(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(M(u))return{field:a}}}}function Y1(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=Pe(i.clip,AK(e),CK(e)),a=$C(i),u=r.key,l=$K(e),c=FK(e);c&&Object.values(e.component.selection).some(p=>p.type==="point"&&!p.bind&&p.on!=="pointerover")&&(e.markDef.cursor??="pointer");const f=me("aria",i,s),d=pl[n].postEncodingTransform?pl[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:pl[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Te.Main)},encode:{update:pl[n].encodeEntry(e)},...d?{transform:d}:{}}]}function AK(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function CK(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function FK(e){if(!e.component.selection)return null;const t=R(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=R(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class AD extends ED{markDef;encoding;specifiedScales={};stack;specifiedAxes={};specifiedLegends={};specifiedProjection={};selection=[];children=[];constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,zv(t)?t.view:void 0);const o=ii(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=aH(o,s,{graticule:t.data&&F1(t.data)}));const u=this.encoding=fG(t.encoding||{},a,o.filled,s);this.markDef=QF(o,u,s),this.size=rK({encoding:u,size:zv(t)?{...r,...t.width!==void 0?{width:t.width}:{},...t.height!==void 0?{height:t.height}:{}}:r}),this.stack=JF(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>S1(l)),this.alignStackOrderWithColorDomain()}get hasProjection(){const{encoding:t}=this,n=this.mark===iF,i=t&&ij.some(r=>ne(t[r]));return n||i}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 Iy.reduce((i,r)=>{const s=Ge(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=tt(t);return F(n)&&(r.domain=n.map(It)),F(i)&&(r.range=i.map(It)),r}initAxes(t){return Ii.reduce((n,i)=>{const r=t[i];if(ne(r)||i===Re&&ne(t.x2)||i===Ze&&ne(t.y2)){const s=ne(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=R(t),i={};for(const r of n){const s=t[r];
9i[r]=Wu(s)?kC(s):It(s)}return i}initLegends(t){return pj.reduce((n,i)=>{const r=Ge(t[i]);if(r&&mj(i)){const s=r.legend;n[i]=s&&tt(s)}return n},{})}alignStackOrderWithColorDomain(){const{color:t,fill:n,order:i,xOffset:r,yOffset:s}=this.encoding,o=n||t,a=M(o)?o:void 0,u=a?.field,l=a?.scale,c=a?.type,f=l?.domain,d=r||s,p=M(d)?d:void 0,h=`_${u}_sort_index`;if(!i&&Array.isArray(f)&&typeof u=="string"&&c==="nominal")if(p&&!p.sort)p.sort=f;else{if(!this.stack)return;const g=`indexof(${L(f)}, datum['${u}'])`,m=this.markDef?.orient==="horizontal"?"ascending":"descending";this.transforms.push({calculate:g,as:h}),this.encoding.order={field:h,type:"quantitative",sort:m}}}parseData(){this.component.data=bd(this)}parseLayoutSize(){UY(this)}parseSelections(){this.component.selection=CV(this,this.selection)}parseMarkGroup(){this.component.mark=wK(this)}parseAxesAndHeaders(){this.component.axes=KY(this)}assembleSelectionTopLevelSignals(t){return eV(this,t)}assembleSignals(){return[...BO(this),...QH(this,[])]}assembleSelectionData(t){return tV(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return P1(this)}correctDataNames=t=>(t.from?.data&&(t.from.data=this.lookupDataSource(t.from.data),"time"in this.encoding&&(t.from.data=t.from.data+hO)),t.from?.facet?.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t);assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Jo(this.parent))&&(t=yO(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 Yr(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Dn(n)}typedFieldDef(t){const n=this.fieldDef(t);return $t(n)?n:null}}class K1 extends G1{children;constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(nd(a))return new K1(a,this,this.getName(`layer_${u}`),o,s);if(zi(a))return new AD(a,this,this.getName(`layer_${u}`),o,s);throw new Error(By(a))})}parseData(){this.component.data=bd(this);for(const t of this.children)t.parseData()}parseLayoutSize(){zY(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of R(t.component.selection))this.component.selection[n]=t.component.selection[n]}Be(this.component.selection).some(t=>Jn(t))&&qy(jy)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){QY(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),BO(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),P1(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of q(i.assembleGroupStyle()))t.add(r);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 nV(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),aD(this))}}function J1(e,t,n,i,r){if(Yf(e))return new Ba(e,t,n,r);if(nd(e))return new K1(e,t,n,i,r);if(zi(e))return new AD(e,t,n,i,r);if(MG(e))return new HY(e,t,n,r);throw new Error(By(e))}function OK(e,t={}){t.logger&&zq(t.logger),t.fieldTitle&&EF(t.fieldTitle);try{const n=KF(_o(t.config,e.config)),i=oO(e,n),r=J1(i,null,"",void 0,n);return r.parse(),zX(r.component.data,r),{spec:RK(r,DK(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Bq(),t.fieldTitle&&nG()}}function DK(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):j(t)&&(t={type:t}),r&&s&&jH(t.type)){if(r==="step"&&s==="step")N(Sv()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";N(Sv(If(o)));const a=o==="width"?"height":"width";t.type=qH(a)}}return{...R(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...Jv(n,!1),...Jv(e,!0)}}function RK(e,t,n={},i){const r=e.config?YG(e.config):void 0,s=MY(e.component.data,n),o=e.assembleSelectionData(s),a=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:d,...p}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...p,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...HF(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const _K=JU.version,TK=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:yo,accessPathWithDatum:Dy,accessWithDatumToUnescapedPath:ye,compile:OK,contains:ae,deepEqual:Bt,deleteNestedProperty:vc,duplicate:te,entries:gr,every:Cy,fieldIntersection:Oy,flatAccessWithDatum:iC,getFirstDefined:Pe,hasIntersection:Fy,hasProperty:_,hash:se,internalField:aC,isBoolean:mo,isEmpty:Se,isEqual:ZU,isInternalField:uC,isNullOrFalse:Mp,isNumeric:_f,isPrimitive:xc,keys:R,logicalExpr:Ia,mergeDeep:tC,never:eC,normalize:oO,normalizeAngle:nu,omit:Wt,pick:po,prefixGenerator:Lp,removePathFromField:Wo,replaceAll:os,replacePathInField:un,resetIdCounter:tj,setEqual:nC,some:go,stringify:xe,titleCase:Tu,unescapeSingleQuoteAndPathDot:rC,unique:zt,uniqueId:oC,vals:Be,varName:De,version:_K},Symbol.toStringTag,{value:"Module"}));function CD(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var NK="3.0.0",MK={version:NK};const js="#fff",FE="#888",LK={background:"#333",view:{stroke:FE},title:{color:js,subtitleColor:js},style:{"guide-label":{fill:js},"guide-title":{fill:js}},axis:{domainColor:js,gridColor:FE,tickColor:js}},Tr="#4572a7",PK={background:"#fff",arc:{fill:Tr},area:{fill:Tr},line:{stroke:Tr,strokeWidth:2},path:{stroke:Tr},rect:{fill:Tr},shape:{stroke:Tr},symbol:{fill:Tr,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"]}},Nr="#30a2da",gh="#cbcbcb",IK="#999",zK="#333",OE="#f0f0f0",DE="#333",BK={arc:{fill:Nr},area:{fill:Nr},axis:{domainColor:gh,grid:!0,gridColor:gh,gridWidth:1,labelColor:IK,labelFontSize:10,titleColor:zK,tickColor:gh,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:OE,group:{fill:OE},legend:{labelColor:DE,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:DE,titleFontSize:14,titlePadding:10},line:{stroke:Nr,strokeWidth:2},path:{stroke:Nr,strokeWidth:.5},rect:{fill:Nr},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:Nr},bar:{binSpacing:2,fill:Nr,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Mr="#000",UK={group:{fill:"#e5e5e5"},arc:{fill:Mr},area:{fill:Mr},line:{stroke:Mr},path:{stroke:Mr},rect:{fill:Mr},shape:{stroke:Mr},symbol:{fill:Mr,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"]}},jK=22,qK="normal",RE="Benton Gothic, sans-serif",_E=11.5,WK="normal",Lr="#82c6df",mh="Benton Gothic Bold, sans-serif",TE="normal",NE=13,ha={"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"]}
vendor: 5,449 bytes, line 9
9,GK={background:"#ffffff",title:{anchor:"start",color:"#000000",font:mh,fontSize:jK,fontWeight:qK},arc:{fill:Lr},area:{fill:Lr},line:{stroke:Lr,strokeWidth:2},path:{stroke:Lr},rect:{fill:Lr},shape:{stroke:Lr},symbol:{fill:Lr,size:30},axis:{labelFont:RE,labelFontSize:_E,labelFontWeight:WK,titleFont:mh,titleFontSize:NE,titleFontWeight:TE},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:RE,labelFontSize:_E,symbolType:"square",titleFont:mh,titleFontSize:NE,titleFontWeight:TE},range:{category:ha["category-6"],diverging:ha["fireandice-6"],heatmap:ha["fire-7"],ordinal:ha["fire-7"],ramp:ha["fire-7"]}},Pr="#ab5787",gl="#979797",HK={background:"#f9f9f9",arc:{fill:Pr},area:{fill:Pr},line:{stroke:Pr},path:{stroke:Pr},rect:{fill:Pr},shape:{stroke:Pr},symbol:{fill:Pr,size:30},axis:{domainColor:gl,domainWidth:.5,gridWidth:.2,labelColor:gl,tickColor:gl,tickWidth:.2,titleColor:gl},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"]}},Ir="#3e5c69",VK={background:"#fff",arc:{fill:Ir},area:{fill:Ir},line:{stroke:Ir},path:{stroke:Ir},rect:{fill:Ir},shape:{stroke:Ir},symbol:{fill:Ir},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"]}},Jt="#1696d2",ME="#000000",XK="#FFFFFF",ml="Lato",yh="Lato",YK="Lato",KK="#DEDDDD",JK=18,pa={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},QK={background:XK,title:{anchor:"start",fontSize:JK,font:ml},axisX:{domain:!0,domainColor:ME,domainWidth:1,grid:!1,labelFontSize:12,labelFont:yh,labelAngle:0,tickColor:ME,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:ml},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:KK,gridWidth:1,labelFontSize:12,labelFont:yh,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:ml,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:yh,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:ml,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:pa["six-groups-cat-1"],diverging:pa["diverging-colors"],heatmap:pa["diverging-colors"],ordinal:pa["six-groups-seq"],ramp:pa["shades-blue"]},area:{fill:Jt},rect:{fill:Jt},line:{color:Jt,stroke:Jt,strokeWidth:5},trail:{color:Jt,stroke:Jt,strokeWidth:0,size:1},path:{stroke:Jt,strokeWidth:.5},point:{filled:!0},text:{font:YK,color:Jt,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Jt,stroke:null}},arc:{fill:Jt},shape:{stroke:Jt},symbol:{fill:Jt,size:30}},zr="#3366CC",LE="#ccc",yl="Arial, sans-serif",ZK={arc:{fill:zr},area:{fill:zr},path:{stroke:zr},rect:{fill:zr},shape:{stroke:zr},symbol:{stroke:zr},circle:{fill:zr},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:yl,fontSize:12},"guide-title":{font:yl,fontSize:12},"group-title":{font:yl,fontSize:12}},title:{font:yl,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:LE,tickColor:LE,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Q1=e=>e*(1/3+1),PE=Q1(9),IE=Q1(10),zE=Q1(12),ga="Segoe UI",BE="wf_standard-font, helvetica, arial, sans-serif",UE="#252423",ma="#605E5C",jE="transparent",eJ="#C8C6C4",gn="#118DFF",tJ="#12239E",nJ="#E66C37",iJ="#6B007B",rJ="#E044A7",sJ="#744EC2",oJ="#D9B300",aJ="#D64550",FD=gn,OD="#DEEFFF",qE=[OD,FD],uJ=[OD,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",FD],lJ={view:{stroke:jE},background:jE,font:ga,header:{titleFont:BE,titleFontSize:zE,titleColor:UE,labelFont:ga,labelFontSize:IE,labelColor:ma},axis:{ticks:!1,grid:!1,domain:!1,labelColor:ma,labelFontSize:PE,titleFont:BE,titleColor:UE,titleFontSize:zE,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:eJ,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:gn},line:{stroke:gn,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:ga,fontSize:PE,fill:ma},arc:{fill:gn},area:{fill:gn,line:!0,opacity:.6},path:{stroke:gn},rect:{fill:gn},point:{fill:gn,filled:!0,size:75},shape:{stroke:gn},symbol:{fill:gn,strokeWidth:1.5,size:50},legend:{titleFont:ga,titleFontWeight:"bold",titleColor:ma,labelFont:ga,labelFontSize:IE,labelColor:ma,symbolType:"circle",symbolSize:75},range:{category:[gn,tJ,nJ,iJ,rJ,sJ,oJ,aJ],diverging:qE,heatmap:qE,ordinal:uJ}},bh='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',cJ='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',x
9h=400,bl={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},fJ=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],dJ=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function xd({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=bl.gridBg[e],r=bl.textPrimary[e],s=bl.textSecondary[e],o=n==="dark"?fJ:dJ,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:bh,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:cJ,labelFontWeight:xh,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:bl.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:bh,fill:s,fontWeight:xh},"guide-title":{font:bh,fill:s,fontWeight:xh}},range:{category:o,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 hJ=xd({theme:"white",background:"#ffffff"}),pJ=xd({theme:"g10",background:"#f4f4f4"}),gJ=xd({theme:"g90",background:"#262626"}),mJ=xd({theme:"g100",background:"#161616"}),yJ=MK.version,bJ=Object.freeze(Object.defineProperty({__proto__:null,carbong10:pJ,carbong100:mJ,carbong90:gJ,carbonwhite:hJ,dark:LK,excel:PK,fivethirtyeight:BK,ggplot2:UK,googlecharts:ZK,latimes:GK,powerbi:lJ,quartz:HK,urbaninstitute:QK,version:yJ,vox:VK},Symbol.toStringTag,{value:"Module"}));function xJ(e,t,n,i){if(F(e))return`[${e.map(r=>t(j(r)?r:WE(r,n))).join(", ")}]`;if(U(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`<h2>${t(s)}</h2>`),o&&(r+=`<img src="${new URL(t(o),i||location.href).href}">`);const u=Object.keys(a);if(u.length>0){r+="<table>";for(const l of u){let c=a[l];c!==void 0&&(U(c)&&(c=WE(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function vJ(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function WE(e,t){return JSON.stringify(e,vJ(t))}var EJ=`#vg-tooltip-element { 10 visibility: hidden; 11 padding: 8px; 12 position: fixed; 13 z-index: 1000; 14 font-family: sans-serif; 15 font-size: 11px; 16 border-radius: 3px; 17 box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); 18 /* The default theme is the light theme. */ 19 background-color: rgba(255, 255, 255, 0.95); 20 border: 1px solid #d9d9d9; 21 color: black; 22} 23#vg-tooltip-element.visible { 24 visibility: visible; 25} 26#vg-tooltip-element h2 { 27 margin-top: 0; 28 margin-bottom: 10px; 29 font-size: 13px; 30} 31#vg-tooltip-element table { 32 border-spacing: 0; 33} 34#vg-tooltip-element table tr { 35 border: none; 36} 37#vg-tooltip-element table tr td { 38 overflow: hidden; 39 text-overflow: ellipsis; 40 padding-top: 2px; 41 padding-bottom: 2px; 42} 43#vg-tooltip-element table tr td.key { 44 color: #808080; 45 max-width: 150px; 46 text-align: right; 47 padding-right: 4px; 48} 49#vg-tooltip-element table tr td.value { 50 display: block; 51 max-width: 300px; 52 max-height: 7em; 53 text-align: left; 54} 55#vg-tooltip-element.dark-theme { 56 background-color: rgba(32, 32, 32, 0.9); 57 border: 1px solid #f5f5f5; 58 color: white; 59} 60#vg-tooltip-element.dark-theme td.key { 61 color: #bfbfbf; 62} 63`;const DD="vg-tooltip-element",wJ={offsetX:10,offsetY:10,id:DD,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:SJ,maxDepth:2,formatTooltip:xJ,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function SJ(e){return String(e).replace(/&/g,"&").replace(/</g,"<")}function kJ(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return EJ.toString().replaceAll(DD,e)}function RD(e,t,{offsetX:n,offsetY:i}){const r=_D({x1:e.clientX,x2:e.clientX,y1:e.clientY,y2:e.clientY},t,n,i),s=["bottom-right","bottom-left","top-right","top-left"];for(const o of s)if(TD(r[o],t))return r[o];return r["top-left"]}function $J(e,t,n,i,r){const{position:s,offsetX:o,offsetY:a}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=AJ(u,l,n),f=_D(c,i,o,a),d=Array.isArray(s)?s:[s];for(const p of d)if(TD(f[p],i)&&!CJ(t,f[p],i))return f[p];return RD(t,i,r)}function AJ(e,t,n){const i=n.isVoronoi?n.datum.bounds:n.bounds;let r=e.left+t[0]+i.x1,s=e.top+t[1]+i.y1,o=n;for(;o.mark.group;)o=o.mark.group,r+=o.x??0,s+=o.y??0;const a=i.x2-i.x1,u=i.y2-i.y1;return{x1:r,x2:r+a,y1:s,y2:s+u}}function _D(e,t,n,i){const r=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,o=e.x1-t.width-n,a=r-t.width/2,u=e.x2+n,l=e.y1-t.height-i,
63c=s-t.height/2,f=e.y2+i;return{top:{x:a,y:l},bottom:{x:a,y:f},left:{x:o,y:c},right:{x:u,y:c},"top-left":{x:o,y:l},"top-right":{x:u,y:l},"bottom-left":{x:o,y:f},"bottom-right":{x:u,y:f}}}function TD(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function CJ(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class FJ{call;options;el;constructor(t){this.options={...wJ,...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 i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=kJ(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){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)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=this.options.anchor==="mark"?$J(t,n,i,this.el.getBoundingClientRect(),this.options):RD(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}var vh={};var OJ=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),DJ=Object.prototype.hasOwnProperty;function cg(e,t){return DJ.call(e,t)}function fg(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)cg(e,r)&&i.push(r);return i}function Ut(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function dg(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function Br(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function ND(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function hg(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(hg(e[t]))return!0}else if(typeof e=="object"){for(var i=fg(e),r=i.length,s=0;s<r;s++)if(hg(e[i[s]]))return!0}}return!1}function GE(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(` 64`)}var MD=(function(e){OJ(t,e);function t(n,i,r,s,o){var a=this.constructor,u=e.call(this,GE(n,{name:i,index:r,operation:s,tree:o}))||this;return u.name=i,u.index=r,u.operation=s,u.tree=o,Object.setPrototypeOf(u,a.prototype),u.message=GE(n,{name:i,index:r,operation:s,tree:o}),u}return t})(Error),Ne=MD,RJ=Ut,Ys={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=Tc(n,this.path);i&&(i=Ut(i));var r=Qr(n,{op:"remove",path:this.from}).removed;return Qr(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Tc(n,this.from);return Qr(n,{op:"add",path:this.path,value:Ut(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:au(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},_J={add:function(e,t,n){return dg(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:Ys.move,copy:Ys.copy,test:Ys.test,_get:Ys._get};function Tc(e,t){if(t=="")return e;var n={op:"_get",path:t};return Qr(e,n),n.value}function Qr(e,t,n,i,r,s){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),s===void 0&&(s=0),n&&(typeof n=="function"?n(t,0,e,t.path):Nc(t,0)),t.path===""){var o={newDocument:e};if(t.op==="add")return o.newDocument=t.value,o;if(t.op==="replace")return o.newDocument=t.value,o.removed=e,o;
vendor: 4,416 bytes, line 64
64if(t.op==="move"||t.op==="copy")return o.newDocument=Tc(e,t.from),t.op==="move"&&(o.removed=e),o;if(t.op==="test"){if(o.test=au(e,t.value),o.test===!1)throw new Ne("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o.newDocument=e,o}else{if(t.op==="remove")return o.removed=e,o.newDocument=null,o;if(t.op==="_get")return t.value=e,o;if(n)throw new Ne("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return o}}else{i||(e=Ut(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,p=void 0,h=void 0;for(typeof n=="function"?h=n:h=Nc;;){if(p=u[c],p&&p.indexOf("~")!=-1&&(p=ND(p)),r&&(p=="__proto__"||p=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[p]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&h(t,0,e,d)),c++,Array.isArray(l)){if(p==="-")p=l.length;else{if(n&&!dg(p))throw new Ne("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);dg(p)&&(p=~~p)}if(c>=f){if(n&&t.op==="add"&&p>l.length)throw new Ne("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=_J[t.op].call(t,l,p,e);if(o.test===!1)throw new Ne("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=Ys[t.op].call(t,l,p,e);if(o.test===!1)throw new Ne("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[p],n&&c<f&&(!l||typeof l!="object"))throw new Ne("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function vd(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Ne("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Ut(e));for(var s=new Array(t.length),o=0,a=t.length;o<a;o++)s[o]=Qr(e,t[o],n,!0,r,o),e=s[o].newDocument;return s.newDocument=e,s}function TJ(e,t,n){var i=Qr(e,t);if(i.test===!1)throw new Ne("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function Nc(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ne("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Ys[e.op]){if(typeof e.path!="string")throw new Ne("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ne('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Ne("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Ne("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&hg(e.value))throw new Ne("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new Ne("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Ne("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=LD([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ne("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Ne("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function LD(e,t,n){try{if(!Array.isArray(e))throw new Ne("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)vd(Ut(t),Ut(e),n||!0);else{n=n||Nc;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Ne)return r;throw r}}function au(e,t){if(e===t)return!0;
64if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,s,o;if(n&&i){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!au(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(s=a.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=s;r--!==0;)if(o=a[r],!au(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var NJ=Object.freeze({__proto__:null,JsonPatchError:Ne,_areEquals:au,applyOperation:Qr,applyPatch:vd,applyReducer:TJ,deepClone:RJ,getValueByPointer:Tc,validate:LD,validator:Nc});var Z1=new WeakMap,MJ=(function(){function e(t){this.observers=new Map,this.obj=t}return e})(),LJ=(function(){function e(t,n){this.callback=t,this.observer=n}return e})();function PJ(e){return Z1.get(e)}function IJ(e,t){return e.observers.get(t)}function zJ(e,t){e.observers.delete(t.callback)}function BJ(e,t){t.unobserve()}function UJ(e,t){var n=[],i,r=PJ(e);if(!r)r=new MJ(e),Z1.set(e,r);else{var s=IJ(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=Ut(e),t){i.callback=t,i.next=null;var o=function(){pg(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){pg(i),clearTimeout(i.next),zJ(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new LJ(t,i)),i}function pg(e,t){t===void 0&&(t=!1);var n=Z1.get(e.object);eb(n.value,e.object,e.patches,"",t),e.patches.length&&vd(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function eb(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=fg(t),o=fg(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(cg(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?eb(c,f,n,i+"/"+Br(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Br(l),value:Ut(c)}),n.push({op:"replace",path:i+"/"+Br(l),value:Ut(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Br(l),value:Ut(c)}),n.push({op:"remove",path:i+"/"+Br(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u<s.length;u++){var l=s[u];!cg(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+Br(l),value:Ut(t[l])})}}}function jJ(e,t,n){n===void 0&&(n=!1);var i=[];return eb(e,t,i,"",n),i}var qJ=Object.freeze({__proto__:null,compare:jJ,generate:pg,observe:UJ,unobserve:BJ});Object.assign({},NJ,qJ,{JsonPatchError:MD,deepClone:Ut,escapePathComponent:Br,unescapePathComponent:ND});function WJ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eh,HE;function GJ(){if(HE)return Eh;HE=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const i=this.map.get(n);if(i!==void 0)return this.map.delete(n),this.map.set(n,i),i}delete(n){return this.map.delete(n)}set(n,i){if(!this.delete(n)&&i!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,i)}return this}}return Eh=e,Eh}var wh,VE;function tb(){if(VE)return wh;VE=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return wh=i=>i?typeof i!="object"?e:i:t,wh}var xl={exports:{}},Sh,XE;function nb(){if(XE)return Sh;XE=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return Sh={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Sh}var kh,YE;function Ed(){return YE||(YE=1,kh=typeof process=="object"&&vh&&vh.NODE_DEBUG&&/\bsemver\b/i.test(vh.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),kh}var KE;
vendor: 7,660 bytes, line 64
64function ib(){return KE||(KE=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=nb(),s=Ed();t=e.exports={};const o=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],c=t.t={};let f=0;const d="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",r],[d,i]],h=m=>{for(const[y,b]of p)m=m.split(`${y}*`).join(`${y}{0,${b}}`).split(`${y}+`).join(`${y}{1,${b}}`);return m},g=(m,y,b)=>{const v=h(y),w=f++;s(m,w,y),c[m]=w,u[w]=y,l[w]=v,o[w]=new RegExp(y,b?"g":void 0),a[w]=new RegExp(v,b?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),g("FULL",`^${u[c.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),g("LOOSE",`^${u[c.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),g("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?(?:${u[c.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[c.COERCE],!0),g("COERCERTLFULL",u[c.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(xl,xl.exports)),xl.exports}var $h,JE;function HJ(){if(JE)return $h;JE=1;const e=/^[0-9]+$/,t=(i,r)=>{const s=e.test(i),o=e.test(r);return s&&o&&(i=+i,r=+r),i===r?0:s&&!o?-1:o&&!s?1:i<r?-1:1};return $h={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},$h}var Ah,QE;function rb(){if(QE)return Ah;QE=1;const e=Ed(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=nb(),{safeRe:i,t:r}=ib(),s=tb(),{compareIdentifiers:o}=HJ();class a{constructor(l,c){if(c=s(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const p=+d;if(p>=0&&p<n)return p}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),o(this.major,l.major)||o(this.minor,l.minor)||o(this.patch,l.patch)}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const f=this.prerelease[c],d=l.prerelease[c];if(e("prerelease compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return o(f,d)}while(++c)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let c=0;do{const f=this.build[c],d=l.build[c];if(e("build compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return o(f,d)}while(++c)}inc(l,c,f){if(l.startsWith("pre")){if(!c&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(c){const d=`-${c}`.match(this.options.loose?i[r.PRERELEASELOOSE]:i[r.PRERELEASE]);if(!d||d[1]!==c)throw new Error(`invalid identifier: ${c}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,f),this.inc("pre",c,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,f),this.inc("pre",c,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let p=this.prerelease.length;for(;--p>=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let p=[c,d];f===!1&&(p=[c]),o(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=p):this.prerelease=p}break}
vendor: 8,655 bytes, line 64
64default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ah=a,Ah}var Ch,ZE;function Qo(){if(ZE)return Ch;ZE=1;const e=rb();return Ch=(n,i,r)=>new e(n,r).compare(new e(i,r)),Ch}var Fh,ew;function VJ(){if(ew)return Fh;ew=1;const e=Qo();return Fh=(n,i,r)=>e(n,i,r)===0,Fh}var Oh,tw;function XJ(){if(tw)return Oh;tw=1;const e=Qo();return Oh=(n,i,r)=>e(n,i,r)!==0,Oh}var Dh,nw;function YJ(){if(nw)return Dh;nw=1;const e=Qo();return Dh=(n,i,r)=>e(n,i,r)>0,Dh}var Rh,iw;function KJ(){if(iw)return Rh;iw=1;const e=Qo();return Rh=(n,i,r)=>e(n,i,r)>=0,Rh}var _h,rw;function JJ(){if(rw)return _h;rw=1;const e=Qo();return _h=(n,i,r)=>e(n,i,r)<0,_h}var Th,sw;function QJ(){if(sw)return Th;sw=1;const e=Qo();return Th=(n,i,r)=>e(n,i,r)<=0,Th}var Nh,ow;function ZJ(){if(ow)return Nh;ow=1;const e=VJ(),t=XJ(),n=YJ(),i=KJ(),r=JJ(),s=QJ();return Nh=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return i(a,l,c);case"<":return r(a,l,c);case"<=":return s(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},Nh}var Mh,aw;function eQ(){if(aw)return Mh;aw=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(" "),o("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,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.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(o("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 s(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 u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(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("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}Mh=t;const n=tb(),{safeRe:i,t:r}=ib(),s=ZJ(),o=Ed(),a=rb(),u=PD();return Mh}var Lh,uw;function PD(){if(uw)return Lh;uw=1;const e=/\s+/g;class t{constructor(O,I){if(I=r(I),O instanceof t)return O.loose===!!I.loose&&O.includePrerelease===!!I.includePrerelease?O:new t(O.raw,I);if(O instanceof s)return this.raw=O.value,this.set=[[O]],this.formatted=void 0,this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=O.trim().replace(e," "),this.set=this.raw.split("||").map(W=>this.parseRange(W.trim())).filter(W=>W.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const W=this.set[0];if(this.set=this.set.filter(V=>!g(V[0])),this.set.length===0)this.set=[W];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&m(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let O=0;O<this.set.length;O++){O>0&&(this.formatted+="||");const I=this.set[O];for(let W=0;W<I.length;W++)W>0&&(this.formatted+=" "),this.formatted+=I[W].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(O){const W=((this.options.includePrerelease&&p)|(this.options.loose&&h))+":"+O,V=i.get(W);if(V)return V;const H=this.options.loose,Z=H?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];O=O.replace(Z,ee(this.options.includePrerelease)),o("hyphen replace",O),O=O.replace(u[l.COMPARATORTRIM],c),o("comparator trim",O),O=O.replace(u[l.TILDETRIM],f),o("tilde trim",O),O=O.replace(u[l.CARETTRIM],d),o("caret trim",O);let pe=O.split(" ").map(_e=>b(_e,this.options)).join(" ").split(/\s+/).map(_e=>K(_e,this.options));H&&(pe=pe.filter(_e=>(o("loose invalid filter",_e,this.options),!!_e.match(u[l.COMPARATORLOOSE])))),o("range list",pe);const oe=new Map,ke=pe.map(_e=>new s(_e,this.options));for(const _e of ke){if(g(_e))return[_e];oe.set(_e.value,_e)}oe.size>1&&oe.has("")&&oe.delete("");const ut=[...oe.values()];return i.set(W,ut),ut}intersects(O,I){if(!(O instanceof t))throw new TypeError("a Range is required");return this.set.some(W=>y(W,I)&&O.set.some(V=>y(V,I)&&W.every(H=>V.every(Z=>H.intersects(Z,I)))))}test(O){if(!O)return!1;if(typeof O=="string")try{O=new a(O,this.options)}catch{return!1}for(let I=0;I<this.set.length;I++)if(ce(this.set[I],O,this.options))return!0;return!1}}Lh=t;const n=GJ(),i=new n,r=tb(),s=eQ(),o=Ed(),a=rb(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=ib(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:h}=nb(),g=T=>T.value==="<0.0.0-0",m=T=>T.value==="",y=(T,O)=>{let I=!0;const W=T.slice();let V=W.pop();for(;I&&W.length;)I=W.every(H=>V.intersects(H,O)),V=W.pop();return I},b=(T,O)=>(o("comp",T,O),T=S(T,O),o("caret",T),T=w(T,O),o("tildes",T),T=k(T,O),o("xrange",T),T=P(T,O),o("stars",T),T),v=T=>!T||T.toLowerCase()==="x"||T==="*",w=(T,O)=>T.trim().split(/\s+/).map(I=>E(I,O)).join(" "),E=(T,O)=>{const I=O.loose?u[l.TILDELOOSE]:u[l.TILDE];return T.replace(I,(W,V,H,Z,pe)=>{o("tilde",T,W,V,H,Z,pe);let oe;return v(V)?oe="":v(H)?oe=`>=${V}.0.0 <${+V+1}.0.0-0`:v(Z)?oe=`>=${V}.${H}.0 <${V}.${+H+1}.0-0`:pe?(o("replaceTilde pr",pe),oe=`>=${V}.${H}.${Z}-${pe} <${V}.${+H+1}.0-0`):oe=`>=${V}.${H}.${Z} <${V}.${+H+1}.0-0`,o("tilde return",oe),oe})},S=(T,O)=>T.trim().split(/\s+/).map(I=>x(I,O)).join(" "),x=(T,O)=>{o("caret",T,O);const I=O.loose?u[l.CARETLOOSE]:u[l.CARET],W=O.includePrerelease?"-0":"";return T.replace(I,(V,H,Z,pe,oe)=>{o("caret",T,V,H,Z,pe,oe);let ke;return v(H)?ke="":v(Z)?ke=`>=${H}.0.0${W} <${+H+1}.0.0-0`:v(pe)?H==="0"?ke=`>=${H}.${Z}.0${W} <${H}.${+Z+1}.0-0`:ke=`>=${H}.${Z}.0${W} <${+H+1}.0.0-0`:oe?(o("replaceCaret pr",oe),H==="0"?Z==="0"?ke=`>=${H}.${Z}.${pe}-${oe} <${H}.${Z}.${+pe+1}-0`:ke=`>=${H}.${Z}.${pe}-${oe} <${H}.${+Z+1}.0-0`:ke=`>=${H}.${Z}.${pe}-${oe} <${+H+1}.0.0-0`):(o("no pr"),H==="0"?Z==="0"?ke=`>=${H}.${Z}.${pe}${W} <${H}.${Z}.${+pe+1}-0`:ke=`>=${H}.${Z}.${pe}${W} <${H}.${+Z+1}.0-0`:ke=`>=${H}.${Z}.${pe} <${+H+1}.0.0-0`),o("caret return",ke),ke})},k=(T,O)=>(o("replaceXRanges",T,O),T.split(/\s+/).map(I=>D(I,O)).join(" ")),D=(T,O)=>{T=T.trim();const I=O.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return T.replace(I,(W,V,H,Z,pe,oe)=>{o("xRange",T,W,V,H,Z,pe,oe);const ke=v(H),ut=ke||v(Z),_e=ut||v(pe),Bn=_e;return V==="="&&Bn&&(V=""),oe=O.includePrerelease?"-0":"",ke?V===">"||V==="<"?W="<0.0.0-0":W="*":V&&Bn?(ut&&(Z=0),pe=0,V===">"?(V=">=",ut?(H=+H+1,Z=0,pe=0):(Z=+Z+1,pe=0)):V==="<="&&(V="<",ut?H=+H+1:Z=+Z+1),V==="<"&&(oe="-0"),W=`${V+H}.${Z}.${pe}${oe}`):ut?W=`>=${H}.0.0${oe} <${+H+1}.0.0-0`:_e&&(W=`>=${H}.${Z}.0${oe} <${H}.${+Z+1}.0-0`),o("xRange return",W),W})},P=(T,O)=>(o("replaceStars",T,O),T.trim().replace(u[l.STAR],"")),K=(T,O)=>(o("replaceGTE0",T,O),T.trim().replace(u[O.includePrerelease?l.GTE0PRE:l.GTE0],"")),ee=T=>(O,I,W,V,H,Z,pe,oe,ke,ut,_e,Bn)=>(v(W)?I="":v(V)?I=`>=${W}.0.0${T?"-0":""}`:v(H)?I=`>=${W}.${V}.0${T?"-0":""}`:Z?I=`>=${I}`:I=`>=${I}${T?"-0":""}`,v(ke)?oe="":v(ut)?oe=`<${+ke+1}.0.0-0`:v(_e)?oe=`<${ke}.${+ut+1}.0-0`:Bn?oe=`<=${ke}.${ut}.${_e}-${Bn}`:T?oe=`<${ke}.${ut}.${+_e+1}-0`:oe=`<=${oe}`,`${I} ${oe}`.trim()),ce=(T,O,I)=>{for(let W=0;W<T.length;W++)if(!T[W].test(O))return!1;if(O.prerelease.length&&!I.includePrerelease){for(let W=0;W<T.length;W++)if(o(T[W].semver),T[W].semver!==s.ANY&&T[W].semver.prerelease.length>0){const V=T[W].semver;if(V.major===O.major&&V.minor===O.minor&&V.patch===O.patch)return!0}return!1}return!0};return Lh}var Ph,lw;function tQ(){if(lw)return Ph;lw=1;const e=PD();return Ph=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},Ph}var nQ=tQ(),ID=WJ(nQ);
vendor: 5,921 bytes, lines 64-187
64function iQ(e,t,n){const i=e.open(t),r=250,{origin:s}=new URL(t);let o=40;function a(l){l.source===i&&(o=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function u(){o<=0||(i.postMessage(n,s),setTimeout(u,r),o-=1)}setTimeout(u,r)}var rQ=`.vega-embed { 65 position: relative; 66 display: inline-block; 67 box-sizing: border-box; 68} 69.vega-embed.has-actions { 70 padding-right: 38px; 71} 72.vega-embed details:not([open]) > :not(summary) { 73 display: none !important; 74} 75.vega-embed summary { 76 list-style: none; 77 position: absolute; 78 top: 0; 79 right: 0; 80 padding: 6px; 81 z-index: 1000; 82 background: white; 83 box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); 84 color: #1b1e23; 85 border: 1px solid #aaa; 86 border-radius: 999px; 87 opacity: 0.2; 88 transition: opacity 0.4s ease-in; 89 cursor: pointer; 90 line-height: 0px; 91} 92.vega-embed summary::-webkit-details-marker { 93 display: none; 94} 95.vega-embed summary:active { 96 box-shadow: #aaa 0px 0px 0px 1px inset; 97} 98.vega-embed summary svg { 99 width: 14px; 100 height: 14px; 101} 102.vega-embed details[open] summary { 103 opacity: 0.7; 104} 105.vega-embed:hover summary, .vega-embed:focus-within summary { 106 opacity: 1 !important; 107 transition: opacity 0.2s ease; 108} 109.vega-embed .vega-actions { 110 position: absolute; 111 z-index: 1001; 112 top: 35px; 113 right: -9px; 114 display: flex; 115 flex-direction: column; 116 padding-bottom: 8px; 117 padding-top: 8px; 118 border-radius: 4px; 119 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); 120 border: 1px solid #d9d9d9; 121 background: white; 122 animation-duration: 0.15s; 123 animation-name: scale-in; 124 animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); 125 text-align: left; 126} 127.vega-embed .vega-actions a { 128 padding: 8px 16px; 129 font-family: sans-serif; 130 font-size: 14px; 131 font-weight: 600; 132 white-space: nowrap; 133 color: #434a56; 134 text-decoration: none; 135} 136.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus { 137 background-color: #f7f7f9; 138 color: black; 139} 140.vega-embed .vega-actions::before, .vega-embed .vega-actions::after { 141 content: ""; 142 display: inline-block; 143 position: absolute; 144} 145.vega-embed .vega-actions::before { 146 left: auto; 147 right: 14px; 148 top: -16px; 149 border: 8px solid rgba(0, 0, 0, 0); 150 border-bottom-color: #d9d9d9; 151} 152.vega-embed .vega-actions::after { 153 left: auto; 154 right: 15px; 155 top: -14px; 156 border: 7px solid rgba(0, 0, 0, 0); 157 border-bottom-color: #fff; 158} 159.vega-embed .chart-wrapper.fit-x { 160 width: 100%; 161} 162.vega-embed .chart-wrapper.fit-y { 163 height: 100%; 164} 165 166.vega-embed-wrapper { 167 max-width: 100%; 168 overflow: auto; 169 padding-right: 14px; 170} 171 172@keyframes scale-in { 173 from { 174 opacity: 0; 175 transform: scale(0.6); 176 } 177 to { 178 opacity: 1; 179 transform: scale(1); 180 } 181} 182`;function zD(e,...t){for(const n of t)sQ(e,n);return e}function sQ(e,t){for(const n of Object.keys(t))To(e,n,t[n],!0)}const qn=zU;let uu=TK;const cw=typeof window<"u"?window:void 0;uu===void 0&&cw?.vl?.compile&&(uu=cw.vl);const oQ={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},aQ={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Da={vega:"Vega","vega-lite":"Vega-Lite"},Mc={vega:qn.version,"vega-lite":uu?uu.version:"not available"},uQ={vega:e=>e,"vega-lite":(e,t,n)=>uu.compile(e,{config:n,logger:t}).spec},lQ=` 183<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"> 184 <circle r="2" cy="8" cx="2"></circle> 185 <circle r="2" cy="8" cx="8"></circle> 186 <circle r="2" cy="8" cx="14"></circle> 187</svg>`,cQ="chart-wrapper";function fQ(e){return typeof e=="function"}function fw(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,s=`</code></pre>${n}</body></html>`,o=window.open("");o.document.write(r+e+s),o.document.title=`${Da[i]} JSON Source`}function dQ(e,t,n){if(e.$schema){const i=CD(e.$schema);n&&n!==i.library&&t.warn(`The given visualization spec is written in ${Da[i.library]}, but mode argument sets ${Da[n]??n}.`);const r=i.library;return ID(Mc[r],`^${i.version.slice(1)}`)||t.warn(`The input spec uses ${Da[r]} ${i.version}, but the current version of ${Da[r]} is v${Mc[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":n??"vega"}function BD(e){return!!(e&&"load"in e)}function dw(e){return BD(e)?e:qn.loader(e)}function hQ(e){const t=e.usermeta?.embedOptions??{};return j(t.defaultStyle)&&(t.defaultStyle=!1),t}async function dZ(e,t,n={}){let i,r;j(t)?(r=dw(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=hQ(i),o=s.loader;(!r||o)&&(r=dw(n.loader??o));const a=await hw(s,r),u=await hw(n,r),l={...zD(u,a),config:_o(u.config??{},a.config??{})};return await gQ(e,i,l,r)}async function hw(e,t){const n=j(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=j(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function pQ(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 gQ(e,t,n={},i){const r=n.theme?_o(bJ[n.theme],n.config??{}):n.config,s=bs(n.actions)?n.actions:zD({},oQ,n.actions??{}),o={...aQ,...n.i18n},a=n.renderer??"svg",u=n.logger??Lc(qn.Warn);n.logLevel!==void 0&&u.level(n.logLevel);const l=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 E="vega-embed-style",{root:S,rootContainer:x}=pQ(c);if(!S.getElementById(E)){const k=document.createElement("style");k.id=E,k.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?rQ.toString():n.defaultStyle,x.appendChild(k)}}const f=dQ(t,u,n.mode);let d=uQ[f](t,u,r);
vendor: 3,339 bytes, line 187
187if(f==="vega-lite"&&d.$schema){const E=CD(d.$schema);ID(Mc.vega,`^${E.version.slice(1)}`)||u.warn(`The compiled spec uses Vega ${E.version}, but current version is v${Mc.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let p=c;if(s){const E=document.createElement("div");E.classList.add(cQ),c.appendChild(E),p=E}const h=n.patch;if(h&&(d=h instanceof Function?h(d):vd(d,h,!0,!1).newDocument),n.formatLocale&&qn.formatLocale(n.formatLocale),n.timeFormatLocale&&qn.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const E in n.expressionFunctions){const S=n.expressionFunctions[E];"fn"in S?qn.expressionFunction(E,S.fn,S.visitor):S instanceof Function&&qn.expressionFunction(E,S)}const{ast:g}=n,m=qn.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||qn.View)(m,{loader:i,logger:u,renderer:a,...g?{expr:qn.expressionInterpreter??n.expr??YU}:{}});if(y.addSignalListener("autosize",(E,S)=>{const{type:x}=S;x=="fit-x"?(p.classList.add("fit-x"),p.classList.remove("fit-y")):x=="fit-y"?(p.classList.remove("fit-x"),p.classList.add("fit-y")):x=="fit"?p.classList.add("fit-x","fit-y"):p.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:E,tooltip:S}=n,x=E&&!BD(E)?E?.baseURL:void 0,k=fQ(S)?S:new FJ({baseURL:x,...S===!0?{}:S}).call;y.tooltip(k)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:E,updateSet:S}=typeof b=="boolean"?{}:b;y.hover(E,S)}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(p,n.bind).runAsync();let v;if(s!==!1){let E=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const x=document.createElement("details");x.title=o.CLICK_TO_VIEW_ACTIONS,c.append(x),E=x;const k=document.createElement("summary");k.innerHTML=lQ,x.append(k),v=D=>{x.contains(D.target)||x.removeAttribute("open")},document.addEventListener("click",v)}const S=document.createElement("div");if(E.append(S),S.classList.add("vega-actions"),s===!0||s.export!==!1){for(const x of["svg","png"])if(s===!0||s.export===!0||s.export[x]){const k=o[`${x.toUpperCase()}_ACTION`],D=document.createElement("a"),P=U(n.scaleFactor)?n.scaleFactor[x]:n.scaleFactor;D.text=k,D.href="#",D.target="_blank",D.download=`${l}.${x}`,D.addEventListener("mousedown",async function(K){K.preventDefault();const ee=await y.toImageURL(x,P);this.href=ee}),S.append(D)}}if(s===!0||s.source!==!1){const x=document.createElement("a");x.text=o.SOURCE_ACTION,x.href="#",x.addEventListener("click",function(k){fw(wd(t),n.sourceHeader??"",n.sourceFooter??"",f),k.preventDefault()}),S.append(x)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const x=document.createElement("a");x.text=o.COMPILED_ACTION,x.href="#",x.addEventListener("click",function(k){fw(wd(d),n.sourceHeader??"",n.sourceFooter??"","vega"),k.preventDefault()}),S.append(x)}if(s===!0||s.editor!==!1){const x=n.editorUrl??"https://vega.github.io/editor/",k=document.createElement("a");k.text=o.EDITOR_ACTION,k.href="#",k.addEventListener("click",function(D){iQ(window,x,{config:r,mode:h?"vega":f,renderer:a,spec:wd(h?d:t)}),D.preventDefault()}),S.append(k)}}function w(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:w,embedOptions:n}}export{oQ as DEFAULT_ACTIONS,dZ as default,dQ as guessMode,qn as vega,uu as vegaLite};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.