text: (self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9741],{83082:(t,e,n)=>{"use strict";n.d(e,{n:()=>g});const i="view",r="[",a="]",o="{",s="}",u=":",l=",",c="@",f=">",h=/[[\]{}]/,d={"*":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 p,m;function g(t,e,n){p=e||i;m=n||d;return x(t.trim()).map(_)}function y(t){return m[t]}function v(t,e,n,i,r){const a=t.length;let o=0,s;for(;e<a;++e){s=t[e];if(!o&&s===n)return e;else if(r&&r.indexOf(s)>=0)--o;else if(i&&i.indexOf(s)>=0)++o}return e}function x(t){const e=[],n=t.length;let i=0,u=0;while(u<n){u=v(t,u,l,r+o,a+s);e.push(t.substring(i,u).trim());i=++u}if(e.length===0){throw"Empty event selector: "+t}return e}function _(t){return t[0]==="["?b(t):w(t)}function b(t){const e=t.length;let n=1,i;n=v(t,n,a,r,a);if(n===e){throw"Empty between selector: "+t}i=x(t.substring(1,n));if(i.length!==2){throw"Between selector must have two elements: "+t}t=t.slice(n+1).trim();if(t[0]!==f){throw"Expected '>' after between selector: "+t}i=i.map(_);const o=_(t.slice(1).trim());if(o.between){return{between:i,stream:o}}else{o.between=i}return o}function w(t){const e={source:p},n=[];let i=[0,0],l=0,f=0,d=t.length,m=0,g,x;if(t[d-1]===s){m=t.lastIndexOf(o);if(m>=0){try{i=k(t.substring(m+1,d-1))}catch(_){throw"Invalid throttle specification: "+t}t=t.slice(0,m).trim();d=t.length}else throw"Unmatched right brace: "+t;m=0}if(!d)throw t;if(t[0]===c)l=++m;g=v(t,m,u);if(g<d){n.push(t.substring(f,g).trim());f=m=++g}m=v(t,m,r);if(m===d){n.push(t.substring(f,d).trim())}else{n.push(t.substring(f,m).trim());x=[];f=++m;if(f===d)throw"Unmatched left bracket: "+t}while(m<d){m=v(t,m,a);if(m===d)throw"Unmatched left bracket: "+t;x.push(t.substring(f,m).trim());if(m<d-1&&t[++m]!==r)throw"Expected left bracket: "+t;f=++m}if(!(d=n.length)||h.test(n[d-1])){throw"Invalid event selector: "+t}if(d>1){e.type=n[1];if(l){e.markname=n[0].slice(1)}else if(y(n[0])){e.marktype=n[0]}else{e.source=n[0]}}else{e.type=n[0]}if(e.type.slice(-1)==="!"){e.consume=true;e.type=e.type.slice(0,-1)}if(x!=null)e.filter=x;if(i[0])e.throttle=i[0];if(i[1])e.debounce=i[1];return e}function k(t){const e=t.split(l);if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!==n)throw t;return n}))}},9741:(t,e,n)=>{"use strict";n.r(e);n.d(e,{Bounds:()=>Fv,CanvasHandler:()=>Vb,CanvasRenderer:()=>rw,DATE:()=>xn,DAY:()=>_n,DAYOFYEAR:()=>bn,Dataflow:()=>Lo,Debug:()=>m.cG,Error:()=>m.jj,EventStream:()=>Ya,Gradient:()=>cy,GroupItem:()=>Tv,HOURS:()=>wn,Handler:()=>Mb,Info:()=>m.kI,Item:()=>Sv,MILLISECONDS:()=>An,MINUTES:()=>kn,MONTH:()=>yn,Marks:()=>sb,MultiPulse:()=>Mo,None:()=>m.Hq,Operator:()=>ja,Parameters:()=>Ra,Pulse:()=>_o,QUARTER:()=>gn,RenderType:()=>lk,Renderer:()=>Eb,ResourceLoader:()=>Bv,SECONDS:()=>Mn,SVGHandler:()=>uw,SVGRenderer:()=>Lw,SVGStringRenderer:()=>ik,Scenegraph:()=>mb,TIME_UNITS:()=>En,Transform:()=>jo,View:()=>dX,WEEK:()=>vn,Warn:()=>m.uU,YEAR:()=>mn,accessor:()=>m.ZE,accessorFields:()=>m.Oj,accessorName:()=>m.el,array:()=>m.IX,ascending:()=>m.j2,bandwidthNRD:()=>os,bin:()=>ss,bootstrapCI:()=>cs,boundClip:()=>vk,boundContext:()=>tx,boundItem:()=>ub,boundMark:()=>cb,boundStroke:()=>Ov,changeset:()=>za,clampRange:()=>m.l$,codegenExpression:()=>Hq,compare:()=>m.qu,constant:()=>m.a9,cumulativeLogNormal:()=>Ds,cumulativeNormal:()=>_s,cumulativeUniform:()=>Ns,dayofyear:()=>Nn,debounce:()=>m.Ds,defaultLocale:()=>ga,definition:()=>Xo,densityLogNormal:()=>Es,densityNormal:()=>xs,densityUniform:()=>Bs,domChild:()=>xb,domClear:()=>_b,domCreate:()=>yb,domFind:()=>vb,dotbin:()=>fs,error:()=>m.vU,expressionFunction:()=>uj,extend:()=>m.l7,extent:()=>m.We,extentIndex:()=>m.dI,falsy:()=>m.k,fastmap:()=>m.Xr,field:()=>m.EP,flush:()=>m.yl,font:()=>V_,fontFamily:()=>J_,fontSize:()=>L_,format:()=>ht,formatLocale:()=>sa,formats:()=>dt,hasOwnProperty:()=>m.nr,id:()=>m.id,identity:()=>m.yR,inferType:()=>O,inferTypes:()=>R,ingest:()=>Ca,inherits:()=>m.XW,inrange:()=>m.u5,interpolate:()=>kg,interpolateColors:()=>xg,interpolateRange:()=>vg,intersect:()=>hk,intersectBoxLine:()=>fx,intersectPath:()=>sx,intersectPoint:()=>ux,intersectRule:()=>cx,isArray:()=>m.kJ,isBoolean:()=>m.jn,isDate:()=>m.J_,isFunction:()=>m.mf,isIterable:()=>m.TW,isNumber:()=>m.hj,isObject:()=>m.Kn,isRegExp:()=>m.Kj,isString:()=>m.HD,isTuple:()=>Aa,key:()=>m.Jy,lerp:()=>m.t7,lineHeight:()=>P_,loader:()=>_a,locale:()=>ma,logger:()=>m.kg,lruCache:()=>m.$m,markup:()=>Bw,merge:()=>m.TS,mergeConfig:()=>m.fE,multiLineOffset:()=>X_,one:()=>m.kX,pad:()=>m.vk,panLinear:()=>m.Dw,panLog:()=>m.mJ,panPow:()=>m.QA,panSymlog:()=>m.Zw,parse:()=>zV,parseExpression:()=>jq,parseSelector:()=>vX.n,pathCurves:()=>hy,pathEqual:()=>bk,pathParse:()=>my,pathRectangle:()=>jy,pathRender:()=>Cy,pathSymbols:()=>By,pathTrail:()=>Wy,peek:()=>m.fj,point:()=>wb,projection:()=>xS,quantileLogNormal:()=>Cs,quantileNormal:()=>bs,quantileUniform:()=>zs,quantiles:()=>rs,quantizeInterpolator:()=>_g,quarter:()=>m.mS,quartiles:()=>as,random:()=>us,randomInteger:()=>ps,randomKDE:()=>Ms,randomLCG:()=>ds,randomLogNormal:()=>Fs,randomMixture:()=>Ss,randomNormal:()=>ks,randomUniform:()=>Os,read:()=>va,regressionExp:()=>js,regressionLinear:()=>Ls,regressionLoess:()=>Gs,regressionLog:()=>Ps,regressionPoly:()=>$s,regressionPow:()=>Ws,regressionQuad:()=>Xs,renderModule:()=>fk,repeat:()=>m.rx,resetDefaultLocale:()=>ya,resetSVGClipId:()=>Dv,resetSVGDefIds:()=>kk,responseType:()=>pt,runtimeContext:()=>Ij,sampleCurve:()=>eu,sampleLogNormal:()=>As,sampleNormal:()=>vs,sampleUniform:()=>Ts,scale:()=>sg,sceneEqual:()=>_k,sceneFromJSON:()=>db,scenePickVisit:()=>kx,sceneToJSON:()=>hb,sceneVisit:()=>wx,sceneZOrder:()=>bx,scheme:()=>Sg,serializeXML:()=>Nw,setRandom:()=>ls,span:()=>m.yP,splitAccessPath:()=>m._k,stringValue:()=>m.m8,textMetrics:()=>z_,timeBin:()=>Ei,timeFloor:()=>Gn,timeFormatLocale:()=>da,timeInterval:()=>ni,timeOffset:()=>ai,timeSequence:()=>ui,timeUnitSpecifier:()=>Sn,timeUnits:()=>Cn,toBoolean:()=>m.sw,toDate:()=>m.ZU,toNumber:()=>m.He,toSet:()=>m.Rg,toString:()=>m.BB,transform:()=>$o,transforms:()=>Wo,truncate:()=>m.$G,truthy:()=>m.yb,tupleid:()=>Ea,typeParsers:()=>B,utcFloor:()=>Qn,utcInterval:()=>ii,utcOffset:()=>oi,utcSequence:()=>li,utcdayofyear:()=>In,utcquarter:()=>m.N3,utcweek:()=>Ln,version:()=>ZV,visitArray:()=>m.FP,week:()=>zn,writeConfig:()=>m.iL,zero:()=>m.bM,zoomLinear:()=>m.ay,zoomLog:()=>m.dH,zoomPow:()=>m.mK,zoomSymlog:()=>m.bV});var i={};n.r(i);n.d(i,{aggregate:()=>ku,bin:()=>Au,collect:()=>Du,compare:()=>Cu,countpattern:()=>Su,cross:()=>Bu,density:()=>Iu,dotbin:()=>Hu,expression:()=>Ju,extent:()=>Gu,facet:()=>Zu,field:()=>Qu,filter:()=>el,flatten:()=>nl,fold:()=>il,formula:()=>rl,generate:()=>al,impute:()=>ul,joinaggregate:()=>hl,kde:()=>dl,key:()=>pl,load:()=>gl,lookup:()=>xl,multiextent:()=>_l,multivalues:()=>wl,params:()=>Ml,pivot:()=>Al,prefacet:()=>Fl,project:()=>Sl,proxy:()=>Bl,quantile:()=>Nl,relay:()=>Ol,sample:()=>Rl,sequence:()=>Ul,sieve:()=>ql,subflow:()=>Ku,timeunit:()=>Il,tupleindex:()=>Pl,values:()=>jl,window:()=>Gl});var r={};n.r(r);n.d(r,{interpolate:()=>ud,interpolateArray:()=>Zh,interpolateBasis:()=>qh,interpolateBasisClosed:()=>Ih,interpolateCubehelix:()=>Mm,interpolateCubehelixLong:()=>Am,interpolateDate:()=>td,interpolateDiscrete:()=>_p,interpolateHcl:()=>cm,interpolateHclLong:()=>fm,interpolateHsl:()=>Up,interpolateHslLong:()=>qp,interpolateHue:()=>bp,interpolateLab:()=>um,interpolateNumber:()=>ed,interpolateNumberArray:()=>Gh,interpolateObject:()=>nd,interpolateRgb:()=>Hh,interpolateRgbBasis:()=>Jh,interpolateRgbBasisClosed:()=>Vh,interpolateRound:()=>ld,interpolateString:()=>sd,interpolateTransformCss:()=>Fp,interpolateTransformSvg:()=>Sp,interpolateZoom:()=>Op,piecewise:()=>cp,quantize:()=>Em});var a={};n.r(a);n.d(a,{bound:()=>sM,identifier:()=>cM,mark:()=>hM,overlap:()=>pM,render:()=>wM,viewlayout:()=>ZM});var o={};n.r(o);n.d(o,{axisticks:()=>iA,datajoin:()=>rA,encode:()=>sA,legendentries:()=>uA,linkpath:()=>dA,pie:()=>DA,scale:()=>BA,sortitems:()=>$A,stack:()=>GA});var s={};n.r(s);n.d(s,{contour:()=>VS,geojson:()=>QS,geopath:()=>tT,geopoint:()=>nT,geoshape:()=>iT,graticule:()=>aT,heatmap:()=>oT,isocontour:()=>RS,kde2d:()=>$S,projection:()=>fT});var u={};n.r(u);n.d(u,{force:()=>qB});var l={};n.r(l);n.d(l,{nest:()=>xz,pack:()=>Dz,partition:()=>Fz,stratify:()=>Sz,tree:()=>Nz,treelinks:()=>zz,treemap:()=>Uz});var c={};n.r(c);n.d(c,{label:()=>AO});var f={};n.r(f);n.d(f,{loess:()=>DO,regression:()=>SO});var h={};n.r(h);n.d(h,{voronoi:()=>rR});var d={};n.r(d);n.d(d,{wordcloud:()=>wR});var p={};n.r(p);n.d(p,{crossfilter:()=>zR,resolvefilter:()=>OR});var m=n(48823);const g=/^([A-Za-z]+:)?\/\//;const y=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;const v=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;const x="file://";function _(t,e){return n=>({options:n||{},sanitize:w,load:b,fileAccess:!!e,file:k(e),http:A(t)})}async function b(t,e){const n=await this.sanitize(t,e),i=n.href;return n.localFile?this.file(i):this.http(i,e)}async function w(t,e){e=(0,m.l7)({},this.options,e);const n=this.fileAccess,i={href:null};let r,a,o;const s=y.test(t.replace(v,""));if(t==null||typeof t!=="string"||!s){(0,m.vU)("Sanitize failure, invalid URI: "+(0,m.m8)(t))}const u=g.test(t);if((o=e.baseURL)&&!u){if(!t.startsWith("/")&&o[o.length-1]!=="/"){t="/"+t}t=o+t}a=(r=t.startsWith(x))||e.mode==="file"||e.mode!=="http"&&!u&&n;if(r){t=t.slice(x.length)}else if(t.startsWith("//")){if(e.defaultProtocol==="file"){t=t.slice(2);a=true}else{t=(e.defaultProtocol||"http")+":"+t}}Object.defineProperty(i,"localFile",{value:!!a});i.href=t;if(e.target){i.target=e.target+""}if(e.rel){i.rel=e.rel+""}if(e.context==="image"&&e.crossOrigin){i.crossOrigin=e.crossOrigin+""}return i}function k(t){return t?e=>new Promise(((n,i)=>{t.readFile(e,((t,e)=>{if(t)i(t);else n(e)}))})):M}async function M(){(0,m.vU)("No file system access.")}function A(t){return t?async function(e,n){const i=(0,m.l7)({},this.options.http,n),r=n&&n.response,a=await t(e,i);return!a.ok?(0,m.vU)(a.status+""+a.statusText):(0,m.mf)(a[r])?a[r]():a.text()}:E}async function E(){(0,m.vU)("No HTTP fetch method available.")}const D=t=>t!=null&&t===t;const C=t=>t==="true"||t==="false"||t===true||t===false;const F=t=>!Number.isNaN(Date.parse(t));const S=t=>!Number.isNaN(+t)&&!(t instanceof Date);const T=t=>S(t)&&Number.isInteger(+t);const B={boolean:m.sw,integer:m.He,number:m.He,date:m.ZU,string:m.BB,unknown:m.yR};const N=[C,T,S,F];const z=["boolean","integer","number","date"];function O(t,e){if(!t||!t.length)return"unknown";const n=t.length,i=N.length,r=N.map(((t,e)=>e+1));for(let a=0,o=0,s,u;a<n;++a){u=e?t[a][e]:t[a];for(s=0;s<i;++s){if(r[s]&&D(u)&&!N[s](u)){r[s]=0;++o;if(o===N.length)return"string"}}}return z[r.reduce(((t,e)=>t===0?e:t),0)-1]}function R(t,e){return e.reduce(((e,n)=>{e[n]=O(t,n);return e}),{})}var U={},q={},I=34,L=10,P=13;function j(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function W(t,e){var n=j(t);return function(i,r){return e(n(i),r,t)}}function X(t){var e=Object.create(null),n=[];t.forEach((function(t){for(var i in t){if(!(i in e)){n.push(e[i]=i)}}}));return n}function $(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function H(t){return t<0?"-"+$(-t,6):t>9999?"+"+$(t,6):$(t,4)}function Y(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),i=t.getUTCSeconds(),r=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":H(t.getUTCFullYear(),4)+"-"+$(t.getUTCMonth()+1,2)+"-"+$(t.getUTCDate(),2)+(r?"T"+$(e,2)+":"+$(n,2)+":"+$(i,2)+"."+$(r,3)+"Z":i?"T"+$(e,2)+":"+$(n,2)+":"+$(i,2)+"Z":n||e?"T"+$(e,2)+":"+$(n,2)+"Z":"")}function J(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?W(t,e):j(t)}));a.columns=i||[];return a}function r(t,e){var i=[],r=t.length,a=0,o=0,s,u=r<=0,l=false;if(t.charCodeAt(r-1)===L)--r;if(t.charCodeAt(r-1)===P)--r;function c(){if(u)return q;if(l)return l=false,U;var e,i=a,o;if(t.charCodeAt(i)===I){while(a++<r&&t.charCodeAt(a)!==I||t.charCodeAt(++a)===I);if((e=a)>=r)u=true;else if((o=t.charCodeAt(a++))===L)l=true;else if(o===P){l=true;if(t.charCodeAt(a)===L)++a}return t.slice(i+1,e-1).replace(/""/g,'"')}while(a<r){if((o=t.charCodeAt(e=a++))===L)l=true;else if(o===P){l=true;if(t.charCodeAt(a)===L)++a}else if(o!==n)continue;return t.slice(i,e)}return u=true,t.slice(i,r)}while((s=c())!==q){var f=[];while(s!==U&&s!==q)f.push(s),s=c();if(e&&(f=e(f,o++))==null)continue;i.push(f)}return i}function a(e,n){return e.map((function(e){return n.map((function(t){return c(e[t])})).join(t)}))}function o(e,n){if(n==null)n=X(e);return[n.map(c).join(t)].concat(a(e,n)).join("\n")}function s(t,e){if(e==null)e=X(t);return a(t,e).join("\n")}function u(t){return t.map(l).join("\n")}function l(e){return e.map(c).join(t)}function c(t){return t==null?"":t instanceof Date?Y(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:i,parseRows:r,format:o,formatBody:s,formatRows:u,formatRow:l,formatValue:c}}function V(t){const e=function(e,n){const i={delimiter:t};return G(e,n?(0,m.l7)(n,i):i)};e.responseType="text";return e}function G(t,e){if(e.header){t=e.header.map(m.m8).join(e.delimiter)+"\n"+t}return J(e.delimiter).parse(t+"")}G.responseType="text";function K(t){return typeof Buffer==="function"&&(0,m.mf)(Buffer.isBuffer)?Buffer.isBuffer(t):false}function Z(t,e){const n=e&&e.property?(0,m.EP)(e.property):m.yR;return(0,m.Kn)(t)&&!K(t)?Q(n(t),e):n(JSON.parse(t))}Z.responseType="json";function Q(t,e){if(!(0,m.kJ)(t)&&(0,m.TW)(t)){t=[...t]}return e&&e.copy?JSON.parse(JSON.stringify(t)):t}function tt(t,e){var n,i=t.length,r=i-e;while(r<--i)n=t[r],t[r++]=t[i],t[i]=n}function et(t){return t}function nt(t){if(t==null)return et;var e,n,i=t.scale[0],r=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){if(!s)e=n=0;var u=2,l=t.length,c=new Array(l);c[0]=(e+=t[0])*i+a;c[1]=(n+=t[1])*r+o;while(u<l)c[u]=t[u],++u;return c}}function it(t,e){if(typeof e==="string")e=t.objects[e];return e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map((function(e){return rt(t,e)}))}:rt(t,e)}function rt(t,e){var n=e.id,i=e.bbox,r=e.properties==null?{}:e.properties,a=at(t,e);return n==null&&i==null?{type:"Feature",properties:r,geometry:a}:i==null?{type:"Feature",id:n,properties:r,geometry:a}:{type:"Feature",id:n,bbox:i,properties:r,geometry:a}}function at(t,e){var n=nt(t.transform),i=t.arcs;function r(t,e){if(e.length)e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a<o;++a){e.push(n(r[a],a))}if(t<0)tt(e,o)}function a(t){return n(t)}function o(t){var e=[];for(var n=0,i=t.length;n<i;++n)r(t[n],e);if(e.length<2)e.push(e[0]);return e}function s(t){var e=o(t);while(e.length<4)e.push(e[0]);return e}function u(t){return t.map(s)}function l(t){var e=t.type,n;switch(e){case"GeometryCollection":return{type:e,geometries:t.geometries.map(l)};case"Point":n=a(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(a);break;case"LineString":n=o(t.arcs);break;case"MultiLineString":n=t.arcs.map(o);break;case"Polygon":n=u(t.arcs);break;case"MultiPolygon":n=t.arcs.map(u);break;default:return null}return{type:e,coordinates:n}}return l(e)}function ot(t,e){var n={},i={},r={},a=[],o=-1;e.forEach((function(n,i){var r=t.arcs[n<0?~n:n],a;if(r.length<3&&!r[1][0]&&!r[1][1]){a=e[++o],e[o]=n,e[i]=a}}));e.forEach((function(t){var e=s(t),n=e[0],a=e[1],o,u;if(o=r[n]){delete r[o.end];o.push(t);o.end=a;if(u=i[a]){delete i[u.start];var l=u===o?o:o.concat(u);i[l.start=o.start]=r[l.end=u.end]=l}else{i[o.start]=r[o.end]=o}}else if(o=i[a]){delete i[o.start];o.unshift(t);o.start=n;if(u=r[n]){delete r[u.end];var c=u===o?o:u.concat(o);i[c.start=u.start]=r[c.end=o.end]=c}else{i[o.start]=r[o.end]=o}}else{o=[t];i[o.start=n]=r[o.end=a]=o}}));function s(e){var n=t.arcs[e<0?~e:e],i=n[0],r;if(t.transform)r=[0,0],n.forEach((function(t){r[0]+=t[0],r[1]+=t[1]}));else r=n[n.length-1];return e<0?[r,i]:[i,r]}function u(t,e){for(var i in t){var r=t[i];delete e[r.start];delete r.start;delete r.end;r.forEach((function(t){n[t<0?~t:t]=1}));a.push(r)}}u(r,i);u(i,r);e.forEach((function(t){if(!n[t<0?~t:t])a.push([t])}));return a}function st(t){return at(t,ut.apply(this,arguments))}function ut(t,e,n){var i,r,a;if(arguments.length>1)i=lt(t,e,n);else for(r=0,i=new Array(a=t.arcs.length);r<a;++r)i[r]=r;return{type:"MultiLineString",arcs:ot(t,i)}}function lt(t,e,n){var i=[],r=[],a;function o(t){var e=t<0?~t:t;(r[e]||(r[e]=[])).push({i:t,g:a})}function s(t){t.forEach(o)}function u(t){t.forEach(s)}function l(t){t.forEach(u)}function c(t){switch(a=t,t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":u(t.arcs);break;case"MultiPolygon":l(t.arcs);break}}c(e);r.forEach(n==null?function(t){i.push(t[0].i)}:function(t){if(n(t[0].g,t[t.length-1].g))i.push(t[0].i)});return i}const ct={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function ft(t,e){let n,i,r,a;t=Z(t,e);if(e&&e.feature){n=it;r=e.feature}else if(e&&e.mesh){n=st;r=e.mesh;a=ct[e.filter]}else{(0,m.vU)("Missing TopoJSON feature or mesh parameter.")}i=(i=t.objects[r])?n(t,i,a):(0,m.vU)("Invalid TopoJSON object: "+r);return i&&i.features||[i]}ft.responseType="json";const ht={dsv:G,csv:V(","),tsv:V("\t"),json:Z,topojson:ft};function dt(t,e){if(arguments.length>1){ht[t]=e;return this}else{return(0,m.nr)(ht,t)?ht[t]:null}}function pt(t){const e=dt(t);return e&&e.responseType||"text"}var mt=Math.sqrt(50),gt=Math.sqrt(10),yt=Math.sqrt(2);function vt(t,e,n){var i,r=-1,a,o,s;e=+e,t=+t,n=+n;if(t===e&&n>0)return[t];if(i=e<t)a=t,t=e,e=a;if((s=xt(t,e,n))===0||!isFinite(s))return[];if(s>0){t=Math.ceil(t/s);e=Math.floor(e/s);o=new Array(a=Math.ceil(e-t+1));while(++r<a)o[r]=(t+r)*s}else{s=-s;t=Math.ceil(t*s);e=Math.floor(e*s);o=new Array(a=Math.ceil(e-t+1));while(++r<a)o[r]=(t+r)/s}if(i)o.reverse();return o}function xt(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),a=i/Math.pow(10,r);return r>=0?(a>=mt?10:a>=gt?5:a>=yt?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(a>=mt?10:a>=gt?5:a>=yt?2:1)}function _t(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),a=i/r;if(a>=mt)r*=10;else if(a>=gt)r*=5;else if(a>=yt)r*=2;return e<t?-r:r}var bt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wt(t){if(!(e=bt.exec(t)))throw new Error("invalid format: "+t);var e;return new kt({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}wt.prototype=kt.prototype;function kt(t){this.fill=t.fill===undefined?" ":t.fill+"";this.align=t.align===undefined?">":t.align+"";this.sign=t.sign===undefined?"-":t.sign+"";this.symbol=t.symbol===undefined?"":t.symbol+"";this.zero=!!t.zero;this.width=t.width===undefined?undefined:+t.width;this.comma=!!t.comma;this.precision=t.precision===undefined?undefined:+t.precision;this.trim=!!t.trim;this.type=t.type===undefined?"":t.type+""}kt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===undefined?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===undefined?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Mt(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function At(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Et(t){return t=At(Math.abs(t)),t?t[1]:NaN}function Dt(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Et(e)/3)))*3-Et(Math.abs(t)))}function Ct(t,e){t=Math.abs(t),e=Math.abs(e)-t;return Math.max(0,Et(e)-Et(t))+1}function Ft(t){return Math.max(0,-Et(Math.abs(t)))}function St(t,e){return function(n,i){var r=n.length,a=[],o=0,s=t[0],u=0;while(r>0&&s>0){if(u+s+1>i)s=Math.max(1,i-u);a.push(n.substring(r-=s,r+s));if((u+=s+1)>i)break;s=t[o=(o+1)%t.length]}return a.reverse().join(e)}}function Tt(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}function Bt(t){t:for(var e=t.length,n=1,i=-1,r;n<e;++n){switch(t[n]){case".":i=r=n;break;case"0":if(i===0)i=n;r=n;break;default:if(!+t[n])break t;if(i>0)i=0;break}}return i>0?t.slice(0,i)+t.slice(r+1):t}var Nt;function zt(t,e){var n=At(t,e);if(!n)return t+"";var i=n[0],r=n[1],a=r-(Nt=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+At(t,Math.max(0,e+a-1))[0]}function Ot(t,e){var n=At(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const Rt={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Mt,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ot(t*100,e),r:Ot,s:zt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ut(t){return t}var qt=Array.prototype.map,It=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lt(t){var e=t.grouping===undefined||t.thousands===undefined?Ut:St(qt.call(t.grouping,Number),t.thousands+""),n=t.currency===undefined?"":t.currency[0]+"",i=t.currency===undefined?"":t.currency[1]+"",r=t.decimal===undefined?".":t.decimal+"",a=t.numerals===undefined?Ut:Tt(qt.call(t.numerals,String)),o=t.percent===undefined?"%":t.percent+"",s=t.minus===undefined?"−":t.minus+"",u=t.nan===undefined?"NaN":t.nan+"";function l(t){t=wt(t);var l=t.fill,c=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,m=t.comma,g=t.precision,y=t.trim,v=t.type;if(v==="n")m=true,v="g";else if(!Rt[v])g===undefined&&(g=12),y=true,v="g";if(d||l==="0"&&c==="=")d=true,l="0",c="=";var x=h==="$"?n:h==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",_=h==="$"?i:/[%p]/.test(v)?o:"";var b=Rt[v],w=/[defgprs%]/.test(v);g=g===undefined?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function k(t){var n=x,i=_,o,h,k;if(v==="c"){i=b(t)+i;t=""}else{t=+t;var M=t<0||1/t<0;t=isNaN(t)?u:b(Math.abs(t),g);if(y)t=Bt(t);if(M&&+t===0&&f!=="+")M=false;n=(M?f==="("?f:s:f==="-"||f==="("?"":f)+n;i=(v==="s"?It[8+Nt/3]:"")+i+(M&&f==="("?")":"");if(w){o=-1,h=t.length;while(++o<h){if(k=t.charCodeAt(o),48>k||k>57){i=(k===46?r+t.slice(o+1):t.slice(o))+i;t=t.slice(0,o);break}}}}if(m&&!d)t=e(t,Infinity);var A=n.length+t.length+i.length,E=A<p?new Array(p-A+1).join(l):"";if(m&&d)t=e(E+t,E.length?p-i.length:Infinity),E="";switch(c){case"<":t=n+t+i+E;break;case"=":t=n+E+t+i;break;case"^":t=E.slice(0,A=E.length>>1)+n+t+i+E.slice(A);break;default:t=E+n+t+i;break}return a(t)}k.toString=function(){return t+""};return k}function c(t,e){var n=l((t=wt(t),t.type="f",t)),i=Math.max(-8,Math.min(8,Math.floor(Et(e)/3)))*3,r=Math.pow(10,-i),a=It[8+i/3];return function(t){return n(r*t)+a}}return{format:l,formatPrefix:c}}var Pt;var jt;var Wt;Xt({thousands:",",grouping:[3],currency:["$",""]});function Xt(t){Pt=Lt(t);jt=Pt.format;Wt=Pt.formatPrefix;return Pt}var $t=new Date,Ht=new Date;function Yt(t,e,n,i){function r(e){return t(e=arguments.length===0?new Date:new Date(+e)),e}r.floor=function(e){return t(e=new Date(+e)),e};r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n};r.round=function(t){var e=r(t),n=r.ceil(t);return t-e<n-t?e:n};r.offset=function(t,n){return e(t=new Date(+t),n==null?1:Math.floor(n)),t};r.range=function(n,i,a){var o=[],s;n=r.ceil(n);a=a==null?1:Math.floor(a);if(!(n<i)||!(a>0))return o;do{o.push(s=new Date(+n)),e(n,a),t(n)}while(s<n&&n<i);return o};r.filter=function(n){return Yt((function(e){if(e>=e)while(t(e),!n(e))e.setTime(e-1)}),(function(t,i){if(t>=t){if(i<0)while(++i<=0){while(e(t,-1),!n(t)){}}else while(--i>=0){while(e(t,+1),!n(t)){}}}}))};if(n){r.count=function(e,i){$t.setTime(+e),Ht.setTime(+i);t($t),t(Ht);return Math.floor(n($t,Ht))};r.every=function(t){t=Math.floor(t);return!isFinite(t)||!(t>0)?null:!(t>1)?r:r.filter(i?function(e){return i(e)%t===0}:function(e){return r.count(0,e)%t===0})}}return r}var Jt=1e3;var Vt=6e4;var Gt=36e5;var Kt=864e5;var Zt=6048e5;var Qt=Yt((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vt)/Kt),(t=>t.getDate()-1));const te=Qt;var ee=Qt.range;function ne(t){return Yt((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7);e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e*7)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vt)/Zt}))}var ie=ne(0);var re=ne(1);var ae=ne(2);var oe=ne(3);var se=ne(4);var ue=ne(5);var le=ne(6);var ce=ie.range;var fe=re.range;var he=ae.range;var de=oe.range;var pe=se.range;var me=ue.range;var ge=le.range;var ye=Yt((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/Kt}),(function(t){return t.getUTCDate()-1}));const ve=ye;var xe=ye.range;function _e(t){return Yt((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7);e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e*7)}),(function(t,e){return(e-t)/Zt}))}var be=_e(0);var we=_e(1);var ke=_e(2);var Me=_e(3);var Ae=_e(4);var Ee=_e(5);var De=_e(6);var Ce=be.range;var Fe=we.range;var Se=ke.range;var Te=Me.range;var Be=Ae.range;var Ne=Ee.range;var ze=De.range;var Oe=Yt((function(t){t.setMonth(0,1);t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Oe.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Yt((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t);e.setMonth(0,1);e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)}))};const Re=Oe;var Ue=Oe.range;var qe=Yt((function(t){t.setDate(1);t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12}),(function(t){return t.getMonth()}));const Ie=qe;var Le=qe.range;var Pe=Yt((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Jt-t.getMinutes()*Vt)}),(function(t,e){t.setTime(+t+e*Gt)}),(function(t,e){return(e-t)/Gt}),(function(t){return t.getHours()}));const je=Pe;var We=Pe.range;var Xe=Yt((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Jt)}),(function(t,e){t.setTime(+t+e*Vt)}),(function(t,e){return(e-t)/Vt}),(function(t){return t.getMinutes()}));const $e=Xe;var He=Xe.range;var Ye=Yt((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*Jt)}),(function(t,e){return(e-t)/Jt}),(function(t){return t.getUTCSeconds()}));const Je=Ye;var Ve=Ye.range;var Ge=Yt((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));Ge.every=function(t){t=Math.floor(t);if(!isFinite(t)||!(t>0))return null;if(!(t>1))return Ge;return Yt((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t}))};const Ke=Ge;var Ze=Ge.range;var Qe=Yt((function(t){t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Qe.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Yt((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t);e.setUTCMonth(0,1);e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}))};const tn=Qe;var en=Qe.range;var nn=Yt((function(t){t.setUTCDate(1);t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12}),(function(t){return t.getUTCMonth()}));const rn=nn;var an=nn.range;var on=Yt((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*Gt)}),(function(t,e){return(e-t)/Gt}),(function(t){return t.getUTCHours()}));const sn=on;var un=on.range;var ln=Yt((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*Vt)}),(function(t,e){return(e-t)/Vt}),(function(t){return t.getUTCMinutes()}));const cn=ln;var fn=ln.range;function hn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function dn(t){let e=t;let n=t;if(t.length===1){e=(e,n)=>t(e)-n;n=pn(t)}function i(t,e,i,r){if(i==null)i=0;if(r==null)r=t.length;while(i<r){const a=i+r>>>1;if(n(t[a],e)<0)i=a+1;else r=a}return i}function r(t,e,i,r){if(i==null)i=0;if(r==null)r=t.length;while(i<r){const a=i+r>>>1;if(n(t[a],e)>0)r=a;else i=a+1}return i}function a(t,n,r,a){if(r==null)r=0;if(a==null)a=t.length;const o=i(t,n,r,a-1);return o>r&&e(t[o-1],n)>-e(t[o],n)?o-1:o}return{left:i,center:a,right:r}}function pn(t){return(e,n)=>hn(t(e),n)}const mn="year";const gn="quarter";const yn="month";const vn="week";const xn="date";const _n="day";const bn="dayofyear";const wn="hours";const kn="minutes";const Mn="seconds";const An="milliseconds";const En=[mn,gn,yn,vn,xn,_n,bn,wn,kn,Mn,An];const Dn=En.reduce(((t,e,n)=>(t[e]=1+n,t)),{});function Cn(t){const e=(0,m.IX)(t).slice(),n={};if(!e.length)(0,m.vU)("Missing time unit.");e.forEach((t=>{if((0,m.nr)(Dn,t)){n[t]=1}else{(0,m.vU)("Invalid time unit: ".concat(t,"."))}}));const i=(n[vn]||n[_n]?1:0)+(n[gn]||n[yn]||n[xn]?1:0)+(n[bn]?1:0);if(i>1){(0,m.vU)("Incompatible time units: ".concat(t))}e.sort(((t,e)=>Dn[t]-Dn[e]));return e}const Fn={[mn]:"%Y ",[gn]:"Q%q ",[yn]:"%b ",[xn]:"%d ",[vn]:"W%U ",[_n]:"%a ",[bn]:"%j ",[wn]:"%H:00",[kn]:"00:%M",[Mn]:":%S",[An]:".%L",["".concat(mn,"-").concat(yn)]:"%Y-%m ",["".concat(mn,"-").concat(yn,"-").concat(xn)]:"%Y-%m-%d ",["".concat(wn,"-").concat(kn)]:"%H:%M"};function Sn(t,e){const n=(0,m.l7)({},Fn,e),i=Cn(t),r=i.length;let a="",o=0,s,u;for(o=0;o<r;){for(s=i.length;s>o;--s){u=i.slice(o,s).join("-");if(n[u]!=null){a+=n[u];o=s;break}}}return a.trim()}const Tn=new Date;function Bn(t){Tn.setFullYear(t);Tn.setMonth(0);Tn.setDate(1);Tn.setHours(0,0,0,0);return Tn}function Nn(t){return On(new Date(t))}function zn(t){return Rn(new Date(t))}function On(t){return te.count(Bn(t.getFullYear())-1,t)}function Rn(t){return ie.count(Bn(t.getFullYear())-1,t)}function Un(t){return Bn(t).getDay()}function qn(t,e,n,i,r,a,o){if(0<=t&&t<100){const s=new Date(-1,e,n,i,r,a,o);s.setFullYear(t);return s}return new Date(t,e,n,i,r,a,o)}function In(t){return Pn(new Date(t))}function Ln(t){return jn(new Date(t))}function Pn(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return ve.count(e-1,t)}function jn(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return be.count(e-1,t)}function Wn(t){Tn.setTime(Date.UTC(t,0,1));return Tn.getUTCDay()}function Xn(t,e,n,i,r,a,o){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,i,r,a,o));t.setUTCFullYear(n.y);return t}return new Date(Date.UTC(t,e,n,i,r,a,o))}function $n(t,e,n,i,r){const a=e||1,o=(0,m.fj)(t),s=(t,e,r)=>{r=r||t;return Hn(n[r],i[r],t===o&&a,e)};const u=new Date,l=(0,m.Rg)(t),c=l[mn]?s(mn):(0,m.a9)(2012),f=l[yn]?s(yn):l[gn]?s(gn):m.bM,h=l[vn]&&l[_n]?s(_n,1,vn+_n):l[vn]?s(vn,1):l[_n]?s(_n,1):l[xn]?s(xn,1):l[bn]?s(bn,1):m.kX,d=l[wn]?s(wn):m.bM,p=l[kn]?s(kn):m.bM,g=l[Mn]?s(Mn):m.bM,y=l[An]?s(An):m.bM;return function(t){u.setTime(+t);const e=c(u);return r(e,f(u),h(u,e),d(u),p(u),g(u),y(u))}}function Hn(t,e,n,i){const r=n<=1?t:i?(e,r)=>i+n*Math.floor((t(e,r)-i)/n):(e,i)=>n*Math.floor(t(e,i)/n);return e?(t,n)=>e(r(t,n),n):r}function Yn(t,e,n){return e+t*7-(n+6)%7}const Jn={[mn]:t=>t.getFullYear(),[gn]:t=>Math.floor(t.getMonth()/3),[yn]:t=>t.getMonth(),[xn]:t=>t.getDate(),[wn]:t=>t.getHours(),[kn]:t=>t.getMinutes(),[Mn]:t=>t.getSeconds(),[An]:t=>t.getMilliseconds(),[bn]:t=>On(t),[vn]:t=>Rn(t),[vn+_n]:(t,e)=>Yn(Rn(t),t.getDay(),Un(e)),[_n]:(t,e)=>Yn(1,t.getDay(),Un(e))};const Vn={[gn]:t=>3*t,[vn]:(t,e)=>Yn(t,0,Un(e))};function Gn(t,e){return $n(t,e||1,Jn,Vn,qn)}const Kn={[mn]:t=>t.getUTCFullYear(),[gn]:t=>Math.floor(t.getUTCMonth()/3),[yn]:t=>t.getUTCMonth(),[xn]:t=>t.getUTCDate(),[wn]:t=>t.getUTCHours(),[kn]:t=>t.getUTCMinutes(),[Mn]:t=>t.getUTCSeconds(),[An]:t=>t.getUTCMilliseconds(),[bn]:t=>Pn(t),[vn]:t=>jn(t),[_n]:(t,e)=>Yn(1,t.getUTCDay(),Wn(e)),[vn+_n]:(t,e)=>Yn(jn(t),t.getUTCDay(),Wn(e))};const Zn={[gn]:t=>3*t,[vn]:(t,e)=>Yn(t,0,Wn(e))};function Qn(t,e){return $n(t,e||1,Kn,Zn,Xn)}const ti={[mn]:Re,[gn]:Ie.every(3),[yn]:Ie,[vn]:ie,[xn]:te,[_n]:te,[bn]:te,[wn]:je,[kn]:$e,[Mn]:Je,[An]:Ke};const ei={[mn]:tn,[gn]:rn.every(3),[yn]:rn,[vn]:be,[xn]:ve,[_n]:ve,[bn]:ve,[wn]:sn,[kn]:cn,[Mn]:Je,[An]:Ke};function ni(t){return ti[t]}function ii(t){return ei[t]}function ri(t,e,n){return t?t.offset(e,n):undefined}function ai(t,e,n){return ri(ni(t),e,n)}function oi(t,e,n){return ri(ii(t),e,n)}function si(t,e,n,i){return t?t.range(e,n,i):undefined}function ui(t,e,n,i){return si(ni(t),e,n,i)}function li(t,e,n,i){return si(ii(t),e,n,i)}const ci=1e3,fi=ci*60,hi=fi*60,di=hi*24,pi=di*7,mi=di*30,gi=di*365;const yi=[mn,yn,xn,wn,kn,Mn,An],vi=yi.slice(0,-1),xi=vi.slice(0,-1),_i=xi.slice(0,-1),bi=_i.slice(0,-1),wi=[mn,vn],ki=[mn,yn],Mi=[mn];const Ai=[[vi,1,ci],[vi,5,5*ci],[vi,15,15*ci],[vi,30,30*ci],[xi,1,fi],[xi,5,5*fi],[xi,15,15*fi],[xi,30,30*fi],[_i,1,hi],[_i,3,3*hi],[_i,6,6*hi],[_i,12,12*hi],[bi,1,di],[wi,1,pi],[ki,1,mi],[ki,3,3*mi],[Mi,1,gi]];function Ei(t){const e=t.extent,n=t.maxbins||40,i=Math.abs((0,m.yP)(e))/n;let r=dn((t=>t[2])).right(Ai,i),a,o;if(r===Ai.length){a=Mi,o=_t(e[0]/gi,e[1]/gi,n)}else if(r){r=Ai[i/Ai[r-1][2]<Ai[r][2]/i?r-1:r];a=r[0];o=r[1]}else{a=yi;o=Math.max(_t(e[0],e[1],n),1)}return{units:a,step:o}}function Di(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);e.setFullYear(t.y);return e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ci(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));e.setUTCFullYear(t.y);return e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Fi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Si(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,a=t.days,o=t.shortDays,s=t.months,u=t.shortMonths;var l=Ui(r),c=qi(r),f=Ui(a),h=qi(a),d=Ui(o),p=qi(o),m=Ui(s),g=qi(s),y=Ui(u),v=qi(u);var x={a:N,A:z,b:O,B:R,c:null,d:ar,e:ar,f:cr,g:br,G:kr,H:or,I:sr,j:ur,L:lr,m:fr,M:hr,p:U,q,Q:Hr,s:Yr,S:dr,u:pr,U:mr,V:yr,w:vr,W:xr,x:null,X:null,y:_r,Y:wr,Z:Mr,"%":$r};var _={a:I,A:L,b:P,B:j,c:null,d:Ar,e:Ar,f:Sr,g:Pr,G:Wr,H:Er,I:Dr,j:Cr,L:Fr,m:Tr,M:Br,p:W,q:X,Q:Hr,s:Yr,S:Nr,u:zr,U:Or,V:Ur,w:qr,W:Ir,x:null,X:null,y:Lr,Y:jr,Z:Xr,"%":$r};var b={a:E,A:D,b:C,B:F,c:S,d:Vi,e:Vi,f:er,g:$i,G:Xi,H:Ki,I:Ki,j:Gi,L:tr,m:Ji,M:Zi,p:A,q:Yi,Q:ir,s:rr,S:Qi,u:Li,U:Pi,V:ji,w:Ii,W:Wi,x:T,X:B,y:$i,Y:Xi,Z:Hi,"%":nr};x.x=w(n,x);x.X=w(i,x);x.c=w(e,x);_.x=w(n,_);_.X=w(i,_);_.c=w(e,_);function w(t,e){return function(n){var i=[],r=-1,a=0,o=t.length,s,u,l;if(!(n instanceof Date))n=new Date(+n);while(++r<o){if(t.charCodeAt(r)===37){i.push(t.slice(a,r));if((u=Ti[s=t.charAt(++r)])!=null)s=t.charAt(++r);else u=s==="e"?" ":"0";if(l=e[s])s=l(n,u);i.push(s);a=r+1}}i.push(t.slice(a,r));return i.join("")}}function k(t,e){return function(n){var i=Fi(1900,undefined,1),r=M(i,t,n+="",0),a,o;if(r!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(i.s*1e3+("L"in i?i.L:0));if(e&&!("Z"in i))i.Z=0;if("p"in i)i.H=i.H%12+i.p*12;if(i.m===undefined)i.m="q"in i?i.q:0;if("V"in i){if(i.V<1||i.V>53)return null;if(!("w"in i))i.w=1;if("Z"in i){a=Ci(Fi(i.y,0,1)),o=a.getUTCDay();a=o>4||o===0?we.ceil(a):we(a);a=ve.offset(a,(i.V-1)*7);i.y=a.getUTCFullYear();i.m=a.getUTCMonth();i.d=a.getUTCDate()+(i.w+6)%7}else{a=Di(Fi(i.y,0,1)),o=a.getDay();a=o>4||o===0?re.ceil(a):re(a);a=te.offset(a,(i.V-1)*7);i.y=a.getFullYear();i.m=a.getMonth();i.d=a.getDate()+(i.w+6)%7}}else if("W"in i||"U"in i){if(!("w"in i))i.w="u"in i?i.u%7:"W"in i?1:0;o="Z"in i?Ci(Fi(i.y,0,1)).getUTCDay():Di(Fi(i.y,0,1)).getDay();i.m=0;i.d="W"in i?(i.w+6)%7+i.W*7-(o+5)%7:i.w+i.U*7-(o+6)%7}if("Z"in i){i.H+=i.Z/100|0;i.M+=i.Z%100;return Ci(i)}return Di(i)}}function M(t,e,n,i){var r=0,a=e.length,o=n.length,s,u;while(r<a){if(i>=o)return-1;s=e.charCodeAt(r++);if(s===37){s=e.charAt(r++);u=b[s in Ti?e.charAt(r++):s];if(!u||(i=u(t,n,i))<0)return-1}else if(s!=n.charCodeAt(i++)){return-1}}return i}function A(t,e,n){var i=l.exec(e.slice(n));return i?(t.p=c.get(i[0].toLowerCase()),n+i[0].length):-1}function E(t,e,n){var i=d.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1}function D(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=h.get(i[0].toLowerCase()),n+i[0].length):-1}function C(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1}function F(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=g.get(i[0].toLowerCase()),n+i[0].length):-1}function S(t,n,i){return M(t,e,n,i)}function T(t,e,i){return M(t,n,e,i)}function B(t,e,n){return M(t,i,e,n)}function N(t){return o[t.getDay()]}function z(t){return a[t.getDay()]}function O(t){return u[t.getMonth()]}function R(t){return s[t.getMonth()]}function U(t){return r[+(t.getHours()>=12)]}function q(t){return 1+~~(t.getMonth()/3)}function I(t){return o[t.getUTCDay()]}function L(t){return a[t.getUTCDay()]}function P(t){return u[t.getUTCMonth()]}function j(t){return s[t.getUTCMonth()]}function W(t){return r[+(t.getUTCHours()>=12)]}function X(t){return 1+~~(t.getUTCMonth()/3)}return{format:function(t){var e=w(t+="",x);e.toString=function(){return t};return e},parse:function(t){var e=k(t+="",false);e.toString=function(){return t};return e},utcFormat:function(t){var e=w(t+="",_);e.toString=function(){return t};return e},utcParse:function(t){var e=k(t+="",true);e.toString=function(){return t};return e}}}var Ti={"-":"",_:" ",0:"0"},Bi=/^\s*\d+/,Ni=/^%/,zi=/[\\^$*+?|[\]().{}]/g;function Oi(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",a=r.length;return i+(a<n?new Array(n-a+1).join(e)+r:r)}function Ri(t){return t.replace(zi,"\\$&")}function Ui(t){return new RegExp("^(?:"+t.map(Ri).join("|")+")","i")}function qi(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Ii(t,e,n){var i=Bi.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Li(t,e,n){var i=Bi.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Pi(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function ji(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Wi(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Xi(t,e,n){var i=Bi.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function $i(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Hi(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Yi(t,e,n){var i=Bi.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function Ji(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Vi(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Gi(t,e,n){var i=Bi.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Ki(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Zi(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Qi(t,e,n){var i=Bi.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function tr(t,e,n){var i=Bi.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function er(t,e,n){var i=Bi.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function nr(t,e,n){var i=Ni.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function ir(t,e,n){var i=Bi.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function rr(t,e,n){var i=Bi.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function ar(t,e){return Oi(t.getDate(),e,2)}function or(t,e){return Oi(t.getHours(),e,2)}function sr(t,e){return Oi(t.getHours()%12||12,e,2)}function ur(t,e){return Oi(1+te.count(Re(t),t),e,3)}function lr(t,e){return Oi(t.getMilliseconds(),e,3)}function cr(t,e){return lr(t,e)+"000"}function fr(t,e){return Oi(t.getMonth()+1,e,2)}function hr(t,e){return Oi(t.getMinutes(),e,2)}function dr(t,e){return Oi(t.getSeconds(),e,2)}function pr(t){var e=t.getDay();return e===0?7:e}function mr(t,e){return Oi(ie.count(Re(t)-1,t),e,2)}function gr(t){var e=t.getDay();return e>=4||e===0?se(t):se.ceil(t)}function yr(t,e){t=gr(t);return Oi(se.count(Re(t),t)+(Re(t).getDay()===4),e,2)}function vr(t){return t.getDay()}function xr(t,e){return Oi(re.count(Re(t)-1,t),e,2)}function _r(t,e){return Oi(t.getFullYear()%100,e,2)}function br(t,e){t=gr(t);return Oi(t.getFullYear()%100,e,2)}function wr(t,e){return Oi(t.getFullYear()%1e4,e,4)}function kr(t,e){var n=t.getDay();t=n>=4||n===0?se(t):se.ceil(t);return Oi(t.getFullYear()%1e4,e,4)}function Mr(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Oi(e/60|0,"0",2)+Oi(e%60,"0",2)}function Ar(t,e){return Oi(t.getUTCDate(),e,2)}function Er(t,e){return Oi(t.getUTCHours(),e,2)}function Dr(t,e){return Oi(t.getUTCHours()%12||12,e,2)}function Cr(t,e){return Oi(1+ve.count(tn(t),t),e,3)}function Fr(t,e){return Oi(t.getUTCMilliseconds(),e,3)}function Sr(t,e){return Fr(t,e)+"000"}function Tr(t,e){return Oi(t.getUTCMonth()+1,e,2)}function Br(t,e){return Oi(t.getUTCMinutes(),e,2)}function Nr(t,e){return Oi(t.getUTCSeconds(),e,2)}function zr(t){var e=t.getUTCDay();return e===0?7:e}function Or(t,e){return Oi(be.count(tn(t)-1,t),e,2)}function Rr(t){var e=t.getUTCDay();return e>=4||e===0?Ae(t):Ae.ceil(t)}function Ur(t,e){t=Rr(t);return Oi(Ae.count(tn(t),t)+(tn(t).getUTCDay()===4),e,2)}function qr(t){return t.getUTCDay()}function Ir(t,e){return Oi(we.count(tn(t)-1,t),e,2)}function Lr(t,e){return Oi(t.getUTCFullYear()%100,e,2)}function Pr(t,e){t=Rr(t);return Oi(t.getUTCFullYear()%100,e,2)}function jr(t,e){return Oi(t.getUTCFullYear()%1e4,e,4)}function Wr(t,e){var n=t.getUTCDay();t=n>=4||n===0?Ae(t):Ae.ceil(t);return Oi(t.getUTCFullYear()%1e4,e,4)}function Xr(){return"+0000"}function $r(){return"%"}function Hr(t){return+t}function Yr(t){return Math.floor(+t/1e3)}var Jr;var Vr;var Gr;var Kr;var Zr;Qr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Qr(t){Jr=Si(t);Vr=Jr.format;Gr=Jr.parse;Kr=Jr.utcFormat;Zr=Jr.utcParse;return Jr}function ta(t){const e={};return n=>e[n]||(e[n]=t(n))}function ea(t,e){return n=>{const i=t(n),r=i.indexOf(e);if(r<0)return i;let a=na(i,r);const o=a<i.length?i.slice(a):"";while(--a>r)if(i[a]!=="0"){++a;break}return i.slice(0,a)+o}}function na(t,e){let n=t.lastIndexOf("e"),i;if(n>0)return n;for(n=t.length;--n>e;){i=t.charCodeAt(n);if(i>=48&&i<=57)return n+1}}function ia(t){const e=ta(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=wt(t||",");if(n.precision==null){n.precision=12;switch(n.type){case"%":n.precision-=2;break;case"e":n.precision-=1;break}return ea(e(n),e(".1f")(1)[1])}else{return e(n)}},formatSpan(t,i,r,a){a=wt(a==null?",f":a);const o=_t(t,i,r),s=Math.max(Math.abs(t),Math.abs(i));let u;if(a.precision==null){switch(a.type){case"s":{if(!isNaN(u=Dt(o,s))){a.precision=u}return n(a,s)}case"":case"e":case"g":case"p":case"r":{if(!isNaN(u=Ct(o,s))){a.precision=u-(a.type==="e")}break}case"f":case"%":{if(!isNaN(u=Ft(o))){a.precision=u-(a.type==="%")*2}break}}}return e(a)}}}let ra;aa();function aa(){return ra=ia({format:jt,formatPrefix:Wt})}function oa(t){return ia(Lt(t))}function sa(t){return arguments.length?ra=oa(t):ra}function ua(t,e,n){n=n||{};if(!(0,m.Kn)(n)){(0,m.vU)("Invalid time multi-format specifier: ".concat(n))}const i=e(Mn),r=e(kn),a=e(wn),o=e(xn),s=e(vn),u=e(yn),l=e(gn),c=e(mn),f=t(n[An]||".%L"),h=t(n[Mn]||":%S"),d=t(n[kn]||"%I:%M"),p=t(n[wn]||"%I %p"),g=t(n[xn]||n[_n]||"%a %d"),y=t(n[vn]||"%b %d"),v=t(n[yn]||"%B"),x=t(n[gn]||"%B"),_=t(n[mn]||"%Y");return t=>(i(t)<t?f:r(t)<t?h:a(t)<t?d:o(t)<t?p:u(t)<t?s(t)<t?g:y:c(t)<t?l(t)<t?v:x:_)(t)}function la(t){const e=ta(t.format),n=ta(t.utcFormat);return{timeFormat:t=>(0,m.HD)(t)?e(t):ua(e,ni,t),utcFormat:t=>(0,m.HD)(t)?n(t):ua(n,ii,t),timeParse:ta(t.parse),utcParse:ta(t.utcParse)}}let ca;fa();function fa(){return ca=la({format:Vr,parse:Gr,utcFormat:Kr,utcParse:Zr})}function ha(t){return la(Si(t))}function da(t){return arguments.length?ca=ha(t):ca}const pa=(t,e)=>(0,m.l7)({},t,e);function ma(t,e){const n=t?oa(t):sa();const i=e?ha(e):da();return pa(n,i)}function ga(t,e){const n=arguments.length;if(n&&n!==2){(0,m.vU)("defaultLocale expects either zero or two arguments.")}return n?pa(sa(t),da(e)):pa(sa(),da())}function ya(){aa();fa();return ga()}function va(t,e,n,i){e=e||{};const r=dt(e.type||"json");if(!r)(0,m.vU)("Unknown data format type: "+e.type);t=r(t,e);if(e.parse)xa(t,e.parse,n,i);if((0,m.nr)(t,"columns"))delete t.columns;return t}function xa(t,e,n,i){if(!t.length)return;const r=da();n=n||r.timeParse;i=i||r.utcParse;let a=t.columns||Object.keys(t[0]),o,s,u,l,c,f;if(e==="auto")e=R(t,a);a=Object.keys(e);const h=a.map((t=>{const r=e[t];let a,o;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){a=r.split(/:(.+)?/,2);o=a[1];if(o[0]==="'"&&o[o.length-1]==="'"||o[0]==='"'&&o[o.length-1]==='"'){o=o.slice(1,-1)}const t=a[0]==="utc"?i:n;return t(o)}if(!B[r]){throw Error("Illegal format pattern: "+t+":"+r)}return B[r]}));for(u=0,c=t.length,f=a.length;u<c;++u){o=t[u];for(l=0;l<f;++l){s=a[l];o[s]=h[l](o[s])}}}const _a=_(typeof fetch!=="undefined"&&fetch,null);function ba(t){const e=t||m.yR,n=[],i={};n.add=t=>{const r=e(t);if(!i[r]){i[r]=1;n.push(t)}return n};n.remove=t=>{const r=e(t);if(i[r]){i[r]=0;const e=n.indexOf(t);if(e>=0)n.splice(e,1)}return n};return n}async function wa(t,e){try{await e(t)}catch(n){t.error(n)}}const ka=Symbol("vega_id");let Ma=1;function Aa(t){return!!(t&&Ea(t))}function Ea(t){return t[ka]}function Da(t,e){t[ka]=e;return t}function Ca(t){const e=t===Object(t)?t:{data:t};return Ea(e)?e:Da(e,Ma++)}function Fa(t){return Sa(t,Ca({}))}function Sa(t,e){for(const n in t)e[n]=t[n];return e}function Ta(t,e){return Da(e,Ea(t))}function Ba(t,e){return!t?null:e?(n,i)=>t(n,i)||Ea(e(n))-Ea(e(i)):(e,n)=>t(e,n)||Ea(e)-Ea(n)}function Na(t){return t&&t.constructor===za}function za(){const t=[],e=[],n=[],i=[],r=[];let a=null,o=false;return{constructor:za,insert(e){const n=(0,m.IX)(e),i=n.length;for(let r=0;r<i;++r)t.push(n[r]);return this},remove(t){const n=(0,m.mf)(t)?i:e,r=(0,m.IX)(t),a=r.length;for(let e=0;e<a;++e)n.push(r[e]);return this},modify(t,e,i){const a={field:e,value:(0,m.a9)(i)};if((0,m.mf)(t)){a.filter=t;r.push(a)}else{a.tuple=t;n.push(a)}return this},encode(t,e){if((0,m.mf)(t))r.push({filter:t,field:e});else n.push({tuple:t,field:e});return this},clean(t){a=t;return this},reflow(){o=true;return this},pulse(s,u){const l={},c={};let f,h,d,p,m,g;for(f=0,h=u.length;f<h;++f){l[Ea(u[f])]=1}for(f=0,h=e.length;f<h;++f){m=e[f];l[Ea(m)]=-1}for(f=0,h=i.length;f<h;++f){p=i[f];u.forEach((t=>{if(p(t))l[Ea(t)]=-1}))}for(f=0,h=t.length;f<h;++f){m=t[f];g=Ea(m);if(l[g]){l[g]=1}else{s.add.push(Ca(t[f]))}}for(f=0,h=u.length;f<h;++f){m=u[f];if(l[Ea(m)]<0)s.rem.push(m)}function y(t,e,n){if(n){t[e]=n(t)}else{s.encode=e}if(!o)c[Ea(t)]=t}for(f=0,h=n.length;f<h;++f){d=n[f];m=d.tuple;p=d.field;g=l[Ea(m)];if(g>0){y(m,p,d.value);s.modifies(p)}}for(f=0,h=r.length;f<h;++f){d=r[f];p=d.filter;u.forEach((t=>{if(p(t)&&l[Ea(t)]>0){y(t,d.field,d.value)}}));s.modifies(d.field)}if(o){s.mod=e.length||i.length?u.filter((t=>l[Ea(t)]>0)):u.slice()}else{for(g in c)s.mod.push(c[g])}if(a||a==null&&(e.length||i.length)){s.clean(true)}return s}}}const Oa="_:mod:_";function Ra(){Object.defineProperty(this,Oa,{writable:true,value:{}})}Ra.prototype={set(t,e,n,i){const r=this,a=r[t],o=r[Oa];if(e!=null&&e>=0){if(a[e]!==n||i){a[e]=n;o[e+":"+t]=-1;o[t]=-1}}else if(a!==n||i){r[t]=n;o[t]=(0,m.kJ)(n)?1+n.length:-1}return r},modified(t,e){const n=this[Oa];if(!arguments.length){for(const t in n){if(n[t])return true}return false}else if((0,m.kJ)(t)){for(let e=0;e<t.length;++e){if(n[t[e]])return true}return false}return e!=null&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){this[Oa]={};return this}};let Ua=0;const qa="pulse",Ia=new Ra;const La=1,Pa=2;function ja(t,e,n,i){this.id=++Ua;this.value=t;this.stamp=-1;this.rank=-1;this.qrank=-1;this.flags=0;if(e){this._update=e}if(n)this.parameters(n,i)}function Wa(t){return function(e){const n=this.flags;if(arguments.length===0)return!!(n&t);this.flags=e?n|t:n&~t;return this}}ja.prototype={targets(){return this._targets||(this._targets=ba(m.id))},set(t){if(this.value!==t){this.value=t;return 1}else{return 0}},skip:Wa(La),modified:Wa(Pa),parameters(t,e,n){e=e!==false;const i=this._argval=this._argval||new Ra,r=this._argops=this._argops||[],a=[];let o,s,u,l;const c=(t,n,o)=>{if(o instanceof ja){if(o!==this){if(e)o.targets().add(this);a.push(o)}r.push({op:o,name:t,index:n})}else{i.set(t,n,o)}};for(o in t){s=t[o];if(o===qa){(0,m.IX)(s).forEach((t=>{if(!(t instanceof ja)){(0,m.vU)("Pulse parameters must be operator instances.")}else if(t!==this){t.targets().add(this);a.push(t)}}));this.source=s}else if((0,m.kJ)(s)){i.set(o,-1,Array(u=s.length));for(l=0;l<u;++l)c(o,l,s[l])}else{c(o,-1,s)}}this.marshall().clear();if(n)r.initonly=true;return a},marshall(t){const e=this._argval||Ia,n=this._argops;let i,r,a,o;if(n){const s=n.length;for(r=0;r<s;++r){i=n[r];a=i.op;o=a.modified()&&a.stamp===t;e.set(i.name,i.index,a.value,o)}if(n.initonly){for(r=0;r<s;++r){i=n[r];i.op.targets().remove(this)}this._argops=null;this._update=null}}return e},detach(){const t=this._argops;let e,n,i,r;if(t){for(e=0,n=t.length;e<n;++e){i=t[e];r=i.op;if(r._targets){r._targets.remove(this)}}}},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),i=e.call(this,n,t);n.clear();if(i!==this.value){this.value=i}else if(!this.modified()){return t.StopPropagation}}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;if(this.skip()){this.skip(false);e=0}else{e=this.evaluate(t)}return this.pulse=e||t}};function Xa(t,e,n,i){let r=1,a;if(t instanceof ja){a=t}else if(t&&t.prototype instanceof ja){a=new t}else if((0,m.mf)(t)){a=new ja(null,t)}else{r=0;a=new ja(t,e)}this.rank(a);if(r){i=n;n=e}if(n)this.connect(a,a.parameters(n,i));this.touch(a);return a}function $a(t,e){const n=t.rank,i=e.length;for(let r=0;r<i;++r){if(n<e[r].rank){this.rerank(t);return}}}let Ha=0;function Ya(t,e,n){this.id=++Ha;this.value=null;if(n)this.receive=n;if(t)this._filter=t;if(e)this._apply=e}function Ja(t,e,n){return new Ya(t,e,n)}Ya.prototype={_filter:m.yb,_apply:m.yR,targets(){return this._targets||(this._targets=ba(m.id))},consume(t){if(!arguments.length)return!!this._consume;this._consume=!!t;return this},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,i=n?n.length:0;for(let t=0;t<i;++t)n[t].receive(e);if(this._consume){t.preventDefault();t.stopPropagation()}}},filter(t){const e=Ja(t);this.targets().add(e);return e},apply(t){const e=Ja(null,t);this.targets().add(e);return e},merge(){const t=Ja();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e){arguments[e].targets().add(t)}return t},throttle(t){let e=-1;return this.filter((()=>{const n=Date.now();if(n-e>t){e=n;return 1}else{return 0}}))},debounce(t){const e=Ja();this.targets().add(Ja(null,null,(0,m.Ds)(t,(t=>{const n=t.dataflow;e.receive(t);if(n&&n.run)n.run()}))));return e},between(t,e){let n=false;t.targets().add(Ja(null,null,(()=>n=true)));e.targets().add(Ja(null,null,(()=>n=false)));return this.filter((()=>n))},detach(){}};function Va(t,e,n,i){const r=this,a=Ja(n,i),o=function(t){t.dataflow=r;try{a.receive(t)}catch(e){r.error(e)}finally{r.run()}};let s;if(typeof t==="string"&&typeof document!=="undefined"){s=document.querySelectorAll(t)}else{s=(0,m.IX)(t)}const u=s.length;for(let l=0;l<u;++l){s[l].addEventListener(e,o)}return a}function Ga(t,e){const n=this.locale();return va(t,e,n.timeParse,n.utcParse)}function Ka(t,e,n){e=this.parse(e,n);return this.pulse(t,this.changeset().insert(e))}async function Za(t,e){const n=this;let i=0,r;try{r=await n.loader().load(t,{context:"dataflow",response:pt(e&&e.type)});try{r=n.parse(r,e)}catch(a){i=-2;n.warn("Data ingestion failed",t,a)}}catch(a){i=-1;n.warn("Loading failed",t,a)}return{data:r,status:i}}async function Qa(t,e,n){const i=this,r=i._pending||to(i);r.requests+=1;const a=await i.request(e,n);i.pulse(t,i.changeset().remove(m.yb).insert(a.data||[]));r.done();return a}function to(t){let e;const n=new Promise((t=>e=t));n.requests=0;n.done=()=>{if(--n.requests===0){t._pending=null;e(t)}};return t._pending=n}const eo={skip:true};function no(t,e,n,i,r){const a=t instanceof ja?ro:io;a(this,t,e,n,i,r);return this}function io(t,e,n,i,r,a){const o=(0,m.l7)({},a,eo);let s,u;if(!(0,m.mf)(n))n=(0,m.a9)(n);if(i===undefined){s=e=>t.touch(n(e))}else if((0,m.mf)(i)){u=new ja(null,i,r,false);s=e=>{u.evaluate(e);const i=n(e),r=u.value;Na(r)?t.pulse(i,r,a):t.update(i,r,o)}}else{s=e=>t.update(n(e),i,o)}e.apply(s)}function ro(t,e,n,i,r,a){if(i===undefined){e.targets().add(n)}else{const o=a||{},s=new ja(null,ao(n,i),r,false);s.modified(o.force);s.rank=e.rank;e.targets().add(s);if(n){s.skip(true);s.value=n.value;s.targets().add(n);t.connect(n,[s])}}}function ao(t,e){e=(0,m.mf)(e)?e:(0,m.a9)(e);return t?function(n,i){const r=e(n,i);if(!t.skip()){t.skip(r!==this.value).value=r}return r}:e}function oo(t){t.rank=++this._rank}function so(t){const e=[t];let n,i,r;while(e.length){this.rank(n=e.pop());if(i=n._targets){for(r=i.length;--r>=0;){e.push(n=i[r]);if(n===t)(0,m.vU)("Cycle detected in dataflow graph.")}}}}const uo={};const lo=1<<0,co=1<<1,fo=1<<2,ho=lo|co,po=lo|fo,mo=lo|co|fo,go=1<<3,yo=1<<4,vo=1<<5,xo=1<<6;function _o(t,e,n){this.dataflow=t;this.stamp=e==null?-1:e;this.add=[];this.rem=[];this.mod=[];this.fields=null;this.encode=n||null}function bo(t,e){const n=[];(0,m.FP)(t,e,(t=>n.push(t)));return n}function wo(t,e){const n={};t.visit(e,(t=>{n[Ea(t)]=1}));return t=>n[Ea(t)]?null:t}function ko(t,e){return t?(n,i)=>t(n,i)&&e(n,i):e}_o.prototype={StopPropagation:uo,ADD:lo,REM:co,MOD:fo,ADD_REM:ho,ADD_MOD:po,ALL:mo,REFLOW:go,SOURCE:yo,NO_SOURCE:vo,NO_FIELDS:xo,fork(t){return new _o(this.dataflow).init(this,t)},clone(){const t=this.fork(mo);t.add=t.add.slice();t.rem=t.rem.slice();t.mod=t.mod.slice();if(t.source)t.source=t.source.slice();return t.materialize(mo|yo)},addAll(){let t=this;const e=!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length;if(e){return t}else{t=new _o(this.dataflow).init(this);t.add=t.source;t.rem=[];return t}},init(t,e){const n=this;n.stamp=t.stamp;n.encode=t.encode;if(t.fields&&!(e&xo)){n.fields=t.fields}if(e&lo){n.addF=t.addF;n.add=t.add}else{n.addF=null;n.add=[]}if(e&co){n.remF=t.remF;n.rem=t.rem}else{n.remF=null;n.rem=[]}if(e&fo){n.modF=t.modF;n.mod=t.mod}else{n.modF=null;n.mod=[]}if(e&vo){n.srcF=null;n.source=null}else{n.srcF=t.srcF;n.source=t.source;if(t.cleans)n.cleans=t.cleans}return n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||mo;return e&lo&&this.add.length||e&co&&this.rem.length||e&fo&&this.mod.length},reflow(t){if(t)return this.fork(mo).reflow();const e=this.add.length,n=this.source&&this.source.length;if(n&&n!==e){this.mod=this.source;if(e)this.filter(fo,wo(this,lo))}return this},clean(t){if(arguments.length){this.cleans=!!t;return this}else{return this.cleans}},modifies(t){const e=this.fields||(this.fields={});if((0,m.kJ)(t)){t.forEach((t=>e[t]=true))}else{e[t]=true}return this},modified(t,e){const n=this.fields;return!((e||this.mod.length)&&n)?false:!arguments.length?!!n:(0,m.kJ)(t)?t.some((t=>n[t])):n[t]},filter(t,e){const n=this;if(t&lo)n.addF=ko(n.addF,e);if(t&co)n.remF=ko(n.remF,e);if(t&fo)n.modF=ko(n.modF,e);if(t&yo)n.srcF=ko(n.srcF,e);return n},materialize(t){t=t||mo;const e=this;if(t&lo&&e.addF){e.add=bo(e.add,e.addF);e.addF=null}if(t&co&&e.remF){e.rem=bo(e.rem,e.remF);e.remF=null}if(t&fo&&e.modF){e.mod=bo(e.mod,e.modF);e.modF=null}if(t&yo&&e.srcF){e.source=e.source.filter(e.srcF);e.srcF=null}return e},visit(t,e){const n=this,i=e;if(t&yo){(0,m.FP)(n.source,n.srcF,i);return n}if(t&lo)(0,m.FP)(n.add,n.addF,i);if(t&co)(0,m.FP)(n.rem,n.remF,i);if(t&fo)(0,m.FP)(n.mod,n.modF,i);const r=n.source;if(t&go&&r){const t=n.add.length+n.mod.length;if(t===r.length);else if(t){(0,m.FP)(r,wo(n,po),i)}else{(0,m.FP)(r,n.srcF,i)}}return n}};function Mo(t,e,n,i){const r=this,a=n.length;let o=0;this.dataflow=t;this.stamp=e;this.fields=null;this.encode=i||null;this.pulses=n;for(let s=0;s<a;++s){const t=n[s];if(t.stamp!==e)continue;if(t.fields){const e=r.fields||(r.fields={});for(const n in t.fields){e[n]=1}}if(t.changed(r.ADD))o|=r.ADD;if(t.changed(r.REM))o|=r.REM;if(t.changed(r.MOD))o|=r.MOD}this.changes=o}(0,m.XW)(Mo,_o,{fork(t){const e=new _o(this.dataflow).init(this,t&this.NO_FIELDS);if(t!==undefined){if(t&e.ADD)this.visit(e.ADD,(t=>e.add.push(t)));if(t&e.REM)this.visit(e.REM,(t=>e.rem.push(t)));if(t&e.MOD)this.visit(e.MOD,(t=>e.mod.push(t)))}return e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return!(n&&e.changes&e.MOD)?0:(0,m.kJ)(t)?t.some((t=>n[t])):n[t]},filter(){(0,m.vU)("MultiPulse does not support filtering.")},materialize(){(0,m.vU)("MultiPulse does not support materialization.")},visit(t,e){const n=this,i=n.pulses,r=i.length;let a=0;if(t&n.SOURCE){for(;a<r;++a){i[a].visit(t,e)}}else{for(;a<r;++a){if(i[a].stamp===n.stamp){i[a].visit(t,e)}}}return n}});async function Ao(t,e,n){const i=this,r=[];if(i._pulse)return Fo(i);if(i._pending)await i._pending;if(e)await wa(i,e);if(!i._touched.length){i.debug("Dataflow invoked, but nothing to do.");return i}const a=++i._clock;i._pulse=new _o(i,a,t);i._touched.forEach((t=>i._enqueue(t,true)));i._touched=ba(m.id);let o=0,s,u,l;try{while(i._heap.size()>0){s=i._heap.pop();if(s.rank!==s.qrank){i._enqueue(s,true);continue}u=s.run(i._getPulse(s,t));if(u.then){u=await u}else if(u.async){r.push(u.async);u=uo}if(u!==uo){if(s._targets)s._targets.forEach((t=>i._enqueue(t)))}++o}}catch(c){i._heap.clear();l=c}i._input={};i._pulse=null;i.debug("Pulse ".concat(a,": ").concat(o," operators"));if(l){i._postrun=[];i.error(l)}if(i._postrun.length){const t=i._postrun.sort(((t,e)=>e.priority-t.priority));i._postrun=[];for(let e=0;e<t.length;++e){await wa(i,t[e].callback)}}if(n)await wa(i,n);if(r.length){Promise.all(r).then((t=>i.runAsync(null,(()=>{t.forEach((t=>{try{t(i)}catch(c){i.error(c)}}))}))))}return i}async function Eo(t,e,n){while(this._running)await this._running;const i=()=>this._running=null;(this._running=this.evaluate(t,e,n)).then(i,i);return this._running}function Do(t,e,n){return this._pulse?Fo(this):(this.evaluate(t,e,n),this)}function Co(t,e,n){if(this._pulse||e){this._postrun.push({priority:n||0,callback:t})}else{try{t(this)}catch(i){this.error(i)}}}function Fo(t){t.error("Dataflow already running. Use runAsync() to chain invocations.");return t}function So(t,e){const n=t.stamp<this._clock;if(n)t.stamp=this._clock;if(n||e){t.qrank=t.rank;this._heap.push(t)}}function To(t,e){const n=t.source,i=this._clock;return n&&(0,m.kJ)(n)?new Mo(this,i,n.map((t=>t.pulse)),e):this._input[t.id]||Bo(this._pulse,n&&n.pulse)}function Bo(t,e){if(e&&e.stamp===t.stamp){return e}t=t.fork();if(e&&e!==uo){t.source=e.source}return t}const No={skip:false,force:false};function zo(t,e){const n=e||No;if(this._pulse){this._enqueue(t)}else{this._touched.add(t)}if(n.skip)t.skip(true);return this}function Oo(t,e,n){const i=n||No;if(t.set(e)||i.force){this.touch(t,i)}return this}function Ro(t,e,n){this.touch(t,n||No);const i=new _o(this,this._clock+(this._pulse?0:1)),r=t.pulse&&t.pulse.source||[];i.target=t;this._input[t.id]=e.pulse(i,r);return this}function Uo(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>{e.push(n);return qo(e,0,e.length-1,t)},pop:()=>{const n=e.pop();let i;if(e.length){i=e[0];e[0]=n;Io(e,0,t)}else{i=n}return i}}}function qo(t,e,n,i){let r,a;const o=t[n];while(n>e){a=n-1>>1;r=t[a];if(i(o,r)<0){t[n]=r;n=a;continue}break}return t[n]=o}function Io(t,e,n){const i=e,r=t.length,a=t[e];let o=(e<<1)+1,s;while(o<r){s=o+1;if(s<r&&n(t[o],t[s])>=0){o=s}t[e]=t[o];e=o;o=(e<<1)+1}t[e]=a;return qo(t,i,e,n)}function Lo(){this.logger((0,m.kg)());this.logLevel(m.jj);this._clock=0;this._rank=0;this._locale=ga();try{this._loader=_a()}catch(t){}this._touched=ba(m.id);this._input={};this._pulse=null;this._heap=Uo(((t,e)=>t.qrank-e.qrank));this._postrun=[]}function Po(t){return function(){return this._log[t].apply(this,arguments)}}Lo.prototype={stamp(){return this._clock},loader(t){if(arguments.length){this._loader=t;return this}else{return this._loader}},locale(t){if(arguments.length){this._locale=t;return this}else{return this._locale}},logger(t){if(arguments.length){this._log=t;return this}else{return this._log}},error:Po("error"),warn:Po("warn"),info:Po("info"),debug:Po("debug"),logLevel:Po("level"),cleanThreshold:1e4,add:Xa,connect:$a,rank:oo,rerank:so,pulse:Ro,touch:zo,update:Oo,changeset:za,ingest:Ka,parse:Ga,preload:Qa,request:Za,events:Va,on:no,evaluate:Ao,run:Do,runAsync:Eo,runAfter:Co,_enqueue:So,_getPulse:To};function jo(t,e){ja.call(this,t,null,e)}(0,m.XW)(jo,ja,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;if(this.skip()){this.skip(false)}else{e=this.evaluate(t)}e=e||t;if(e.then){e=e.then((t=>this.pulse=t))}else if(e!==t.StopPropagation){this.pulse=e}return e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);e.clear();return n},transform(){}});const Wo={};function Xo(t){const e=$o(t);return e&&e.Definition||null}function $o(t){t=t&&t.toLowerCase();return(0,m.nr)(Wo,t)?Wo[t]:null}function Ho(t,e){let n;if(e===undefined){for(const e of t){if(e!=null&&(n<e||n===undefined&&e>=e)){n=e}}}else{let i=-1;for(let r of t){if((r=e(r,++i,t))!=null&&(n<r||n===undefined&&r>=r)){n=r}}}return n}function Yo(t,e){let n;if(e===undefined){for(const e of t){if(e!=null&&(n>e||n===undefined&&e>=e)){n=e}}}else{let i=-1;for(let r of t){if((r=e(r,++i,t))!=null&&(n>r||n===undefined&&r>=r)){n=r}}}return n}function Jo(t,e,n=0,i=t.length-1,r=hn){while(i>n){if(i-n>600){const a=i-n+1;const o=e-n+1;const s=Math.log(a);const u=.5*Math.exp(2*s/3);const l=.5*Math.sqrt(s*u*(a-u)/a)*(o-a/2<0?-1:1);const c=Math.max(n,Math.floor(e-o*u/a+l));const f=Math.min(i,Math.floor(e+(a-o)*u/a+l));Jo(t,e,c,f,r)}const a=t[e];let o=n;let s=i;Vo(t,n,e);if(r(t[i],a)>0)Vo(t,n,i);while(o<s){Vo(t,o,s),++o,--s;while(r(t[o],a)<0)++o;while(r(t[s],a)>0)--s}if(r(t[n],a)===0)Vo(t,n,s);else++s,Vo(t,s,i);if(s<=e)n=s+1;if(e<=s)i=s-1}return t}function Vo(t,e,n){const i=t[e];t[e]=t[n];t[n]=i}function Go(t){return t===null?NaN:+t}function*Ko(t,e){if(e===undefined){for(let e of t){if(e!=null&&(e=+e)>=e){yield e}}}else{let n=-1;for(let i of t){if((i=e(i,++n,t))!=null&&(i=+i)>=i){yield i}}}}function Zo(t,e,n){t=Float64Array.from(Ko(t,n));if(!(i=t.length))return;if((e=+e)<=0||i<2)return Yo(t);if(e>=1)return Ho(t);var i,r=(i-1)*e,a=Math.floor(r),o=Ho(Jo(t,a).subarray(0,a+1)),s=Yo(t.subarray(a+1));return o+(s-o)*(r-a)}function Qo(t,e,n=Go){if(!(i=t.length))return;if((e=+e)<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,a=Math.floor(r),o=+n(t[a],a,t),s=+n(t[a+1],a+1,t);return o+(s-o)*(r-a)}function ts(t,e){let n=0;let i;let r=0;let a=0;if(e===undefined){for(let e of t){if(e!=null&&(e=+e)>=e){i=e-r;r+=i/++n;a+=i*(e-r)}}}else{let o=-1;for(let s of t){if((s=e(s,++o,t))!=null&&(s=+s)>=s){i=s-r;r+=i/++n;a+=i*(s-r)}}}if(n>1)return a/(n-1)}function es(t,e){const n=ts(t,e);return n?Math.sqrt(n):n}function ns(t,e){return Zo(t,.5,e)}function*is(t,e){if(e==null){for(let e of t){if(e!=null&&e!==""&&(e=+e)>=e){yield e}}}else{let n=-1;for(let i of t){i=e(i,++n,t);if(i!=null&&i!==""&&(i=+i)>=i){yield i}}}}function rs(t,e,n){const i=Float64Array.from(is(t,n));i.sort(hn);return e.map((t=>Qo(i,t)))}function as(t,e){return rs(t,[.25,.5,.75],e)}function os(t,e){const n=t.length,i=es(t,e),r=as(t,e),a=(r[2]-r[0])/1.34,o=Math.min(i,a)||i||Math.abs(r[0])||1;return 1.06*o*Math.pow(n,-.2)}function ss(t){const e=t.maxbins||20,n=t.base||10,i=Math.log(n),r=t.divide||[5,2];let a=t.extent[0],o=t.extent[1],s,u,l,c,f,h;const d=t.span||o-a||Math.abs(a)||1;if(t.step){s=t.step}else if(t.steps){c=d/e;for(f=0,h=t.steps.length;f<h&&t.steps[f]<c;++f);s=t.steps[Math.max(0,f-1)]}else{u=Math.ceil(Math.log(e)/i);l=t.minstep||0;s=Math.max(l,Math.pow(n,Math.round(Math.log(d)/i)-u));while(Math.ceil(d/s)>e){s*=n}for(f=0,h=r.length;f<h;++f){c=s/r[f];if(c>=l&&d/c<=e)s=c}}c=Math.log(s);const p=c>=0?0:~~(-c/i)+1,m=Math.pow(n,-p-1);if(t.nice||t.nice===undefined){c=Math.floor(a/s+m)*s;a=a<c?c-s:c;o=Math.ceil(o/s)*s}return{start:a,stop:o===a?a+s:o,step:s}}var us=Math.random;function ls(t){us=t}function cs(t,e,n,i){if(!t.length)return[undefined,undefined];const r=Float64Array.from(is(t,i)),a=r.length,o=e;let s,u,l,c;for(l=0,c=Array(o);l<o;++l){for(s=0,u=0;u<a;++u){s+=r[~~(us()*a)]}c[l]=s/a}c.sort(hn);return[Zo(c,n/2),Zo(c,1-n/2)]}function fs(t,e,n,i){i=i||(t=>t);const r=t.length,a=new Float64Array(r);let o=0,s=1,u=i(t[0]),l=u,c=u+e,f;for(;s<r;++s){f=i(t[s]);if(f>=c){l=(u+l)/2;for(;o<s;++o)a[o]=l;c=f+e;u=f}l=f}l=(u+l)/2;for(;o<s;++o)a[o]=l;return n?hs(a,e+e/4):a}function hs(t,e){const n=t.length;let i=0,r=1,a,o;while(t[i]===t[r])++r;while(r<n){a=r+1;while(t[r]===t[a])++a;if(t[r]-t[r-1]<e){o=r+(i+a-r-r>>1);while(o<r)t[o++]=t[r];while(o>r)t[o--]=t[i]}i=r;r=a}return t}function ds(t){return function(){t=(1103515245*t+12345)%2147483647;return t/2147483647}}function ps(t,e){if(e==null){e=t;t=0}let n,i,r;const a={min(t){if(arguments.length){n=t||0;r=i-n;return a}else{return n}},max(t){if(arguments.length){i=t||0;r=i-n;return a}else{return i}},sample(){return n+Math.floor(r*us())},pdf(t){return t===Math.floor(t)&&t>=n&&t<i?1/r:0},cdf(t){const e=Math.floor(t);return e<n?0:e>=i?1:(e-n+1)/r},icdf(t){return t>=0&&t<=1?n-1+Math.floor(t*r):NaN}};return a.min(t).max(e)}const ms=Math.sqrt(2*Math.PI);const gs=Math.SQRT2;let ys=NaN;function vs(t,e){t=t||0;e=e==null?1:e;let n=0,i=0,r,a;if(ys===ys){n=ys;ys=NaN}else{do{n=us()*2-1;i=us()*2-1;r=n*n+i*i}while(r===0||r>1);a=Math.sqrt(-2*Math.log(r)/r);n*=a;ys=i*a}return t+n*e}function xs(t,e,n){n=n==null?1:n;const i=(t-(e||0))/n;return Math.exp(-.5*i*i)/(n*ms)}function _s(t,e,n){e=e||0;n=n==null?1:n;const i=(t-e)/n,r=Math.abs(i);let a;if(r>37){a=0}else{const t=Math.exp(-r*r/2);let e;if(r<7.07106781186547){e=.0352624965998911*r+.700383064443688;e=e*r+6.37396220353165;e=e*r+33.912866078383;e=e*r+112.079291497871;e=e*r+221.213596169931;e=e*r+220.206867912376;a=t*e;e=.0883883476483184*r+1.75566716318264;e=e*r+16.064177579207;e=e*r+86.7807322029461;e=e*r+296.564248779674;e=e*r+637.333633378831;e=e*r+793.826512519948;e=e*r+440.413735824752;a=a/e}else{e=r+.65;e=r+4/e;e=r+3/e;e=r+2/e;e=r+1/e;a=t/e/2.506628274631}}return i>0?1-a:a}function bs(t,e,n){if(t<0||t>1)return NaN;return(e||0)+(n==null?1:n)*gs*ws(2*t-1)}function ws(t){let e=-Math.log((1-t)*(1+t)),n;if(e<6.25){e-=3.125;n=-364441206401782e-35;n=-16850591381820166e-35+n*e;n=128584807152564e-32+n*e;n=11157877678025181e-33+n*e;n=-1333171662854621e-31+n*e;n=20972767875968562e-33+n*e;n=6637638134358324e-30+n*e;n=-4054566272975207e-29+n*e;n=-8151934197605472e-29+n*e;n=26335093153082323e-28+n*e;n=-12975133253453532e-27+n*e;n=-5415412054294628e-26+n*e;n=1.0512122733215323e-9+n*e;n=-4.112633980346984e-9+n*e;n=-2.9070369957882005e-8+n*e;n=4.2347877827932404e-7+n*e;n=-13654692000834679e-22+n*e;n=-13882523362786469e-21+n*e;n=.00018673420803405714+n*e;n=-.000740702534166267+n*e;n=-.006033670871430149+n*e;n=.24015818242558962+n*e;n=1.6536545626831027+n*e}else if(e<16){e=Math.sqrt(e)-3.25;n=2.2137376921775787e-9;n=9.075656193888539e-8+n*e;n=-2.7517406297064545e-7+n*e;n=1.8239629214389228e-8+n*e;n=15027403968909828e-22+n*e;n=-4013867526981546e-21+n*e;n=29234449089955446e-22+n*e;n=12475304481671779e-21+n*e;n=-47318229009055734e-21+n*e;n=6828485145957318e-20+n*e;n=24031110387097894e-21+n*e;n=-.0003550375203628475+n*e;n=.0009532893797373805+n*e;n=-.0016882755560235047+n*e;n=.002491442096107851+n*e;n=-.003751208507569241+n*e;n=.005370914553590064+n*e;n=1.0052589676941592+n*e;n=3.0838856104922208+n*e}else if(Number.isFinite(e)){e=Math.sqrt(e)-5;n=-27109920616438573e-27;n=-2.555641816996525e-10+n*e;n=1.5076572693500548e-9+n*e;n=-3.789465440126737e-9+n*e;n=7.61570120807834e-9+n*e;n=-1.496002662714924e-8+n*e;n=2.914795345090108e-8+n*e;n=-6.771199775845234e-8+n*e;n=2.2900482228026655e-7+n*e;n=-9.9298272942317e-7+n*e;n=4526062597223154e-21+n*e;n=-1968177810553167e-20+n*e;n=7599527703001776e-20+n*e;n=-.00021503011930044477+n*e;n=-.00013871931833623122+n*e;n=1.0103004648645344+n*e;n=4.849906401408584+n*e}else{n=Infinity}return n*t}function ks(t,e){let n,i;const r={mean(t){if(arguments.length){n=t||0;return r}else{return n}},stdev(t){if(arguments.length){i=t==null?1:t;return r}else{return i}},sample:()=>vs(n,i),pdf:t=>xs(t,n,i),cdf:t=>_s(t,n,i),icdf:t=>bs(t,n,i)};return r.mean(t).stdev(e)}function Ms(t,e){const n=ks();let i=0;const r={data(n){if(arguments.length){t=n;i=n?n.length:0;return r.bandwidth(e)}else{return t}},bandwidth(n){if(!arguments.length)return e;e=n;if(!e&&t)e=os(t);return r},sample(){return t[~~(us()*i)]+e*n.sample()},pdf(r){let a=0,o=0;for(;o<i;++o){a+=n.pdf((r-t[o])/e)}return a/e/i},cdf(r){let a=0,o=0;for(;o<i;++o){a+=n.cdf((r-t[o])/e)}return a/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(t)}function As(t,e){t=t||0;e=e==null?1:e;return Math.exp(t+vs()*e)}function Es(t,e,n){if(t<=0)return 0;e=e||0;n=n==null?1:n;const i=(Math.log(t)-e)/n;return Math.exp(-.5*i*i)/(n*ms*t)}function Ds(t,e,n){return _s(Math.log(t),e,n)}function Cs(t,e,n){return Math.exp(bs(t,e,n))}function Fs(t,e){let n,i;const r={mean(t){if(arguments.length){n=t||0;return r}else{return n}},stdev(t){if(arguments.length){i=t==null?1:t;return r}else{return i}},sample:()=>As(n,i),pdf:t=>Es(t,n,i),cdf:t=>Ds(t,n,i),icdf:t=>Cs(t,n,i)};return r.mean(t).stdev(e)}function Ss(t,e){let n=0,i;function r(t){const e=[];let i=0,r;for(r=0;r<n;++r){i+=e[r]=t[r]==null?1:+t[r]}for(r=0;r<n;++r){e[r]/=i}return e}const a={weights(t){if(arguments.length){i=r(e=t||[]);return a}return e},distributions(i){if(arguments.length){if(i){n=i.length;t=i}else{n=0;t=[]}return a.weights(e)}return t},sample(){const e=us();let r=t[n-1],a=i[0],o=0;for(;o<n-1;a+=i[++o]){if(e<a){r=t[o];break}}return r.sample()},pdf(e){let r=0,a=0;for(;a<n;++a){r+=i[a]*t[a].pdf(e)}return r},cdf(e){let r=0,a=0;for(;a<n;++a){r+=i[a]*t[a].cdf(e)}return r},icdf(){throw Error("Mixture icdf not supported.")}};return a.distributions(t).weights(e)}function Ts(t,e){if(e==null){e=t==null?1:t;t=0}return t+(e-t)*us()}function Bs(t,e,n){if(n==null){n=e==null?1:e;e=0}return t>=e&&t<=n?1/(n-e):0}function Ns(t,e,n){if(n==null){n=e==null?1:e;e=0}return t<e?0:t>n?1:(t-e)/(n-e)}function zs(t,e,n){if(n==null){n=e==null?1:e;e=0}return t>=0&&t<=1?e+t*(n-e):NaN}function Os(t,e){let n,i;const r={min(t){if(arguments.length){n=t||0;return r}else{return n}},max(t){if(arguments.length){i=t==null?1:t;return r}else{return i}},sample:()=>Ts(n,i),pdf:t=>Bs(t,n,i),cdf:t=>Ns(t,n,i),icdf:t=>zs(t,n,i)};if(e==null){e=t==null?1:t;t=0}return r.min(t).max(e)}function Rs(t,e,n,i){const r=i-t*t,a=Math.abs(r)<1e-24?0:(n-t*e)/r,o=e-a*t;return[o,a]}function Us(t,e,n,i){t=t.filter((t=>{let i=e(t),r=n(t);return i!=null&&(i=+i)>=i&&r!=null&&(r=+r)>=r}));if(i){t.sort(((t,n)=>e(t)-e(n)))}const r=t.length,a=new Float64Array(r),o=new Float64Array(r);let s=0,u=0,l=0,c,f,h;for(h of t){a[s]=c=+e(h);o[s]=f=+n(h);++s;u+=(c-u)/s;l+=(f-l)/s}for(s=0;s<r;++s){a[s]-=u;o[s]-=l}return[a,o,u,l]}function qs(t,e,n,i){let r=-1,a,o;for(const s of t){a=e(s);o=n(s);if(a!=null&&(a=+a)>=a&&o!=null&&(o=+o)>=o){i(a,o,++r)}}}function Is(t,e,n,i,r){let a=0,o=0;qs(t,e,n,((t,e)=>{const n=e-r(t),s=e-i;a+=n*n;o+=s*s}));return 1-a/o}function Ls(t,e,n){let i=0,r=0,a=0,o=0,s=0;qs(t,e,n,((t,e)=>{++s;i+=(t-i)/s;r+=(e-r)/s;a+=(t*e-a)/s;o+=(t*t-o)/s}));const u=Rs(i,r,a,o),l=t=>u[0]+u[1]*t;return{coef:u,predict:l,rSquared:Is(t,e,n,r,l)}}function Ps(t,e,n){let i=0,r=0,a=0,o=0,s=0;qs(t,e,n,((t,e)=>{++s;t=Math.log(t);i+=(t-i)/s;r+=(e-r)/s;a+=(t*e-a)/s;o+=(t*t-o)/s}));const u=Rs(i,r,a,o),l=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:l,rSquared:Is(t,e,n,r,l)}}function js(t,e,n){const[i,r,a,o]=Us(t,e,n);let s=0,u=0,l=0,c=0,f=0,h,d,p;qs(t,e,n,((t,e)=>{h=i[f++];d=Math.log(e);p=h*e;s+=(e*d-s)/f;u+=(p-u)/f;l+=(p*d-l)/f;c+=(h*p-c)/f}));const[m,g]=Rs(u/o,s/o,l/o,c/o),y=t=>Math.exp(m+g*(t-a));return{coef:[Math.exp(m-g*a),g],predict:y,rSquared:Is(t,e,n,o,y)}}function Ws(t,e,n){let i=0,r=0,a=0,o=0,s=0,u=0;qs(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++u;i+=(n-i)/u;r+=(l-r)/u;a+=(n*l-a)/u;o+=(n*n-o)/u;s+=(e-s)/u}));const l=Rs(i,r,a,o),c=t=>l[0]*Math.pow(t,l[1]);l[0]=Math.exp(l[0]);return{coef:l,predict:c,rSquared:Is(t,e,n,s,c)}}function Xs(t,e,n){const[i,r,a,o]=Us(t,e,n),s=i.length;let u=0,l=0,c=0,f=0,h=0,d,p,m,g;for(d=0;d<s;){p=i[d];m=r[d++];g=p*p;u+=(g-u)/d;l+=(g*p-l)/d;c+=(g*g-c)/d;f+=(p*m-f)/d;h+=(g*m-h)/d}const y=c-u*u,v=u*y-l*l,x=(h*u-f*l)/v,_=(f*y-h*l)/v,b=-x*u,w=t=>{t=t-a;return x*t*t+_*t+b+o};return{coef:[b-_*a+x*a*a+o,_-2*x*a,x],predict:w,rSquared:Is(t,e,n,o,w)}}function $s(t,e,n,i){if(i===1)return Ls(t,e,n);if(i===2)return Xs(t,e,n);const[r,a,o,s]=Us(t,e,n),u=r.length,l=[],c=[],f=i+1;let h,d,p,m,g;for(h=0;h<f;++h){for(p=0,m=0;p<u;++p){m+=Math.pow(r[p],h)*a[p]}l.push(m);g=new Float64Array(f);for(d=0;d<f;++d){for(p=0,m=0;p<u;++p){m+=Math.pow(r[p],h+d)}g[d]=m}c.push(g)}c.push(l);const y=Ys(c),v=t=>{t-=o;let e=s+y[0]+y[1]*t+y[2]*t*t;for(h=3;h<f;++h)e+=y[h]*Math.pow(t,h);return e};return{coef:Hs(f,y,-o,s),predict:v,rSquared:Is(t,e,n,s,v)}}function Hs(t,e,n,i){const r=Array(t);let a,o,s,u;for(a=0;a<t;++a)r[a]=0;for(a=t-1;a>=0;--a){s=e[a];u=1;r[a]+=s;for(o=1;o<=a;++o){u*=(a+1-o)/o;r[a-o]+=s*Math.pow(n,o)*u}}r[0]+=i;return r}function Ys(t){const e=t.length-1,n=[];let i,r,a,o,s;for(i=0;i<e;++i){o=i;for(r=i+1;r<e;++r){if(Math.abs(t[i][r])>Math.abs(t[i][o])){o=r}}for(a=i;a<e+1;++a){s=t[a][i];t[a][i]=t[a][o];t[a][o]=s}for(r=i+1;r<e;++r){for(a=e;a>=i;a--){t[a][r]-=t[a][i]*t[i][r]/t[i][i]}}}for(r=e-1;r>=0;--r){s=0;for(a=r+1;a<e;++a){s+=t[a][r]*n[a]}n[r]=(t[e][r]-s)/t[r][r]}return n}const Js=2,Vs=1e-12;function Gs(t,e,n,i){const[r,a,o,s]=Us(t,e,n,true),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),h=new Float64Array(u).fill(1);for(let d=-1;++d<=Js;){const t=[0,l-1];for(let n=0;n<u;++n){const e=r[n],i=t[0],o=t[1],s=e-r[i]>r[o]-e?i:o;let u=0,l=0,d=0,p=0,m=0;const g=1/Math.abs(r[s]-e||1);for(let t=i;t<=o;++t){const n=r[t],i=a[t],o=Ks(Math.abs(e-n)*g)*h[t],s=n*o;u+=o;l+=s;d+=i*o;p+=i*s;m+=n*s}const[y,v]=Rs(l/u,d/u,p/u,m/u);c[n]=y+v*e;f[n]=Math.abs(a[n]-c[n]);Zs(r,n+1,t)}if(d===Js){break}const e=ns(f);if(Math.abs(e)<Vs)break;for(let n=0,i,r;n<u;++n){i=f[n]/(6*e);h[n]=i>=1?Vs:(r=1-i*i)*r}}return Qs(r,c,o,s)}function Ks(t){return(t=1-t*t*t)*t*t}function Zs(t,e,n){const i=t[e];let r=n[0],a=n[1]+1;if(a>=t.length)return;while(e>r&&t[a]-i<=i-t[r]){n[0]=++r;n[1]=a;++a}}function Qs(t,e,n,i){const r=t.length,a=[];let o=0,s=0,u=[],l;for(;o<r;++o){l=t[o]+n;if(u[0]===l){u[1]+=(e[o]-u[1])/++s}else{s=0;u[1]+=i;u=[l,e[o]];a.push(u)}}u[1]+=i;return a}const tu=.1*Math.PI/180;function eu(t,e,n,i){n=n||25;i=Math.max(n,i||200);const r=e=>[e,t(e)],a=e[0],o=e[1],s=o-a,u=s/i,l=[r(a)],c=[];if(n===i){for(let t=1;t<i;++t){l.push(r(a+t/n*s))}l.push(r(o));return l}else{c.push(r(o));for(let t=n;--t>0;){c.push(r(a+t/n*s))}}let f=l[0],h=c[c.length-1];while(h){const t=r((f[0]+h[0])/2);if(t[0]-f[0]>=u&&nu(f,t,h)>tu){c.push(t)}else{f=h;l.push(h);c.pop()}h=c[c.length-1]}return l}function nu(t,e,n){const i=Math.atan2(n[1]-t[1],n[0]-t[0]),r=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(i-r)}function iu(t,e){let n=0;let i=0;if(e===undefined){for(let e of t){if(e!=null&&(e=+e)>=e){++n,i+=e}}}else{let r=-1;for(let a of t){if((a=e(a,++r,t))!=null&&(a=+a)>=a){++n,i+=a}}}if(n)return i/n}function ru(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(r);while(++i<r){a[i]=t+i*n}return a}function au(t){return e=>{const n=t.length;let i=1,r=String(t[0](e));for(;i<n;++i){r+="|"+t[i](e)}return r}}function ou(t){return!t||!t.length?function(){return""}:t.length===1?t[0]:au(t)}function su(t,e,n){return n||t+(!e?"":"_"+e)}const uu=()=>{};const lu={init:uu,add:uu,rem:uu,idx:0};const cu={values:{init:t=>t.cell.store=true,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:undefined,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:undefined,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:undefined,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):undefined,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:undefined,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):undefined,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):undefined,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):undefined,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=undefined,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{if(e<t.min||t.min===undefined)t.min=e},rem:(t,e)=>{if(e<=t.min)t.min=NaN},req:["values"],idx:4},max:{init:t=>t.max=undefined,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{if(e>t.max||t.max===undefined)t.max=e},rem:(t,e)=>{if(e>=t.max)t.max=NaN},req:["values"],idx:4},argmin:{init:t=>t.argmin=undefined,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{if(e<t.min)t.argmin=n},rem:(t,e)=>{if(e<=t.min)t.argmin=undefined},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=undefined,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{if(e>t.max)t.argmax=n},rem:(t,e)=>{if(e>=t.max)t.argmax=undefined},req:["max","values"],idx:3}};const fu=Object.keys(cu);function hu(t,e){return n=>(0,m.l7)({name:t,out:n||t},lu,e)}fu.forEach((t=>{cu[t]=hu(t,cu[t])}));function du(t,e){return cu[t](e)}function pu(t,e){return t.idx-e.idx}function mu(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{if(!t.req)return;t.req.forEach((t=>{if(!e[t])n(e[t]=cu[t]())}))};t.forEach(n);return Object.values(e).sort(pu)}function gu(){this.valid=0;this.missing=0;this._ops.forEach((t=>t.init(this)))}function yu(t,e){if(t==null||t===""){++this.missing;return}if(t!==t)return;++this.valid;this._ops.forEach((n=>n.add(this,t,e)))}function vu(t,e){if(t==null||t===""){--this.missing;return}if(t!==t)return;--this.valid;this._ops.forEach((n=>n.rem(this,t,e)))}function xu(t){this._out.forEach((e=>t[e.out]=e.value(this)));return t}function _u(t,e){const n=e||m.yR,i=mu(t),r=t.slice().sort(pu);function a(t){this._ops=i;this._out=r;this.cell=t;this.init()}a.prototype.init=gu;a.prototype.add=yu;a.prototype.rem=vu;a.prototype.set=xu;a.prototype.get=n;a.fields=t.map((t=>t.out));return a}function bu(t){this._key=t?(0,m.EP)(t):Ea;this.reset()}const wu=bu.prototype;wu.reset=function(){this._add=[];this._rem=[];this._ext=null;this._get=null;this._q=null};wu.add=function(t){this._add.push(t)};wu.rem=function(t){this._rem.push(t)};wu.values=function(){this._get=null;if(this._rem.length===0)return this._add;const t=this._add,e=this._rem,n=this._key,i=t.length,r=e.length,a=Array(i-r),o={};let s,u,l;for(s=0;s<r;++s){o[n(e[s])]=1}for(s=0,u=0;s<i;++s){if(o[n(l=t[s])]){o[n(l)]=0}else{a[u++]=l}}this._rem=[];return this._add=a};wu.distinct=function(t){const e=this.values(),n={};let i=e.length,r=0,a;while(--i>=0){a=t(e[i])+"";if(!(0,m.nr)(n,a)){n[a]=1;++r}}return r};wu.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=(0,m.dI)(e,t);this._ext=[e[n[0]],e[n[1]]];this._get=t}return this._ext};wu.argmin=function(t){return this.extent(t)[0]||{}};wu.argmax=function(t){return this.extent(t)[1]||{}};wu.min=function(t){const e=this.extent(t)[0];return e!=null?t(e):undefined};wu.max=function(t){const e=this.extent(t)[1];return e!=null?t(e):undefined};wu.quartile=function(t){if(this._get!==t||!this._q){this._q=as(this.values(),t);this._get=t}return this._q};wu.q1=function(t){return this.quartile(t)[0]};wu.q2=function(t){return this.quartile(t)[1]};wu.q3=function(t){return this.quartile(t)[2]};wu.ci=function(t){if(this._get!==t||!this._ci){this._ci=cs(this.values(),1e3,.05,t);this._get=t}return this._ci};wu.ci0=function(t){return this.ci(t)[0]};wu.ci1=function(t){return this.ci(t)[1]};function ku(t){jo.call(this,null,t);this._adds=[];this._mods=[];this._alen=0;this._mlen=0;this._drop=true;this._cross=false;this._dims=[];this._dnames=[];this._measures=[];this._countOnly=false;this._counts=null;this._prev=null;this._inputs=null;this._outputs=null}ku.Definition={type:"Aggregate",metadata:{generates:true,changes:true},params:[{name:"groupby",type:"field",array:true},{name:"ops",type:"enum",array:true,values:fu},{name:"fields",type:"field",null:true,array:true},{name:"as",type:"string",null:true,array:true},{name:"drop",type:"boolean",default:true},{name:"cross",type:"boolean",default:false},{name:"key",type:"field"}]};(0,m.XW)(ku,jo,{transform(t,e){const n=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.modified();n.stamp=i.stamp;if(n.value&&(r||e.modified(n._inputs,true))){n._prev=n.value;n.value=r?n.init(t):{};e.visit(e.SOURCE,(t=>n.add(t)))}else{n.value=n.value||n.init(t);e.visit(e.REM,(t=>n.rem(t)));e.visit(e.ADD,(t=>n.add(t)))}i.modifies(n._outputs);n._drop=t.drop!==false;if(t.cross&&n._dims.length>1){n._drop=false;n.cross()}if(e.clean()&&n._drop){i.clean(true).runAfter((()=>this.clean()))}return n.changes(i)},cross(){const t=this,e=t.value,n=t._dnames,i=n.map((()=>({}))),r=n.length;function a(t){let e,a,o,s;for(e in t){o=t[e].tuple;for(a=0;a<r;++a){i[a][s=o[n[a]]]=s}}}a(t._prev);a(e);function o(a,s,u){const l=n[u],c=i[u++];for(const n in c){const i=a?a+"|"+n:n;s[l]=c[n];if(u<r)o(i,s,u);else if(!e[i])t.cell(i,s)}}o("",{},0)},init(t){const e=this._inputs=[],n=this._outputs=[],i={};function r(t){const n=(0,m.IX)((0,m.Oj)(t)),r=n.length;let a=0,o;for(;a<r;++a){if(!i[o=n[a]]){i[o]=1;e.push(o)}}}this._dims=(0,m.IX)(t.groupby);this._dnames=this._dims.map((t=>{const e=(0,m.el)(t);r(t);n.push(e);return e}));this.cellkey=t.key?t.key:ou(this._dims);this._countOnly=true;this._counts=[];this._measures=[];const a=t.fields||[null],o=t.ops||["count"],s=t.as||[],u=a.length,l={};let c,f,h,d,p,g;if(u!==o.length){(0,m.vU)("Unmatched number of fields and aggregate ops.")}for(g=0;g<u;++g){c=a[g];f=o[g];if(c==null&&f!=="count"){(0,m.vU)("Null aggregate field specified.")}d=(0,m.el)(c);p=su(f,d,s[g]);n.push(p);if(f==="count"){this._counts.push(p);continue}h=l[d];if(!h){r(c);h=l[d]=[];h.field=c;this._measures.push(h)}if(f!=="count")this._countOnly=false;h.push(du(f,p))}this._measures=this._measures.map((t=>_u(t,t.field)));return{}},cellkey:ou(),cell(t,e){let n=this.value[t];if(!n){n=this.value[t]=this.newcell(t,e);this._adds[this._alen++]=n}else if(n.num===0&&this._drop&&n.stamp<this.stamp){n.stamp=this.stamp;this._adds[this._alen++]=n}else if(n.stamp<this.stamp){n.stamp=this.stamp;this._mods[this._mlen++]=n}return n},newcell(t,e){const n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:false};if(!this._countOnly){const t=this._measures,e=t.length;n.agg=Array(e);for(let i=0;i<e;++i){n.agg[i]=new t[i](n)}}if(n.store){n.data=new bu}return n},newtuple(t,e){const n=this._dnames,i=this._dims,r=i.length,a={};for(let o=0;o<r;++o){a[n[o]]=i[o](t)}return e?Ta(e.tuple,a):Ca(a)},clean(){const t=this.value;for(const e in t){if(t[e].num===0){delete t[e]}}},add(t){const e=this.cellkey(t),n=this.cell(e,t);n.num+=1;if(this._countOnly)return;if(n.store)n.data.add(t);const i=n.agg;for(let r=0,a=i.length;r<a;++r){i[r].add(i[r].get(t),t)}},rem(t){const e=this.cellkey(t),n=this.cell(e,t);n.num-=1;if(this._countOnly)return;if(n.store)n.data.rem(t);const i=n.agg;for(let r=0,a=i.length;r<a;++r){i[r].rem(i[r].get(t),t)}},celltuple(t){const e=t.tuple,n=this._counts;if(t.store){t.data.values()}for(let i=0,r=n.length;i<r;++i){e[n[i]]=t.num}if(!this._countOnly){const n=t.agg;for(let t=0,i=n.length;t<i;++t){n[t].set(e)}}return e},changes(t){const e=this._adds,n=this._mods,i=this._prev,r=this._drop,a=t.add,o=t.rem,s=t.mod;let u,l,c,f;if(i)for(l in i){u=i[l];if(!r||u.num)o.push(u.tuple)}for(c=0,f=this._alen;c<f;++c){a.push(this.celltuple(e[c]));e[c]=null}for(c=0,f=this._mlen;c<f;++c){u=n[c];(u.num===0&&r?o:s).push(this.celltuple(u));n[c]=null}this._alen=this._mlen=0;this._prev=null;return t}});const Mu=1e-14;function Au(t){jo.call(this,null,t)}Au.Definition={type:"Bin",metadata:{modifies:true},params:[{name:"field",type:"field",required:true},{name:"interval",type:"boolean",default:true},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:true,default:[5,2]},{name:"extent",type:"number",array:true,length:2,required:true},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:true},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:true},{name:"name",type:"string"},{name:"as",type:"string",array:true,length:2,default:["bin0","bin1"]}]};(0,m.XW)(Au,jo,{transform(t,e){const n=t.interval!==false,i=this._bins(t),r=i.start,a=i.step,o=t.as||["bin0","bin1"],s=o[0],u=o[1];let l;if(t.modified()){e=e.reflow(true);l=e.SOURCE}else{l=e.modified((0,m.Oj)(t.field))?e.ADD_MOD:e.ADD}e.visit(l,n?t=>{const e=i(t);t[s]=e;t[u]=e==null?null:r+a*(1+(e-r)/a)}:t=>t[s]=i(t));return e.modifies(n?o:s)},_bins(t){if(this.value&&!t.modified()){return this.value}const e=t.field,n=ss(t),i=n.step;let r=n.start,a=r+Math.ceil((n.stop-r)/i)*i,o,s;if((o=t.anchor)!=null){s=o-(r+i*Math.floor((o-r)/i));r+=s;a+=s}const u=function(t){let n=(0,m.He)(e(t));return n==null?null:n<r?-Infinity:n>a?+Infinity:(n=Math.max(r,Math.min(n,a-i)),r+i*Math.floor(Mu+(n-r)/i))};u.start=r;u.stop=n.stop;u.step=i;return this.value=(0,m.ZE)(u,(0,m.Oj)(e),t.name||"bin_"+(0,m.el)(e))}});function Eu(t,e,n){const i=t;let r=e||[],a=n||[],o={},s=0;return{add:t=>a.push(t),remove:t=>o[i(t)]=++s,size:()=>r.length,data:(t,e)=>{if(s){r=r.filter((t=>!o[i(t)]));o={};s=0}if(e&&t){r.sort(t)}if(a.length){r=t?(0,m.TS)(t,r,a.sort(t)):r.concat(a);a=[]}return r}}}function Du(t){jo.call(this,[],t)}Du.Definition={type:"Collect",metadata:{source:true},params:[{name:"sort",type:"compare"}]};(0,m.XW)(Du,jo,{transform(t,e){const n=e.fork(e.ALL),i=Eu(Ea,this.value,n.materialize(n.ADD).add),r=t.sort,a=e.changed()||r&&(t.modified("sort")||e.modified(r.fields));n.visit(n.REM,i.remove);this.modified(a);this.value=n.source=i.data(Ba(r),a);if(e.source&&e.source.root){this.value.root=e.source.root}return n}});function Cu(t){ja.call(this,null,Fu,t)}(0,m.XW)(Cu,ja);function Fu(t){return this.value&&!t.modified()?this.value:(0,m.qu)(t.fields,t.orders)}function Su(t){jo.call(this,null,t)}Su.Definition={type:"CountPattern",metadata:{generates:true,changes:true},params:[{name:"field",type:"field",required:true},{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:true,length:2,default:["text","count"]}]};function Tu(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break}return t.match(n)}(0,m.XW)(Su,jo,{transform(t,e){const n=e=>n=>{var i=Tu(s(n),t.case,a)||[],r;for(var u=0,l=i.length;u<l;++u){if(!o.test(r=i[u]))e(r)}};const i=this._parameterCheck(t,e),r=this._counts,a=this._match,o=this._stop,s=t.field,u=t.as||["text","count"],l=n((t=>r[t]=1+(r[t]||0))),c=n((t=>r[t]-=1));if(i){e.visit(e.SOURCE,l)}else{e.visit(e.ADD,l);e.visit(e.REM,c)}return this._finish(e,u)},_parameterCheck(t,e){let n=false;if(t.modified("stopwords")||!this._stop){this._stop=new RegExp("^"+(t.stopwords||"")+"$","i");n=true}if(t.modified("pattern")||!this._match){this._match=new RegExp(t.pattern||"[\\w']+","g");n=true}if(t.modified("field")||e.modified(t.field.fields)){n=true}if(n)this._counts={};return n},_finish(t,e){const n=this._counts,i=this._tuples||(this._tuples={}),r=e[0],a=e[1],o=t.fork(t.NO_SOURCE|t.NO_FIELDS);let s,u,l;for(s in n){u=i[s];l=n[s]||0;if(!u&&l){i[s]=u=Ca({});u[r]=s;u[a]=l;o.add.push(u)}else if(l===0){if(u)o.rem.push(u);n[s]=null;i[s]=null}else if(u[a]!==l){u[a]=l;o.mod.push(u)}}return o.modifies(e)}});function Bu(t){jo.call(this,null,t)}Bu.Definition={type:"Cross",metadata:{generates:true},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:true,length:2,default:["a","b"]}]};(0,m.XW)(Bu,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.as||["a","b"],r=i[0],a=i[1],o=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let s=this.value;if(o){if(s)n.rem=s;s=e.materialize(e.SOURCE).source;n.add=this.value=Nu(s,r,a,t.filter||m.yb)}else{n.mod=s}n.source=this.value;return n.modifies(i)}});function Nu(t,e,n,i){var r=[],a={},o=t.length,s=0,u,l;for(;s<o;++s){a[e]=l=t[s];for(u=0;u<o;++u){a[n]=t[u];if(i(a)){r.push(Ca(a));a={};a[e]=l}}}return r}const zu={kde:Ms,mixture:Ss,normal:ks,lognormal:Fs,uniform:Os};const Ou="distributions",Ru="function",Uu="field";function qu(t,e){const n=t[Ru];if(!(0,m.nr)(zu,n)){(0,m.vU)("Unknown distribution function: "+n)}const i=zu[n]();for(const r in t){if(r===Uu){i.data((t.from||e()).map(t[r]))}else if(r===Ou){i[r](t[r].map((t=>qu(t,e))))}else if(typeof i[r]===Ru){i[r](t[r])}}return i}function Iu(t){jo.call(this,null,t)}const Lu=[{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:true},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}];const Pu={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:true,params:Lu},{name:"weights",type:"number",array:true}]};Iu.Definition={type:"Density",metadata:{generates:true},params:[{name:"extent",type:"number",array:true,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:Lu.concat(Pu)},{name:"as",type:"string",array:true,default:["value","density"]}]};(0,m.XW)(Iu,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=qu(t.distribution,ju(e)),r=t.steps||t.minsteps||25,a=t.steps||t.maxsteps||200;let o=t.method||"pdf";if(o!=="pdf"&&o!=="cdf"){(0,m.vU)("Invalid density method: "+o)}if(!t.extent&&!i.data){(0,m.vU)("Missing density extent parameter.")}o=i[o];const s=t.as||["value","density"],u=t.extent||(0,m.We)(i.data()),l=eu(o,u,r,a).map((t=>{const e={};e[s[0]]=t[0];e[s[1]]=t[1];return Ca(e)}));if(this.value)n.rem=this.value;this.value=n.add=n.source=l}return n}});function ju(t){return()=>t.materialize(t.SOURCE).source}function Wu(t,e){if(!t)return null;return t.map(((t,n)=>e[n]||(0,m.el)(t)))}function Xu(t,e,n){const i=[],r=t=>t(u);let a,o,s,u,l,c;if(e==null){i.push(t.map(n))}else{for(a={},o=0,s=t.length;o<s;++o){u=t[o];l=e.map(r);c=a[l];if(!c){a[l]=c=[];c.dims=l;i.push(c)}c.push(n(u))}}return i}const $u="bin";function Hu(t){jo.call(this,null,t)}Hu.Definition={type:"DotBin",metadata:{modifies:true},params:[{name:"field",type:"field",required:true},{name:"groupby",type:"field",array:true},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:false},{name:"as",type:"string",default:$u}]};const Yu=(t,e)=>(0,m.yP)((0,m.We)(t,e))/30;(0,m.XW)(Hu,jo,{transform(t,e){if(this.value&&!(t.modified()||e.changed())){return e}const n=e.materialize(e.SOURCE).source,i=Xu(e.source,t.groupby,m.yR),r=t.smooth||false,a=t.field,o=t.step||Yu(n,a),s=Ba(((t,e)=>a(t)-a(e))),u=t.as||$u,l=i.length;let c=Infinity,f=-Infinity,h=0,d;for(;h<l;++h){const t=i[h].sort(s);d=-1;for(const e of fs(t,o,r,a)){if(e<c)c=e;if(e>f)f=e;t[++d][u]=e}}this.value={start:c,stop:f,step:o};return e.reflow(true).modifies(u)}});function Ju(t){ja.call(this,null,Vu,t);this.modified(true)}(0,m.XW)(Ju,ja);function Vu(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:(0,m.ZE)((n=>e(n,t)),(0,m.Oj)(e),(0,m.el)(e))}function Gu(t){jo.call(this,[undefined,undefined],t)}Gu.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:true}]};(0,m.XW)(Gu,jo,{transform(t,e){const n=this.value,i=t.field,r=e.changed()||e.modified(i.fields)||t.modified("field");let a=n[0],o=n[1];if(r||a==null){a=+Infinity;o=-Infinity}e.visit(r?e.SOURCE:e.ADD,(t=>{const e=(0,m.He)(i(t));if(e!=null){if(e<a)a=e;if(e>o)o=e}}));if(!Number.isFinite(a)||!Number.isFinite(o)){let t=(0,m.el)(i);if(t)t=' for field "'.concat(t,'"');e.dataflow.warn("Infinite extent".concat(t,": [").concat(a,", ").concat(o,"]"));a=o=undefined}this.value=[a,o]}});function Ku(t,e){ja.call(this,t);this.parent=e;this.count=0}(0,m.XW)(Ku,ja,{connect(t){this.detachSubflow=t.detachSubflow;this.targets().add(t);return t.source=this},add(t){this.count+=1;this.value.add.push(t)},rem(t){this.count-=1;this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}});function Zu(t){jo.call(this,{},t);this._keys=(0,m.Xr)();const e=this._targets=[];e.active=0;e.forEach=t=>{for(let n=0,i=e.active;n<i;++n){t(e[n],n,e)}}}(0,m.XW)(Zu,jo,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,i){const r=this.value;let a=(0,m.nr)(r,t)&&r[t],o,s;if(!a){s=i||(s=this._group[t])&&s.tuple;o=n.dataflow;a=new Ku(n.fork(n.NO_SOURCE),this);o.add(a).connect(e(o,t,s));r[t]=a;this.activate(a)}else if(a.value.stamp<n.stamp){a.init(n);this.activate(a)}return a},clean(){const t=this.value;for(const e in t){if(t[e].count===0){const n=t[e].detachSubflow;if(n)n();delete t[e]}}},initTargets(){const t=this._targets,e=t.length;for(let n=0;n<e&&t[n]!=null;++n){t[n]=null}t.active=0},transform(t,e){const n=e.dataflow,i=t.key,r=t.subflow,a=this._keys,o=t.modified("key"),s=t=>this.subflow(t,r,e);this._group=t.group||{};this.initTargets();e.visit(e.REM,(t=>{const e=Ea(t),n=a.get(e);if(n!==undefined){a.delete(e);s(n).rem(t)}}));e.visit(e.ADD,(t=>{const e=i(t);a.set(Ea(t),e);s(e).add(t)}));if(o||e.modified(i.fields)){e.visit(e.MOD,(t=>{const e=Ea(t),n=a.get(e),r=i(t);if(n===r){s(r).mod(t)}else{a.set(e,r);s(n).rem(t);s(r).add(t)}}))}else if(e.changed(e.MOD)){e.visit(e.MOD,(t=>{s(a.get(Ea(t))).mod(t)}))}if(o){e.visit(e.REFLOW,(t=>{const e=Ea(t),n=a.get(e),r=i(t);if(n!==r){a.set(e,r);s(n).rem(t);s(r).add(t)}}))}if(e.clean()){n.runAfter((()=>{this.clean();a.clean()}))}else if(a.empty>n.cleanThreshold){n.runAfter(a.clean)}return e}});function Qu(t){ja.call(this,null,tl,t)}(0,m.XW)(Qu,ja);function tl(t){return this.value&&!t.modified()?this.value:(0,m.kJ)(t.name)?(0,m.IX)(t.name).map((t=>(0,m.EP)(t))):(0,m.EP)(t.name,t.as)}function el(t){jo.call(this,(0,m.Xr)(),t)}el.Definition={type:"Filter",metadata:{changes:true},params:[{name:"expr",type:"expr",required:true}]};(0,m.XW)(el,jo,{transform(t,e){const n=e.dataflow,i=this.value,r=e.fork(),a=r.add,o=r.rem,s=r.mod,u=t.expr;let l=true;e.visit(e.REM,(t=>{const e=Ea(t);if(!i.has(e))o.push(t);else i.delete(e)}));e.visit(e.ADD,(e=>{if(u(e,t))a.push(e);else i.set(Ea(e),1)}));function c(e){const n=Ea(e),r=u(e,t),c=i.get(n);if(r&&c){i.delete(n);a.push(e)}else if(!r&&!c){i.set(n,1);o.push(e)}else if(l&&r&&!c){s.push(e)}}e.visit(e.MOD,c);if(t.modified()){l=false;e.visit(e.REFLOW,c)}if(i.empty>n.cleanThreshold)n.runAfter(i.clean);return r}});function nl(t){jo.call(this,[],t)}nl.Definition={type:"Flatten",metadata:{generates:true},params:[{name:"fields",type:"field",array:true,required:true},{name:"index",type:"string"},{name:"as",type:"string",array:true}]};(0,m.XW)(nl,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=Wu(i,t.as||[]),a=t.index||null,o=r.length;n.rem=this.value;e.visit(e.SOURCE,(t=>{const e=i.map((e=>e(t))),s=e.reduce(((t,e)=>Math.max(t,e.length)),0);let u=0,l,c,f;for(;u<s;++u){c=Fa(t);for(l=0;l<o;++l){c[r[l]]=(f=e[l][u])==null?null:f}if(a){c[a]=u}n.add.push(c)}}));this.value=n.source=n.add;if(a)n.modifies(a);return n.modifies(r)}});function il(t){jo.call(this,[],t)}il.Definition={type:"Fold",metadata:{generates:true},params:[{name:"fields",type:"field",array:true,required:true},{name:"as",type:"string",array:true,length:2,default:["key","value"]}]};(0,m.XW)(il,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=i.map(m.el),a=t.as||["key","value"],o=a[0],s=a[1],u=i.length;n.rem=this.value;e.visit(e.SOURCE,(t=>{for(let e=0,a;e<u;++e){a=Fa(t);a[o]=r[e];a[s]=i[e](t);n.add.push(a)}}));this.value=n.source=n.add;return n.modifies(a)}});function rl(t){jo.call(this,null,t)}rl.Definition={type:"Formula",metadata:{modifies:true},params:[{name:"expr",type:"expr",required:true},{name:"as",type:"string",required:true},{name:"initonly",type:"boolean"}]};(0,m.XW)(rl,jo,{transform(t,e){const n=t.expr,i=t.as,r=t.modified(),a=t.initonly?e.ADD:r?e.SOURCE:e.modified(n.fields)||e.modified(i)?e.ADD_MOD:e.ADD;if(r){e=e.materialize().reflow(true)}if(!t.initonly){e.modifies(i)}return e.visit(a,(e=>e[i]=n(e,t)))}});function al(t){jo.call(this,[],t)}(0,m.XW)(al,jo,{transform(t,e){const n=e.fork(e.ALL),i=t.generator;let r=this.value,a=t.size-r.length,o,s,u;if(a>0){for(o=[];--a>=0;){o.push(u=Ca(i(t)));r.push(u)}n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else{s=r.slice(0,-a);n.rem=n.rem.length?n.materialize(n.REM).rem.concat(s):s;r=r.slice(-a)}n.source=this.value=r;return n}});const ol={value:"value",median:ns,mean:iu,min:Yo,max:Ho};const sl=[];function ul(t){jo.call(this,[],t)}ul.Definition={type:"Impute",metadata:{changes:true},params:[{name:"field",type:"field",required:true},{name:"key",type:"field",required:true},{name:"keyvals",array:true},{name:"groupby",type:"field",array:true},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function ll(t){var e=t.method||ol.value,n;if(ol[e]==null){(0,m.vU)("Unrecognized imputation method: "+e)}else if(e===ol.value){n=t.value!==undefined?t.value:0;return()=>n}else{return ol[e]}}function cl(t){const e=t.field;return t=>t?e(t):NaN}(0,m.XW)(ul,jo,{transform(t,e){var n=e.fork(e.ALL),i=ll(t),r=cl(t),a=(0,m.el)(t.field),o=(0,m.el)(t.key),s=(t.groupby||[]).map(m.el),u=fl(e.source,t.groupby,t.key,t.keyvals),l=[],c=this.value,f=u.domain.length,h,d,p,g,y,v,x,_,b,w;for(y=0,_=u.length;y<_;++y){h=u[y];p=h.values;d=NaN;for(x=0;x<f;++x){if(h[x]!=null)continue;g=u.domain[x];w={_impute:true};for(v=0,b=p.length;v<b;++v)w[s[v]]=p[v];w[o]=g;w[a]=Number.isNaN(d)?d=i(h,r):d;l.push(Ca(w))}}if(l.length)n.add=n.materialize(n.ADD).add.concat(l);if(c.length)n.rem=n.materialize(n.REM).rem.concat(c);this.value=l;return n}});function fl(t,e,n,i){var r=t=>t(g),a=[],o=i?i.slice():[],s={},u={},l,c,f,h,d,p,m,g;o.forEach(((t,e)=>s[t]=e+1));for(h=0,m=t.length;h<m;++h){g=t[h];p=n(g);d=s[p]||(s[p]=o.push(p));c=(l=e?e.map(r):sl)+"";if(!(f=u[c])){f=u[c]=[];a.push(f);f.values=l}f[d-1]=g}a.domain=o;return a}function hl(t){ku.call(this,t)}hl.Definition={type:"JoinAggregate",metadata:{modifies:true},params:[{name:"groupby",type:"field",array:true},{name:"fields",type:"field",null:true,array:true},{name:"ops",type:"enum",array:true,values:fu},{name:"as",type:"string",null:true,array:true},{name:"key",type:"field"}]};(0,m.XW)(hl,ku,{transform(t,e){const n=this,i=t.modified();let r;if(n.value&&(i||e.modified(n._inputs,true))){r=n.value=i?n.init(t):{};e.visit(e.SOURCE,(t=>n.add(t)))}else{r=n.value=n.value||this.init(t);e.visit(e.REM,(t=>n.rem(t)));e.visit(e.ADD,(t=>n.add(t)))}n.changes();e.visit(e.SOURCE,(t=>{(0,m.l7)(t,r[n.cellkey(t)].tuple)}));return e.reflow(i).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n){this.celltuple(t[n]);t[n]=null}for(n=0,i=this._mlen;n<i;++n){this.celltuple(e[n]);e[n]=null}this._alen=this._mlen=0}});function dl(t){jo.call(this,null,t)}dl.Definition={type:"KDE",metadata:{generates:true},params:[{name:"groupby",type:"field",array:true},{name:"field",type:"field",required:true},{name:"cumulative",type:"boolean",default:false},{name:"counts",type:"boolean",default:false},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:true,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:true,default:["value","density"]}]};(0,m.XW)(dl,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=e.materialize(e.SOURCE).source,r=Xu(i,t.groupby,t.field),a=(t.groupby||[]).map(m.el),o=t.bandwidth,s=t.cumulative?"cdf":"pdf",u=t.as||["value","density"],l=[];let c=t.extent,f=t.steps||t.minsteps||25,h=t.steps||t.maxsteps||200;if(s!=="pdf"&&s!=="cdf"){(0,m.vU)("Invalid density method: "+s)}if(t.resolve==="shared"){if(!c)c=(0,m.We)(i,t.field);f=h=t.steps||h}r.forEach((e=>{const n=Ms(e,o)[s],i=t.counts?e.length:1,r=c||(0,m.We)(e);eu(n,r,f,h).forEach((t=>{const n={};for(let i=0;i<a.length;++i){n[a[i]]=e.dims[i]}n[u[0]]=t[0];n[u[1]]=t[1]*i;l.push(Ca(n))}))}));if(this.value)n.rem=this.value;this.value=n.add=n.source=l}return n}});function pl(t){ja.call(this,null,ml,t)}(0,m.XW)(pl,ja);function ml(t){return this.value&&!t.modified()?this.value:(0,m.Jy)(t.fields,t.flat)}function gl(t){jo.call(this,[],t);this._pending=null}(0,m.XW)(gl,jo,{transform(t,e){const n=e.dataflow;if(this._pending){return vl(this,e,this._pending)}if(yl(t))return e.StopPropagation;if(t.values){return vl(this,e,n.parse(t.values,t.format))}else if(t.async){const e=n.request(t.url,t.format).then((t=>{this._pending=(0,m.IX)(t.data);return t=>t.touch(this)}));return{async:e}}else{return n.request(t.url,t.format).then((t=>vl(this,e,(0,m.IX)(t.data))))}}});function yl(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}function vl(t,e,n){n.forEach(Ca);const i=e.fork(e.NO_FIELDS&e.NO_SOURCE);i.rem=t.value;t.value=i.source=i.add=n;t._pending=null;if(i.rem.length)i.clean(true);return i}function xl(t){jo.call(this,{},t)}xl.Definition={type:"Lookup",metadata:{modifies:true},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:true},{name:"key",type:"field",required:true}]},{name:"values",type:"field",array:true},{name:"fields",type:"field",array:true,required:true},{name:"as",type:"string",array:true},{name:"default",default:null}]};(0,m.XW)(xl,jo,{transform(t,e){const n=t.fields,i=t.index,r=t.values,a=t.default==null?null:t.default,o=t.modified(),s=n.length;let u=o?e.SOURCE:e.ADD,l=e,c=t.as,f,h,d;if(r){h=r.length;if(s>1&&!c){(0,m.vU)('Multi-field lookup requires explicit "as" parameter.')}if(c&&c.length!==s*h){(0,m.vU)('The "as" parameter has too few output field names.')}c=c||r.map(m.el);f=function(t){for(var e=0,o=0,u,l;e<s;++e){l=i.get(n[e](t));if(l==null)for(u=0;u<h;++u,++o)t[c[o]]=a;else for(u=0;u<h;++u,++o)t[c[o]]=r[u](l)}}}else{if(!c){(0,m.vU)("Missing output field names.")}f=function(t){for(var e=0,r;e<s;++e){r=i.get(n[e](t));t[c[e]]=r==null?a:r}}}if(o){l=e.reflow(true)}else{d=n.some((t=>e.modified(t.fields)));u|=d?e.MOD:0}e.visit(u,f);return l.modifies(c)}});function _l(t){ja.call(this,null,bl,t)}(0,m.XW)(_l,ja);function bl(t){if(this.value&&!t.modified()){return this.value}const e=t.extents,n=e.length;let i=+Infinity,r=-Infinity,a,o;for(a=0;a<n;++a){o=e[a];if(o[0]<i)i=o[0];if(o[1]>r)r=o[1]}return[i,r]}function wl(t){ja.call(this,null,kl,t)}(0,m.XW)(wl,ja);function kl(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function Ml(t){jo.call(this,null,t)}(0,m.XW)(Ml,jo,{transform(t,e){this.modified(t.modified());this.value=t;return e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Al(t){ku.call(this,t)}Al.Definition={type:"Pivot",metadata:{generates:true,changes:true},params:[{name:"groupby",type:"field",array:true},{name:"field",type:"field",required:true},{name:"value",type:"field",required:true},{name:"op",type:"enum",values:fu,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};(0,m.XW)(Al,ku,{_transform:ku.prototype.transform,transform(t,e){return this._transform(El(t,e),e)}});function El(t,e){const n=t.field,i=t.value,r=(t.op==="count"?"__count__":t.op)||"sum",a=(0,m.Oj)(n).concat((0,m.Oj)(i)),o=Cl(n,t.limit||0,e);if(e.changed())t.set("__pivot__",null,null,true);return{key:t.key,groupby:t.groupby,ops:o.map((()=>r)),fields:o.map((t=>Dl(t,n,i,a))),as:o.map((t=>t+"")),modified:t.modified.bind(t)}}function Dl(t,e,n,i){return(0,m.ZE)((i=>e(i)===t?n(i):NaN),i,t+"")}function Cl(t,e,n){const i={},r=[];n.visit(n.SOURCE,(e=>{const n=t(e);if(!i[n]){i[n]=1;r.push(n)}}));r.sort(m.j2);return e?r.slice(0,e):r}function Fl(t){Zu.call(this,t)}(0,m.XW)(Fl,Zu,{transform(t,e){const n=t.subflow,i=t.field,r=t=>this.subflow(Ea(t),n,e,t);if(t.modified("field")||i&&e.modified((0,m.Oj)(i))){(0,m.vU)("PreFacet does not support field modification.")}this.initTargets();if(i){e.visit(e.MOD,(t=>{const e=r(t);i(t).forEach((t=>e.mod(t)))}));e.visit(e.ADD,(t=>{const e=r(t);i(t).forEach((t=>e.add(Ca(t))))}));e.visit(e.REM,(t=>{const e=r(t);i(t).forEach((t=>e.rem(t)))}))}else{e.visit(e.MOD,(t=>r(t).mod(t)));e.visit(e.ADD,(t=>r(t).add(t)));e.visit(e.REM,(t=>r(t).rem(t)))}if(e.clean()){e.runAfter((()=>this.clean()))}return e}});function Sl(t){jo.call(this,null,t)}Sl.Definition={type:"Project",metadata:{generates:true,changes:true},params:[{name:"fields",type:"field",array:true},{name:"as",type:"string",null:true,array:true}]};(0,m.XW)(Sl,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=Wu(t.fields,t.as||[]),a=i?(t,e)=>Tl(t,e,i,r):Sa;let o;if(this.value){o=this.value}else{e=e.addAll();o=this.value={}}e.visit(e.REM,(t=>{const e=Ea(t);n.rem.push(o[e]);o[e]=null}));e.visit(e.ADD,(t=>{const e=a(t,Ca({}));o[Ea(t)]=e;n.add.push(e)}));e.visit(e.MOD,(t=>{n.mod.push(a(t,o[Ea(t)]))}));return n}});function Tl(t,e,n,i){for(let r=0,a=n.length;r<a;++r){e[i[r]]=n[r](t)}return e}function Bl(t){jo.call(this,null,t)}(0,m.XW)(Bl,jo,{transform(t,e){this.value=t.value;return t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function Nl(t){jo.call(this,null,t)}Nl.Definition={type:"Quantile",metadata:{generates:true,changes:true},params:[{name:"groupby",type:"field",array:true},{name:"field",type:"field",required:true},{name:"probs",type:"number",array:true},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:true,default:["prob","value"]}]};const zl=1e-14;(0,m.XW)(Nl,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed()){n.source=this.value;return n}const r=e.materialize(e.SOURCE).source,a=Xu(r,t.groupby,t.field),o=(t.groupby||[]).map(m.el),s=[],u=t.step||.01,l=t.probs||ru(u/2,1-zl,u),c=l.length;a.forEach((t=>{const e=rs(t,l);for(let n=0;n<c;++n){const r={};for(let e=0;e<o.length;++e){r[o[e]]=t.dims[e]}r[i[0]]=l[n];r[i[1]]=e[n];s.push(Ca(r))}}));if(this.value)n.rem=this.value;this.value=n.add=n.source=s;return n}});function Ol(t){jo.call(this,null,t)}(0,m.XW)(Ol,jo,{transform(t,e){let n,i;if(this.value){i=this.value}else{n=e=e.addAll();i=this.value={}}if(t.derive){n=e.fork(e.NO_SOURCE);e.visit(e.REM,(t=>{const e=Ea(t);n.rem.push(i[e]);i[e]=null}));e.visit(e.ADD,(t=>{const e=Fa(t);i[Ea(t)]=e;n.add.push(e)}));e.visit(e.MOD,(t=>{const e=i[Ea(t)];for(const i in t){e[i]=t[i];n.modifies(i)}n.mod.push(e)}))}return n}});function Rl(t){jo.call(this,[],t);this.count=0}Rl.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};(0,m.XW)(Rl,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.modified("size"),r=t.size,a=this.value.reduce(((t,e)=>(t[Ea(e)]=1,t)),{});let o=this.value,s=this.count,u=0;function l(t){let e,i;if(o.length<r){o.push(t)}else{i=~~((s+1)*us());if(i<o.length&&i>=u){e=o[i];if(a[Ea(e)])n.rem.push(e);o[i]=t}}++s}if(e.rem.length){e.visit(e.REM,(t=>{const e=Ea(t);if(a[e]){a[e]=-1;n.rem.push(t)}--s}));o=o.filter((t=>a[Ea(t)]!==-1))}if((e.rem.length||i)&&o.length<r&&e.source){u=s=o.length;e.visit(e.SOURCE,(t=>{if(!a[Ea(t)])l(t)}));u=-1}if(i&&o.length>r){const t=o.length-r;for(let e=0;e<t;++e){a[Ea(o[e])]=-1;n.rem.push(o[e])}o=o.slice(t)}if(e.mod.length){e.visit(e.MOD,(t=>{if(a[Ea(t)])n.mod.push(t)}))}if(e.add.length){e.visit(e.ADD,l)}if(e.add.length||u<0){n.add=o.filter((t=>!a[Ea(t)]))}this.count=s;this.value=n.source=o;return n}});function Ul(t){jo.call(this,null,t)}Ul.Definition={type:"Sequence",metadata:{generates:true,changes:true},params:[{name:"start",type:"number",required:true},{name:"stop",type:"number",required:true},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};(0,m.XW)(Ul,jo,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),i=t.as||"data";n.rem=this.value?e.rem.concat(this.value):e.rem;this.value=ru(t.start,t.stop,t.step||1).map((t=>{const e={};e[i]=t;return Ca(e)}));n.add=e.add.concat(this.value);return n}});function ql(t){jo.call(this,null,t);this.modified(true)}(0,m.XW)(ql,jo,{transform(t,e){this.value=e.source;return e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function Il(t){jo.call(this,null,t)}const Ll=["unit0","unit1"];Il.Definition={type:"TimeUnit",metadata:{modifies:true},params:[{name:"field",type:"field",required:true},{name:"interval",type:"boolean",default:true},{name:"units",type:"enum",values:En,array:true},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:true},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:true,length:2,default:Ll}]};(0,m.XW)(Il,jo,{transform(t,e){const n=t.field,i=t.interval!==false,r=t.timezone==="utc",a=this._floor(t,e),o=(r?ii:ni)(a.unit).offset,s=t.as||Ll,u=s[0],l=s[1],c=a.step;let f=a.start||Infinity,h=a.stop||-Infinity,d=e.ADD;if(t.modified()||e.modified((0,m.Oj)(n))){e=e.reflow(true);d=e.SOURCE;f=Infinity;h=-Infinity}e.visit(d,(t=>{const e=n(t);let r,s;if(e==null){t[u]=null;if(i)t[l]=null}else{t[u]=r=s=a(e);if(i)t[l]=s=o(r,c);if(r<f)f=r;if(s>h)h=s}}));a.start=f;a.stop=h;return e.modifies(i?s:u)},_floor(t,e){const n=t.timezone==="utc";const{units:i,step:r}=t.units?{units:t.units,step:t.step||1}:Ei({extent:t.extent||(0,m.We)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins});const a=Cn(i),o=this.value||{},s=(n?Qn:Gn)(a,r);s.unit=(0,m.fj)(a);s.units=a;s.step=r;s.start=o.start;s.stop=o.stop;return this.value=s}});function Pl(t){jo.call(this,(0,m.Xr)(),t)}(0,m.XW)(Pl,jo,{transform(t,e){const n=e.dataflow,i=t.field,r=this.value,a=t=>r.set(i(t),t);let o=true;if(t.modified("field")||e.modified(i.fields)){r.clear();e.visit(e.SOURCE,a)}else if(e.changed()){e.visit(e.REM,(t=>r.delete(i(t))));e.visit(e.ADD,a)}else{o=false}this.modified(o);if(r.empty>n.cleanThreshold)n.runAfter(r.clean);return e.fork()}});function jl(t){jo.call(this,null,t)}(0,m.XW)(jl,jo,{transform(t,e){const n=!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields);if(n){this.value=(t.sort?e.source.slice().sort(Ba(t.sort)):e.source).map(t.field)}}});function Wl(t,e,n,i){const r=Xl[t](e,n);return{init:r.init||m.bM,update:function(t,e){e[i]=r.next(t)}}}const Xl={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?++t:t}}},percent_rank:function(){const t=Xl.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,i=e.compare;let r=e.index;if(t<r){while(r+1<n.length&&!i(n[r],n[r+1]))++r;t=r}return(1+t)/n.length}}},ntile:function(t,e){e=+e;if(!(e>0))(0,m.vU)("ntile num must be greater than zero.");const n=Xl.cume_dist(),i=n.next;return{init:n.init,next:t=>Math.ceil(e*i(t))}},lag:function(t,e){e=+e||1;return{next:n=>{const i=n.index-e;return i>=0?t(n.data[i]):null}}},lead:function(t,e){e=+e||1;return{next:n=>{const i=n.index+e,r=n.data;return i<r.length?t(r[i]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){e=+e;if(!(e>0))(0,m.vU)("nth_value nth must be greater than zero.");return{next:n=>{const i=n.i0+(e-1);return i<n.i1?t(n.data[i]):null}}},prev_value:function(t){let e;return{init:()=>e=null,next:n=>{const i=t(n.data[n.index]);return i!=null?e=i:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:i=>{const r=i.data;return i.index<=n?e:(n=$l(t,r,i.index))<0?(n=r.length,e=null):e=t(r[n])}}}};function $l(t,e,n){for(let i=e.length;n<i;++n){const i=t(e[n]);if(i!=null)return n}return-1}const Hl=Object.keys(Xl);function Yl(t){const e=(0,m.IX)(t.ops),n=(0,m.IX)(t.fields),i=(0,m.IX)(t.params),r=(0,m.IX)(t.as),a=this.outputs=[],o=this.windows=[],s={},u={},l=[],c=[];let f=true;function h(t){(0,m.IX)((0,m.Oj)(t)).forEach((t=>s[t]=1))}h(t.sort);e.forEach(((t,e)=>{const s=n[e],d=(0,m.el)(s),p=su(t,d,r[e]);h(s);a.push(p);if((0,m.nr)(Xl,t)){o.push(Wl(t,n[e],i[e],p))}else{if(s==null&&t!=="count"){(0,m.vU)("Null aggregate field specified.")}if(t==="count"){l.push(p);return}f=false;let e=u[d];if(!e){e=u[d]=[];e.field=s;c.push(e)}e.push(du(t,p))}}));if(l.length||c.length){this.cell=Vl(c,l,f)}this.inputs=Object.keys(s)}const Jl=Yl.prototype;Jl.init=function(){this.windows.forEach((t=>t.init()));if(this.cell)this.cell.init()};Jl.update=function(t,e){const n=this.cell,i=this.windows,r=t.data,a=i&&i.length;let o;if(n){for(o=t.p0;o<t.i0;++o)n.rem(r[o]);for(o=t.p1;o<t.i1;++o)n.add(r[o]);n.set(e)}for(o=0;o<a;++o)i[o].update(t,e)};function Vl(t,e,n){t=t.map((t=>_u(t,t.field)));const i={num:0,agg:null,store:false,count:e};if(!n){var r=t.length,a=i.agg=Array(r),o=0;for(;o<r;++o)a[o]=new t[o](i)}if(i.store){var s=i.data=new bu}i.add=function(t){i.num+=1;if(n)return;if(s)s.add(t);for(let e=0;e<r;++e){a[e].add(a[e].get(t),t)}};i.rem=function(t){i.num-=1;if(n)return;if(s)s.rem(t);for(let e=0;e<r;++e){a[e].rem(a[e].get(t),t)}};i.set=function(t){let r,o;if(s)s.values();for(r=0,o=e.length;r<o;++r)t[e[r]]=i.num;if(!n)for(r=0,o=a.length;r<o;++r)a[r].set(t)};i.init=function(){i.num=0;if(s)s.reset();for(let t=0;t<r;++t)a[t].init()};return i}function Gl(t){jo.call(this,{},t);this._mlen=0;this._mods=[]}Gl.Definition={type:"Window",metadata:{modifies:true},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:true},{name:"ops",type:"enum",array:true,values:Hl.concat(fu)},{name:"params",type:"number",null:true,array:true},{name:"fields",type:"field",null:true,array:true},{name:"as",type:"string",null:true,array:true},{name:"frame",type:"number",null:true,array:true,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:false}]};(0,m.XW)(Gl,jo,{transform(t,e){this.stamp=e.stamp;const n=t.modified(),i=Ba(t.sort),r=ou(t.groupby),a=t=>this.group(r(t));let o=this.state;if(!o||n){o=this.state=new Yl(t)}if(n||e.modified(o.inputs)){this.value={};e.visit(e.SOURCE,(t=>a(t).add(t)))}else{e.visit(e.REM,(t=>a(t).remove(t)));e.visit(e.ADD,(t=>a(t).add(t)))}for(let s=0,u=this._mlen;s<u;++s){Kl(this._mods[s],o,i,t)}this._mlen=0;this._mods=[];return e.reflow(n).modifies(o.outputs)},group(t){let e=this.value[t];if(!e){e=this.value[t]=Eu(Ea);e.stamp=-1}if(e.stamp<this.stamp){e.stamp=this.stamp;this._mods[this._mlen++]=e}return e}});function Kl(t,e,n,i){const r=i.sort,a=r&&!i.ignorePeers,o=i.frame||[null,0],s=t.data(n),u=s.length,l=a?dn(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:r||(0,m.a9)(-1)};e.init();for(let f=0;f<u;++f){Zl(c,o,f,u);if(a)Ql(c,l);e.update(c,s[f])}}function Zl(t,e,n,i){t.p0=t.i0;t.p1=t.i1;t.i0=e[0]==null?0:Math.max(0,n-Math.abs(e[0]));t.i1=e[1]==null?i:Math.min(i,n+Math.abs(e[1])+1);t.index=n}function Ql(t,e){const n=t.i0,i=t.i1-1,r=t.compare,a=t.data,o=a.length-1;if(n>0&&!r(a[n],a[n-1]))t.i0=e.left(a,a[n]);if(i<o&&!r(a[i],a[i+1]))t.i1=e.right(a,a[i])}function tc(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ec(t){this._context=t}ec.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){switch(this._point){case 3:tc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:tc(this,t,e);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e}};function nc(t){return new ec(t)}function ic(){}function rc(t){this._context=t}rc.prototype={areaStart:ic,areaEnd:ic,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2);this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3);this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3);this._context.closePath();break}case 3:{this.point(this._x2,this._y2);this.point(this._x3,this._y3);this.point(this._x4,this._y4);break}}},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._x2=t,this._y2=e;break;case 1:this._point=2;this._x3=t,this._y3=e;break;case 2:this._point=3;this._x4=t,this._y4=e;this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:tc(this,t,e);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e}};function ac(t){return new rc(t)}function oc(t){this._context=t}oc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:tc(this,t,e);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e}};function sc(t){return new oc(t)}function uc(t,e){this._basis=new ec(t);this._beta=e}uc.prototype={lineStart:function(){this._x=[];this._y=[];this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0){var i=t[0],r=e[0],a=t[n]-i,o=e[n]-r,s=-1,u;while(++s<=n){u=s/n;this._basis.point(this._beta*t[s]+(1-this._beta)*(i+u*a),this._beta*e[s]+(1-this._beta)*(r+u*o))}}this._x=this._y=null;this._basis.lineEnd()},point:function(t,e){this._x.push(+t);this._y.push(+e)}};const lc=function t(e){function n(t){return e===1?new ec(t):new uc(t,e)}n.beta=function(e){return t(+e)};return n}(.85);function cc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function fc(t,e){this._context=t;this._k=(1-e)/6}fc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cc(this,this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;this._x1=t,this._y1=e;break;case 2:this._point=3;default:cc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hc=function t(e){function n(t){return new fc(t,e)}n.tension=function(e){return t(+e)};return n}(0);function dc(t,e){this._context=t;this._k=(1-e)/6}dc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};const pc=function t(e){function n(t){return new dc(t,e)}n.tension=function(e){return t(+e)};return n}(0);function mc(t,e){this._context=t;this._k=(1-e)/6}mc.prototype={areaStart:ic,areaEnd:ic,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._x3=t,this._y3=e;break;case 1:this._point=2;this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3;this._x5=t,this._y5=e;break;default:cc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};const gc=function t(e){function n(t){return new mc(t,e)}n.tension=function(e){return t(+e)};return n}(0);var yc=Math.abs;var vc=Math.atan2;var xc=Math.cos;var _c=Math.max;var bc=Math.min;var wc=Math.sin;var kc=Math.sqrt;var Mc=1e-12;var Ac=Math.PI;var Ec=Ac/2;var Dc=2*Ac;function Cc(t){return t>1?0:t<-1?Ac:Math.acos(t)}function Fc(t){return t>=1?Ec:t<=-1?-Ec:Math.asin(t)}function Sc(t,e,n){var i=t._x1,r=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Mc){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u;r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Mc){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*l+t._x1*t._l23_2a-e*t._l12_2a)/c;o=(o*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(i,r,a,o,t._x2,t._y2)}function Tc(t,e){this._context=t;this._alpha=e}Tc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,e){t=+t,e=+e;if(this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Sc(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Bc=function t(e){function n(t){return e?new Tc(t,e):new fc(t,0)}n.alpha=function(e){return t(+e)};return n}(.5);function Nc(t,e){this._context=t;this._alpha=e}Nc.prototype={areaStart:ic,areaEnd:ic,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(t,e){t=+t,e=+e;if(this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._x3=t,this._y3=e;break;case 1:this._point=2;this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3;this._x5=t,this._y5=e;break;default:Sc(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};const zc=function t(e){function n(t){return e?new Nc(t,e):new mc(t,0)}n.alpha=function(e){return t(+e)};return n}(.5);function Oc(t,e){this._context=t;this._alpha=e}Oc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(t,e){t=+t,e=+e;if(this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Sc(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Rc=function t(e){function n(t){return e?new Oc(t,e):new dc(t,0)}n.alpha=function(e){return t(+e)};return n}(.5);function Uc(t){this._context=t}Uc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function qc(t){return new Uc(t)}function Ic(t){this._context=t}Ic.prototype={areaStart:ic,areaEnd:ic,lineStart:function(){this._point=0},lineEnd:function(){if(this._point)this._context.closePath()},point:function(t,e){t=+t,e=+e;if(this._point)this._context.lineTo(t,e);else this._point=1,this._context.moveTo(t,e)}};function Lc(t){return new Ic(t)}function Pc(t){return t<0?-1:1}function jc(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),s=(a*r+o*i)/(i+r);return(Pc(a)+Pc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Wc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Xc(t,e,n){var i=t._x0,r=t._y0,a=t._x1,o=t._y1,s=(a-i)/3;t._context.bezierCurveTo(i+s,r+s*e,a-s,o-s*n,a,o)}function $c(t){this._context=t}$c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xc(this,this._t0,Wc(this,this._t0));break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,e){var n=NaN;t=+t,e=+e;if(t===this._x1&&e===this._y1)return;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;Xc(this,Wc(this,n=jc(this,t,e)),n);break;default:Xc(this,this._t0,n=jc(this,t,e));break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e;this._t0=n}};function Hc(t){this._context=new Yc(t)}(Hc.prototype=Object.create($c.prototype)).point=function(t,e){$c.prototype.point.call(this,e,t)};function Yc(t){this._context=t}Yc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,a){this._context.bezierCurveTo(e,t,i,n,a,r)}};function Jc(t){return new $c(t)}function Vc(t){return new Hc(t)}function Gc(t){this._context=t}Gc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[];this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n){this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]);if(n===2){this._context.lineTo(t[1],e[1])}else{var i=Kc(t),r=Kc(e);for(var a=0,o=1;o<n;++a,++o){this._context.bezierCurveTo(i[0][a],r[0][a],i[1][a],r[1][a],t[o],e[o])}}}if(this._line||this._line!==0&&n===1)this._context.closePath();this._line=1-this._line;this._x=this._y=null},point:function(t,e){this._x.push(+t);this._y.push(+e)}};function Kc(t){var e,n=t.length-1,i,r=new Array(n),a=new Array(n),o=new Array(n);r[0]=0,a[0]=2,o[0]=t[0]+2*t[1];for(e=1;e<n-1;++e)r[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];r[n-1]=2,a[n-1]=7,o[n-1]=8*t[n-1]+t[n];for(e=1;e<n;++e)i=r[e]/a[e-1],a[e]-=i,o[e]-=i*o[e-1];r[n-1]=o[n-1]/a[n-1];for(e=n-2;e>=0;--e)r[e]=(o[e]-r[e+1])/a[e];a[n-1]=(t[n]+r[n-1])/2;for(e=0;e<n-1;++e)a[e]=2*t[e+1]-r[e+1];return[r,a]}function Zc(t){return new Gc(t)}function Qc(t,e){this._context=t;this._t=e}Qc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN;this._point=0},lineEnd:function(){if(0<this._t&&this._t<1&&this._point===2)this._context.lineTo(this._x,this._y);if(this._line||this._line!==0&&this._point===1)this._context.closePath();if(this._line>=0)this._t=1-this._t,this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0){this._context.lineTo(this._x,e);this._context.lineTo(t,e)}else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y);this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function tf(t){return new Qc(t,.5)}function ef(t){return new Qc(t,0)}function nf(t){return new Qc(t,1)}const rf=Math.PI,af=2*rf,of=1e-6,sf=af-of;function uf(){this._x0=this._y0=this._x1=this._y1=null;this._=""}function lf(){return new uf}uf.prototype=lf.prototype={constructor:uf,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){if(this._x1!==null){this._x1=this._x0,this._y1=this._y0;this._+="Z"}},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+a)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var a=this._x1,o=this._y1,s=n-t,u=i-e,l=a-t,c=o-e,f=l*l+c*c;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null){this._+="M"+(this._x1=t)+","+(this._y1=e)}else if(!(f>of));else if(!(Math.abs(c*s-u*l)>of)||!r){this._+="L"+(this._x1=t)+","+(this._y1=e)}else{var h=n-a,d=i-o,p=s*s+u*u,m=h*h+d*d,g=Math.sqrt(p),y=Math.sqrt(f),v=r*Math.tan((rf-Math.acos((p+f-m)/(2*g*y)))/2),x=v/y,_=v/g;if(Math.abs(x-1)>of){this._+="L"+(t+x*l)+","+(e+x*c)}this._+="A"+r+","+r+",0,0,"+ +(c*h>l*d)+","+(this._x1=t+_*s)+","+(this._y1=e+_*u)}},arc:function(t,e,n,i,r,a){t=+t,e=+e,n=+n,a=!!a;var o=n*Math.cos(i),s=n*Math.sin(i),u=t+o,l=e+s,c=1^a,f=a?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);if(this._x1===null){this._+="M"+u+","+l}else if(Math.abs(this._x1-u)>of||Math.abs(this._y1-l)>of){this._+="L"+u+","+l}if(!n)return;if(f<0)f=f%af+af;if(f>sf){this._+="A"+n+","+n+",0,1,"+c+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l)}else if(f>of){this._+="A"+n+","+n+",0,"+ +(f>=rf)+","+c+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))}},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const cf=lf;function ff(t){return function e(){return t}}function hf(t){return t.innerRadius}function df(t){return t.outerRadius}function pf(t){return t.startAngle}function mf(t){return t.endAngle}function gf(t){return t&&t.padAngle}function yf(t,e,n,i,r,a,o,s){var u=n-t,l=i-e,c=o-r,f=s-a,h=f*u-c*l;if(h*h<Mc)return;h=(c*(e-a)-f*(t-r))/h;return[t+h*u,e+h*l]}function vf(t,e,n,i,r,a,o){var s=t-n,u=e-i,l=(o?a:-a)/kc(s*s+u*u),c=l*u,f=-l*s,h=t+c,d=e+f,p=n+c,m=i+f,g=(h+p)/2,y=(d+m)/2,v=p-h,x=m-d,_=v*v+x*x,b=r-a,w=h*m-p*d,k=(x<0?-1:1)*kc(_c(0,b*b*_-w*w)),M=(w*x-v*k)/_,A=(-w*v-x*k)/_,E=(w*x+v*k)/_,D=(-w*v+x*k)/_,C=M-g,F=A-y,S=E-g,T=D-y;if(C*C+F*F>S*S+T*T)M=E,A=D;return{cx:M,cy:A,x01:-c,y01:-f,x11:M*(r/b-1),y11:A*(r/b-1)}}function xf(){var t=hf,e=df,n=ff(0),i=null,r=pf,a=mf,o=gf,s=null;function u(){var u,l,c=+t.apply(this,arguments),f=+e.apply(this,arguments),h=r.apply(this,arguments)-Ec,d=a.apply(this,arguments)-Ec,p=yc(d-h),m=d>h;if(!s)s=u=cf();if(f<c)l=f,f=c,c=l;if(!(f>Mc))s.moveTo(0,0);else if(p>Dc-Mc){s.moveTo(f*xc(h),f*wc(h));s.arc(0,0,f,h,d,!m);if(c>Mc){s.moveTo(c*xc(d),c*wc(d));s.arc(0,0,c,d,h,m)}}else{var g=h,y=d,v=h,x=d,_=p,b=p,w=o.apply(this,arguments)/2,k=w>Mc&&(i?+i.apply(this,arguments):kc(c*c+f*f)),M=bc(yc(f-c)/2,+n.apply(this,arguments)),A=M,E=M,D,C;if(k>Mc){var F=Fc(k/c*wc(w)),S=Fc(k/f*wc(w));if((_-=F*2)>Mc)F*=m?1:-1,v+=F,x-=F;else _=0,v=x=(h+d)/2;if((b-=S*2)>Mc)S*=m?1:-1,g+=S,y-=S;else b=0,g=y=(h+d)/2}var T=f*xc(g),B=f*wc(g),N=c*xc(x),z=c*wc(x);if(M>Mc){var O=f*xc(y),R=f*wc(y),U=c*xc(v),q=c*wc(v),I;if(p<Ac&&(I=yf(T,B,U,q,O,R,N,z))){var L=T-I[0],P=B-I[1],j=O-I[0],W=R-I[1],X=1/wc(Cc((L*j+P*W)/(kc(L*L+P*P)*kc(j*j+W*W)))/2),$=kc(I[0]*I[0]+I[1]*I[1]);A=bc(M,(c-$)/(X-1));E=bc(M,(f-$)/(X+1))}}if(!(b>Mc))s.moveTo(T,B);else if(E>Mc){D=vf(U,q,T,B,f,E,m);C=vf(O,R,N,z,f,E,m);s.moveTo(D.cx+D.x01,D.cy+D.y01);if(E<M)s.arc(D.cx,D.cy,E,vc(D.y01,D.x01),vc(C.y01,C.x01),!m);else{s.arc(D.cx,D.cy,E,vc(D.y01,D.x01),vc(D.y11,D.x11),!m);s.arc(0,0,f,vc(D.cy+D.y11,D.cx+D.x11),vc(C.cy+C.y11,C.cx+C.x11),!m);s.arc(C.cx,C.cy,E,vc(C.y11,C.x11),vc(C.y01,C.x01),!m)}}else s.moveTo(T,B),s.arc(0,0,f,g,y,!m);if(!(c>Mc)||!(_>Mc))s.lineTo(N,z);else if(A>Mc){D=vf(N,z,O,R,c,-A,m);C=vf(T,B,U,q,c,-A,m);s.lineTo(D.cx+D.x01,D.cy+D.y01);if(A<M)s.arc(D.cx,D.cy,A,vc(D.y01,D.x01),vc(C.y01,C.x01),!m);else{s.arc(D.cx,D.cy,A,vc(D.y01,D.x01),vc(D.y11,D.x11),!m);s.arc(0,0,c,vc(D.cy+D.y11,D.cx+D.x11),vc(C.cy+C.y11,C.cx+C.x11),m);s.arc(C.cx,C.cy,A,vc(C.y11,C.x11),vc(C.y01,C.x01),!m)}}else s.arc(0,0,c,x,v,m)}s.closePath();if(u)return s=null,u+""||null}u.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-Ac/2;return[xc(i)*n,wc(i)*n]};u.innerRadius=function(e){return arguments.length?(t=typeof e==="function"?e:ff(+e),u):t};u.outerRadius=function(t){return arguments.length?(e=typeof t==="function"?t:ff(+t),u):e};u.cornerRadius=function(t){return arguments.length?(n=typeof t==="function"?t:ff(+t),u):n};u.padRadius=function(t){return arguments.length?(i=t==null?null:typeof t==="function"?t:ff(+t),u):i};u.startAngle=function(t){return arguments.length?(r=typeof t==="function"?t:ff(+t),u):r};u.endAngle=function(t){return arguments.length?(a=typeof t==="function"?t:ff(+t),u):a};u.padAngle=function(t){return arguments.length?(o=typeof t==="function"?t:ff(+t),u):o};u.context=function(t){return arguments.length?(s=t==null?null:t,u):s};return u}var _f=Array.prototype.slice;function bf(t){return typeof t==="object"&&"length"in t?t:Array.from(t)}function wf(t){return t[0]}function kf(t){return t[1]}function Mf(t,e){var n=ff(true),i=null,r=qc,a=null;t=typeof t==="function"?t:t===undefined?wf:ff(t);e=typeof e==="function"?e:e===undefined?kf:ff(e);function o(o){var s,u=(o=bf(o)).length,l,c=false,f;if(i==null)a=r(f=cf());for(s=0;s<=u;++s){if(!(s<u&&n(l=o[s],s,o))===c){if(c=!c)a.lineStart();else a.lineEnd()}if(c)a.point(+t(l,s,o),+e(l,s,o))}if(f)return a=null,f+""||null}o.x=function(e){return arguments.length?(t=typeof e==="function"?e:ff(+e),o):t};o.y=function(t){return arguments.length?(e=typeof t==="function"?t:ff(+t),o):e};o.defined=function(t){return arguments.length?(n=typeof t==="function"?t:ff(!!t),o):n};o.curve=function(t){return arguments.length?(r=t,i!=null&&(a=r(i)),o):r};o.context=function(t){return arguments.length?(t==null?i=a=null:a=r(i=t),o):i};return o}function Af(t,e,n){var i=null,r=ff(true),a=null,o=qc,s=null;t=typeof t==="function"?t:t===undefined?wf:ff(+t);e=typeof e==="function"?e:e===undefined?ff(0):ff(+e);n=typeof n==="function"?n:n===undefined?kf:ff(+n);function u(u){var l,c,f,h=(u=bf(u)).length,d,p=false,m,g=new Array(h),y=new Array(h);if(a==null)s=o(m=cf());for(l=0;l<=h;++l){if(!(l<h&&r(d=u[l],l,u))===p){if(p=!p){c=l;s.areaStart();s.lineStart()}else{s.lineEnd();s.lineStart();for(f=l-1;f>=c;--f){s.point(g[f],y[f])}s.lineEnd();s.areaEnd()}}if(p){g[l]=+t(d,l,u),y[l]=+e(d,l,u);s.point(i?+i(d,l,u):g[l],n?+n(d,l,u):y[l])}}if(m)return s=null,m+""||null}function l(){return Mf().defined(r).curve(o).context(a)}u.x=function(e){return arguments.length?(t=typeof e==="function"?e:ff(+e),i=null,u):t};u.x0=function(e){return arguments.length?(t=typeof e==="function"?e:ff(+e),u):t};u.x1=function(t){return arguments.length?(i=t==null?null:typeof t==="function"?t:ff(+t),u):i};u.y=function(t){return arguments.length?(e=typeof t==="function"?t:ff(+t),n=null,u):e};u.y0=function(t){return arguments.length?(e=typeof t==="function"?t:ff(+t),u):e};u.y1=function(t){return arguments.length?(n=t==null?null:typeof t==="function"?t:ff(+t),u):n};u.lineX0=u.lineY0=function(){return l().x(t).y(e)};u.lineY1=function(){return l().x(t).y(n)};u.lineX1=function(){return l().x(i).y(e)};u.defined=function(t){return arguments.length?(r=typeof t==="function"?t:ff(!!t),u):r};u.curve=function(t){return arguments.length?(o=t,a!=null&&(s=o(a)),u):o};u.context=function(t){return arguments.length?(t==null?a=s=null:s=o(a=t),u):a};return u}const Ef={draw:function(t,e){var n=Math.sqrt(e/Ac);t.moveTo(n,0);t.arc(0,0,n,0,Dc)}};const Df={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n);t.lineTo(-n,-n);t.lineTo(-n,-3*n);t.lineTo(n,-3*n);t.lineTo(n,-n);t.lineTo(3*n,-n);t.lineTo(3*n,n);t.lineTo(n,n);t.lineTo(n,3*n);t.lineTo(-n,3*n);t.lineTo(-n,n);t.lineTo(-3*n,n);t.closePath()}};var Cf=Math.sqrt(1/3),Ff=Cf*2;const Sf={draw:function(t,e){var n=Math.sqrt(e/Ff),i=n*Cf;t.moveTo(0,-n);t.lineTo(i,0);t.lineTo(0,n);t.lineTo(-i,0);t.closePath()}};var Tf=.8908130915292852,Bf=Math.sin(Ac/10)/Math.sin(7*Ac/10),Nf=Math.sin(Dc/10)*Bf,zf=-Math.cos(Dc/10)*Bf;const Of={draw:function(t,e){var n=Math.sqrt(e*Tf),i=Nf*n,r=zf*n;t.moveTo(0,-n);t.lineTo(i,r);for(var a=1;a<5;++a){var o=Dc*a/5,s=Math.cos(o),u=Math.sin(o);t.lineTo(u*n,-s*n);t.lineTo(s*i-u*r,u*i+s*r)}t.closePath()}};const Rf={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}};var Uf=Math.sqrt(3);const qf={draw:function(t,e){var n=-Math.sqrt(e/(Uf*3));t.moveTo(0,n*2);t.lineTo(-Uf*n,-n);t.lineTo(Uf*n,-n);t.closePath()}};var If=-.5,Lf=Math.sqrt(3)/2,Pf=1/Math.sqrt(12),jf=(Pf/2+1)*3;const Wf={draw:function(t,e){var n=Math.sqrt(e/jf),i=n/2,r=n*Pf,a=i,o=n*Pf+n,s=-a,u=o;t.moveTo(i,r);t.lineTo(a,o);t.lineTo(s,u);t.lineTo(If*i-Lf*r,Lf*i+If*r);t.lineTo(If*a-Lf*o,Lf*a+If*o);t.lineTo(If*s-Lf*u,Lf*s+If*u);t.lineTo(If*i+Lf*r,If*r-Lf*i);t.lineTo(If*a+Lf*o,If*o-Lf*a);t.lineTo(If*s+Lf*u,If*u-Lf*s);t.closePath()}};var Xf=[Ef,Df,Sf,Rf,Of,qf,Wf];function $f(t,e){var n=null;t=typeof t==="function"?t:ff(t||Ef);e=typeof e==="function"?e:ff(e===undefined?64:+e);function i(){var i;if(!n)n=i=cf();t.apply(this,arguments).draw(n,+e.apply(this,arguments));if(i)return n=null,i+""||null}i.type=function(e){return arguments.length?(t=typeof e==="function"?e:ff(e),i):t};i.size=function(t){return arguments.length?(e=typeof t==="function"?t:ff(+t),i):e};i.context=function(t){return arguments.length?(n=t==null?null:t,i):n};return i}function Hf(t,e){if(typeof document!=="undefined"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext){n.width=t;n.height=e;return n}}return null}const Yf=()=>typeof Image!=="undefined"?Image:null;const Jf=dn(hn);const Vf=Jf.right;const Gf=Jf.left;const Kf=dn(Go).center;const Zf=Vf;function Qf(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function th(t,e){switch(arguments.length){case 0:break;case 1:{if(typeof t==="function")this.interpolator(t);else this.range(t);break}default:{this.domain(t);if(typeof e==="function")this.interpolator(e);else this.range(e);break}}return this}const eh=Symbol("implicit");function nh(){var t=new Map,e=[],n=[],i=eh;function r(r){var a=r+"",o=t.get(a);if(!o){if(i!==eh)return i;t.set(a,o=e.push(r))}return n[(o-1)%n.length]}r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const i of n){const n=i+"";if(t.has(n))continue;t.set(n,e.push(i))}return r};r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()};r.unknown=function(t){return arguments.length?(i=t,r):i};r.copy=function(){return nh(e,n).unknown(i)};Qf.apply(r,arguments);return r}function ih(t,e,n,i){var r=_t(t,e,n),a;i=wt(i==null?",f":i);switch(i.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));if(i.precision==null&&!isNaN(a=Dt(r,o)))i.precision=a;return Wt(i,o)}case"":case"e":case"g":case"p":case"r":{if(i.precision==null&&!isNaN(a=Ct(r,Math.max(Math.abs(t),Math.abs(e)))))i.precision=a-(i.type==="e");break}case"f":case"%":{if(i.precision==null&&!isNaN(a=Ft(r)))i.precision=a-(i.type==="%")*2;break}}return jt(i)}function rh(t,e,n){t.prototype=e.prototype=n;n.constructor=t}function ah(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function oh(){}var sh=.7;var uh=1/sh;var lh="\\s*([+-]?\\d+)\\s*",ch="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fh="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hh=/^#([0-9a-f]{3,8})$/,dh=new RegExp("^rgb\\("+[lh,lh,lh]+"\\)$"),ph=new RegExp("^rgb\\("+[fh,fh,fh]+"\\)$"),mh=new RegExp("^rgba\\("+[lh,lh,lh,ch]+"\\)$"),gh=new RegExp("^rgba\\("+[fh,fh,fh,ch]+"\\)$"),yh=new RegExp("^hsl\\("+[ch,fh,fh]+"\\)$"),vh=new RegExp("^hsla\\("+[ch,fh,fh,ch]+"\\)$");var xh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};rh(oh,kh,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:_h,formatHex:_h,formatHsl:bh,formatRgb:wh,toString:wh});function _h(){return this.rgb().formatHex()}function bh(){return Nh(this).formatHsl()}function wh(){return this.rgb().formatRgb()}function kh(t){var e,n;t=(t+"").trim().toLowerCase();return(e=hh.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Mh(e):n===3?new Ch(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Ah(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Ah(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=dh.exec(t))?new Ch(e[1],e[2],e[3],1):(e=ph.exec(t))?new Ch(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=mh.exec(t))?Ah(e[1],e[2],e[3],e[4]):(e=gh.exec(t))?Ah(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=yh.exec(t))?Bh(e[1],e[2]/100,e[3]/100,1):(e=vh.exec(t))?Bh(e[1],e[2]/100,e[3]/100,e[4]):xh.hasOwnProperty(t)?Mh(xh[t]):t==="transparent"?new Ch(NaN,NaN,NaN,0):null}function Mh(t){return new Ch(t>>16&255,t>>8&255,t&255,1)}function Ah(t,e,n,i){if(i<=0)t=e=n=NaN;return new Ch(t,e,n,i)}function Eh(t){if(!(t instanceof oh))t=kh(t);if(!t)return new Ch;t=t.rgb();return new Ch(t.r,t.g,t.b,t.opacity)}function Dh(t,e,n,i){return arguments.length===1?Eh(t):new Ch(t,e,n,i==null?1:i)}function Ch(t,e,n,i){this.r=+t;this.g=+e;this.b=+n;this.opacity=+i}rh(Ch,Dh,ah(oh,{brighter:function(t){t=t==null?uh:Math.pow(uh,t);return new Ch(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){t=t==null?sh:Math.pow(sh,t);return new Ch(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&(-.5<=this.g&&this.g<255.5)&&(-.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:Fh,formatHex:Fh,formatRgb:Sh,toString:Sh}));function Fh(){return"#"+Th(this.r)+Th(this.g)+Th(this.b)}function Sh(){var t=this.opacity;t=isNaN(t)?1:Math.max(0,Math.min(1,t));return(t===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(t===1?")":", "+t+")")}function Th(t){t=Math.max(0,Math.min(255,Math.round(t)||0));return(t<16?"0":"")+t.toString(16)}function Bh(t,e,n,i){if(i<=0)t=e=n=NaN;else if(n<=0||n>=1)t=e=NaN;else if(e<=0)t=NaN;return new Oh(t,e,n,i)}function Nh(t){if(t instanceof Oh)return new Oh(t.h,t.s,t.l,t.opacity);if(!(t instanceof oh))t=kh(t);if(!t)return new Oh;if(t instanceof Oh)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,u=(a+r)/2;if(s){if(e===a)o=(n-i)/s+(n<i)*6;else if(n===a)o=(i-e)/s+2;else o=(e-n)/s+4;s/=u<.5?a+r:2-a-r;o*=60}else{s=u>0&&u<1?0:o}return new Oh(o,s,u,t.opacity)}function zh(t,e,n,i){return arguments.length===1?Nh(t):new Oh(t,e,n,i==null?1:i)}function Oh(t,e,n,i){this.h=+t;this.s=+e;this.l=+n;this.opacity=+i}rh(Oh,zh,ah(oh,{brighter:function(t){t=t==null?uh:Math.pow(uh,t);return new Oh(this.h,this.s,this.l*t,this.opacity)},darker:function(t){t=t==null?sh:Math.pow(sh,t);return new Oh(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ch(Rh(t>=240?t-240:t+120,r,i),Rh(t,r,i),Rh(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl:function(){var t=this.opacity;t=isNaN(t)?1:Math.max(0,Math.min(1,t));return(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function Rh(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function Uh(t,e,n,i,r){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*i+o*r)/6}function qh(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],a=t[i+1],o=i>0?t[i-1]:2*r-a,s=i<e-1?t[i+2]:2*a-r;return Uh((n-i/e)*e,o,r,a,s)}}function Ih(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],a=t[i%e],o=t[(i+1)%e],s=t[(i+2)%e];return Uh((n-i/e)*e,r,a,o,s)}}const Lh=t=>()=>t;function Ph(t,e){return function(n){return t+n*e}}function jh(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Wh(t,e){var n=e-t;return n?Ph(t,n>180||n<-180?n-360*Math.round(n/360):n):Lh(isNaN(t)?e:t)}function Xh(t){return(t=+t)===1?$h:function(e,n){return n-e?jh(e,n,t):Lh(isNaN(e)?n:e)}}function $h(t,e){var n=e-t;return n?Ph(t,n):Lh(isNaN(t)?e:t)}const Hh=function t(e){var n=Xh(e);function i(t,e){var i=n((t=Dh(t)).r,(e=Dh(e)).r),r=n(t.g,e.g),a=n(t.b,e.b),o=$h(t.opacity,e.opacity);return function(e){t.r=i(e);t.g=r(e);t.b=a(e);t.opacity=o(e);return t+""}}i.gamma=t;return i}(1);function Yh(t){return function(e){var n=e.length,i=new Array(n),r=new Array(n),a=new Array(n),o,s;for(o=0;o<n;++o){s=Dh(e[o]);i[o]=s.r||0;r[o]=s.g||0;a[o]=s.b||0}i=t(i);r=t(r);a=t(a);s.opacity=1;return function(t){s.r=i(t);s.g=r(t);s.b=a(t);return s+""}}}var Jh=Yh(qh);var Vh=Yh(Ih);function Gh(t,e){if(!e)e=[];var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function Kh(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Zh(t,e){return(Kh(e)?Gh:Qh)(t,e)}function Qh(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),a=new Array(n),o;for(o=0;o<i;++o)r[o]=ud(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(t){for(o=0;o<i;++o)a[o]=r[o](t);return a}}function td(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function ed(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function nd(t,e){var n={},i={},r;if(t===null||typeof t!=="object")t={};if(e===null||typeof e!=="object")e={};for(r in e){if(r in t){n[r]=ud(t[r],e[r])}else{i[r]=e[r]}}return function(t){for(r in n)i[r]=n[r](t);return i}}var id=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rd=new RegExp(id.source,"g");function ad(t){return function(){return t}}function od(t){return function(e){return t(e)+""}}function sd(t,e){var n=id.lastIndex=rd.lastIndex=0,i,r,a,o=-1,s=[],u=[];t=t+"",e=e+"";while((i=id.exec(t))&&(r=rd.exec(e))){if((a=r.index)>n){a=e.slice(n,a);if(s[o])s[o]+=a;else s[++o]=a}if((i=i[0])===(r=r[0])){if(s[o])s[o]+=r;else s[++o]=r}else{s[++o]=null;u.push({i:o,x:ed(i,r)})}n=rd.lastIndex}if(n<e.length){a=e.slice(n);if(s[o])s[o]+=a;else s[++o]=a}return s.length<2?u[0]?od(u[0].x):ad(e):(e=u.length,function(t){for(var n=0,i;n<e;++n)s[(i=u[n]).i]=i.x(t);return s.join("")})}function ud(t,e){var n=typeof e,i;return e==null||n==="boolean"?Lh(e):(n==="number"?ed:n==="string"?(i=kh(e))?(e=i,Hh):sd:e instanceof kh?Hh:e instanceof Date?td:Kh(e)?Gh:Array.isArray(e)?Qh:typeof e.valueOf!=="function"&&typeof e.toString!=="function"||isNaN(e)?nd:ed)(t,e)}function ld(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function cd(t){return function(){return t}}function fd(t){return+t}var hd=[0,1];function dd(t){return t}function pd(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:cd(isNaN(e)?NaN:.5)}function md(t,e){var n;if(t>e)n=t,t=e,e=n;return function(n){return Math.max(t,Math.min(e,n))}}function gd(t,e,n){var i=t[0],r=t[1],a=e[0],o=e[1];if(r<i)i=pd(r,i),a=n(o,a);else i=pd(i,r),a=n(a,o);return function(t){return a(i(t))}}function yd(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=-1;if(t[i]<t[0]){t=t.slice().reverse();e=e.slice().reverse()}while(++o<i){r[o]=pd(t[o],t[o+1]);a[o]=n(e[o],e[o+1])}return function(e){var n=Zf(t,e,1,i)-1;return a[n](r[n](e))}}function vd(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function xd(){var t=hd,e=hd,n=ud,i,r,a,o=dd,s,u,l;function c(){var n=Math.min(t.length,e.length);if(o!==dd)o=md(t[0],t[n-1]);s=n>2?yd:gd;u=l=null;return f}function f(r){return isNaN(r=+r)?a:(u||(u=s(t.map(i),e,n)))(i(o(r)))}f.invert=function(n){return o(r((l||(l=s(e,t.map(i),ed)))(n)))};f.domain=function(e){return arguments.length?(t=Array.from(e,fd),c()):t.slice()};f.range=function(t){return arguments.length?(e=Array.from(t),c()):e.slice()};f.rangeRound=function(t){return e=Array.from(t),n=ld,c()};f.clamp=function(t){return arguments.length?(o=t?true:dd,c()):o!==dd};f.interpolate=function(t){return arguments.length?(n=t,c()):n};f.unknown=function(t){return arguments.length?(a=t,f):a};return function(t,e){i=t,r=e;return c()}}function _d(){return xd()(dd,dd)}function bd(t){var e=t.domain;t.ticks=function(t){var n=e();return vt(n[0],n[n.length-1],t==null?10:t)};t.tickFormat=function(t,n){var i=e();return ih(i[0],i[i.length-1],t==null?10:t,n)};t.nice=function(n){if(n==null)n=10;var i=e();var r=0;var a=i.length-1;var o=i[r];var s=i[a];var u;var l;var c=10;if(s<o){l=o,o=s,s=l;l=r,r=a,a=l}while(c-- >0){l=xt(o,s,n);if(l===u){i[r]=o;i[a]=s;return e(i)}else if(l>0){o=Math.floor(o/l)*l;s=Math.ceil(s/l)*l}else if(l<0){o=Math.ceil(o*l)/l;s=Math.floor(s*l)/l}else{break}u=l}return t};return t}function wd(){var t=_d();t.copy=function(){return vd(t,wd())};Qf.apply(t,arguments);return bd(t)}function kd(t){var e;function n(t){return isNaN(t=+t)?e:t}n.invert=n;n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,fd),n):t.slice()};n.unknown=function(t){return arguments.length?(e=t,n):e};n.copy=function(){return kd(t).unknown(e)};t=arguments.length?Array.from(t,fd):[0,1];return bd(n)}function Md(t,e){t=t.slice();var n=0,i=t.length-1,r=t[n],a=t[i],o;if(a<r){o=n,n=i,i=o;o=r,r=a,a=o}t[n]=e.floor(r);t[i]=e.ceil(a);return t}function Ad(t){return Math.log(t)}function Ed(t){return Math.exp(t)}function Dd(t){return-Math.log(-t)}function Cd(t){return-Math.exp(-t)}function Fd(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Sd(t){return t===10?Fd:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}function Td(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}function Bd(t){return function(e){return-t(-e)}}function Nd(t){var e=t(Ad,Ed),n=e.domain,i=10,r,a;function o(){r=Td(i),a=Sd(i);if(n()[0]<0){r=Bd(r),a=Bd(a);t(Dd,Cd)}else{t(Ad,Ed)}return e}e.base=function(t){return arguments.length?(i=+t,o()):i};e.domain=function(t){return arguments.length?(n(t),o()):n()};e.ticks=function(t){var e=n(),o=e[0],s=e[e.length-1],u;if(u=s<o)l=o,o=s,s=l;var l=r(o),c=r(s),f,h,d,p=t==null?10:+t,m=[];if(!(i%1)&&c-l<p){l=Math.floor(l),c=Math.ceil(c);if(o>0)for(;l<=c;++l){for(h=1,f=a(l);h<i;++h){d=f*h;if(d<o)continue;if(d>s)break;m.push(d)}}else for(;l<=c;++l){for(h=i-1,f=a(l);h>=1;--h){d=f*h;if(d<o)continue;if(d>s)break;m.push(d)}}if(m.length*2<p)m=vt(o,s,p)}else{m=vt(l,c,Math.min(c-l,p)).map(a)}return u?m.reverse():m};e.tickFormat=function(t,n){if(n==null)n=i===10?".0e":",";if(typeof n!=="function")n=jt(n);if(t===Infinity)return n;if(t==null)t=10;var o=Math.max(1,i*t/e.ticks().length);return function(t){var e=t/a(Math.round(r(t)));if(e*i<i-.5)e*=i;return e<=o?n(t):""}};e.nice=function(){return n(Md(n(),{floor:function(t){return a(Math.floor(r(t)))},ceil:function(t){return a(Math.ceil(r(t)))}}))};return e}function zd(){var t=Nd(xd()).domain([1,10]);t.copy=function(){return vd(t,zd()).base(t.base())};Qf.apply(t,arguments);return t}function Od(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Rd(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Ud(t){return t<0?-t*t:t*t}function qd(t){var e=t(dd,dd),n=1;function i(){return n===1?t(dd,dd):n===.5?t(Rd,Ud):t(Od(n),Od(1/n))}e.exponent=function(t){return arguments.length?(n=+t,i()):n};return bd(e)}function Id(){var t=qd(xd());t.copy=function(){return vd(t,Id()).exponent(t.exponent())};Qf.apply(t,arguments);return t}function Ld(){return Id.apply(null,arguments).exponent(.5)}function Pd(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function jd(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Wd(t){var e=1,n=t(Pd(e),jd(e));n.constant=function(n){return arguments.length?t(Pd(e=+n),jd(e)):e};return bd(n)}function Xd(){var t=Wd(xd());t.copy=function(){return vd(t,Xd()).constant(t.constant())};return Qf.apply(t,arguments)}var $d=1e3,Hd=$d*60,Yd=Hd*60,Jd=Yd*24,Vd=Jd*7,Gd=Jd*30,Kd=Jd*365;function Zd(t){return new Date(t)}function Qd(t){return t instanceof Date?+t:+new Date(+t)}function tp(t,e,n,i,r,a,o,s,u){var l=_d(),c=l.invert,f=l.domain;var h=u(".%L"),d=u(":%S"),p=u("%I:%M"),m=u("%I %p"),g=u("%a %d"),y=u("%b %d"),v=u("%B"),x=u("%Y");var _=[[o,1,$d],[o,5,5*$d],[o,15,15*$d],[o,30,30*$d],[a,1,Hd],[a,5,5*Hd],[a,15,15*Hd],[a,30,30*Hd],[r,1,Yd],[r,3,3*Yd],[r,6,6*Yd],[r,12,12*Yd],[i,1,Jd],[i,2,2*Jd],[n,1,Vd],[e,1,Gd],[e,3,3*Gd],[t,1,Kd]];function b(s){return(o(s)<s?h:a(s)<s?d:r(s)<s?p:i(s)<s?m:e(s)<s?n(s)<s?g:y:t(s)<s?v:x)(s)}function w(e,n,i){if(e==null)e=10;if(typeof e==="number"){var r=Math.abs(i-n)/e,a=dn((function(t){return t[2]})).right(_,r),o;if(a===_.length){o=_t(n/Kd,i/Kd,e);e=t}else if(a){a=_[r/_[a-1][2]<_[a][2]/r?a-1:a];o=a[1];e=a[0]}else{o=Math.max(_t(n,i,e),1);e=s}return e.every(o)}return e}l.invert=function(t){return new Date(c(t))};l.domain=function(t){return arguments.length?f(Array.from(t,Qd)):f().map(Zd)};l.ticks=function(t){var e=f(),n=e[0],i=e[e.length-1],r=i<n,a;if(r)a=n,n=i,i=a;a=w(t,n,i);a=a?a.range(n,i+1):[];return r?a.reverse():a};l.tickFormat=function(t,e){return e==null?b:u(e)};l.nice=function(t){var e=f();return(t=w(t,e[0],e[e.length-1]))?f(Md(e,t)):l};l.copy=function(){return vd(l,tp(t,e,n,i,r,a,o,s,u))};return l}function ep(){return Qf.apply(tp(Re,Ie,ie,te,je,$e,Je,Ke,Vr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function np(){return Qf.apply(tp(tn,rn,be,ve,sn,cn,Je,Ke,Kr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ip(){var t=0,e=1,n,i,r,a,o=dd,s=false,u;function l(t){return isNaN(t=+t)?u:o(r===0?.5:(t=(a(t)-n)*r,s?Math.max(0,Math.min(1,t)):t))}l.domain=function(o){return arguments.length?([t,e]=o,n=a(t=+t),i=a(e=+e),r=n===i?0:1/(i-n),l):[t,e]};l.clamp=function(t){return arguments.length?(s=!!t,l):s};l.interpolator=function(t){return arguments.length?(o=t,l):o};function c(t){return function(e){var n,i;return arguments.length?([n,i]=e,o=t(n,i),l):[o(0),o(1)]}}l.range=c(ud);l.rangeRound=c(ld);l.unknown=function(t){return arguments.length?(u=t,l):u};return function(o){a=o,n=o(t),i=o(e),r=n===i?0:1/(i-n);return l}}function rp(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function ap(){var t=bd(ip()(dd));t.copy=function(){return rp(t,ap())};return th.apply(t,arguments)}function op(){var t=Nd(ip()).domain([1,10]);t.copy=function(){return rp(t,op()).base(t.base())};return th.apply(t,arguments)}function sp(){var t=Wd(ip());t.copy=function(){return rp(t,sp()).constant(t.constant())};return th.apply(t,arguments)}function up(){var t=qd(ip());t.copy=function(){return rp(t,up()).exponent(t.exponent())};return th.apply(t,arguments)}function lp(){return up.apply(null,arguments).exponent(.5)}function cp(t,e){if(e===undefined)e=t,t=ud;var n=0,i=e.length-1,r=e[0],a=new Array(i<0?0:i);while(n<i)a[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return a[e](t-e)}}function fp(){var t=0,e=.5,n=1,i=1,r,a,o,s,u,l=dd,c,f=false,h;function d(t){return isNaN(t=+t)?h:(t=.5+((t=+c(t))-a)*(i*t<i*a?s:u),l(f?Math.max(0,Math.min(1,t)):t))}d.domain=function(l){return arguments.length?([t,e,n]=l,r=c(t=+t),a=c(e=+e),o=c(n=+n),s=r===a?0:.5/(a-r),u=a===o?0:.5/(o-a),i=a<r?-1:1,d):[t,e,n]};d.clamp=function(t){return arguments.length?(f=!!t,d):f};d.interpolator=function(t){return arguments.length?(l=t,d):l};function p(t){return function(e){var n,i,r;return arguments.length?([n,i,r]=e,l=cp(t,[n,i,r]),d):[l(0),l(.5),l(1)]}}d.range=p(ud);d.rangeRound=p(ld);d.unknown=function(t){return arguments.length?(h=t,d):h};return function(l){c=l,r=l(t),a=l(e),o=l(n),s=r===a?0:.5/(a-r),u=a===o?0:.5/(o-a),i=a<r?-1:1;return d}}function hp(){var t=bd(fp()(dd));t.copy=function(){return rp(t,hp())};return th.apply(t,arguments)}function dp(){var t=Nd(fp()).domain([.1,1,10]);t.copy=function(){return rp(t,dp()).base(t.base())};return th.apply(t,arguments)}function pp(){var t=Wd(fp());t.copy=function(){return rp(t,pp()).constant(t.constant())};return th.apply(t,arguments)}function mp(){var t=qd(fp());t.copy=function(){return rp(t,mp()).exponent(t.exponent())};return th.apply(t,arguments)}function gp(){return mp.apply(null,arguments).exponent(.5)}function yp(){var t=[],e=[],n=[],i;function r(){var i=0,r=Math.max(1,e.length);n=new Array(r-1);while(++i<r)n[i-1]=Qo(t,i/r);return a}function a(t){return isNaN(t=+t)?i:e[Zf(n,t)]}a.invertExtent=function(i){var r=e.indexOf(i);return r<0?[NaN,NaN]:[r>0?n[r-1]:t[0],r<n.length?n[r]:t[t.length-1]]};a.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let n of e)if(n!=null&&!isNaN(n=+n))t.push(n);t.sort(hn);return r()};a.range=function(t){return arguments.length?(e=Array.from(t),r()):e.slice()};a.unknown=function(t){return arguments.length?(i=t,a):i};a.quantiles=function(){return n.slice()};a.copy=function(){return yp().domain(t).range(e).unknown(i)};return Qf.apply(a,arguments)}function vp(){var t=0,e=1,n=1,i=[.5],r=[0,1],a;function o(t){return t<=t?r[Zf(i,t,0,n)]:a}function s(){var r=-1;i=new Array(n);while(++r<n)i[r]=((r+1)*e-(r-n)*t)/(n+1);return o}o.domain=function(n){return arguments.length?([t,e]=n,t=+t,e=+e,s()):[t,e]};o.range=function(t){return arguments.length?(n=(r=Array.from(t)).length-1,s()):r.slice()};o.invertExtent=function(a){var o=r.indexOf(a);return o<0?[NaN,NaN]:o<1?[t,i[0]]:o>=n?[i[n-1],e]:[i[o-1],i[o]]};o.unknown=function(t){return arguments.length?(a=t,o):o};o.thresholds=function(){return i.slice()};o.copy=function(){return vp().domain([t,e]).range(r).unknown(a)};return Qf.apply(bd(o),arguments)}function xp(){var t=[.5],e=[0,1],n,i=1;function r(r){return r<=r?e[Zf(t,r,0,i)]:n}r.domain=function(n){return arguments.length?(t=Array.from(n),i=Math.min(t.length,e.length-1),r):t.slice()};r.range=function(n){return arguments.length?(e=Array.from(n),i=Math.min(t.length,e.length-1),r):e.slice()};r.invertExtent=function(n){var i=e.indexOf(n);return[t[i-1],t[i]]};r.unknown=function(t){return arguments.length?(n=t,r):n};r.copy=function(){return xp().domain(t).range(e).unknown(n)};return Qf.apply(r,arguments)}function _p(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function bp(t,e){var n=Wh(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}var wp=180/Math.PI;var kp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Mp(t,e,n,i,r,a){var o,s,u;if(o=Math.sqrt(t*t+e*e))t/=o,e/=o;if(u=t*n+e*i)n-=t*u,i-=e*u;if(s=Math.sqrt(n*n+i*i))n/=s,i/=s,u/=s;if(t*i<e*n)t=-t,e=-e,u=-u,o=-o;return{translateX:r,translateY:a,rotate:Math.atan2(e,t)*wp,skewX:Math.atan(u)*wp,scaleX:o,scaleY:s}}var Ap;function Ep(t){const e=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?kp:Mp(e.a,e.b,e.c,e.d,e.e,e.f)}function Dp(t){if(t==null)return kp;if(!Ap)Ap=document.createElementNS("http://www.w3.org/2000/svg","g");Ap.setAttribute("transform",t);if(!(t=Ap.transform.baseVal.consolidate()))return kp;t=t.matrix;return Mp(t.a,t.b,t.c,t.d,t.e,t.f)}function Cp(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}function a(t,i,r,a,o,s){if(t!==r||i!==a){var u=o.push("translate(",null,e,null,n);s.push({i:u-4,x:ed(t,r)},{i:u-2,x:ed(i,a)})}else if(r||a){o.push("translate("+r+e+a+n)}}function o(t,e,n,a){if(t!==e){if(t-e>180)e+=360;else if(e-t>180)t+=360;a.push({i:n.push(r(n)+"rotate(",null,i)-2,x:ed(t,e)})}else if(e){n.push(r(n)+"rotate("+e+i)}}function s(t,e,n,a){if(t!==e){a.push({i:n.push(r(n)+"skewX(",null,i)-2,x:ed(t,e)})}else if(e){n.push(r(n)+"skewX("+e+i)}}function u(t,e,n,i,a,o){if(t!==n||e!==i){var s=a.push(r(a)+"scale(",null,",",null,")");o.push({i:s-4,x:ed(t,n)},{i:s-2,x:ed(e,i)})}else if(n!==1||i!==1){a.push(r(a)+"scale("+n+","+i+")")}}return function(e,n){var i=[],r=[];e=t(e),n=t(n);a(e.translateX,e.translateY,n.translateX,n.translateY,i,r);o(e.rotate,n.rotate,i,r);s(e.skewX,n.skewX,i,r);u(e.scaleX,e.scaleY,n.scaleX,n.scaleY,i,r);e=n=null;return function(t){var e=-1,n=r.length,a;while(++e<n)i[(a=r[e]).i]=a.x(t);return i.join("")}}}var Fp=Cp(Ep,"px, ","px)","deg)");var Sp=Cp(Dp,", ",")",")");var Tp=1e-12;function Bp(t){return((t=Math.exp(t))+1/t)/2}function Np(t){return((t=Math.exp(t))-1/t)/2}function zp(t){return((t=Math.exp(2*t))-1)/(t+1)}const Op=function t(e,n,i){function r(t,r){var a=t[0],o=t[1],s=t[2],u=r[0],l=r[1],c=r[2],f=u-a,h=l-o,d=f*f+h*h,p,m;if(d<Tp){m=Math.log(c/s)/e;p=function(t){return[a+t*f,o+t*h,s*Math.exp(e*t*m)]}}else{var g=Math.sqrt(d),y=(c*c-s*s+i*d)/(2*s*n*g),v=(c*c-s*s-i*d)/(2*c*n*g),x=Math.log(Math.sqrt(y*y+1)-y),_=Math.log(Math.sqrt(v*v+1)-v);m=(_-x)/e;p=function(t){var i=t*m,r=Bp(x),u=s/(n*g)*(r*zp(e*i+x)-Np(x));return[a+u*f,o+u*h,s*r/Bp(e*i+x)]}}p.duration=m*1e3*e/Math.SQRT2;return p}r.rho=function(e){var n=Math.max(.001,+e),i=n*n,r=i*i;return t(n,i,r)};return r}(Math.SQRT2,2,4);function Rp(t){return function(e,n){var i=t((e=zh(e)).h,(n=zh(n)).h),r=$h(e.s,n.s),a=$h(e.l,n.l),o=$h(e.opacity,n.opacity);return function(t){e.h=i(t);e.s=r(t);e.l=a(t);e.opacity=o(t);return e+""}}}const Up=Rp(Wh);var qp=Rp($h);const Ip=Math.PI/180;const Lp=180/Math.PI;const Pp=18,jp=.96422,Wp=1,Xp=.82521,$p=4/29,Hp=6/29,Yp=3*Hp*Hp,Jp=Hp*Hp*Hp;function Vp(t){if(t instanceof Zp)return new Zp(t.l,t.a,t.b,t.opacity);if(t instanceof om)return sm(t);if(!(t instanceof Ch))t=Eh(t);var e=nm(t.r),n=nm(t.g),i=nm(t.b),r=Qp((.2225045*e+.7168786*n+.0606169*i)/Wp),a,o;if(e===n&&n===i)a=o=r;else{a=Qp((.4360747*e+.3850649*n+.1430804*i)/jp);o=Qp((.0139322*e+.0971045*n+.7141733*i)/Xp)}return new Zp(116*r-16,500*(a-r),200*(r-o),t.opacity)}function Gp(t,e){return new Zp(t,0,0,e==null?1:e)}function Kp(t,e,n,i){return arguments.length===1?Vp(t):new Zp(t,e,n,i==null?1:i)}function Zp(t,e,n,i){this.l=+t;this.a=+e;this.b=+n;this.opacity=+i}rh(Zp,Kp,ah(oh,{brighter:function(t){return new Zp(this.l+Pp*(t==null?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Zp(this.l-Pp*(t==null?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;e=jp*tm(e);t=Wp*tm(t);n=Xp*tm(n);return new Ch(em(3.1338561*e-1.6168667*t-.4906146*n),em(-.9787684*e+1.9161415*t+.033454*n),em(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function Qp(t){return t>Jp?Math.pow(t,1/3):t/Yp+$p}function tm(t){return t>Hp?t*t*t:Yp*(t-$p)}function em(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function nm(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function im(t){if(t instanceof om)return new om(t.h,t.c,t.l,t.opacity);if(!(t instanceof Zp))t=Vp(t);if(t.a===0&&t.b===0)return new om(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Lp;return new om(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function rm(t,e,n,i){return arguments.length===1?im(t):new om(n,e,t,i==null?1:i)}function am(t,e,n,i){return arguments.length===1?im(t):new om(t,e,n,i==null?1:i)}function om(t,e,n,i){this.h=+t;this.c=+e;this.l=+n;this.opacity=+i}function sm(t){if(isNaN(t.h))return new Zp(t.l,0,0,t.opacity);var e=t.h*Ip;return new Zp(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}rh(om,am,ah(oh,{brighter:function(t){return new om(this.h,this.c,this.l+Pp*(t==null?1:t),this.opacity)},darker:function(t){return new om(this.h,this.c,this.l-Pp*(t==null?1:t),this.opacity)},rgb:function(){return sm(this).rgb()}}));function um(t,e){var n=$h((t=Kp(t)).l,(e=Kp(e)).l),i=$h(t.a,e.a),r=$h(t.b,e.b),a=$h(t.opacity,e.opacity);return function(e){t.l=n(e);t.a=i(e);t.b=r(e);t.opacity=a(e);return t+""}}function lm(t){return function(e,n){var i=t((e=am(e)).h,(n=am(n)).h),r=$h(e.c,n.c),a=$h(e.l,n.l),o=$h(e.opacity,n.opacity);return function(t){e.h=i(t);e.c=r(t);e.l=a(t);e.opacity=o(t);return e+""}}}const cm=lm(Wh);var fm=lm($h);var hm=-.14861,dm=+1.78277,pm=-.29227,mm=-.90649,gm=+1.97294,ym=gm*mm,vm=gm*dm,xm=dm*pm-mm*hm;function _m(t){if(t instanceof wm)return new wm(t.h,t.s,t.l,t.opacity);if(!(t instanceof Ch))t=Eh(t);var e=t.r/255,n=t.g/255,i=t.b/255,r=(xm*i+ym*e-vm*n)/(xm+ym-vm),a=i-r,o=(gm*(n-r)-pm*a)/mm,s=Math.sqrt(o*o+a*a)/(gm*r*(1-r)),u=s?Math.atan2(o,a)*Lp-120:NaN;return new wm(u<0?u+360:u,s,r,t.opacity)}function bm(t,e,n,i){return arguments.length===1?_m(t):new wm(t,e,n,i==null?1:i)}function wm(t,e,n,i){this.h=+t;this.s=+e;this.l=+n;this.opacity=+i}rh(wm,bm,ah(oh,{brighter:function(t){t=t==null?uh:Math.pow(uh,t);return new wm(this.h,this.s,this.l*t,this.opacity)},darker:function(t){t=t==null?sh:Math.pow(sh,t);return new wm(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Ip,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new Ch(255*(e+n*(hm*i+dm*r)),255*(e+n*(pm*i+mm*r)),255*(e+n*(gm*i)),this.opacity)}}));function km(t){return function e(n){n=+n;function i(e,i){var r=t((e=bm(e)).h,(i=bm(i)).h),a=$h(e.s,i.s),o=$h(e.l,i.l),s=$h(e.opacity,i.opacity);return function(t){e.h=r(t);e.s=a(t);e.l=o(Math.pow(t,n));e.opacity=s(t);return e+""}}i.gamma=e;return i}(1)}const Mm=km(Wh);var Am=km($h);function Em(t,e){var n=new Array(e);for(var i=0;i<e;++i)n[i]=t(i/(e-1));return n}function Dm(t,e,n){const i=t-e+n*2;return t?i>0?i:1:0}const Cm="identity";const Fm="linear";const Sm="log";const Tm="pow";const Bm="sqrt";const Nm="symlog";const zm="time";const Om="utc";const Rm="sequential";const Um="diverging";const qm="quantile";const Im="quantize";const Lm="threshold";const Pm="ordinal";const jm="point";const Wm="band";const Xm="bin-ordinal";const $m="continuous";const Hm="discrete";const Ym="discretizing";const Jm="interpolating";const Vm="temporal";function Gm(t){return function(e){let n=e[0],i=e[1],r;if(i<n){r=n;n=i;i=r}return[t.invert(n),t.invert(i)]}}function Km(t){return function(e){const n=t.range();let i=e[0],r=e[1],a=-1,o,s,u,l;if(r<i){s=i;i=r;r=s}for(u=0,l=n.length;u<l;++u){if(n[u]>=i&&n[u]<=r){if(a<0)a=u;o=u}}if(a<0)return undefined;i=t.invertExtent(n[a]);r=t.invertExtent(n[o]);return[i[0]===undefined?i[1]:i[0],r[1]===undefined?r[0]:r[1]]}}function Zm(){const t=nh().unknown(undefined),e=t.domain,n=t.range;let i=[0,1],r,a,o=false,s=0,u=0,l=.5;delete t.unknown;function c(){const t=e().length,c=i[1]<i[0],f=i[1-c],h=Dm(t,s,u);let d=i[c-0];r=(f-d)/(h||1);if(o){r=Math.floor(r)}d+=(f-d-r*(t-s))*l;a=r*(1-s);if(o){d=Math.round(d);a=Math.round(a)}const p=ru(t).map((t=>d+r*t));return n(c?p.reverse():p)}t.domain=function(t){if(arguments.length){e(t);return c()}else{return e()}};t.range=function(t){if(arguments.length){i=[+t[0],+t[1]];return c()}else{return i.slice()}};t.rangeRound=function(t){i=[+t[0],+t[1]];o=true;return c()};t.bandwidth=function(){return a};t.step=function(){return r};t.round=function(t){if(arguments.length){o=!!t;return c()}else{return o}};t.padding=function(t){if(arguments.length){u=Math.max(0,Math.min(1,t));s=u;return c()}else{return s}};t.paddingInner=function(t){if(arguments.length){s=Math.max(0,Math.min(1,t));return c()}else{return s}};t.paddingOuter=function(t){if(arguments.length){u=Math.max(0,Math.min(1,t));return c()}else{return u}};t.align=function(t){if(arguments.length){l=Math.max(0,Math.min(1,t));return c()}else{return l}};t.invertRange=function(t){if(t[0]==null||t[1]==null)return;const r=i[1]<i[0],o=r?n().reverse():n(),s=o.length-1;let u=+t[0],l=+t[1],c,f,h;if(u!==u||l!==l)return;if(l<u){h=u;u=l;l=h}if(l<o[0]||u>i[1-r])return;c=Math.max(0,Vf(o,u)-1);f=u===l?c:Vf(o,l)-1;if(u-o[c]>a+1e-10)++c;if(r){h=c;c=s-f;f=s-h}return c>f?undefined:e().slice(c,f+1)};t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n};t.copy=function(){return Zm().domain(e()).range(i).round(o).paddingInner(s).paddingOuter(u).align(l)};return c()}function Qm(t){const e=t.copy;t.padding=t.paddingOuter;delete t.paddingInner;t.copy=function(){return Qm(e())};return t}function tg(){return Qm(Zm().paddingInner(1))}var eg=Array.prototype.map;function ng(t){return eg.call(t,m.He)}const ig=Array.prototype.slice;function rg(){let t=[],e=[];function n(n){return n==null||n!==n?undefined:e[(Zf(t,n)-1)%e.length]}n.domain=function(e){if(arguments.length){t=ng(e);return n}else{return t.slice()}};n.range=function(t){if(arguments.length){e=ig.call(t);return n}else{return e.slice()}};n.tickFormat=function(e,n){return ih(t[0],(0,m.fj)(t),e==null?10:e,n)};n.copy=function(){return rg().domain(n.domain()).range(n.range())};return n}const ag={};function og(t,e,n){const i=function n(){const i=e();if(!i.invertRange){i.invertRange=i.invert?Gm(i):i.invertExtent?Km(i):undefined}i.type=t;return i};i.metadata=(0,m.Rg)((0,m.IX)(n));return i}function sg(t,e,n){if(arguments.length>1){ag[t]=og(t,e,n);return this}else{return ug(t)?ag[t]:undefined}}sg(Cm,kd);sg(Fm,wd,$m);sg(Sm,zd,[$m,Sm]);sg(Tm,Id,$m);sg(Bm,Ld,$m);sg(Nm,Xd,$m);sg(zm,ep,[$m,Vm]);sg(Om,np,[$m,Vm]);sg(Rm,ap,[$m,Jm]);sg("".concat(Rm,"-").concat(Fm),ap,[$m,Jm]);sg("".concat(Rm,"-").concat(Sm),op,[$m,Jm,Sm]);sg("".concat(Rm,"-").concat(Tm),up,[$m,Jm]);sg("".concat(Rm,"-").concat(Bm),lp,[$m,Jm]);sg("".concat(Rm,"-").concat(Nm),sp,[$m,Jm]);sg("".concat(Um,"-").concat(Fm),hp,[$m,Jm]);sg("".concat(Um,"-").concat(Sm),dp,[$m,Jm,Sm]);sg("".concat(Um,"-").concat(Tm),mp,[$m,Jm]);sg("".concat(Um,"-").concat(Bm),gp,[$m,Jm]);sg("".concat(Um,"-").concat(Nm),pp,[$m,Jm]);sg(qm,yp,[Ym,qm]);sg(Im,vp,Ym);sg(Lm,xp,Ym);sg(Xm,rg,[Hm,Ym]);sg(Pm,nh,Hm);sg(Wm,Zm,Hm);sg(jm,tg,Hm);function ug(t){return(0,m.nr)(ag,t)}function lg(t,e){const n=ag[t];return n&&n.metadata[e]}function cg(t){return lg(t,$m)}function fg(t){return lg(t,Hm)}function hg(t){return lg(t,Ym)}function dg(t){return lg(t,Sm)}function pg(t){return lg(t,Vm)}function mg(t){return lg(t,Jm)}function gg(t){return lg(t,qm)}const yg=["clamp","base","constant","exponent"];function vg(t,e){const n=e[0],i=(0,m.fj)(e)-n;return function(e){return t(n+e*i)}}function xg(t,e,n){return cp(kg(e||"rgb",n),t)}function _g(t,e){const n=new Array(e),i=e+1;for(let r=0;r<e;)n[r]=t(++r/i);return n}function bg(t){const e=t.type,n=t.copy();n.type=e;return n}function wg(t,e,n){const i=n-e;let r,a,o;if(!i||!Number.isFinite(i)){return(0,m.a9)(.5)}else{r=(a=t.type).indexOf("-");a=r<0?a:a.slice(r+1);o=sg(a)().domain([e,n]).range([0,1]);yg.forEach((e=>t[e]?o[e](t[e]()):0));return o}}function kg(t,e){const n=r[Mg(t)];return e!=null&&n&&n.gamma?n.gamma(e):n}function Mg(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}const Ag={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"};const Eg={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function Dg(t){const e=t.length/6|0,n=new Array(e);for(let i=0;i<e;){n[i]="#"+t.slice(i*6,++i*6)}return n}function Cg(t,e){for(const n in t)Sg(n,e(t[n]))}const Fg={};Cg(Eg,Dg);Cg(Ag,(t=>xg(Dg(t))));function Sg(t,e){t=t&&t.toLowerCase();if(arguments.length>1){Fg[t]=e;return this}else{return Fg[t]}}const Tg="symbol";const Bg="discrete";const Ng="gradient";const zg=t=>(0,m.kJ)(t)?t.map((t=>String(t))):String(t);const Og=(t,e)=>t[1]-e[1];const Rg=(t,e)=>e[1]-t[1];function Ug(t,e,n){let i;if((0,m.hj)(e)){if(t.bins){e=Math.max(e,t.bins.length)}if(n!=null){e=Math.min(e,Math.floor((0,m.yP)(t.domain())/n||1))}}if((0,m.Kn)(e)){i=e.step;e=e.interval}if((0,m.HD)(e)){e=t.type===zm?ni(e):t.type==Om?ii(e):(0,m.vU)("Only time and utc scales accept interval strings.");if(i)e=e.every(i)}return e}function qg(t,e,n){let i=t.range(),r=i[0],a=(0,m.fj)(i),o=Og;if(r>a){i=a;a=r;r=i;o=Rg}r=Math.floor(r);a=Math.ceil(a);e=e.map((e=>[e,t(e)])).filter((t=>r<=t[1]&&t[1]<=a)).sort(o).map((t=>t[0]));if(n>0&&e.length>1){const t=[e[0],(0,m.fj)(e)];while(e.length>n&&e.length>=3){e=e.filter(((t,e)=>!(e%2)))}if(e.length<3){e=t}}return e}function Ig(t,e){return t.bins?qg(t,t.bins):t.ticks?t.ticks(e):t.domain()}function Lg(t,e,n,i,r,a){const o=e.type;let s=zg;if(o===zm||r===zm){s=t.timeFormat(i)}else if(o===Om||r===Om){s=t.utcFormat(i)}else if(dg(o)){const r=t.formatFloat(i);if(a||e.bins){s=r}else{const t=Pg(e,n,false);s=e=>t(e)?r(e):""}}else if(e.tickFormat){const r=e.domain();s=t.formatSpan(r[0],r[r.length-1],n,i)}else if(i){s=t.format(i)}return s}function Pg(t,e,n){const i=Ig(t,e),r=t.base(),a=Math.log(r),o=Math.max(1,r*e/i.length);const s=t=>{let e=t/Math.pow(r,Math.round(Math.log(t)/a));if(e*r<r-.5)e*=r;return e<=o};return n?i.filter(s):s}const jg={[qm]:"quantiles",[Im]:"thresholds",[Lm]:"domain"};const Wg={[qm]:"quantiles",[Im]:"domain"};function Xg(t,e){return t.bins?Yg(t.bins):t.type===Sm?Pg(t,e,true):jg[t.type]?Hg(t[jg[t.type]]()):Ig(t,e)}function $g(t,e,n){const i=e[Wg[e.type]](),r=i.length;let a=r>1?i[1]-i[0]:i[0],o;for(o=1;o<r;++o){a=Math.min(a,i[o]-i[o-1])}return t.formatSpan(0,a,3*10,n)}function Hg(t){const e=[-Infinity].concat(t);e.max=+Infinity;return e}function Yg(t){const e=t.slice(0,-1);e.max=(0,m.fj)(t);return e}const Jg=t=>jg[t.type]||t.bins;function Vg(t,e,n,i,r,a,o){const s=Wg[e.type]&&a!==zm&&a!==Om?$g(t,e,r):Lg(t,e,n,r,a,o);return i===Tg&&Jg(e)?Gg(s):i===Bg?Zg(s):Qg(s)}const Gg=t=>(e,n,i)=>{const r=Kg(i[n+1],Kg(i.max,+Infinity)),a=ty(e,t),o=ty(r,t);return a&&o?a+" – "+o:o?"< "+o:"≥ "+a};const Kg=(t,e)=>t!=null?t:e;const Zg=t=>(e,n)=>n?t(e):null;const Qg=t=>e=>t(e);const ty=(t,e)=>Number.isFinite(t)?e(t):null;function ey(t){const e=t.domain(),n=e.length-1;let i=+e[0],r=+(0,m.fj)(e),a=r-i;if(t.type===Lm){const t=n?a/n:.1;i-=t;r+=t;a=r-i}return t=>(t-i)/a}function ny(t,e,n,i){const r=i||e.type;if((0,m.HD)(n)&&pg(r)){n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")}return!n&&r===zm?t.timeFormat("%A, %d %B %Y, %X"):!n&&r===Om?t.utcFormat("%A, %d %B %Y, %X UTC"):Vg(t,e,5,null,n,i,true)}function iy(t,e,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=ny(t,e,n.format,n.formatType);if(hg(e.type)){const t=Xg(e).slice(1).map(r),n=t.length;return"".concat(n," boundar").concat(n===1?"y":"ies",": ").concat(t.join(", "))}else if(fg(e.type)){const t=e.domain(),n=t.length,a=n>i?t.slice(0,i-2).map(r).join(", ")+", ending with "+t.slice(-1).map(r):t.map(r).join(", ");return"".concat(n," value").concat(n===1?"":"s",": ").concat(a)}else{const t=e.domain();return"values from ".concat(r(t[0])," to ").concat(r((0,m.fj)(t)))}}let ry=0;function ay(){ry=0}const oy="p_";function sy(t){return t&&t.gradient}function uy(t,e,n){const i=t.gradient;let r=t.id,a=i==="radial"?oy:"";if(!r){r=t.id="gradient_"+ry++;if(i==="radial"){t.x1=ly(t.x1,.5);t.y1=ly(t.y1,.5);t.r1=ly(t.r1,0);t.x2=ly(t.x2,.5);t.y2=ly(t.y2,.5);t.r2=ly(t.r2,.5);a=oy}else{t.x1=ly(t.x1,0);t.y1=ly(t.y1,0);t.x2=ly(t.x2,1);t.y2=ly(t.y2,0)}}e[r]=t;return"url("+(n||"")+"#"+a+r+")"}function ly(t,e){return t!=null?t:e}function cy(t,e){var n=[],i;return i={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:n,stop:function(t,e){n.push({offset:t,color:e});return i}}}const fy={basis:{curve:nc},"basis-closed":{curve:ac},"basis-open":{curve:sc},bundle:{curve:lc,tension:"beta",value:.85},cardinal:{curve:hc,tension:"tension",value:0},"cardinal-open":{curve:pc,tension:"tension",value:0},"cardinal-closed":{curve:gc,tension:"tension",value:0},"catmull-rom":{curve:Bc,tension:"alpha",value:.5},"catmull-rom-closed":{curve:zc,tension:"alpha",value:.5},"catmull-rom-open":{curve:Rc,tension:"alpha",value:.5},linear:{curve:qc},"linear-closed":{curve:Lc},monotone:{horizontal:Vc,vertical:Jc},natural:{curve:Zc},step:{curve:tf},"step-after":{curve:nf},"step-before":{curve:ef}};function hy(t,e,n){var i=(0,m.nr)(fy,t)&&fy[t],r=null;if(i){r=i.curve||i[e||"vertical"];if(i.tension&&n!=null){r=r[i.tension](n)}}return r}const dy={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},py=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function my(t){const e=[];let n,i,r,a,o,s,u,l,c,f;const h=t.slice().replace(py[0],"###$1").split(py[1]).slice(1);for(u=0,c=h.length;u<c;++u){n=h[u];i=n.slice(1).trim().replace(py[2],"$1###$2").replace(py[3],"$1###$2").split(py[4]);o=n.charAt(0);r=[o];for(l=0,f=i.length;l<f;++l){if((a=+i[l])===a){r.push(a)}}s=dy[o.toLowerCase()];if(r.length-1>s){const t=r.length;l=1;e.push([o].concat(r.slice(l,l+=s)));o=o==="M"?"L":o==="m"?"l":o;for(;l<t;l+=s){e.push([o].concat(r.slice(l,l+s)))}}else{e.push(r)}}return e}const gy=Math.PI/180;const yy=1e-14;const vy=Math.PI/2;const xy=Math.PI*2;const _y=Math.sqrt(3)/2;var by={};var wy={};var ky=[].join;function My(t,e,n,i,r,a,o,s,u){const l=ky.call(arguments);if(by[l]){return by[l]}const c=o*gy;const f=Math.sin(c);const h=Math.cos(c);n=Math.abs(n);i=Math.abs(i);const d=h*(s-t)*.5+f*(u-e)*.5;const p=h*(u-e)*.5-f*(s-t)*.5;let m=d*d/(n*n)+p*p/(i*i);if(m>1){m=Math.sqrt(m);n*=m;i*=m}const g=h/n;const y=f/n;const v=-f/i;const x=h/i;const _=g*s+y*u;const b=v*s+x*u;const w=g*t+y*e;const k=v*t+x*e;const M=(w-_)*(w-_)+(k-b)*(k-b);let A=1/M-.25;if(A<0)A=0;let E=Math.sqrt(A);if(a==r)E=-E;const D=.5*(_+w)-E*(k-b);const C=.5*(b+k)+E*(w-_);const F=Math.atan2(b-C,_-D);const S=Math.atan2(k-C,w-D);let T=S-F;if(T<0&&a===1){T+=xy}else if(T>0&&a===0){T-=xy}const B=Math.ceil(Math.abs(T/(vy+.001)));const N=[];for(let z=0;z<B;++z){const t=F+z*T/B;const e=F+(z+1)*T/B;N[z]=[D,C,t,e,n,i,f,h]}return by[l]=N}function Ay(t){const e=ky.call(t);if(wy[e]){return wy[e]}var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7];const c=l*o;const f=-u*s;const h=u*o;const d=l*s;const p=Math.cos(r);const m=Math.sin(r);const g=Math.cos(a);const y=Math.sin(a);const v=.5*(a-r);const x=Math.sin(v*.5);const _=8/3*x*x/Math.sin(v);const b=n+p-_*m;const w=i+m+_*p;const k=n+g;const M=i+y;const A=k+_*y;const E=M-_*g;return wy[e]=[c*b+f*w,h*b+d*w,c*A+f*E,h*A+d*E,c*k+f*M,h*k+d*M]}const Ey=["l",0,0,0,0,0,0,0];function Dy(t,e,n){const i=Ey[0]=t[0];if(i==="a"||i==="A"){Ey[1]=e*t[1];Ey[2]=n*t[2];Ey[3]=t[3];Ey[4]=t[4];Ey[5]=t[5];Ey[6]=e*t[6];Ey[7]=n*t[7]}else if(i==="h"||i==="H"){Ey[1]=e*t[1]}else if(i==="v"||i==="V"){Ey[1]=n*t[1]}else{for(var r=1,a=t.length;r<a;++r){Ey[r]=(r%2==1?e:n)*t[r]}}return Ey}function Cy(t,e,n,i,r,a){var o,s=null,u=0,l=0,c=0,f=0,h,d,p,m;if(n==null)n=0;if(i==null)i=0;if(r==null)r=1;if(a==null)a=r;if(t.beginPath)t.beginPath();for(var g=0,y=e.length;g<y;++g){o=e[g];if(r!==1||a!==1){o=Dy(o,r,a)}switch(o[0]){case"l":u+=o[1];l+=o[2];t.lineTo(u+n,l+i);break;case"L":u=o[1];l=o[2];t.lineTo(u+n,l+i);break;case"h":u+=o[1];t.lineTo(u+n,l+i);break;case"H":u=o[1];t.lineTo(u+n,l+i);break;case"v":l+=o[1];t.lineTo(u+n,l+i);break;case"V":l=o[1];t.lineTo(u+n,l+i);break;case"m":u+=o[1];l+=o[2];t.moveTo(u+n,l+i);break;case"M":u=o[1];l=o[2];t.moveTo(u+n,l+i);break;case"c":h=u+o[5];d=l+o[6];c=u+o[3];f=l+o[4];t.bezierCurveTo(u+o[1]+n,l+o[2]+i,c+n,f+i,h+n,d+i);u=h;l=d;break;case"C":u=o[5];l=o[6];c=o[3];f=o[4];t.bezierCurveTo(o[1]+n,o[2]+i,c+n,f+i,u+n,l+i);break;case"s":h=u+o[3];d=l+o[4];c=2*u-c;f=2*l-f;t.bezierCurveTo(c+n,f+i,u+o[1]+n,l+o[2]+i,h+n,d+i);c=u+o[1];f=l+o[2];u=h;l=d;break;case"S":h=o[3];d=o[4];c=2*u-c;f=2*l-f;t.bezierCurveTo(c+n,f+i,o[1]+n,o[2]+i,h+n,d+i);u=h;l=d;c=o[1];f=o[2];break;case"q":h=u+o[3];d=l+o[4];c=u+o[1];f=l+o[2];t.quadraticCurveTo(c+n,f+i,h+n,d+i);u=h;l=d;break;case"Q":h=o[3];d=o[4];t.quadraticCurveTo(o[1]+n,o[2]+i,h+n,d+i);u=h;l=d;c=o[1];f=o[2];break;case"t":h=u+o[1];d=l+o[2];if(s[0].match(/[QqTt]/)===null){c=u;f=l}else if(s[0]==="t"){c=2*u-p;f=2*l-m}else if(s[0]==="q"){c=2*u-c;f=2*l-f}p=c;m=f;t.quadraticCurveTo(c+n,f+i,h+n,d+i);u=h;l=d;c=u+o[1];f=l+o[2];break;case"T":h=o[1];d=o[2];c=2*u-c;f=2*l-f;t.quadraticCurveTo(c+n,f+i,h+n,d+i);u=h;l=d;break;case"a":Fy(t,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":Fy(t,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":t.closePath();break}s=o}}function Fy(t,e,n,i){const r=My(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let a=0;a<r.length;++a){const e=Ay(r[a]);t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5])}}const Sy=.5773502691896257;const Ty={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0);t.arc(0,0,n,0,xy)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i);t.lineTo(-n,i);t.lineTo(-i,i);t.lineTo(-i,n);t.lineTo(i,n);t.lineTo(i,i);t.lineTo(n,i);t.lineTo(n,-i);t.lineTo(i,-i);t.lineTo(i,-n);t.lineTo(-i,-n);t.lineTo(-i,-i);t.closePath()}},diamond:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0);t.lineTo(0,-n);t.lineTo(n,0);t.lineTo(0,n);t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,a=n/8;t.moveTo(-i,n);t.lineTo(i,n);t.lineTo(i,-a);t.lineTo(r,-a);t.lineTo(0,-n);t.lineTo(-r,-a);t.lineTo(-i,-a);t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=_y*n,r=i-n*Sy,a=n/4;t.moveTo(0,-i-r);t.lineTo(-a,i-r);t.lineTo(a,i-r);t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=_y*n,r=i-n*Sy;t.moveTo(0,-i-r);t.lineTo(-n,i-r);t.lineTo(n,i-r);t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_y*n;t.moveTo(0,-i);t.lineTo(-n,i);t.lineTo(n,i);t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_y*n;t.moveTo(0,i);t.lineTo(-n,-i);t.lineTo(n,-i);t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_y*n;t.moveTo(i,0);t.lineTo(-i,-n);t.lineTo(-i,n);t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=_y*n;t.moveTo(-i,0);t.lineTo(i,-n);t.lineTo(i,n);t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0);t.lineTo(n,0)}}};function By(t){return(0,m.nr)(Ty,t)?Ty[t]:zy(t)}var Ny={};function zy(t){if(!(0,m.nr)(Ny,t)){const e=my(t);Ny[t]={draw:function(t,n){Cy(t,e,0,0,Math.sqrt(n)/2)}}}return Ny[t]}const Oy=.448084975506;function Ry(t){return t.x}function Uy(t){return t.y}function qy(t){return t.width}function Iy(t){return t.height}function Ly(t){return typeof t==="function"?t:()=>+t}function Py(t,e,n){return Math.max(e,Math.min(t,n))}function jy(){var t=Ry,e=Uy,n=qy,i=Iy,r=Ly(0),a=r,o=r,s=r,u=null;function l(l,c,f){var h,d=c!=null?c:+t.call(this,l),p=f!=null?f:+e.call(this,l),m=+n.call(this,l),g=+i.call(this,l),y=Math.min(m,g)/2,v=Py(+r.call(this,l),0,y),x=Py(+a.call(this,l),0,y),_=Py(+o.call(this,l),0,y),b=Py(+s.call(this,l),0,y);if(!u)u=h=cf();if(v<=0&&x<=0&&_<=0&&b<=0){u.rect(d,p,m,g)}else{var w=d+m,k=p+g;u.moveTo(d+v,p);u.lineTo(w-x,p);u.bezierCurveTo(w-Oy*x,p,w,p+Oy*x,w,p+x);u.lineTo(w,k-b);u.bezierCurveTo(w,k-Oy*b,w-Oy*b,k,w-b,k);u.lineTo(d+_,k);u.bezierCurveTo(d+Oy*_,k,d,k-Oy*_,d,k-_);u.lineTo(d,p+v);u.bezierCurveTo(d,p+Oy*v,d+Oy*v,p,d+v,p);u.closePath()}if(h){u=null;return h+""||null}}l.x=function(e){if(arguments.length){t=Ly(e);return l}else{return t}};l.y=function(t){if(arguments.length){e=Ly(t);return l}else{return e}};l.width=function(t){if(arguments.length){n=Ly(t);return l}else{return n}};l.height=function(t){if(arguments.length){i=Ly(t);return l}else{return i}};l.cornerRadius=function(t,e,n,i){if(arguments.length){r=Ly(t);a=e!=null?Ly(e):r;s=n!=null?Ly(n):r;o=i!=null?Ly(i):a;return l}else{return r}};l.context=function(t){if(arguments.length){u=t==null?null:t;return l}else{return u}};return l}function Wy(){var t,e,n,i,r=null,a,o,s,u;function l(t,e,n){const i=n/2;if(a){var l=s-e,c=t-o;if(l||c){var f=Math.sqrt(l*l+c*c),h=(l/=f)*u,d=(c/=f)*u,p=Math.atan2(c,l);r.moveTo(o-h,s-d);r.lineTo(t-l*i,e-c*i);r.arc(t,e,i,p-Math.PI,p);r.lineTo(o+h,s+d);r.arc(o,s,u,p,p+Math.PI)}else{r.arc(t,e,i,0,xy)}r.closePath()}else{a=1}o=t;s=e;u=i}function c(o){var s,u=o.length,c,f=false,h;if(r==null)r=h=cf();for(s=0;s<=u;++s){if(!(s<u&&i(c=o[s],s,o))===f){if(f=!f)a=0}if(f)l(+t(c,s,o),+e(c,s,o),+n(c,s,o))}if(h){r=null;return h+""||null}}c.x=function(e){if(arguments.length){t=e;return c}else{return t}};c.y=function(t){if(arguments.length){e=t;return c}else{return e}};c.size=function(t){if(arguments.length){n=t;return c}else{return n}};c.defined=function(t){if(arguments.length){i=t;return c}else{return i}};c.context=function(t){if(arguments.length){if(t==null){r=null}else{r=t}return c}else{return r}};return c}function Xy(t,e){return t!=null?t:e}const $y=t=>t.x||0,Hy=t=>t.y||0,Yy=t=>t.width||0,Jy=t=>t.height||0,Vy=t=>(t.x||0)+(t.width||0),Gy=t=>(t.y||0)+(t.height||0),Ky=t=>t.startAngle||0,Zy=t=>t.endAngle||0,Qy=t=>t.padAngle||0,tv=t=>t.innerRadius||0,ev=t=>t.outerRadius||0,nv=t=>t.cornerRadius||0,iv=t=>Xy(t.cornerRadiusTopLeft,t.cornerRadius)||0,rv=t=>Xy(t.cornerRadiusTopRight,t.cornerRadius)||0,av=t=>Xy(t.cornerRadiusBottomRight,t.cornerRadius)||0,ov=t=>Xy(t.cornerRadiusBottomLeft,t.cornerRadius)||0,sv=t=>Xy(t.size,64),uv=t=>t.size||1,lv=t=>!(t.defined===false),cv=t=>By(t.shape||"circle");const fv=xf().startAngle(Ky).endAngle(Zy).padAngle(Qy).innerRadius(tv).outerRadius(ev).cornerRadius(nv),hv=Af().x($y).y1(Hy).y0(Gy).defined(lv),dv=Af().y(Hy).x1($y).x0(Vy).defined(lv),pv=Mf().x($y).y(Hy).defined(lv),mv=jy().x($y).y(Hy).width(Yy).height(Jy).cornerRadius(iv,rv,av,ov),gv=$f().type(cv).size(sv),yv=Wy().x($y).y(Hy).defined(lv).size(uv);function vv(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function xv(t,e){return fv.context(t)(e)}function _v(t,e){const n=e[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?dv:hv).curve(hy(i,n.orient,n.tension)).context(t)(e)}function bv(t,e){const n=e[0],i=n.interpolate||"linear";return pv.curve(hy(i,n.orient,n.tension)).context(t)(e)}function wv(t,e,n,i){return mv.context(t)(e,n,i)}function kv(t,e){return(e.mark.shape||e.shape).context(t)(e)}function Mv(t,e){return gv.context(t)(e)}function Av(t,e){return yv.context(t)(e)}var Ev=1;function Dv(){Ev=1}function Cv(t,e,n){var i=e.clip,r=t._defs,a=e.clip_id||(e.clip_id="clip"+Ev++),o=r.clipping[a]||(r.clipping[a]={id:a});if((0,m.mf)(i)){o.path=i(null)}else if(vv(n)){o.path=wv(null,n,0,0)}else{o.width=n.width||0;o.height=n.height||0}return"url(#"+a+")"}function Fv(t){this.clear();if(t)this.union(t)}Fv.prototype={clone(){return new Fv(this)},clear(){this.x1=+Number.MAX_VALUE;this.y1=+Number.MAX_VALUE;this.x2=-Number.MAX_VALUE;this.y2=-Number.MAX_VALUE;return this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,i){if(n<t){this.x2=t;this.x1=n}else{this.x1=t;this.x2=n}if(i<e){this.y2=e;this.y1=i}else{this.y1=e;this.y2=i}return this},add(t,e){if(t<this.x1)this.x1=t;if(e<this.y1)this.y1=e;if(t>this.x2)this.x2=t;if(e>this.y2)this.y2=e;return this},expand(t){this.x1-=t;this.y1-=t;this.x2+=t;this.y2+=t;return this},round(){this.x1=Math.floor(this.x1);this.y1=Math.floor(this.y1);this.x2=Math.ceil(this.x2);this.y2=Math.ceil(this.y2);return this},scale(t){this.x1*=t;this.y1*=t;this.x2*=t;this.y2*=t;return this},translate(t,e){this.x1+=t;this.x2+=t;this.y1+=e;this.y2+=e;return this},rotate(t,e,n){const i=this.rotatedPoints(t,e,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(t,e,n){var{x1:i,y1:r,x2:a,y2:o}=this,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*i-u*r+l,u*i+s*r+c,s*i-u*o+l,u*i+s*o+c,s*a-u*r+l,u*a+s*r+c,s*a-u*o+l,u*a+s*o+c]},union(t){if(t.x1<this.x1)this.x1=t.x1;if(t.y1<this.y1)this.y1=t.y1;if(t.x2>this.x2)this.x2=t.x2;if(t.y2>this.y2)this.y2=t.y2;return this},intersect(t){if(t.x1>this.x1)this.x1=t.x1;if(t.y1>this.y1)this.y1=t.y1;if(t.x2<this.x2)this.x2=t.x2;if(t.y2<this.y2)this.y2=t.y2;return this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Sv(t){this.mark=t;this.bounds=this.bounds||new Fv}function Tv(t){Sv.call(this,t);this.items=this.items||[]}(0,m.XW)(Tv,Sv);function Bv(t){this._pending=0;this._loader=t||_a()}function Nv(t){t._pending+=1}function zv(t){t._pending-=1}Bv.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;Nv(e);return e._loader.sanitize(t,{context:"href"}).then((t=>{zv(e);return t})).catch((()=>{zv(e);return null}))},loadImage(t){const e=this,n=Yf();Nv(e);return e._loader.sanitize(t,{context:"image"}).then((t=>{const i=t.href;if(!i||!n)throw{url:i};const r=new n;const a=(0,m.nr)(t,"crossOrigin")?t.crossOrigin:"anonymous";if(a!=null)r.crossOrigin=a;r.onload=()=>zv(e);r.onerror=()=>zv(e);r.src=i;return r})).catch((t=>{zv(e);return{complete:false,width:0,height:0,src:t&&t.url||""}}))},ready(){const t=this;return new Promise((e=>{function n(i){if(!t.pending())e(i);else setTimeout((()=>{n(true)}),10)}n(false)}))}};function Ov(t,e,n){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const i=e.strokeWidth!=null?+e.strokeWidth:1;t.expand(i+(n?Rv(e,i):0))}return t}function Rv(t,e){return t.strokeJoin&&t.strokeJoin!=="miter"?0:e}const Uv=xy-1e-8;let qv,Iv,Lv,Pv,jv,Wv,Xv,$v;const Hv=(t,e)=>qv.add(t,e);const Yv=(t,e)=>Hv(Iv=t,Lv=e);const Jv=t=>Hv(t,qv.y1);const Vv=t=>Hv(qv.x1,t);const Gv=(t,e)=>jv*t+Xv*e;const Kv=(t,e)=>Wv*t+$v*e;const Zv=(t,e)=>Hv(Gv(t,e),Kv(t,e));const Qv=(t,e)=>Yv(Gv(t,e),Kv(t,e));function tx(t,e){qv=t;if(e){Pv=e*gy;jv=$v=Math.cos(Pv);Wv=Math.sin(Pv);Xv=-Wv}else{jv=$v=1;Pv=Wv=Xv=0}return ex}const ex={beginPath(){},closePath(){},moveTo:Qv,lineTo:Qv,rect(t,e,n,i){if(Pv){Zv(t+n,e);Zv(t+n,e+i);Zv(t,e+i);Qv(t,e)}else{Hv(t+n,e+i);Yv(t,e)}},quadraticCurveTo(t,e,n,i){const r=Gv(t,e),a=Kv(t,e),o=Gv(n,i),s=Kv(n,i);nx(Iv,r,o,Jv);nx(Lv,a,s,Vv);Yv(o,s)},bezierCurveTo(t,e,n,i,r,a){const o=Gv(t,e),s=Kv(t,e),u=Gv(n,i),l=Kv(n,i),c=Gv(r,a),f=Kv(r,a);ix(Iv,o,u,c,Jv);ix(Lv,s,l,f,Vv);Yv(c,f)},arc(t,e,n,i,r,a){i+=Pv;r+=Pv;Iv=n*Math.cos(r)+t;Lv=n*Math.sin(r)+e;if(Math.abs(r-i)>Uv){Hv(t-n,e-n);Hv(t+n,e+n)}else{const o=i=>Hv(n*Math.cos(i)+t,n*Math.sin(i)+e);let s,u;o(i);o(r);if(r!==i){i=i%xy;if(i<0)i+=xy;r=r%xy;if(r<0)r+=xy;if(r<i){a=!a;s=i;i=r;r=s}if(a){r-=xy;s=i-i%vy;for(u=0;u<4&&s>r;++u,s-=vy)o(s)}else{s=i-i%vy+vy;for(u=0;u<4&&s<r;++u,s=s+vy)o(s)}}}}};function nx(t,e,n,i){const r=(t-e)/(t+n-2*e);if(0<r&&r<1)i(t+(e-t)*r)}function ix(t,e,n,i,r){const a=i-t+3*e-3*n,o=t+n-2*e,s=t-e;let u=0,l=0,c;if(Math.abs(a)>yy){c=o*o+s*a;if(c>=0){c=Math.sqrt(c);u=(-o+c)/a;l=(-o-c)/a}}else{u=.5*s/o}if(0<u&&u<1)r(rx(u,t,e,n,i));if(0<l&&l<1)r(rx(l,t,e,n,i))}function rx(t,e,n,i,r){const a=1-t,o=a*a,s=t*t;return o*a*e+3*o*t*n+3*a*s*i+s*t*r}var ax=(ax=Hf(1,1))?ax.getContext("2d"):null;const ox=new Fv;function sx(t){return function(e,n){if(!ax)return true;t(ax,e);ox.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:a,y2:o}=ox;for(let t=r;t<=o;++t){for(let e=i;e<=a;++e){if(ax.isPointInPath(e,t)){return true}}}return false}}function ux(t,e){return e.contains(t.x||0,t.y||0)}function lx(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,a=t.height||0;return e.intersects(ox.set(n,i,n+r,i+a))}function cx(t,e){const n=t.x||0,i=t.y||0,r=t.x2!=null?t.x2:n,a=t.y2!=null?t.y2:i;return fx(e,n,i,r,a)}function fx(t,e,n,i,r){const{x1:a,y1:o,x2:s,y2:u}=t,l=i-e,c=r-n;let f=0,h=1,d,p,m,g;for(g=0;g<4;++g){if(g===0){d=-l;p=-(a-e)}if(g===1){d=l;p=s-e}if(g===2){d=-c;p=-(o-n)}if(g===3){d=c;p=u-n}if(Math.abs(d)<1e-10&&p<0)return false;m=p/d;if(d<0){if(m>h)return false;else if(m>f)f=m}else if(d>0){if(m<f)return false;else if(m<h)h=m}}return true}function hx(t,e){t.globalCompositeOperation=e.blend||"source-over"}function dx(t,e){return t==null?e:t}function px(t,e){const n=e.length;for(let i=0;i<n;++i){t.addColorStop(e[i].offset,e[i].color)}return t}function mx(t,e,n){const i=n.width(),r=n.height();let a;if(e.gradient==="radial"){a=t.createRadialGradient(n.x1+dx(e.x1,.5)*i,n.y1+dx(e.y1,.5)*r,Math.max(i,r)*dx(e.r1,0),n.x1+dx(e.x2,.5)*i,n.y1+dx(e.y2,.5)*r,Math.max(i,r)*dx(e.r2,.5))}else{const o=dx(e.x1,0),s=dx(e.y1,0),u=dx(e.x2,1),l=dx(e.y2,0);if(o===u||s===l||i===r){a=t.createLinearGradient(n.x1+o*i,n.y1+s*r,n.x1+u*i,n.y1+l*r)}else{const n=Hf(Math.ceil(i),Math.ceil(r)),a=n.getContext("2d");a.scale(i,r);a.fillStyle=px(a.createLinearGradient(o,s,u,l),e.stops);a.fillRect(0,0,i,r);return t.createPattern(n,"no-repeat")}}return px(a,e.stops)}function gx(t,e,n){return sy(n)?mx(t,n,e.bounds):n}function yx(t,e,n){n*=e.fillOpacity==null?1:e.fillOpacity;if(n>0){t.globalAlpha=n;t.fillStyle=gx(t,e,e.fill);return true}else{return false}}var vx=[];function xx(t,e,n){var i=(i=e.strokeWidth)!=null?i:1;if(i<=0)return false;n*=e.strokeOpacity==null?1:e.strokeOpacity;if(n>0){t.globalAlpha=n;t.strokeStyle=gx(t,e,e.stroke);t.lineWidth=i;t.lineCap=e.strokeCap||"butt";t.lineJoin=e.strokeJoin||"miter";t.miterLimit=e.strokeMiterLimit||10;if(t.setLineDash){t.setLineDash(e.strokeDash||vx);t.lineDashOffset=e.strokeDashOffset||0}return true}else{return false}}function _x(t,e){return t.zindex-e.zindex||t.index-e.index}function bx(t){if(!t.zdirty)return t.zitems;var e=t.items,n=[],i,r,a;for(r=0,a=e.length;r<a;++r){i=e[r];i.index=r;if(i.zindex)n.push(i)}t.zdirty=false;return t.zitems=n.sort(_x)}function wx(t,e){var n=t.items,i,r;if(!n||!n.length)return;const a=bx(t);if(a&&a.length){for(i=0,r=n.length;i<r;++i){if(!n[i].zindex)e(n[i])}n=a}for(i=0,r=n.length;i<r;++i){e(n[i])}}function kx(t,e){var n=t.items,i,r;if(!n||!n.length)return null;const a=bx(t);if(a&&a.length)n=a;for(r=n.length;--r>=0;){if(i=e(n[r]))return i}if(n===a){for(n=t.items,r=n.length;--r>=0;){if(!n[r].zindex){if(i=e(n[r]))return i}}}return null}function Mx(t){return function(e,n,i){wx(n,(n=>{if(!i||i.intersects(n.bounds)){Ex(t,e,n,n)}}))}}function Ax(t){return function(e,n,i){if(n.items.length&&(!i||i.intersects(n.bounds))){Ex(t,e,n.items[0],n.items)}}}function Ex(t,e,n,i){var r=n.opacity==null?1:n.opacity;if(r===0)return;if(t(e,i))return;hx(e,n);if(n.fill&&yx(e,n,r)){e.fill()}if(n.stroke&&xx(e,n,r)){e.stroke()}}function Dx(t){t=t||m.yb;return function(e,n,i,r,a,o){i*=e.pixelRatio;r*=e.pixelRatio;return kx(n,(n=>{const s=n.bounds;if(s&&!s.contains(a,o)||!s)return;if(t(e,n,i,r,a,o))return n}))}}function Cx(t,e){return function(n,i,r,a){var o=Array.isArray(i)?i[0]:i,s=e==null?o.fill:e,u=o.stroke&&n.isPointInStroke,l,c;if(u){l=o.strokeWidth;c=o.strokeCap;n.lineWidth=l!=null?l:1;n.lineCap=c!=null?c:"butt"}return t(n,i)?false:s&&n.isPointInPath(r,a)||u&&n.isPointInStroke(r,a)}}function Fx(t){return Dx(Cx(t))}function Sx(t,e){return"translate("+t+","+e+")"}function Tx(t){return"rotate("+t+")"}function Bx(t,e){return"scale("+t+","+e+")"}function Nx(t){return Sx(t.x||0,t.y||0)}function zx(t){return Sx(t.x||0,t.y||0)+(t.angle?" "+Tx(t.angle):"")}function Ox(t){return Sx(t.x||0,t.y||0)+(t.angle?" "+Tx(t.angle):"")+(t.scaleX||t.scaleY?" "+Bx(t.scaleX||1,t.scaleY||1):"")}function Rx(t,e,n){function i(t,n){t("transform",zx(n));t("d",e(null,n))}function r(t,n){e(tx(t,n.angle),n);return Ov(t,n).translate(n.x||0,n.y||0)}function a(t,n){var i=n.x||0,r=n.y||0,a=n.angle||0;t.translate(i,r);if(a)t.rotate(a*=gy);t.beginPath();e(t,n);if(a)t.rotate(-a);t.translate(-i,-r)}return{type:t,tag:"path",nested:false,attr:i,bound:r,draw:Mx(a),pick:Fx(a),isect:n||sx(a)}}var Ux=Rx("arc",xv);function qx(t,e){var n=t[0].orient==="horizontal"?e[1]:e[0],i=t[0].orient==="horizontal"?"y":"x",r=t.length,a=+Infinity,o,s;while(--r>=0){if(t[r].defined===false)continue;s=Math.abs(t[r][i]-n);if(s<a){a=s;o=t[r]}}return o}function Ix(t,e){var n=Math.pow(t[0].strokeWidth||1,2),i=t.length,r,a,o;while(--i>=0){if(t[i].defined===false)continue;r=t[i].x-e[0];a=t[i].y-e[1];o=r*r+a*a;if(o<n)return t[i]}return null}function Lx(t,e){var n=t.length,i,r,a;while(--n>=0){if(t[n].defined===false)continue;i=t[n].x-e[0];r=t[n].y-e[1];a=i*i+r*r;i=t[n].size||1;if(a<i*i)return t[n]}return null}function Px(t,e,n){function i(t,n){var i=n.mark.items;if(i.length)t("d",e(null,i))}function r(t,n){var i=n.items;if(i.length===0){return t}else{e(tx(t),i);return Ov(t,i[0])}}function a(t,n){t.beginPath();e(t,n)}const o=Cx(a);function s(t,e,n,i,r,a){var s=e.items,u=e.bounds;if(!s||!s.length||u&&!u.contains(r,a)){return null}n*=t.pixelRatio;i*=t.pixelRatio;return o(t,s,n,i)?s[0]:null}return{type:t,tag:"path",nested:true,attr:i,bound:r,draw:Ax(a),pick:s,isect:ux,tip:n}}var jx=Px("area",_v,qx);function Wx(t,e){var n=e.clip;t.save();if((0,m.mf)(n)){t.beginPath();n(t);t.clip()}else{Xx(t,e.group)}}function Xx(t,e){t.beginPath();vv(e)?wv(t,e,0,0):t.rect(0,0,e.width||0,e.height||0);t.clip()}function $x(t){const e=dx(t.strokeWidth,1);return t.strokeOffset!=null?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function Hx(t,e){t("transform",Nx(e))}function Yx(t,e){const n=$x(e);t("d",wv(null,e,n,n))}function Jx(t,e){t("class","background");t("aria-hidden",true);Yx(t,e)}function Vx(t,e){t("class","foreground");t("aria-hidden",true);if(e.strokeForeground){Yx(t,e)}else{t("d","")}}function Gx(t,e,n){const i=e.clip?Cv(n,e,e):null;t("clip-path",i)}function Kx(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e<i;++e){t.union(n[e].bounds)}}if((e.clip||e.width||e.height)&&!e.noBound){t.add(0,0).add(e.width||0,e.height||0)}Ov(t,e);return t.translate(e.x||0,e.y||0)}function Zx(t,e,n,i){const r=$x(e);t.beginPath();wv(t,e,(n||0)+r,(i||0)+r)}const Qx=Cx(Zx);const t_=Cx(Zx,false);const e_=Cx(Zx,true);function n_(t,e,n){wx(e,(e=>{const i=e.x||0,r=e.y||0,a=e.strokeForeground,o=e.opacity==null?1:e.opacity;if((e.stroke||e.fill)&&o){Zx(t,e,i,r);hx(t,e);if(e.fill&&yx(t,e,o)){t.fill()}if(e.stroke&&!a&&xx(t,e,o)){t.stroke()}}t.save();t.translate(i,r);if(e.clip)Xx(t,e);if(n)n.translate(-i,-r);wx(e,(e=>{this.draw(t,e,n)}));if(n)n.translate(i,r);t.restore();if(a&&e.stroke&&o){Zx(t,e,i,r);hx(t,e);if(xx(t,e,o)){t.stroke()}}}))}function i_(t,e,n,i,r,a){if(e.bounds&&!e.bounds.contains(r,a)||!e.items){return null}const o=n*t.pixelRatio,s=i*t.pixelRatio;return kx(e,(u=>{let l,c,f;const h=u.bounds;if(h&&!h.contains(r,a))return;c=u.x||0;f=u.y||0;const d=c+(u.width||0),p=f+(u.height||0),m=u.clip;if(m&&(r<c||r>d||a<f||a>p))return;t.save();t.translate(c,f);c=r-c;f=a-f;if(m&&vv(u)&&!e_(t,u,o,s)){t.restore();return null}const g=u.strokeForeground,y=e.interactive!==false;if(y&&g&&u.stroke&&t_(t,u,o,s)){t.restore();return u}l=kx(u,(t=>r_(t,c,f)?this.pick(t,n,i,c,f):null));if(!l&&y&&(u.fill||!g&&u.stroke)&&Qx(t,u,o,s)){l=u}t.restore();return l||null}))}function r_(t,e,n){return(t.interactive!==false||t.marktype==="group")&&t.bounds&&t.bounds.contains(e,n)}var a_={type:"group",tag:"g",nested:false,attr:Hx,bound:Kx,draw:n_,pick:i_,isect:lx,content:Gx,background:Jx,foreground:Vx};var o_={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function s_(t,e){var n=t.image;if(!n||t.url&&t.url!==n.url){n={complete:false,width:0,height:0};e.loadImage(t.url).then((e=>{t.image=e;t.image.url=t.url}))}return n}function u_(t,e){return t.width!=null?t.width:!e||!e.width?0:t.aspect!==false&&t.height?t.height*e.width/e.height:e.width}function l_(t,e){return t.height!=null?t.height:!e||!e.height?0:t.aspect!==false&&t.width?t.width*e.height/e.width:e.height}function c_(t,e){return t==="center"?e/2:t==="right"?e:0}function f_(t,e){return t==="middle"?e/2:t==="bottom"?e:0}function h_(t,e,n){const i=s_(e,n),r=u_(e,i),a=l_(e,i),o=(e.x||0)-c_(e.align,r),s=(e.y||0)-f_(e.baseline,a),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";t("href",u,o_["xmlns:xlink"],"xlink:href");t("transform",Sx(o,s));t("width",r);t("height",a);t("preserveAspectRatio",e.aspect===false?"none":"xMidYMid")}function d_(t,e){const n=e.image,i=u_(e,n),r=l_(e,n),a=(e.x||0)-c_(e.align,i),o=(e.y||0)-f_(e.baseline,r);return t.set(a,o,a+i,o+r)}function p_(t,e,n){wx(e,(e=>{if(n&&!n.intersects(e.bounds))return;const i=s_(e,this);let r=u_(e,i);let a=l_(e,i);if(r===0||a===0)return;let o=(e.x||0)-c_(e.align,r),s=(e.y||0)-f_(e.baseline,a),u,l,c,f;if(e.aspect!==false){l=i.width/i.height;c=e.width/e.height;if(l===l&&c===c&&l!==c){if(c<l){f=r/l;s+=(a-f)/2;a=f}else{f=a*l;o+=(r-f)/2;r=f}}}if(i.complete||i.toDataURL){hx(t,e);t.globalAlpha=(u=e.opacity)!=null?u:1;t.imageSmoothingEnabled=e.smooth!==false;t.drawImage(i,o,s,r,a)}}))}var m_={type:"image",tag:"image",nested:false,attr:h_,bound:d_,draw:p_,pick:Dx(),isect:m.yb,get:s_,xOffset:c_,yOffset:f_};var g_=Px("line",bv,Ix);function y_(t,e){var n=e.scaleX||1,i=e.scaleY||1;if(n!==1||i!==1){t("vector-effect","non-scaling-stroke")}t("transform",Ox(e));t("d",e.path)}function v_(t,e){var n=e.path;if(n==null)return true;var i=e.x||0,r=e.y||0,a=e.scaleX||1,o=e.scaleY||1,s=(e.angle||0)*gy,u=e.pathCache;if(!u||u.path!==n){(e.pathCache=u=my(n)).path=n}if(s&&t.rotate&&t.translate){t.translate(i,r);t.rotate(s);Cy(t,u,0,0,a,o);t.rotate(-s);t.translate(-i,-r)}else{Cy(t,u,i,r,a,o)}}function x_(t,e){return v_(tx(t,e.angle),e)?t.set(0,0,0,0):Ov(t,e,true)}var __={type:"path",tag:"path",nested:false,attr:y_,bound:x_,draw:Mx(v_),pick:Fx(v_),isect:sx(v_)};function b_(t,e){t("d",wv(null,e))}function w_(t,e){var n,i;return Ov(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)}function k_(t,e){t.beginPath();wv(t,e)}var M_={type:"rect",tag:"path",nested:false,attr:b_,bound:w_,draw:Mx(k_),pick:Fx(k_),isect:lx};function A_(t,e){t("transform",Nx(e));t("x2",e.x2!=null?e.x2-(e.x||0):0);t("y2",e.y2!=null?e.y2-(e.y||0):0)}function E_(t,e){var n,i;return Ov(t.set(n=e.x||0,i=e.y||0,e.x2!=null?e.x2:n,e.y2!=null?e.y2:i),e)}function D_(t,e,n){var i,r,a,o;if(e.stroke&&xx(t,e,n)){i=e.x||0;r=e.y||0;a=e.x2!=null?e.x2:i;o=e.y2!=null?e.y2:r;t.beginPath();t.moveTo(i,r);t.lineTo(a,o);return true}return false}function C_(t,e,n){wx(e,(e=>{if(n&&!n.intersects(e.bounds))return;var i=e.opacity==null?1:e.opacity;if(i&&D_(t,e,i)){hx(t,e);t.stroke()}}))}function F_(t,e,n,i){if(!t.isPointInStroke)return false;return D_(t,e,1)&&t.isPointInStroke(n,i)}var S_={type:"rule",tag:"line",nested:false,attr:A_,bound:E_,draw:C_,pick:Dx(F_),isect:cx};var T_=Rx("shape",kv);var B_=Rx("symbol",Mv,ux);const N_=(0,m.$m)();var z_={height:L_,measureWidth:q_,estimateWidth:R_,width:R_,canvas:O_};O_(true);function O_(t){z_.width=t&&ax?q_:R_}function R_(t,e){return U_($_(t,e),L_(t))}function U_(t,e){return~~(.8*t.length*e)}function q_(t,e){return L_(t)<=0||!(e=$_(t,e))?0:I_(e,V_(t))}function I_(t,e){const n=`(${e}) ${t}`;let i=N_.get(n);if(i===undefined){ax.font=e;i=ax.measureText(t).width;N_.set(n,i)}return i}function L_(t){return t.fontSize!=null?+t.fontSize||0:11}function P_(t){return t.lineHeight!=null?t.lineHeight:L_(t)+2}function j_(t){return(0,m.kJ)(t)?t.length>1?t:t[0]:t}function W_(t){return j_(t.lineBreak&&t.text&&!(0,m.kJ)(t.text)?t.text.split(t.lineBreak):t.text)}function X_(t){const e=W_(t);return((0,m.kJ)(e)?e.length-1:0)*P_(t)}function $_(t,e){const n=e==null?"":(e+"").trim();return t.limit>0&&n.length?Y_(t,n):n}function H_(t){if(z_.width===q_){const e=V_(t);return t=>I_(t,e)}else{const e=L_(t);return t=>U_(t,e)}}function Y_(t,e){var n=+t.limit,i=H_(t);if(i(e)<n)return e;var r=t.ellipsis||"…",a=t.dir==="rtl",o=0,s=e.length,u;n-=i(r);if(a){while(o<s){u=o+s>>>1;if(i(e.slice(u))>n)o=u+1;else s=u}return r+e.slice(o)}else{while(o<s){u=1+(o+s>>>1);if(i(e.slice(0,u))<n)o=u;else s=u-1}return e.slice(0,o)+r}}function J_(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function V_(t,e){return""+(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+L_(t)+"px "+J_(t,e)}function G_(t){var e=t.baseline,n=L_(t);return Math.round(e==="top"?.79*n:e==="middle"?.3*n:e==="bottom"?-.21*n:e==="line-top"?.29*n+.5*P_(t):e==="line-bottom"?.29*n-.5*P_(t):0)}const K_={left:"start",center:"middle",right:"end"};const Z_=new Fv;function Q_(t){var e=t.x||0,n=t.y||0,i=t.radius||0,r;if(i){r=(t.theta||0)-vy;e+=i*Math.cos(r);n+=i*Math.sin(r)}Z_.x1=e;Z_.y1=n;return Z_}function tb(t,e){var n=e.dx||0,i=(e.dy||0)+G_(e),r=Q_(e),a=r.x1,o=r.y1,s=e.angle||0,u;t("text-anchor",K_[e.align]||"start");if(s){u=Sx(a,o)+" "+Tx(s);if(n||i)u+=" "+Sx(n,i)}else{u=Sx(a+n,o+i)}t("transform",u)}function eb(t,e,n){var i=z_.height(e),r=e.align,a=Q_(e),o=a.x1,s=a.y1,u=e.dx||0,l=(e.dy||0)+G_(e)-Math.round(.8*i),c=W_(e),f;if((0,m.kJ)(c)){i+=P_(e)*(c.length-1);f=c.reduce(((t,n)=>Math.max(t,z_.width(e,n))),0)}else{f=z_.width(e,c)}if(r==="center"){u-=f/2}else if(r==="right"){u-=f}else;t.set(u+=o,l+=s,u+f,l+i);if(e.angle&&!n){t.rotate(e.angle*gy,o,s)}else if(n===2){return t.rotatedPoints(e.angle*gy,o,s)}return t}function nb(t,e,n){wx(e,(e=>{var i=e.opacity==null?1:e.opacity,r,a,o,s,u,l,c;if(n&&!n.intersects(e.bounds)||i===0||e.fontSize<=0||e.text==null||e.text.length===0)return;t.font=V_(e);t.textAlign=e.align||"left";r=Q_(e);a=r.x1,o=r.y1;if(e.angle){t.save();t.translate(a,o);t.rotate(e.angle*gy);a=o=0}a+=e.dx||0;o+=(e.dy||0)+G_(e);l=W_(e);hx(t,e);if((0,m.kJ)(l)){u=P_(e);for(s=0;s<l.length;++s){c=$_(e,l[s]);if(e.fill&&yx(t,e,i)){t.fillText(c,a,o)}if(e.stroke&&xx(t,e,i)){t.strokeText(c,a,o)}o+=u}}else{c=$_(e,l);if(e.fill&&yx(t,e,i)){t.fillText(c,a,o)}if(e.stroke&&xx(t,e,i)){t.strokeText(c,a,o)}}if(e.angle)t.restore()}))}function ib(t,e,n,i,r,a){if(e.fontSize<=0)return false;if(!e.angle)return true;var o=Q_(e),s=o.x1,u=o.y1,l=eb(Z_,e,1),c=-e.angle*gy,f=Math.cos(c),h=Math.sin(c),d=f*r-h*a+(s-f*s+h*u),p=h*r+f*a+(u-h*s-f*u);return l.contains(d,p)}function rb(t,e){const n=eb(Z_,t,2);return fx(e,n[0],n[1],n[2],n[3])||fx(e,n[0],n[1],n[4],n[5])||fx(e,n[4],n[5],n[6],n[7])||fx(e,n[2],n[3],n[6],n[7])}var ab={type:"text",tag:"text",nested:false,attr:tb,bound:eb,draw:nb,pick:Dx(ib),isect:rb};var ob=Px("trail",Av,Lx);var sb={arc:Ux,area:jx,group:a_,image:m_,line:g_,path:__,rect:M_,rule:S_,shape:T_,symbol:B_,text:ab,trail:ob};function ub(t,e,n){var i=sb[t.mark.marktype],r=e||i.bound;if(i.nested)t=t.mark;return r(t.bounds||(t.bounds=new Fv),t,n)}var lb={mark:null};function cb(t,e,n){var i=sb[t.marktype],r=i.bound,a=t.items,o=a&&a.length,s,u,l,c;if(i.nested){if(o){l=a[0]}else{lb.mark=t;l=lb}c=ub(l,r,n);e=e&&e.union(c)||c;return e}e=e||t.bounds&&t.bounds.clear()||new Fv;if(o){for(s=0,u=a.length;s<u;++s){e.union(ub(a[s],r,n))}}return t.bounds=e}const fb=["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 hb(t,e){return JSON.stringify(t,fb,e)}function db(t){const e=typeof t==="string"?JSON.parse(t):t;return pb(e)}function pb(t){var e=t.marktype,n=t.items,i,r,a;if(n){for(r=0,a=n.length;r<a;++r){i=e?"mark":"group";n[r][i]=t;if(n[r].zindex)n[r][i].zdirty=true;if("group"===(e||i))pb(n[r])}}if(e)cb(t);return t}function mb(t){if(arguments.length){this.root=db(t)}else{this.root=gb({marktype:"group",name:"root",role:"frame"});this.root.items=[new Tv(this.root)]}}mb.prototype={toJSON(t){return hb(this.root,t||0)},mark(t,e,n){e=e||this.root.items[0];const i=gb(t,e);e.items[n]=i;if(i.zindex)i.group.zdirty=true;return i}};function gb(t,e){const n={bounds:new Fv,clip:!!t.clip,group:e,interactive:t.interactive===false?false:true,items:[],marktype:t.marktype,name:t.name||undefined,role:t.role||undefined,zindex:t.zindex||0};if(t.aria!=null){n.aria=t.aria}if(t.description){n.description=t.description}return n}function yb(t,e,n){if(!t&&typeof document!=="undefined"&&document.createElement){t=document}return t?n?t.createElementNS(n,e):t.createElement(e):null}function vb(t,e){e=e.toLowerCase();var n=t.childNodes,i=0,r=n.length;for(;i<r;++i)if(n[i].tagName.toLowerCase()===e){return n[i]}}function xb(t,e,n,i){var r=t.childNodes[e],a;if(!r||r.tagName.toLowerCase()!==n.toLowerCase()){a=r||null;r=yb(t.ownerDocument,n,i);t.insertBefore(r,a)}return r}function _b(t,e){var n=t.childNodes,i=n.length;while(i>e)t.removeChild(n[--i]);return t}function bb(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function wb(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function kb(t,e,n,i){var r=t&&t.mark,a,o;if(r&&(a=sb[r.marktype]).tip){o=wb(e,n);o[0]-=i[0];o[1]-=i[1];while(t=t.mark.group){o[0]-=t.x||0;o[1]-=t.y||0}t=a.tip(r.items,o)}return t}function Mb(t,e){this._active=null;this._handlers={};this._loader=t||_a();this._tooltip=e||Ab}function Ab(t,e,n,i){t.element().setAttribute("title",i||"")}Mb.prototype={initialize(t,e,n){this._el=t;this._obj=n||null;return this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){if(arguments.length){this._origin=t||[0,0];return this}else{return this._origin.slice()}},scene(t){if(!arguments.length)return this._scene;this._scene=t;return this},on(){},off(){},_handlerIndex(t,e,n){for(let i=t?t.length:0;--i>=0;){if(t[i].type===e&&(!n||t[i].handler===n)){return i}}return-1},handlers(t){const e=this._handlers,n=[];if(t){n.push(...e[this.eventName(t)])}else{for(const t in e){n.push(...e[t])}}return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),i=yb(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&e.tooltip!=null){e=kb(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,a=r.width(),o=r.height();let s=r.x1+i[0]+n.left,u=r.y1+i[1]+n.top;while(t.mark&&(t=t.mark.group)){s+=t.x||0;u+=t.y||0}return{x:s,y:u,width:a,height:o,left:s,top:u,right:s+a,bottom:u+o}}};function Eb(t){this._el=null;this._bgcolor=null;this._loader=new Bv(t)}Eb.prototype={initialize(t,e,n,i,r){this._el=t;return this.resize(e,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){if(arguments.length===0)return this._bgcolor;this._bgcolor=t;return this},resize(t,e,n,i){this._width=t;this._height=e;this._origin=n||[0,0];this._scale=i||1;return this},dirty(){},render(t){const e=this;e._call=function(){e._render(t)};e._call();e._call=null;return e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then((()=>e)):Promise.resolve(e)},_load(t,e){var n=this,i=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{if(e)t();n._ready=null}))}return i},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const Db="keydown";const Cb="keypress";const Fb="keyup";const Sb="dragenter";const Tb="dragleave";const Bb="dragover";const Nb="mousedown";const zb="mouseup";const Ob="mousemove";const Rb="mouseout";const Ub="mouseover";const qb="click";const Ib="dblclick";const Lb="wheel";const Pb="mousewheel";const jb="touchstart";const Wb="touchmove";const Xb="touchend";const $b=[Db,Cb,Fb,Sb,Tb,Bb,Nb,zb,Ob,Rb,Ub,qb,Ib,Lb,Pb,jb,Wb,Xb];const Hb=Ob;const Yb=Rb;const Jb=qb;function Vb(t,e){Mb.call(this,t,e);this._down=null;this._touch=null;this._first=true;this._events={}}const Gb=t=>t===jb||t===Wb||t===Xb?[jb,Wb,Xb]:[t];function Kb(t,e){Gb(e).forEach((e=>Zb(t,e)))}function Zb(t,e){const n=t.canvas();if(n&&!t._events[e]){t._events[e]=1;n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n))}}function Qb(t,e,n){return function(i){const r=this._active,a=this.pickEvent(i);if(a===r){this.fire(t,i)}else{if(!r||!r.exit){this.fire(n,i)}this._active=a;this.fire(e,i);this.fire(t,i)}}}function tw(t){return function(e){this.fire(t,e);this._active=null}}(0,m.XW)(Vb,Mb,{initialize(t,e,n){this._canvas=t&&vb(t,"canvas");[qb,Nb,Ob,Rb,Tb].forEach((t=>Kb(this,t)));return Mb.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:$b,DOMMouseScroll(t){this.fire(Pb,t)},mousemove:Qb(Ob,Ub,Rb),dragover:Qb(Bb,Sb,Tb),mouseout:tw(Rb),dragleave:tw(Tb),mousedown(t){this._down=this._active;this.fire(Nb,t)},click(t){if(this._down===this._active){this.fire(qb,t);this._down=null}},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]);if(this._first){this._active=this._touch;this._first=false}this.fire(jb,t,true)},touchmove(t){this.fire(Wb,t,true)},touchend(t){this.fire(Xb,t,true);this._touch=null},fire(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];e.vegaType=t;if(t===Jb&&i&&i.href){this.handleHref(e,i,i.href)}else if(t===Hb||t===Yb){this.handleTooltip(e,i,t!==Yb)}if(r){for(let t=0,n=r.length;t<n;++t){r[t].handler.call(this._obj,e,i)}}},on(t,e){const n=this.eventName(t),i=this._handlers,r=this._handlerIndex(i[n],t,e);if(r<0){Kb(this,t);(i[n]||(i[n]=[])).push({type:t,handler:e})}return this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);if(r>=0){i.splice(r,1)}return this},pickEvent(t){const e=wb(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,i,r){const a=this.context(),o=sb[t.marktype];return o.pick.call(this,a,t,e,n,i,r)}});function ew(){return typeof window!=="undefined"?window.devicePixelRatio||1:1}var nw=ew();function iw(t,e,n,i,r,a){const o=typeof HTMLElement!=="undefined"&&t instanceof HTMLElement&&t.parentNode!=null,s=t.getContext("2d"),u=o?nw:r;t.width=e*u;t.height=n*u;for(const l in a){s[l]=a[l]}if(o&&u!==1){t.style.width=e+"px";t.style.height=n+"px"}s.pixelRatio=u;s.setTransform(u,0,0,u,u*i[0],u*i[1]);return t}function rw(t){Eb.call(this,t);this._options={};this._redraw=false;this._dirty=new Fv;this._tempb=new Fv}const aw=Eb.prototype;const ow=(t,e,n)=>(new Fv).set(0,0,e,n).translate(-t[0],-t[1]);function sw(t,e,n){e.expand(1).round();if(t.pixelRatio%1){e.scale(t.pixelRatio).round().scale(1/t.pixelRatio)}e.translate(-(n[0]%1),-(n[1]%1));t.beginPath();t.rect(e.x1,e.y1,e.width(),e.height());t.clip();return e}(0,m.XW)(rw,Eb,{initialize(t,e,n,i,r,a){this._options=a||{};this._canvas=this._options.externalContext?null:Hf(1,1,this._options.type);if(t&&this._canvas){_b(t,0).appendChild(this._canvas);this._canvas.setAttribute("class","marks")}return aw.initialize.call(this,t,e,n,i,r)},resize(t,e,n,i){aw.resize.call(this,t,e,n,i);if(this._canvas){iw(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context)}else{const t=this._options.externalContext;if(!t)(0,m.vU)("CanvasRenderer is missing a valid canvas or context");t.scale(this._scale,this._scale);t.translate(this._origin[0],this._origin[1])}this._redraw=true;return this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;while(n){e.translate(n.x||0,n.y||0);n=n.mark.group}this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,i=this._width,r=this._height,a=this._dirty,o=ow(n,i,r);e.save();const s=this._redraw||a.empty()?(this._redraw=false,o.expand(1)):sw(e,o.intersect(a),n);this.clear(-n[0],-n[1],i,r);this.draw(e,t,s);e.restore();a.clear();return this},draw(t,e,n){const i=sb[e.marktype];if(e.clip)Wx(t,e);i.draw.call(this,t,e,n);if(e.clip)t.restore()},clear(t,e,n,i){const r=this._options,a=this.context();if(r.type!=="pdf"&&!r.externalContext){a.clearRect(t,e,n,i)}if(this._bgcolor!=null){a.fillStyle=this._bgcolor;a.fillRect(t,e,n,i)}}});function uw(t,e){Mb.call(this,t,e);const n=this;n._hrefHandler=lw(n,((t,e)=>{if(e&&e.href)n.handleHref(t,e,e.href)}));n._tooltipHandler=lw(n,((t,e)=>{n.handleTooltip(t,e,t.type!==Yb)}))}const lw=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i;n.vegaType=n.type;e.call(t._obj,n,i)};(0,m.XW)(uw,Mb,{initialize(t,e,n){let i=this._svg;if(i){i.removeEventListener(Jb,this._hrefHandler);i.removeEventListener(Hb,this._tooltipHandler);i.removeEventListener(Yb,this._tooltipHandler)}this._svg=i=t&&vb(t,"svg");if(i){i.addEventListener(Jb,this._hrefHandler);i.addEventListener(Hb,this._tooltipHandler);i.addEventListener(Yb,this._tooltipHandler)}return Mb.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),i=this._handlers,r=this._handlerIndex(i[n],t,e);if(r<0){const r={type:t,handler:e,listener:lw(this,e)};(i[n]||(i[n]=[])).push(r);if(this._svg){this._svg.addEventListener(n,r.listener)}}return this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);if(r>=0){if(this._svg){this._svg.removeEventListener(n,i[r].listener)}i.splice(r,1)}return this}});const cw="aria-hidden";const fw="aria-label";const hw="role";const dw="aria-roledescription";const pw="graphics-object";const mw="graphics-symbol";const gw=(t,e,n)=>({[hw]:t,[dw]:e,[fw]:n||undefined});const yw=(0,m.Rg)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]);const vw={axis:{desc:"axis",caption:Aw},legend:{desc:"legend",caption:Ew},"title-text":{desc:"title",caption:t=>`Title text '${Mw(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${Mw(t)}'`}};const xw={ariaRole:hw,ariaRoleDescription:dw,description:fw};function _w(t,e){const n=e.aria===false;t(cw,n||undefined);if(n||e.description==null){for(const e in xw){t(xw[e],undefined)}}else{const n=e.mark.marktype;t(fw,e.description);t(hw,e.ariaRole||(n==="group"?pw:mw));t(dw,e.ariaRoleDescription||`${n} mark`)}}function bw(t){return t.aria===false?{[cw]:true}:yw[t.role]?null:vw[t.role]?kw(t,vw[t.role]):ww(t)}function ww(t){const e=t.marktype;const n=e==="group"||e==="text"||t.items.some((t=>t.description!=null&&t.aria!==false));return gw(n?pw:mw,`${e} mark container`,t.description)}function kw(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return gw(e.role||mw,e.desc,n.description||i(n))}catch(n){return null}}function Mw(t){return(0,m.IX)(t.text).join(" ")}function Aw(t){const e=t.datum,n=t.orient,i=e.title?Dw(t):null,r=t.context,a=r.scales[e.scale].value,o=r.dataflow.locale(),s=a.type,u=n==="left"||n==="right"?"Y":"X";return`${u}-axis`+(i?` titled '${i}'`:"")+` for a ${fg(s)?"discrete":s} scale`+` with ${iy(o,a,t)}`}function Ew(t){const e=t.datum,n=e.title?Dw(t):null,i=`${e.type||""} legend`.trim(),r=e.scales,a=Object.keys(r),o=t.context,s=o.scales[r[a[0]]].value,u=o.dataflow.locale();return Fw(i)+(n?` titled '${n}'`:"")+` for ${Cw(a)}`+` with ${iy(u,s,t)}`}function Dw(t){try{return(0,m.IX)((0,m.fj)(t.items).items[0].text).join(" ")}catch(e){return null}}function Cw(t){t=t.map((t=>t+(t==="fill"||t==="stroke"?" color":"")));return t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+(0,m.fj)(t)}function Fw(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const Sw=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");const Tw=t=>Sw(t).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function Bw(){let t="",e="",n="";const i=[],r=()=>e=n="",a=a=>{if(e){t+=`${e}>${n}`;r()}i.push(a)},o=(t,n)=>{if(n!=null)e+=` ${t}="${Tw(n)}"`;return s},s={open(t,...n){a(t);e="<"+t;for(const e of n){for(const t in e)o(t,e[t])}return s},close(){const a=i.pop();if(e){t+=e+(n?`>${n}</${a}>`:"/>")}else{t+=`</${a}>`}r();return s},attr:o,text:t=>(n+=Sw(t),s),toString:()=>t};return s}const Nw=t=>zw(Bw(),t)+"";function zw(t,e){t.open(e.tagName);if(e.hasAttributes()){const n=e.attributes,i=n.length;for(let e=0;e<i;++e){t.attr(n[e].name,n[e].value)}}if(e.hasChildNodes()){const n=e.childNodes,i=n.length;for(let e=0;e<i;e++){const i=n[e];i.nodeType===3?t.text(i.nodeValue):zw(t,i)}}return t.close()}const Ow={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",blend:"mix-blend-mode"};const Rw={fill:"none","stroke-miterlimit":10};const Uw=0,qw="http://www.w3.org/2000/xmlns/",Iw=o_.xmlns;function Lw(t){Eb.call(this,t);this._dirtyID=0;this._dirty=[];this._svg=null;this._root=null;this._defs=null}const Pw=Eb.prototype;(0,m.XW)(Lw,Eb,{initialize(t,e,n,i,r){this._defs={};this._clearDefs();if(t){this._svg=xb(t,0,"svg",Iw);this._svg.setAttributeNS(qw,"xmlns",Iw);this._svg.setAttributeNS(qw,"xmlns:xlink",o_["xmlns:xlink"]);this._svg.setAttribute("version",o_["version"]);this._svg.setAttribute("class","marks");_b(t,1);this._root=xb(this._svg,Uw,"g",Iw);Qw(this._root,Rw);_b(this._svg,Uw+1)}this.background(this._bgcolor);return Pw.initialize.call(this,t,e,n,i,r)},background(t){if(arguments.length&&this._svg){this._svg.style.setProperty("background-color",t)}return Pw.background.apply(this,arguments)},resize(t,e,n,i){Pw.resize.call(this,t,e,n,i);if(this._svg){Qw(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=[];return this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;if(e){t.removeAttribute("style");n=xb(t,Uw,"rect",Iw);Qw(n,{width:this._width,height:this._height,fill:e})}const i=Nw(t);if(e){t.removeChild(n);this._svg.style.setProperty("background-color",e)}return i},_render(t){if(this._dirtyCheck()){if(this._dirtyAll)this._clearDefs();this.mark(this._root,t);_b(this._root,1)}this.defs();this._dirty=[];++this._dirtyID;return this},dirty(t){if(t.dirty!==this._dirtyID){t.dirty=this._dirtyID;this._dirty.push(t)}},isDirty(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=true;const t=this._dirty;if(!t.length||!this._dirtyID)return true;const e=++this._dirtyID;let n,i,r,a,o,s,u;for(o=0,s=t.length;o<s;++o){n=t[o];i=n.mark;if(i.marktype!==r){r=i.marktype;a=sb[r]}if(i.zdirty&&i.dirty!==e){this._dirtyAll=false;jw(n,e);i.items.forEach((t=>{t.dirty=e}))}if(i.zdirty)continue;if(n.exit){if(a.nested&&i.items.length){u=i.items[0];if(u._svg)this._update(a,u._svg,u)}else if(n._svg){u=n._svg.parentNode;if(u)u.removeChild(n._svg)}n._svg=null;continue}n=a.nested?i.items[0]:n;if(n._update===e)continue;if(!n._svg||!n._svg.ownerSVGElement){this._dirtyAll=false;jw(n,e)}else{this._update(a,n._svg,n)}n._update=e}return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const i=this._svg,r=sb[e.marktype],a=e.interactive===false?"none":null,o=r.tag==="g";let s=null,u=0;const l=Hw(e,t,n,"g",i);l.setAttribute("class",bb(e));const c=bw(e);for(const h in c)tk(l,h,c[h]);if(!o){tk(l,"pointer-events",a)}tk(l,"clip-path",e.clip?Cv(this,e,e.group):null);const f=t=>{const e=this.isDirty(t),n=Hw(t,l,s,r.tag,i);if(e){this._update(r,n,t);if(o)$w(this,n,t)}s=n;++u};if(r.nested){if(e.items.length)f(e.items[0])}else{wx(e,f)}_b(l,u);return l},_update(t,e,n){Jw=e;Vw=e.__values__;_w(Kw,n);t.attr(Kw,n,this);const i=Gw[t.type];if(i)i.call(this,t,e,n);if(Jw)this.style(Jw,n)},style(t,e){if(e==null)return;for(const n in Ow){let i=n==="font"?J_(e):e[n];if(i===Vw[n])continue;const r=Ow[n];if(i==null){t.removeAttribute(r)}else{if(sy(i)){i=uy(i,this._defs.gradient,nk())}t.setAttribute(r,i+"")}Vw[n]=i}},defs(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient){if(!n)e.el=n=xb(t,Uw+1,"defs",Iw);i=Ww(n,e.gradient[r],i)}for(const r in e.clipping){if(!n)e.el=n=xb(t,Uw+1,"defs",Iw);i=Xw(n,e.clipping[r],i)}if(n){i===0?(t.removeChild(n),e.el=null):_b(n,i)}},_clearDefs(){const t=this._defs;t.gradient={};t.clipping={}}});function jw(t,e){for(;t&&t.dirty!==e;t=t.mark.group){t.dirty=e;if(t.mark&&t.mark.dirty!==e){t.mark.dirty=e}else return}}function Ww(t,e,n){let i,r,a;if(e.gradient==="radial"){let i=xb(t,n++,"pattern",Iw);Qw(i,{id:oy+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"});i=xb(i,0,"rect",Iw);Qw(i,{width:1,height:1,fill:`url(${nk()}#${e.id})`});t=xb(t,n++,"radialGradient",Iw);Qw(t,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else{t=xb(t,n++,"linearGradient",Iw);Qw(t,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2})}for(i=0,r=e.stops.length;i<r;++i){a=xb(t,i,"stop",Iw);a.setAttribute("offset",e.stops[i].offset);a.setAttribute("stop-color",e.stops[i].color)}_b(t,i);return n}function Xw(t,e,n){let i;t=xb(t,n,"clipPath",Iw);t.setAttribute("id",e.id);if(e.path){i=xb(t,0,"path",Iw);i.setAttribute("d",e.path)}else{i=xb(t,0,"rect",Iw);Qw(i,{x:0,y:0,width:e.width,height:e.height})}_b(t,1);return n+1}function $w(t,e,n){e=e.lastChild.previousSibling;let i,r=0;wx(n,(n=>{i=t.mark(e,n,i);++r}));_b(e,1+r)}function Hw(t,e,n,i,r){let a=t._svg,o;if(!a){o=e.ownerDocument;a=yb(o,i,Iw);t._svg=a;if(t.mark){a.__data__=t;a.__values__={fill:"default"};if(i==="g"){const e=yb(o,"path",Iw);a.appendChild(e);e.__data__=t;const n=yb(o,"g",Iw);a.appendChild(n);n.__data__=t;const i=yb(o,"path",Iw);a.appendChild(i);i.__data__=t;i.__values__={fill:"default"}}}}if(a.ownerSVGElement!==r||Yw(a,n)){e.insertBefore(a,n?n.nextSibling:e.firstChild)}return a}function Yw(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}let Jw=null,Vw=null;const Gw={group(t,e,n){const i=Jw=e.childNodes[2];Vw=i.__values__;t.foreground(Kw,n,this);Vw=e.__values__;Jw=e.childNodes[1];t.content(Kw,n,this);const r=Jw=e.childNodes[0];t.background(Kw,n,this);const a=n.mark.interactive===false?"none":null;if(a!==Vw.events){tk(i,"pointer-events",a);tk(r,"pointer-events",a);Vw.events=a}if(n.strokeForeground&&n.stroke){const t=n.fill;tk(i,"display",null);this.style(r,n);tk(r,"stroke",null);if(t)n.fill=null;Vw=i.__values__;this.style(i,n);if(t)n.fill=t;Jw=null}else{tk(i,"display","none")}},image(t,e,n){if(n.smooth===false){Zw(e,"image-rendering","optimizeSpeed");Zw(e,"image-rendering","pixelated")}else{Zw(e,"image-rendering",null)}},text(t,e,n){const i=W_(n);let r,a,o,s;if((0,m.kJ)(i)){a=i.map((t=>$_(n,t)));r=a.join("\n");if(r!==Vw.text){_b(e,0);o=e.ownerDocument;s=P_(n);a.forEach(((t,i)=>{const r=yb(o,"tspan",Iw);r.__data__=n;r.textContent=t;if(i){r.setAttribute("x",0);r.setAttribute("dy",s)}e.appendChild(r)}));Vw.text=r}}else{a=$_(n,i);if(a!==Vw.text){e.textContent=a;Vw.text=a}}tk(e,"font-family",J_(n));tk(e,"font-size",L_(n)+"px");tk(e,"font-style",n.fontStyle);tk(e,"font-variant",n.fontVariant);tk(e,"font-weight",n.fontWeight)}};function Kw(t,e,n){if(e===Vw[t])return;if(n){ek(Jw,t,e,n)}else{tk(Jw,t,e)}Vw[t]=e}function Zw(t,e,n){if(n!==Vw[e]){if(n==null){t.style.removeProperty(e)}else{t.style.setProperty(e,n+"")}Vw[e]=n}}function Qw(t,e){for(const n in e){tk(t,n,e[n])}}function tk(t,e,n){if(n!=null){t.setAttribute(e,n)}else{t.removeAttribute(e)}}function ek(t,e,n,i){if(n!=null){t.setAttributeNS(i,e,n)}else{t.removeAttributeNS(i,e)}}function nk(){let t;return typeof window==="undefined"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function ik(t){Eb.call(this,t);this._text=null;this._defs={gradient:{},clipping:{}}}(0,m.XW)(ik,Eb,{svg(){return this._text},_render(t){const e=Bw();e.open("svg",(0,m.l7)({},o_,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;if(n&&n!=="transparent"&&n!=="none"){e.open("rect",{width:this._width,height:this._height,fill:n}).close()}e.open("g",Rw,{transform:"translate("+this._origin+")"});this.mark(e,t);e.close();this.defs(e);this._text=e.close()+"";return this},mark(t,e){const n=sb[e.marktype],i=n.tag,r=[_w,n.attr];t.open("g",{class:bb(e),"clip-path":e.clip?Cv(this,e,e.group):null},bw(e),{"pointer-events":i!=="g"&&e.interactive===false?"none":null});const a=a=>{const o=this.href(a);if(o)t.open("a",o);t.open(i,this.attr(e,a,r,i!=="g"?i:null));if(i==="text"){const e=W_(a);if((0,m.kJ)(e)){const n={x:0,dy:P_(a)};for(let i=0;i<e.length;++i){t.open("tspan",i?n:null).text($_(a,e[i])).close()}}else{t.text($_(a,e))}}else if(i==="g"){const i=a.strokeForeground,r=a.fill,o=a.stroke;if(i&&o){a.stroke=null}t.open("path",this.attr(e,a,n.background,"bgrect")).close();t.open("g",this.attr(e,a,n.content));wx(a,(e=>this.mark(t,e)));t.close();if(i&&o){if(r)a.fill=null;a.stroke=o;t.open("path",this.attr(e,a,n.foreground,"bgrect")).close();if(r)a.fill=r}else{t.open("path",this.attr(e,a,n.foreground,"bgfore")).close()}}t.close();if(o)t.close()};if(n.nested){if(e.items&&e.items.length)a(e.items[0])}else{wx(e,a)}return t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e]){return n}else{this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href;t.href=null;(this._hrefs||(this._hrefs={}))[e]=t}))}}return null},attr(t,e,n,i){const r={},a=(t,e,n,i)=>{r[i||t]=e};if(Array.isArray(n)){n.forEach((t=>t(a,e,this)))}else{n(a,e,this)}if(i){rk(r,e,t,i,this._defs)}return r},defs(t){const e=this._defs.gradient,n=this._defs.clipping,i=Object.keys(e).length+Object.keys(n).length;if(i===0)return;t.open("defs");for(const r in e){const n=e[r],i=n.stops;if(n.gradient==="radial"){t.open("pattern",{id:oy+r,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"});t.open("rect",{width:"1",height:"1",fill:"url(#"+r+")"}).close();t.close();t.open("radialGradient",{id:r,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})}else{t.open("linearGradient",{id:r,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2})}for(let e=0;e<i.length;++e){t.open("stop",{offset:i[e].offset,"stop-color":i[e].color}).close()}t.close()}for(const r in n){const e=n[r];t.open("clipPath",{id:r});if(e.path){t.open("path",{d:e.path}).close()}else{t.open("rect",{x:0,y:0,width:e.width,height:e.height}).close()}t.close()}t.close()}});function rk(t,e,n,i,r){if(e==null)return t;if(i==="bgrect"&&n.interactive===false){t["pointer-events"]="none"}if(i==="bgfore"){if(n.interactive===false){t["pointer-events"]="none"}t.display="none";if(e.fill!==null)return t}if(i==="image"&&e.smooth===false){t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;"}if(i==="text"){t["font-family"]=J_(e);t["font-size"]=L_(e)+"px";t["font-style"]=e.fontStyle;t["font-variant"]=e.fontVariant;t["font-weight"]=e.fontWeight}for(const a in Ow){let n=e[a];const i=Ow[a];if(n==="transparent"&&(i==="fill"||i==="stroke"));else if(n!=null){if(sy(n)){n=uy(n,r.gradient,"")}t[i]=n}}return t}const ak="canvas";const ok="png";const sk="svg";const uk="none";const lk={Canvas:ak,PNG:ok,SVG:sk,None:uk};const ck={};ck[ak]=ck[ok]={renderer:rw,headless:rw,handler:Vb};ck[sk]={renderer:Lw,headless:ik,handler:uw};ck[uk]={};function fk(t,e){t=String(t||"").toLowerCase();if(arguments.length>1){ck[t]=e;return this}else{return ck[t]}}function hk(t,e,n){const i=[],r=(new Fv).union(e),a=t.marktype;return a?dk(t,r,n,i):a==="group"?mk(t,r,n,i):(0,m.vU)("Intersect scene must be mark node or group item.")}function dk(t,e,n,i){if(pk(t,e,n)){const r=t.items,a=t.marktype,o=r.length;let s=0;if(a==="group"){for(;s<o;++s){mk(r[s],e,n,i)}}else{for(const t=sb[a].isect;s<o;++s){const n=r[s];if(gk(n,e,t))i.push(n)}}}return i}function pk(t,e,n){return t.bounds&&e.intersects(t.bounds)&&(t.marktype==="group"||t.interactive!==false&&(!n||n(t)))}function mk(t,e,n,i){if(n&&n(t.mark)&&gk(t,e,sb.group.isect)){i.push(t)}const r=t.items,a=r&&r.length;if(a){const o=t.x||0,s=t.y||0;e.translate(-o,-s);for(let t=0;t<a;++t){dk(r[t],e,n,i)}e.translate(o,s)}return i}function gk(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}const yk=new Fv;function vk(t){const e=t.clip;if((0,m.mf)(e)){e(tx(yk.clear()))}else if(e){yk.set(0,0,t.group.width,t.group.height)}else return;t.bounds.intersect(yk)}const xk=1e-9;function _k(t,e,n){return t===e?true:n==="path"?bk(t,e):t instanceof Date&&e instanceof Date?+t===+e:(0,m.hj)(t)&&(0,m.hj)(e)?Math.abs(t-e)<=xk:!t||!e||!(0,m.Kn)(t)&&!(0,m.Kn)(e)?t==e:wk(t,e)}function bk(t,e){return _k(my(t),my(e))}function wk(t,e){var n=Object.keys(t),i=Object.keys(e),r,a;if(n.length!==i.length)return false;n.sort();i.sort();for(a=n.length-1;a>=0;a--){if(n[a]!=i[a])return false}for(a=n.length-1;a>=0;a--){r=n[a];if(!_k(t[r],e[r],r))return false}return typeof t===typeof e}function kk(){Dv();ay()}const Mk="top";const Ak="left";const Ek="right";const Dk="bottom";const Ck="top-left";const Fk="top-right";const Sk="bottom-left";const Tk="bottom-right";const Bk="start";const Nk="middle";const zk="end";const Ok="x";const Rk="y";const Uk="group";const qk="axis";const Ik="title";const Lk="frame";const Pk="scope";const jk="legend";const Wk="row-header";const Xk="row-footer";const $k="row-title";const Hk="column-header";const Yk="column-footer";const Jk="column-title";const Vk="padding";const Gk="symbol";const Kk="fit";const Zk="fit-x";const Qk="fit-y";const tM="pad";const eM="none";const nM="all";const iM="each";const rM="flush";const aM="column";const oM="row";function sM(t){jo.call(this,null,t)}(0,m.XW)(sM,jo,{transform(t,e){const n=e.dataflow,i=t.mark,r=i.marktype,a=sb[r],o=a.bound;let s=i.bounds,u;if(a.nested){if(i.items.length)n.dirty(i.items[0]);s=uM(i,o);i.items.forEach((t=>{t.bounds.clear().union(s)}))}else if(r===Uk||t.modified()){e.visit(e.MOD,(t=>n.dirty(t)));s.clear();i.items.forEach((t=>s.union(uM(t,o))));switch(i.role){case qk:case jk:case Ik:e.reflow()}}else{u=e.changed(e.REM);e.visit(e.ADD,(t=>{s.union(uM(t,o))}));e.visit(e.MOD,(t=>{u=u||s.alignsWith(t.bounds);n.dirty(t);s.union(uM(t,o))}));if(u){s.clear();i.items.forEach((t=>s.union(t.bounds)))}}vk(i);return e.modifies("bounds")}});function uM(t,e,n){return e(t.bounds.clear(),t,n)}const lM=":vega_identifier:";function cM(t){jo.call(this,0,t)}cM.Definition={type:"Identifier",metadata:{modifies:true},params:[{name:"as",type:"string",required:true}]};(0,m.XW)(cM,jo,{transform(t,e){const n=fM(e.dataflow),i=t.as;let r=n.value;e.visit(e.ADD,(t=>t[i]=t[i]||++r));n.set(this.value=r);return e}});function fM(t){return t._signals[lM]||(t._signals[lM]=t.add(0))}function hM(t){jo.call(this,null,t)}(0,m.XW)(hM,jo,{transform(t,e){let n=this.value;if(!n){n=e.dataflow.scenegraph().mark(t.markdef,dM(t),t.index);n.group.context=t.context;if(!t.context.group)t.context.group=n.group;n.source=this.source;n.clip=t.clip;n.interactive=t.interactive;this.value=n}const i=n.marktype===Uk?Tv:Sv;e.visit(e.ADD,(t=>i.call(t,n)));if(t.modified("clip")||t.modified("interactive")){n.clip=t.clip;n.interactive=!!t.interactive;n.zdirty=true;e.reflow()}n.items=e.source;return e}});function dM(t){const e=t.groups,n=t.parent;return e&&e.size===1?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}function pM(t){jo.call(this,null,t)}const mM={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,i)=>!i||!gM(n.bounds,t.bounds,e)?(n=t,1):t.opacity=0))}};const gM=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2);const yM=(t,e)=>{for(var n=1,i=t.length,r=t[0].bounds,a;n<i;r=a,++n){if(gM(r,a=t[n].bounds,e))return true}};const vM=t=>{const e=t.bounds;return e.width()>1&&e.height()>1};const xM=(t,e,n)=>{var i=t.range(),r=new Fv;if(e===Mk||e===Dk){r.set(i[0],-Infinity,i[1],+Infinity)}else{r.set(-Infinity,i[0],+Infinity,i[1])}r.expand(n||1);return t=>r.encloses(t.bounds)};const _M=t=>{t.forEach((t=>t.opacity=1));return t};const bM=(t,e)=>t.reflow(e.modified()).modifies("opacity");(0,m.XW)(pM,jo,{transform(t,e){const n=mM[t.method]||mM.parity,i=t.separation||0;let r=e.materialize(e.SOURCE).source,a,o;if(!r||!r.length)return;if(!t.method){if(t.modified("method")){_M(r);e=bM(e,t)}return e}r=r.filter(vM);if(!r.length)return;if(t.sort){r=r.slice().sort(t.sort)}a=_M(r);e=bM(e,t);if(a.length>=3&&yM(a,i)){do{a=n(a,i)}while(a.length>=3&&yM(a,i));if(a.length<3&&!(0,m.fj)(r).opacity){if(a.length>1)(0,m.fj)(a).opacity=0;(0,m.fj)(r).opacity=1}}if(t.boundScale&&t.boundTolerance>=0){o=xM(t.boundScale,t.boundOrient,+t.boundTolerance);r.forEach((t=>{if(!o(t))t.opacity=0}))}const s=a[0].mark.bounds.clear();r.forEach((t=>{if(t.opacity)s.union(t.bounds)}));return e}});function wM(t){jo.call(this,null,t)}(0,m.XW)(wM,jo,{transform(t,e){const n=e.dataflow;e.visit(e.ALL,(t=>n.dirty(t)));if(e.fields&&e.fields["zindex"]){const t=e.source&&e.source[0];if(t)t.mark.zdirty=true}}});const kM=new Fv;function MM(t,e,n){return t[e]===n?0:(t[e]=n,1)}function AM(t){var e=t.items[0].orient;return e===Ak||e===Ek}function EM(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}function DM(t,e,n,i){var r=e.items[0],a=r.datum,o=r.translate!=null?r.translate:.5,s=r.orient,u=EM(a),l=r.range,c=r.offset,f=r.position,h=r.minExtent,d=r.maxExtent,p=a.title&&r.items[u[2]].items[0],m=r.titlePadding,g=r.bounds,y=p&&X_(p),v=0,x=0,_,b;kM.clear().union(g);g.clear();if((_=u[0])>-1)g.union(r.items[_].bounds);if((_=u[1])>-1)g.union(r.items[_].bounds);switch(s){case Mk:v=f||0;x=-c;b=Math.max(h,Math.min(d,-g.y1));g.add(0,-b).add(l,0);if(p)CM(t,p,b,m,y,0,-1,g);break;case Ak:v=-c;x=f||0;b=Math.max(h,Math.min(d,-g.x1));g.add(-b,0).add(0,l);if(p)CM(t,p,b,m,y,1,-1,g);break;case Ek:v=n+c;x=f||0;b=Math.max(h,Math.min(d,g.x2));g.add(0,0).add(b,l);if(p)CM(t,p,b,m,y,1,1,g);break;case Dk:v=f||0;x=i+c;b=Math.max(h,Math.min(d,g.y2));g.add(0,0).add(l,b);if(p)CM(t,p,b,m,0,0,1,g);break;default:v=r.x;x=r.y}Ov(g.translate(v,x),r);if(MM(r,"x",v+o)|MM(r,"y",x+o)){r.bounds=kM;t.dirty(r);r.bounds=g;t.dirty(r)}return r.mark.bounds.clear().union(g)}function CM(t,e,n,i,r,a,o,s){const u=e.bounds;if(e.auto){const s=o*(n+r+i);let l=0,c=0;t.dirty(e);a?l=(e.x||0)-(e.x=s):c=(e.y||0)-(e.y=s);e.mark.bounds.clear().union(u.translate(-l,-c));t.dirty(e)}s.union(u)}const FM=(t,e)=>Math.floor(Math.min(t,e));const SM=(t,e)=>Math.ceil(Math.max(t,e));function TM(t){var e=t.items,n=e.length,i=0,r,a;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i){r=e[i];a=r.items;if(r.marktype===Uk){switch(r.role){case qk:case jk:case Ik:break;case Wk:o.rowheaders.push(...a);break;case Xk:o.rowfooters.push(...a);break;case Hk:o.colheaders.push(...a);break;case Yk:o.colfooters.push(...a);break;case $k:o.rowtitle=a[0];break;case Jk:o.coltitle=a[0];break;default:o.marks.push(...a)}}}return o}function BM(t){return(new Fv).set(0,0,t.width||0,t.height||0)}function NM(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function zM(t,e,n){const i=(0,m.Kn)(t)?t[e]:t;return i!=null?i:n!==undefined?n:0}function OM(t){return t<0?Math.ceil(-t):0}function RM(t,e,n){var i=!n.nodirty,r=n.bounds===rM?BM:NM,a=kM.set(0,0,0,0),o=zM(n.align,aM),s=zM(n.align,oM),u=zM(n.padding,aM),l=zM(n.padding,oM),c=n.columns||e.length,f=c<=0?1:Math.ceil(e.length/c),h=e.length,d=Array(h),p=Array(c),m=0,g=Array(h),y=Array(f),v=0,x=Array(h),_=Array(h),b=Array(h),w,k,M,A,E,D,C,F,S,T,B;for(k=0;k<c;++k)p[k]=0;for(k=0;k<f;++k)y[k]=0;for(k=0;k<h;++k){D=e[k];E=b[k]=r(D);D.x=D.x||0;x[k]=0;D.y=D.y||0;_[k]=0;M=k%c;A=~~(k/c);m=Math.max(m,C=Math.ceil(E.x2));v=Math.max(v,F=Math.ceil(E.y2));p[M]=Math.max(p[M],C);y[A]=Math.max(y[A],F);d[k]=u+OM(E.x1);g[k]=l+OM(E.y1);if(i)t.dirty(e[k])}for(k=0;k<h;++k){if(k%c===0)d[k]=0;if(k<c)g[k]=0}if(o===iM){for(M=1;M<c;++M){for(B=0,k=M;k<h;k+=c){if(B<d[k])B=d[k]}for(k=M;k<h;k+=c){d[k]=B+p[M-1]}}}else if(o===nM){for(B=0,k=0;k<h;++k){if(k%c&&B<d[k])B=d[k]}for(k=0;k<h;++k){if(k%c)d[k]=B+m}}else{for(o=false,M=1;M<c;++M){for(k=M;k<h;k+=c){d[k]+=p[M-1]}}}if(s===iM){for(A=1;A<f;++A){for(B=0,k=A*c,w=k+c;k<w;++k){if(B<g[k])B=g[k]}for(k=A*c;k<w;++k){g[k]=B+y[A-1]}}}else if(s===nM){for(B=0,k=c;k<h;++k){if(B<g[k])B=g[k]}for(k=c;k<h;++k){g[k]=B+v}}else{for(s=false,A=1;A<f;++A){for(k=A*c,w=k+c;k<w;++k){g[k]+=y[A-1]}}}for(S=0,k=0;k<h;++k){S=d[k]+(k%c?S:0);x[k]+=S-e[k].x}for(M=0;M<c;++M){for(T=0,k=M;k<h;k+=c){T+=g[k];_[k]+=T-e[k].y}}if(o&&zM(n.center,aM)&&f>1){for(k=0;k<h;++k){E=o===nM?m:p[k%c];S=E-b[k].x2-e[k].x-x[k];if(S>0)x[k]+=S/2}}if(s&&zM(n.center,oM)&&c!==1){for(k=0;k<h;++k){E=s===nM?v:y[~~(k/c)];T=E-b[k].y2-e[k].y-_[k];if(T>0)_[k]+=T/2}}for(k=0;k<h;++k){a.union(b[k].translate(x[k],_[k]))}S=zM(n.anchor,Ok);T=zM(n.anchor,Rk);switch(zM(n.anchor,aM)){case zk:S-=a.width();break;case Nk:S-=a.width()/2}switch(zM(n.anchor,oM)){case zk:T-=a.height();break;case Nk:T-=a.height()/2}S=Math.round(S);T=Math.round(T);a.clear();for(k=0;k<h;++k){e[k].mark.bounds.clear()}for(k=0;k<h;++k){D=e[k];D.x+=x[k]+=S;D.y+=_[k]+=T;a.union(D.mark.bounds.union(D.bounds.translate(x[k],_[k])));if(i)t.dirty(D)}return a}function UM(t,e,n){var i=TM(e),r=i.marks,a=n.bounds===rM?qM:IM,o=n.offset,s=n.columns||r.length,u=s<=0?1:Math.ceil(r.length/s),l=u*s,c,f,h,d,p,m,g;const y=RM(t,r,n);if(y.empty())y.set(0,0,0,0);if(i.rowheaders){m=zM(n.headerBand,oM,null);c=LM(t,i.rowheaders,r,s,u,-zM(o,"rowHeader"),FM,0,a,"x1",0,s,1,m)}if(i.colheaders){m=zM(n.headerBand,aM,null);f=LM(t,i.colheaders,r,s,s,-zM(o,"columnHeader"),FM,1,a,"y1",0,1,s,m)}if(i.rowfooters){m=zM(n.footerBand,oM,null);h=LM(t,i.rowfooters,r,s,u,zM(o,"rowFooter"),SM,0,a,"x2",s-1,s,1,m)}if(i.colfooters){m=zM(n.footerBand,aM,null);d=LM(t,i.colfooters,r,s,s,zM(o,"columnFooter"),SM,1,a,"y2",l-s,1,s,m)}if(i.rowtitle){p=zM(n.titleAnchor,oM);g=zM(o,"rowTitle");g=p===zk?h+g:c-g;m=zM(n.titleBand,oM,.5);PM(t,i.rowtitle,g,0,y,m)}if(i.coltitle){p=zM(n.titleAnchor,aM);g=zM(o,"columnTitle");g=p===zk?d+g:f-g;m=zM(n.titleBand,aM,.5);PM(t,i.coltitle,g,1,y,m)}}function qM(t,e){return e==="x1"?t.x||0:e==="y1"?t.y||0:e==="x2"?(t.x||0)+(t.width||0):e==="y2"?(t.y||0)+(t.height||0):undefined}function IM(t,e){return t.bounds[e]}function LM(t,e,n,i,r,a,o,s,u,l,c,f,h,d){var p=n.length,m=0,g=0,y,v,x,_,b,w,k,M,A;if(!p)return m;for(y=c;y<p;y+=f){if(n[y])m=o(m,u(n[y],l))}if(!e.length)return m;if(e.length>r){t.warn("Grid headers exceed limit: "+r);e=e.slice(0,r)}m+=a;for(v=0,_=e.length;v<_;++v){t.dirty(e[v]);e[v].mark.bounds.clear()}for(y=c,v=0,_=e.length;v<_;++v,y+=f){w=e[v];b=w.mark.bounds;for(x=y;x>=0&&(k=n[x])==null;x-=h);if(s){M=d==null?k.x:Math.round(k.bounds.x1+d*k.bounds.width());A=m}else{M=m;A=d==null?k.y:Math.round(k.bounds.y1+d*k.bounds.height())}b.union(w.bounds.translate(M-(w.x||0),A-(w.y||0)));w.x=M;w.y=A;t.dirty(w);g=o(g,b[l])}return g}function PM(t,e,n,i,r,a){if(!e)return;t.dirty(e);var o=n,s=n;i?o=Math.round(r.x1+a*r.width()):s=Math.round(r.y1+a*r.height());e.bounds.translate(o-(e.x||0),s-(e.y||0));e.mark.bounds.clear().union(e.bounds);e.x=o;e.y=s;t.dirty(e)}function jM(t,e){const n=t[e]||{};return(e,i)=>n[e]!=null?n[e]:t[e]!=null?t[e]:i}function WM(t,e){let n=-Infinity;t.forEach((t=>{if(t.offset!=null)n=Math.max(n,t.offset)}));return n>-Infinity?n:e}function XM(t,e,n,i,r,a,o){const s=jM(n,e),u=WM(t,s("offset",0)),l=s("anchor",Bk),c=l===zk?1:l===Nk?.5:0;const f={align:iM,bounds:s("bounds",rM),columns:s("direction")==="vertical"?1:t.length,padding:s("margin",8),center:s("center"),nodirty:true};switch(e){case Ak:f.anchor={x:Math.floor(i.x1)-u,column:zk,y:c*(o||i.height()+2*i.y1),row:l};break;case Ek:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case Mk:f.anchor={y:Math.floor(r.y1)-u,row:zk,x:c*(a||r.width()+2*r.x1),column:l};break;case Dk:f.anchor={y:Math.ceil(r.y2)+u,x:c*(a||r.width()+2*r.x1),column:l};break;case Ck:f.anchor={x:u,y:u};break;case Fk:f.anchor={x:a-u,y:u,column:zk};break;case Sk:f.anchor={x:u,y:o-u,row:zk};break;case Tk:f.anchor={x:a-u,y:o-u,column:zk,row:zk};break}return f}function $M(t,e){var n=e.items[0],i=n.datum,r=n.orient,a=n.bounds,o=n.x,s=n.y,u,l;n._bounds?n._bounds.clear().union(a):n._bounds=a.clone();a.clear();YM(t,n,n.items[0].items[0]);a=HM(n,a);u=2*n.padding;l=2*n.padding;if(!a.empty()){u=Math.ceil(a.width()+u);l=Math.ceil(a.height()+l)}if(i.type===Gk){GM(n.items[0].items[0].items[0].items)}if(r!==eM){n.x=o=0;n.y=s=0}n.width=u;n.height=l;Ov(a.set(o,s,o+u,s+l),n);n.mark.bounds.clear().union(a);return n}function HM(t,e){t.items.forEach((t=>e.union(t.bounds)));e.x1=t.padding;e.y1=t.padding;return e}function YM(t,e,n){var i=e.padding,r=i-n.x,a=i-n.y;if(!e.datum.title){if(r||a)VM(t,n,r,a)}else{var o=e.items[1].items[0],s=o.anchor,u=e.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case Ak:r+=Math.ceil(o.bounds.width())+u;break;case Ek:case Dk:break;default:a+=o.bounds.height()+u}if(r||a)VM(t,n,r,a);switch(o.orient){case Ak:c+=JM(e,n,o,s,1,1);break;case Ek:l+=JM(e,n,o,zk,0,0)+u;c+=JM(e,n,o,s,1,1);break;case Dk:l+=JM(e,n,o,s,0,0);c+=JM(e,n,o,zk,-1,0,1)+u;break;default:l+=JM(e,n,o,s,0,0)}if(l||c)VM(t,o,l,c);if((l=Math.round(o.bounds.x1-i))<0){VM(t,n,-l,0);VM(t,o,-l,0)}}}function JM(t,e,n,i,r,a,o){const s=t.datum.type!=="symbol",u=n.datum.vgrad,l=s&&(a||!u)&&!o?e.items[0]:e,c=l.bounds[r?"y2":"x2"]-t.padding,f=u&&a?c:0,h=u&&a?0:c,d=r<=0?0:X_(n);return Math.round(i===Bk?f:i===zk?h-d:.5*(c-d))}function VM(t,e,n,i){e.x+=n;e.y+=i;e.bounds.translate(n,i);e.mark.bounds.translate(n,i);t.dirty(e)}function GM(t){const e=t.reduce(((t,e)=>{t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0);return t}),{});t.forEach((t=>{t.width=e[t.column];t.height=t.bounds.y2-t.y}))}function KM(t,e,n,i,r){var a=e.items[0],o=a.frame,s=a.orient,u=a.anchor,l=a.offset,c=a.padding,f=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],d=s===Ak||s===Ek?i:n,p=0,m=0,g=0,y=0,v=0,x;if(o!==Uk){s===Ak?(p=r.y2,d=r.y1):s===Ek?(p=r.y1,d=r.y2):(p=r.x1,d=r.x2)}else if(s===Ak){p=i,d=0}x=u===Bk?p:u===zk?d:(p+d)/2;if(h&&h.text){switch(s){case Mk:case Dk:v=f.bounds.height()+c;break;case Ak:y=f.bounds.width()+c;break;case Ek:y=-f.bounds.width()-c;break}kM.clear().union(h.bounds);kM.translate(y-(h.x||0),v-(h.y||0));if(MM(h,"x",y)|MM(h,"y",v)){t.dirty(h);h.bounds.clear().union(kM);h.mark.bounds.clear().union(kM);t.dirty(h)}kM.clear().union(h.bounds)}else{kM.clear()}kM.union(f.bounds);switch(s){case Mk:m=x;g=r.y1-kM.height()-l;break;case Ak:m=r.x1-kM.width()-l;g=x;break;case Ek:m=r.x2+kM.width()+l;g=x;break;case Dk:m=x;g=r.y2+l;break;default:m=a.x;g=a.y}if(MM(a,"x",m)|MM(a,"y",g)){kM.translate(m,g);t.dirty(a);a.bounds.clear().union(kM);e.bounds.clear().union(kM);t.dirty(a)}return a.bounds}function ZM(t){jo.call(this,null,t)}(0,m.XW)(ZM,jo,{transform(t,e){const n=e.dataflow;t.mark.items.forEach((e=>{if(t.layout)UM(n,e,t.layout);tA(n,e,t)}));return QM(t.mark.group)?e.reflow():e}});function QM(t){return t&&t.mark.role!=="legend-entry"}function tA(t,e,n){var i=e.items,r=Math.max(0,e.width||0),a=Math.max(0,e.height||0),o=(new Fv).set(0,0,r,a),s=o.clone(),u=o.clone(),l=[],c,f,h,d,p,m;for(p=0,m=i.length;p<m;++p){f=i[p];switch(f.role){case qk:d=AM(f)?s:u;d.union(DM(t,f,r,a));break;case Ik:c=f;break;case jk:l.push($M(t,f));break;case Lk:case Pk:case Wk:case Xk:case $k:case Hk:case Yk:case Jk:s.union(f.bounds);u.union(f.bounds);break;default:o.union(f.bounds)}}if(l.length){const e={};l.forEach((t=>{h=t.orient||Ek;if(h!==eM)(e[h]||(e[h]=[])).push(t)}));for(const i in e){const o=e[i];RM(t,o,XM(o,i,n.legends,s,u,r,a))}l.forEach((e=>{const i=e.bounds;if(!i.equals(e._bounds)){e.bounds=e._bounds;t.dirty(e);e.bounds=i;t.dirty(e)}if(n.autosize&&n.autosize.type===Kk){switch(e.orient){case Ak:case Ek:o.add(i.x1,0).add(i.x2,0);break;case Mk:case Dk:o.add(0,i.y1).add(0,i.y2)}}else{o.union(i)}}))}o.union(s).union(u);if(c){o.union(KM(t,c,r,a,o))}if(e.clip){o.set(0,0,e.width||0,e.height||0)}eA(t,e,o,n)}function eA(t,e,n,i){const r=i.autosize||{},a=r.type;if(t._autosize<1||!a)return;let o=t._width,s=t._height,u=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const h=Math.max(0,Math.ceil(n.x2-u)),d=Math.max(0,Math.ceil(n.y2-c));if(r.contains===Vk){const e=t.padding();o-=e.left+e.right;s-=e.top+e.bottom}if(a===eM){l=0;f=0;u=o;c=s}else if(a===Kk){u=Math.max(0,o-l-h);c=Math.max(0,s-f-d)}else if(a===Zk){u=Math.max(0,o-l-h);s=c+f+d}else if(a===Qk){o=u+l+h;c=Math.max(0,s-f-d)}else if(a===tM){o=u+l+h;s=c+f+d}t._resizeView(o,s,u,c,[l,f],r.resize)}function nA(t,e){let n=0;if(e===undefined){for(let e of t){if(e=+e){n+=e}}}else{let i=-1;for(let r of t){if(r=+e(r,++i,t)){n+=r}}}return n}function iA(t){jo.call(this,null,t)}(0,m.XW)(iA,jo,{transform(t,e){if(this.value&&!t.modified()){return e.StopPropagation}var n=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,a=t.scale,o=t.count==null?t.values?t.values.length:10:t.count,s=Ug(a,o,t.minstep),u=t.format||Lg(n,a,s,t.formatSpecifier,t.formatType,!!t.values),l=t.values?qg(a,t.values,s):Ig(a,s);if(r)i.rem=r;r=l.map(((t,e)=>Ca({index:e/(l.length-1||1),value:t,label:u(t)})));if(t.extra&&r.length){r.push(Ca({index:-1,extra:{value:r[0].value},label:""}))}i.source=r;i.add=r;this.value=r;return i}});function rA(t){jo.call(this,null,t)}function aA(){return Ca({})}function oA(t){const e=(0,m.Xr)().test((t=>t.exit));e.lookup=n=>e.get(t(n));return e}(0,m.XW)(rA,jo,{transform(t,e){var n=e.dataflow,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.item||aA,a=t.key||Ea,o=this.value;if((0,m.kJ)(i.encode)){i.encode=null}if(o&&(t.modified("key")||e.modified(a))){(0,m.vU)("DataJoin does not support modified key function or fields.")}if(!o){e=e.addAll();this.value=o=oA(a)}e.visit(e.ADD,(t=>{const e=a(t);let n=o.get(e);if(n){if(n.exit){o.empty--;i.add.push(n)}else{i.mod.push(n)}}else{n=r(t);o.set(e,n);i.add.push(n)}n.datum=t;n.exit=false}));e.visit(e.MOD,(t=>{const e=a(t),n=o.get(e);if(n){n.datum=t;i.mod.push(n)}}));e.visit(e.REM,(t=>{const e=a(t),n=o.get(e);if(t===n.datum&&!n.exit){i.rem.push(n);n.exit=true;++o.empty}}));if(e.changed(e.ADD_MOD))i.modifies("datum");if(e.clean()||t.clean&&o.empty>n.cleanThreshold){n.runAfter(o.clean)}return i}});function sA(t){jo.call(this,null,t)}(0,m.XW)(sA,jo,{transform(t,e){var n=e.fork(e.ADD_REM),i=t.mod||false,r=t.encoders,a=e.encode;if((0,m.kJ)(a)){if(n.changed()||a.every((t=>r[t]))){a=a[0];n.encode=null}else{return e.StopPropagation}}var o=a==="enter",s=r.update||m.k,u=r.enter||m.k,l=r.exit||m.k,c=(a&&!o?r[a]:s)||m.k;if(e.changed(e.ADD)){e.visit(e.ADD,(e=>{u(e,t);s(e,t)}));n.modifies(u.output);n.modifies(s.output);if(c!==m.k&&c!==s){e.visit(e.ADD,(e=>{c(e,t)}));n.modifies(c.output)}}if(e.changed(e.REM)&&l!==m.k){e.visit(e.REM,(e=>{l(e,t)}));n.modifies(l.output)}if(o||c!==m.k){const r=e.MOD|(t.modified()?e.REFLOW:0);if(o){e.visit(r,(e=>{const r=u(e,t)||i;if(c(e,t)||r)n.mod.push(e)}));if(n.mod.length)n.modifies(u.output)}else{e.visit(r,(e=>{if(c(e,t)||i)n.mod.push(e)}))}if(n.mod.length)n.modifies(c.output)}return n.changed()?n:e.StopPropagation}});function uA(t){jo.call(this,[],t)}(0,m.XW)(uA,jo,{transform(t,e){if(this.value!=null&&!t.modified()){return e.StopPropagation}var n=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,a=t.type||Tg,o=t.scale,s=+t.limit,u=Ug(o,t.count==null?5:t.count,t.minstep),l=!!t.values||a===Tg,c=t.format||Vg(n,o,u,a,t.formatSpecifier,t.formatType,l),f=t.values||Xg(o,u),h,d,p,g,y;if(r)i.rem=r;if(a===Tg){if(s&&f.length>s){e.dataflow.warn("Symbol legend count exceeds limit, filtering items.");r=f.slice(0,s-1);y=true}else{r=f}if((0,m.mf)(p=t.size)){if(!t.values&&o(r[0])===0){r=r.slice(1)}g=r.reduce(((e,n)=>Math.max(e,p(n,t))),0)}else{p=(0,m.a9)(g=p||8)}r=r.map(((e,n)=>Ca({index:n,label:c(e,n,r),value:e,offset:g,size:p(e,t)})));if(y){y=f[r.length];r.push(Ca({index:r.length,label:"…".concat(f.length-r.length," entries"),value:y,offset:g,size:p(y,t)}))}}else if(a===Ng){h=o.domain(),d=wg(o,h[0],(0,m.fj)(h));if(f.length<3&&!t.values&&h[0]!==(0,m.fj)(h)){f=[h[0],(0,m.fj)(h)]}r=f.map(((t,e)=>Ca({index:e,label:c(t,e,f),value:t,perc:d(t)})))}else{p=f.length-1;d=ey(o);r=f.map(((t,e)=>Ca({index:e,label:c(t,e,f),value:t,perc:e?d(t):0,perc2:e===p?1:d(f[e+1])})))}i.source=r;i.add=r;this.value=r;return i}});const lA=t=>t.source.x;const cA=t=>t.source.y;const fA=t=>t.target.x;const hA=t=>t.target.y;function dA(t){jo.call(this,{},t)}dA.Definition={type:"LinkPath",metadata:{modifies:true},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"}]};(0,m.XW)(dA,jo,{transform(t,e){var n=t.sourceX||lA,i=t.sourceY||cA,r=t.targetX||fA,a=t.targetY||hA,o=t.as||"path",s=t.orient||"vertical",u=t.shape||"line",l=EA.get(u+"-"+s)||EA.get(u);if(!l){(0,m.vU)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:""))}e.visit(e.SOURCE,(t=>{t[o]=l(n(t),i(t),r(t),a(t))}));return e.reflow(t.modified()).modifies(o)}});const pA=(t,e,n,i)=>"M"+t+","+e+"L"+n+","+i;const mA=(t,e,n,i)=>pA(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n));const gA=(t,e,n,i)=>{var r=n-t,a=i-e,o=Math.sqrt(r*r+a*a)/2,s=180*Math.atan2(a,r)/Math.PI;return"M"+t+","+e+"A"+o+","+o+" "+s+" 0 1"+" "+n+","+i};const yA=(t,e,n,i)=>gA(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n));const vA=(t,e,n,i)=>{const r=n-t,a=i-e,o=.2*(r+a),s=.2*(a-r);return"M"+t+","+e+"C"+(t+o)+","+(e+s)+" "+(n+s)+","+(i-o)+" "+n+","+i};const xA=(t,e,n,i)=>vA(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n));const _A=(t,e,n,i)=>"M"+t+","+e+"V"+i+"H"+n;const bA=(t,e,n,i)=>"M"+t+","+e+"H"+n+"V"+i;const wA=(t,e,n,i)=>{const r=Math.cos(t),a=Math.sin(t),o=Math.cos(n),s=Math.sin(n),u=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*r+","+e*a+"A"+e+","+e+" 0 0,"+(u?1:0)+" "+e*o+","+e*s+"L"+i*o+","+i*s};const kA=(t,e,n,i)=>{const r=(t+n)/2;return"M"+t+","+e+"C"+r+","+e+" "+r+","+i+" "+n+","+i};const MA=(t,e,n,i)=>{const r=(e+i)/2;return"M"+t+","+e+"C"+t+","+r+" "+n+","+r+" "+n+","+i};const AA=(t,e,n,i)=>{const r=Math.cos(t),a=Math.sin(t),o=Math.cos(n),s=Math.sin(n),u=(e+i)/2;return"M"+e*r+","+e*a+"C"+u*r+","+u*a+" "+u*o+","+u*s+" "+i*o+","+i*s};const EA=(0,m.Xr)({line:pA,"line-radial":mA,arc:gA,"arc-radial":yA,curve:vA,"curve-radial":xA,"orthogonal-horizontal":_A,"orthogonal-vertical":bA,"orthogonal-radial":wA,"diagonal-horizontal":kA,"diagonal-vertical":MA,"diagonal-radial":AA});function DA(t){jo.call(this,null,t)}DA.Definition={type:"Pie",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:false},{name:"as",type:"string",array:true,length:2,default:["startAngle","endAngle"]}]};(0,m.XW)(DA,jo,{transform(t,e){var n=t.as||["startAngle","endAngle"],i=n[0],r=n[1],a=t.field||m.kX,o=t.startAngle||0,s=t.endAngle!=null?t.endAngle:2*Math.PI,u=e.source,l=u.map(a),c=l.length,f=o,h=(s-o)/nA(l),d=ru(c),p,g,y;if(t.sort){d.sort(((t,e)=>l[t]-l[e]))}for(p=0;p<c;++p){y=l[d[p]];g=u[d[p]];g[i]=f;g[r]=f+=y*h}this.value=l;return e.reflow(t.modified()).modifies(n)}});const CA=5;function FA(t){const e=t.type;return!t.bins&&(e===Fm||e===Tm||e===Bm)}function SA(t){return cg(t)&&t!==Rm}const TA=(0,m.Rg)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function BA(t){jo.call(this,null,t);this.modified(true)}(0,m.XW)(BA,jo,{transform(t,e){var n=e.dataflow,i=this.value,r=NA(t);if(!i||r!==i.type){this.value=i=sg(r)()}for(r in t)if(!TA[r]){if(r==="padding"&&SA(i.type))continue;(0,m.mf)(i[r])?i[r](t[r]):n.warn("Unsupported scale property: "+r)}LA(i,t,IA(i,t,OA(i,t,n)));return e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function NA(t){var e=t.type,n="",i;if(e===Rm)return Rm+"-"+Fm;if(zA(t)){i=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(t.domainMid!=null):0;n=i===2?Rm+"-":i===3?Um+"-":""}return(n+e||Fm).toLowerCase()}function zA(t){const e=t.type;return cg(e)&&e!==zm&&e!==Om&&(t.scheme||t.range&&t.range.length&&t.range.every(m.HD))}function OA(t,e,n){const i=RA(t,e.domainRaw,n);if(i>-1)return i;var r=e.domain,a=t.type,o=e.zero||e.zero===undefined&&FA(t),s,u;if(!r)return 0;if(SA(a)&&e.padding&&r[0]!==(0,m.fj)(r)){r=UA(a,r,e.range,e.padding,e.exponent,e.constant)}if(o||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null){s=(r=r.slice()).length-1||1;if(o){if(r[0]>0)r[0]=0;if(r[s]<0)r[s]=0}if(e.domainMin!=null)r[0]=e.domainMin;if(e.domainMax!=null)r[s]=e.domainMax;if(e.domainMid!=null){u=e.domainMid;const t=u>r[s]?s+1:u<r[0]?0:s;if(t!==s)n.warn("Scale domainMid exceeds domain min or max.",u);r.splice(t,0,u)}}t.domain(qA(a,r,n));if(a===Pm){t.unknown(e.domainImplicit?eh:undefined)}if(e.nice&&t.nice){t.nice(e.nice!==true&&Ug(t,e.nice)||null)}return r.length}function RA(t,e,n){if(e){t.domain(qA(t.type,e,n));return e.length}else{return-1}}function UA(t,e,n,i,r,a){var o=Math.abs((0,m.fj)(n)-n[0]),s=o/(o-2*i),u=t===Sm?(0,m.dH)(e,null,s):t===Bm?(0,m.mK)(e,null,s,.5):t===Tm?(0,m.mK)(e,null,s,r||1):t===Nm?(0,m.bV)(e,null,s,a||1):(0,m.ay)(e,null,s);e=e.slice();e[0]=u[0];e[e.length-1]=u[1];return e}function qA(t,e,n){if(dg(t)){var i=Math.abs(e.reduce(((t,e)=>t+(e<0?-1:e>0?1:0)),0));if(i!==e.length){n.warn("Log scale domain includes zero: "+(0,m.m8)(e))}}return e}function IA(t,e,n){let i=e.bins;if(i&&!(0,m.kJ)(i)){const e=t.domain(),n=e[0],r=(0,m.fj)(e),a=i.step;let o=i.start==null?n:i.start,s=i.stop==null?r:i.stop;if(!a)(0,m.vU)("Scale bins parameter missing step property.");if(o<n)o=a*Math.ceil(n/a);if(s>r)s=a*Math.floor(r/a);i=ru(o,s+a/2,a)}if(i){t.bins=i}else if(t.bins){delete t.bins}if(t.type===Xm){if(!i){t.bins=t.domain()}else if(!e.domain&&!e.domainRaw){t.domain(i);n=i.length}}return n}function LA(t,e,n){var i=t.type,r=e.round||false,a=e.range;if(e.rangeStep!=null){a=PA(i,e,n)}else if(e.scheme){a=jA(i,e,n);if((0,m.mf)(a)){if(t.interpolator){return t.interpolator(a)}else{(0,m.vU)("Scale type ".concat(i," does not support interpolating color schemes."))}}}if(a&&mg(i)){return t.interpolator(xg(XA(a,e.reverse),e.interpolate,e.interpolateGamma))}if(a&&e.interpolate&&t.interpolate){t.interpolate(kg(e.interpolate,e.interpolateGamma))}else if((0,m.mf)(t.round)){t.round(r)}else if((0,m.mf)(t.rangeRound)){t.interpolate(r?ld:ud)}if(a)t.range(XA(a,e.reverse))}function PA(t,e,n){if(t!==Wm&&t!==jm){(0,m.vU)("Only band and point scales support rangeStep.")}var i=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,r=t===jm?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*Dm(n,r,i)]}function jA(t,e,n){var i=e.schemeExtent,r,a;if((0,m.kJ)(e.scheme)){a=xg(e.scheme,e.interpolate,e.interpolateGamma)}else{r=e.scheme.toLowerCase();a=Sg(r);if(!a)(0,m.vU)("Unrecognized scheme name: ".concat(e.scheme))}n=t===Lm?n+1:t===Xm?n-1:t===qm||t===Im?+e.schemeCount||CA:n;return mg(t)?WA(a,i,e.reverse):(0,m.mf)(a)?_g(WA(a,i),n):t===Pm?a:a.slice(0,n)}function WA(t,e,n){return(0,m.mf)(t)&&(e||n)?vg(t,XA(e||[0,1],n)):t}function XA(t,e){return e?t.slice().reverse():t}function $A(t){jo.call(this,null,t)}(0,m.XW)($A,jo,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");if(n)e.source.sort(Ba(t.sort));this.modified(n);return e}});const HA="zero",YA="center",JA="normalize",VA=["y0","y1"];function GA(t){jo.call(this,null,t)}GA.Definition={type:"Stack",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:true},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:HA,values:[HA,YA,JA]},{name:"as",type:"string",array:true,length:2,default:VA}]};(0,m.XW)(GA,jo,{transform(t,e){var n=t.as||VA,i=n[0],r=n[1],a=Ba(t.sort),o=t.field||m.kX,s=t.offset===YA?KA:t.offset===JA?ZA:QA,u,l,c,f;u=tE(e.source,t.groupby,a,o);for(l=0,c=u.length,f=u.max;l<c;++l){s(u[l],f,o,i,r)}return e.reflow(t.modified()).modifies(n)}});function KA(t,e,n,i,r){var a=(e-t.sum)/2,o=t.length,s=0,u;for(;s<o;++s){u=t[s];u[i]=a;u[r]=a+=Math.abs(n(u))}}function ZA(t,e,n,i,r){var a=1/t.sum,o=0,s=t.length,u=0,l=0,c;for(;u<s;++u){c=t[u];c[i]=o;c[r]=o=a*(l+=Math.abs(n(c)))}}function QA(t,e,n,i,r){var a=0,o=0,s=t.length,u=0,l,c;for(;u<s;++u){c=t[u];l=+n(c);if(l<0){c[i]=o;c[r]=o+=l}else{c[i]=a;c[r]=a+=l}}}function tE(t,e,n,i){var r=[],a=t=>t(c),o,s,u,l,c,f,h,d,p;if(e==null){r.push(t.slice())}else{for(o={},s=0,u=t.length;s<u;++s){c=t[s];f=e.map(a);h=o[f];if(!h){o[f]=h=[];r.push(h)}h.push(c)}}for(f=0,p=0,l=r.length;f<l;++f){h=r[f];for(s=0,d=0,u=h.length;s<u;++s){d+=Math.abs(i(h[s]))}h.sum=d;if(d>p)p=d;if(n)h.sort(n)}r.max=p;return r}const eE=t=>t;function nE(t,e){if(t&&rE.hasOwnProperty(t.type)){rE[t.type](t,e)}}var iE={Feature:function(t,e){nE(t.geometry,e)},FeatureCollection:function(t,e){var n=t.features,i=-1,r=n.length;while(++i<r)nE(n[i].geometry,e)}};var rE={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates;e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){aE(t.coordinates,e,0)},MultiLineString:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r)aE(n[i],e,0)},Polygon:function(t,e){oE(t.coordinates,e)},MultiPolygon:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r)oE(n[i],e)},GeometryCollection:function(t,e){var n=t.geometries,i=-1,r=n.length;while(++i<r)nE(n[i],e)}};function aE(t,e,n){var i=-1,r=t.length-n,a;e.lineStart();while(++i<r)a=t[i],e.point(a[0],a[1],a[2]);e.lineEnd()}function oE(t,e){var n=-1,i=t.length;e.polygonStart();while(++n<i)aE(t[n],e,1);e.polygonEnd()}function sE(t,e){if(t&&iE.hasOwnProperty(t.type)){iE[t.type](t,e)}else{nE(t,e)}}class uE{constructor(){this._partials=new Float64Array(32);this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],a=t+r,o=Math.abs(t)<Math.abs(r)?t-(a-r):r-(a-t);if(o)e[n++]=o;t=a}e[n]=t;this._n=n+1;return this}valueOf(){const t=this._partials;let e=this._n,n,i,r,a=0;if(e>0){a=t[--e];while(e>0){n=a;i=t[--e];a=n+i;r=i-(a-n);if(r)break}if(e>0&&(r<0&&t[e-1]<0||r>0&&t[e-1]>0)){i=r*2;n=a+i;if(i==n-a)a=n}}return a}}function lE(t,e){const n=new uE;if(e===undefined){for(let e of t){if(e=+e){n.add(e)}}}else{let i=-1;for(let r of t){if(r=+e(r,++i,t)){n.add(r)}}}return+n}function cE(t,e){const n=new uE;let i=-1;return Float64Array.from(t,e===undefined?t=>n.add(+t||0):r=>n.add(+e(r,++i,t)||0))}var fE=1e-6;var hE=1e-12;var dE=Math.PI;var pE=dE/2;var mE=dE/4;var gE=dE*2;var yE=180/dE;var vE=dE/180;var xE=Math.abs;var _E=Math.atan;var bE=Math.atan2;var wE=Math.cos;var kE=Math.ceil;var ME=Math.exp;var AE=Math.floor;var EE=Math.hypot;var DE=Math.log;var CE=Math.pow;var FE=Math.sin;var SE=Math.sign||function(t){return t>0?1:t<0?-1:0};var TE=Math.sqrt;var BE=Math.tan;function NE(t){return t>1?0:t<-1?dE:Math.acos(t)}function zE(t){return t>1?pE:t<-1?-pE:Math.asin(t)}function OE(t){return(t=FE(t/2))*t}function RE(){}var UE=new uE,qE=new uE,IE,LE,PE,jE;var WE={point:RE,lineStart:RE,lineEnd:RE,polygonStart:function(){WE.lineStart=XE;WE.lineEnd=YE},polygonEnd:function(){WE.lineStart=WE.lineEnd=WE.point=RE;UE.add(xE(qE));qE=new uE},result:function(){var t=UE/2;UE=new uE;return t}};function XE(){WE.point=$E}function $E(t,e){WE.point=HE;IE=PE=t,LE=jE=e}function HE(t,e){qE.add(jE*t-PE*e);PE=t,jE=e}function YE(){HE(IE,LE)}const JE=WE;var VE=Infinity,GE=VE,KE=-VE,ZE=KE;var QE={point:tD,lineStart:RE,lineEnd:RE,polygonStart:RE,polygonEnd:RE,result:function(){var t=[[VE,GE],[KE,ZE]];KE=ZE=-(GE=VE=Infinity);return t}};function tD(t,e){if(t<VE)VE=t;if(t>KE)KE=t;if(e<GE)GE=e;if(e>ZE)ZE=e}const eD=QE;var nD=0,iD=0,rD=0,aD=0,oD=0,sD=0,uD=0,lD=0,cD=0,fD,hD,dD,pD;var mD={point:gD,lineStart:yD,lineEnd:_D,polygonStart:function(){mD.lineStart=bD;mD.lineEnd=wD},polygonEnd:function(){mD.point=gD;mD.lineStart=yD;mD.lineEnd=_D},result:function(){var t=cD?[uD/cD,lD/cD]:sD?[aD/sD,oD/sD]:rD?[nD/rD,iD/rD]:[NaN,NaN];nD=iD=rD=aD=oD=sD=uD=lD=cD=0;return t}};function gD(t,e){nD+=t;iD+=e;++rD}function yD(){mD.point=vD}function vD(t,e){mD.point=xD;gD(dD=t,pD=e)}function xD(t,e){var n=t-dD,i=e-pD,r=TE(n*n+i*i);aD+=r*(dD+t)/2;oD+=r*(pD+e)/2;sD+=r;gD(dD=t,pD=e)}function _D(){mD.point=gD}function bD(){mD.point=kD}function wD(){MD(fD,hD)}function kD(t,e){mD.point=MD;gD(fD=dD=t,hD=pD=e)}function MD(t,e){var n=t-dD,i=e-pD,r=TE(n*n+i*i);aD+=r*(dD+t)/2;oD+=r*(pD+e)/2;sD+=r;r=pD*t-dD*e;uD+=r*(dD+t);lD+=r*(pD+e);cD+=r*3;gD(dD=t,pD=e)}const AD=mD;function ED(t){this._context=t}ED.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line===0)this._context.closePath();this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e);this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e);this._context.arc(t,e,this._radius,0,gE);break}}},result:RE};var DD=new uE,CD,FD,SD,TD,BD;var ND={point:RE,lineStart:function(){ND.point=zD},lineEnd:function(){if(CD)OD(FD,SD);ND.point=RE},polygonStart:function(){CD=true},polygonEnd:function(){CD=null},result:function(){var t=+DD;DD=new uE;return t}};function zD(t,e){ND.point=OD;FD=TD=t,SD=BD=e}function OD(t,e){TD-=t,BD-=e;DD.add(TE(TD*TD+BD*BD));TD=t,BD=e}const RD=ND;function UD(){this._string=[]}UD.prototype={_radius:4.5,_circle:qD(4.5),pointRadius:function(t){if((t=+t)!==this._radius)this._radius=t,this._circle=null;return this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line===0)this._string.push("Z");this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._string.push("M",t,",",e);this._point=1;break}case 1:{this._string.push("L",t,",",e);break}default:{if(this._circle==null)this._circle=qD(this._radius);this._string.push("M",t,",",e,this._circle);break}}},result:function(){if(this._string.length){var t=this._string.join("");this._string=[];return t}else{return null}}};function qD(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ID(t,e){var n=4.5,i,r;function a(t){if(t){if(typeof n==="function")r.pointRadius(+n.apply(this,arguments));sE(t,i(r))}return r.result()}a.area=function(t){sE(t,i(JE));return JE.result()};a.measure=function(t){sE(t,i(RD));return RD.result()};a.bounds=function(t){sE(t,i(eD));return eD.result()};a.centroid=function(t){sE(t,i(AD));return AD.result()};a.projection=function(e){return arguments.length?(i=e==null?(t=null,eE):(t=e).stream,a):t};a.context=function(t){if(!arguments.length)return e;r=t==null?(e=null,new UD):new ED(e=t);if(typeof n!=="function")r.pointRadius(n);return a};a.pointRadius=function(t){if(!arguments.length)return n;n=typeof t==="function"?t:(r.pointRadius(+t),+t);return a};return a.projection(t).context(e)}function LD(){var t=[],e;return{point:function(t,n,i){e.push([t,n,i])},lineStart:function(){t.push(e=[])},lineEnd:RE,rejoin:function(){if(t.length>1)t.push(t.pop().concat(t.shift()))},result:function(){var n=t;t=[];e=null;return n}}}function PD(t,e){return xE(t[0]-e[0])<fE&&xE(t[1]-e[1])<fE}function jD(t,e,n,i){this.x=t;this.z=e;this.o=n;this.e=i;this.v=false;this.n=this.p=null}function WD(t,e,n,i,r){var a=[],o=[],s,u;t.forEach((function(t){if((e=t.length-1)<=0)return;var e,n=t[0],i=t[e],u;if(PD(n,i)){if(!n[2]&&!i[2]){r.lineStart();for(s=0;s<e;++s)r.point((n=t[s])[0],n[1]);r.lineEnd();return}i[0]+=2*fE}a.push(u=new jD(n,t,null,true));o.push(u.o=new jD(n,null,u,false));a.push(u=new jD(i,t,null,false));o.push(u.o=new jD(i,null,u,true))}));if(!a.length)return;o.sort(e);XD(a);XD(o);for(s=0,u=o.length;s<u;++s){o[s].e=n=!n}var l=a[0],c,f;while(1){var h=l,d=true;while(h.v)if((h=h.n)===l)return;c=h.z;r.lineStart();do{h.v=h.o.v=true;if(h.e){if(d){for(s=0,u=c.length;s<u;++s)r.point((f=c[s])[0],f[1])}else{i(h.x,h.n.x,1,r)}h=h.n}else{if(d){c=h.p.z;for(s=c.length-1;s>=0;--s)r.point((f=c[s])[0],f[1])}else{i(h.x,h.p.x,-1,r)}h=h.p}h=h.o;c=h.z;d=!d}while(!h.v);r.lineEnd()}}function XD(t){if(!(e=t.length))return;var e,n=0,i=t[0],r;while(++n<e){i.n=r=t[n];r.p=i;i=r}i.n=r=t[0];r.p=i}function $D(t){return[bE(t[1],t[0]),zE(t[2])]}function HD(t){var e=t[0],n=t[1],i=wE(n);return[i*wE(e),i*FE(e),FE(n)]}function YD(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function JD(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function VD(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function GD(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function KD(t){var e=TE(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ZD(t){if(xE(t[0])<=dE)return t[0];else return SE(t[0])*((xE(t[0])+dE)%gE-dE)}function QD(t,e){var n=ZD(e),i=e[1],r=FE(i),a=[FE(n),-wE(n),0],o=0,s=0;var u=new uE;if(r===1)i=pE+fE;else if(r===-1)i=-pE-fE;for(var l=0,c=t.length;l<c;++l){if(!(h=(f=t[l]).length))continue;var f,h,d=f[h-1],p=ZD(d),m=d[1]/2+mE,g=FE(m),y=wE(m);for(var v=0;v<h;++v,p=_,g=w,y=k,d=x){var x=f[v],_=ZD(x),b=x[1]/2+mE,w=FE(b),k=wE(b),M=_-p,A=M>=0?1:-1,E=A*M,D=E>dE,C=g*w;u.add(bE(C*A*FE(E),y*k+C*wE(E)));o+=D?M+A*gE:M;if(D^p>=n^_>=n){var F=JD(HD(d),HD(x));KD(F);var S=JD(a,F);KD(S);var T=(D^M>=0?-1:1)*zE(S[2]);if(i>T||i===T&&(F[0]||F[1])){s+=D^M>=0?1:-1}}}}return(o<-fE||o<fE&&u<-hE)^s&1}function*tC(t){for(const e of t){yield*e}}function eC(t){return Array.from(tC(t))}function nC(t,e,n,i){return function(r){var a=e(r),o=LD(),s=e(o),u=false,l,c,f;var h={point:d,lineStart:m,lineEnd:g,polygonStart:function(){h.point=y;h.lineStart=v;h.lineEnd=x;c=[];l=[]},polygonEnd:function(){h.point=d;h.lineStart=m;h.lineEnd=g;c=eC(c);var t=QD(l,i);if(c.length){if(!u)r.polygonStart(),u=true;WD(c,rC,t,n,r)}else if(t){if(!u)r.polygonStart(),u=true;r.lineStart();n(null,null,1,r);r.lineEnd()}if(u)r.polygonEnd(),u=false;c=l=null},sphere:function(){r.polygonStart();r.lineStart();n(null,null,1,r);r.lineEnd();r.polygonEnd()}};function d(e,n){if(t(e,n))r.point(e,n)}function p(t,e){a.point(t,e)}function m(){h.point=p;a.lineStart()}function g(){h.point=d;a.lineEnd()}function y(t,e){f.push([t,e]);s.point(t,e)}function v(){s.lineStart();f=[]}function x(){y(f[0][0],f[0][1]);s.lineEnd();var t=s.clean(),e=o.result(),n,i=e.length,a,h,d;f.pop();l.push(f);f=null;if(!i)return;if(t&1){h=e[0];if((a=h.length-1)>0){if(!u)r.polygonStart(),u=true;r.lineStart();for(n=0;n<a;++n)r.point((d=h[n])[0],d[1]);r.lineEnd()}return}if(i>1&&t&2)e.push(e.pop().concat(e.shift()));c.push(e.filter(iC))}return h}}function iC(t){return t.length>1}function rC(t,e){return((t=t.x)[0]<0?t[1]-pE-fE:pE-t[1])-((e=e.x)[0]<0?e[1]-pE-fE:pE-e[1])}const aC=nC((function(){return true}),oC,uC,[-dE,-pE]);function oC(t){var e=NaN,n=NaN,i=NaN,r;return{lineStart:function(){t.lineStart();r=1},point:function(a,o){var s=a>0?dE:-dE,u=xE(a-e);if(xE(u-dE)<fE){t.point(e,n=(n+o)/2>0?pE:-pE);t.point(i,n);t.lineEnd();t.lineStart();t.point(s,n);t.point(a,n);r=0}else if(i!==s&&u>=dE){if(xE(e-i)<fE)e-=i*fE;if(xE(a-s)<fE)a-=s*fE;n=sC(e,n,a,o);t.point(i,n);t.lineEnd();t.lineStart();t.point(s,n);r=0}t.point(e=a,n=o);i=s},lineEnd:function(){t.lineEnd();e=n=NaN},clean:function(){return 2-r}}}function sC(t,e,n,i){var r,a,o=FE(t-n);return xE(o)>fE?_E((FE(e)*(a=wE(i))*FE(n)-FE(i)*(r=wE(e))*FE(t))/(r*a*o)):(e+i)/2}function uC(t,e,n,i){var r;if(t==null){r=n*pE;i.point(-dE,r);i.point(0,r);i.point(dE,r);i.point(dE,0);i.point(dE,-r);i.point(0,-r);i.point(-dE,-r);i.point(-dE,0);i.point(-dE,r)}else if(xE(t[0]-e[0])>fE){var a=t[0]<e[0]?dE:-dE;r=n*a/2;i.point(-a,r);i.point(0,r);i.point(a,r)}else{i.point(e[0],e[1])}}function lC(t,e,n,i,r,a){if(!n)return;var o=wE(e),s=FE(e),u=i*n;if(r==null){r=e+i*gE;a=e-u/2}else{r=cC(o,r);a=cC(o,a);if(i>0?r<a:r>a)r+=i*gE}for(var l,c=r;i>0?c>a:c<a;c-=u){l=$D([o,-s*wE(c),-s*FE(c)]);t.point(l[0],l[1])}}function cC(t,e){e=HD(e),e[0]-=t;KD(e);var n=NE(-e[1]);return((-e[2]<0?-n:n)+gE-fE)%gE}function fC(){var t=constant([0,0]),e=constant(90),n=constant(6),i,r,a={point:o};function o(t,e){i.push(t=r(t,e));t[0]*=degrees,t[1]*=degrees}function s(){var o=t.apply(this,arguments),s=e.apply(this,arguments)*radians,u=n.apply(this,arguments)*radians;i=[];r=rotateRadians(-o[0]*radians,-o[1]*radians,0).invert;lC(a,s,u,1);o={type:"Polygon",coordinates:[i]};i=r=null;return o}s.center=function(e){return arguments.length?(t=typeof e==="function"?e:constant([+e[0],+e[1]]),s):t};s.radius=function(t){return arguments.length?(e=typeof t==="function"?t:constant(+t),s):e};s.precision=function(t){return arguments.length?(n=typeof t==="function"?t:constant(+t),s):n};return s}function hC(t){var e=wE(t),n=6*vE,i=e>0,r=xE(e)>fE;function a(e,i,r,a){lC(a,t,n,r,e,i)}function o(t,n){return wE(t)*wE(n)>e}function s(t){var e,n,a,s,c;return{lineStart:function(){s=a=false;c=1},point:function(f,h){var d=[f,h],p,m=o(f,h),g=i?m?0:l(f,h):m?l(f+(f<0?dE:-dE),h):0;if(!e&&(s=a=m))t.lineStart();if(m!==a){p=u(e,d);if(!p||PD(e,p)||PD(d,p))d[2]=1}if(m!==a){c=0;if(m){t.lineStart();p=u(d,e);t.point(p[0],p[1])}else{p=u(e,d);t.point(p[0],p[1],2);t.lineEnd()}e=p}else if(r&&e&&i^m){var y;if(!(g&n)&&(y=u(d,e,true))){c=0;if(i){t.lineStart();t.point(y[0][0],y[0][1]);t.point(y[1][0],y[1][1]);t.lineEnd()}else{t.point(y[1][0],y[1][1]);t.lineEnd();t.lineStart();t.point(y[0][0],y[0][1],3)}}}if(m&&(!e||!PD(e,d))){t.point(d[0],d[1])}e=d,a=m,n=g},lineEnd:function(){if(a)t.lineEnd();e=null},clean:function(){return c|(s&&a)<<1}}}function u(t,n,i){var r=HD(t),a=HD(n);var o=[1,0,0],s=JD(r,a),u=YD(s,s),l=s[0],c=u-l*l;if(!c)return!i&&t;var f=e*u/c,h=-e*l/c,d=JD(o,s),p=GD(o,f),m=GD(s,h);VD(p,m);var g=d,y=YD(p,g),v=YD(g,g),x=y*y-v*(YD(p,p)-1);if(x<0)return;var _=TE(x),b=GD(g,(-y-_)/v);VD(b,p);b=$D(b);if(!i)return b;var w=t[0],k=n[0],M=t[1],A=n[1],E;if(k<w)E=w,w=k,k=E;var D=k-w,C=xE(D-dE)<fE,F=C||D<fE;if(!C&&A<M)E=M,M=A,A=E;if(F?C?M+A>0^b[1]<(xE(b[0]-w)<fE?M:A):M<=b[1]&&b[1]<=A:D>dE^(w<=b[0]&&b[0]<=k)){var S=GD(g,(-y+_)/v);VD(S,p);return[b,$D(S)]}}function l(e,n){var r=i?t:dE-t,a=0;if(e<-r)a|=1;else if(e>r)a|=2;if(n<-r)a|=4;else if(n>r)a|=8;return a}return nC(o,s,a,i?[0,-t]:[-dE,t-dE])}function dC(t,e,n,i,r,a){var o=t[0],s=t[1],u=e[0],l=e[1],c=0,f=1,h=u-o,d=l-s,p;p=n-o;if(!h&&p>0)return;p/=h;if(h<0){if(p<c)return;if(p<f)f=p}else if(h>0){if(p>f)return;if(p>c)c=p}p=r-o;if(!h&&p<0)return;p/=h;if(h<0){if(p>f)return;if(p>c)c=p}else if(h>0){if(p<c)return;if(p<f)f=p}p=i-s;if(!d&&p>0)return;p/=d;if(d<0){if(p<c)return;if(p<f)f=p}else if(d>0){if(p>f)return;if(p>c)c=p}p=a-s;if(!d&&p<0)return;p/=d;if(d<0){if(p>f)return;if(p>c)c=p}else if(d>0){if(p<c)return;if(p<f)f=p}if(c>0)t[0]=o+c*h,t[1]=s+c*d;if(f<1)e[0]=o+f*h,e[1]=s+f*d;return true}var pC=1e9,mC=-pC;function gC(t,e,n,i){function r(r,a){return t<=r&&r<=n&&e<=a&&a<=i}function a(r,a,s,l){var c=0,f=0;if(r==null||(c=o(r,s))!==(f=o(a,s))||u(r,a)<0^s>0){do{l.point(c===0||c===3?t:n,c>1?i:e)}while((c=(c+s+4)%4)!==f)}else{l.point(a[0],a[1])}}function o(i,r){return xE(i[0]-t)<fE?r>0?0:3:xE(i[0]-n)<fE?r>0?2:1:xE(i[1]-e)<fE?r>0?1:0:r>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:n===0?e[1]-t[1]:n===1?t[0]-e[0]:n===2?t[1]-e[1]:e[0]-t[0]}return function(o){var u=o,l=LD(),c,f,h,d,p,m,g,y,v,x,_;var b={point:w,lineStart:E,lineEnd:D,polygonStart:M,polygonEnd:A};function w(t,e){if(r(t,e))u.point(t,e)}function k(){var e=0;for(var n=0,r=f.length;n<r;++n){for(var a=f[n],o=1,s=a.length,u=a[0],l,c,h=u[0],d=u[1];o<s;++o){l=h,c=d,u=a[o],h=u[0],d=u[1];if(c<=i){if(d>i&&(h-l)*(i-c)>(d-c)*(t-l))++e}else{if(d<=i&&(h-l)*(i-c)<(d-c)*(t-l))--e}}}return e}function M(){u=l,c=[],f=[],_=true}function A(){var t=k(),e=_&&t,n=(c=eC(c)).length;if(e||n){o.polygonStart();if(e){o.lineStart();a(null,null,1,o);o.lineEnd()}if(n){WD(c,s,t,a,o)}o.polygonEnd()}u=o,c=f=h=null}function E(){b.point=C;if(f)f.push(h=[]);x=true;v=false;g=y=NaN}function D(){if(c){C(d,p);if(m&&v)l.rejoin();c.push(l.result())}b.point=w;if(v)u.lineEnd()}function C(a,o){var s=r(a,o);if(f)h.push([a,o]);if(x){d=a,p=o,m=s;x=false;if(s){u.lineStart();u.point(a,o)}}else{if(s&&v)u.point(a,o);else{var l=[g=Math.max(mC,Math.min(pC,g)),y=Math.max(mC,Math.min(pC,y))],c=[a=Math.max(mC,Math.min(pC,a)),o=Math.max(mC,Math.min(pC,o))];if(dC(l,c,t,e,n,i)){if(!v){u.lineStart();u.point(l[0],l[1])}u.point(c[0],c[1]);if(!s)u.lineEnd();_=false}else if(s){u.lineStart();u.point(a,o);_=false}}}g=a,y=o,v=s}return b}}function yC(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}if(t.invert&&e.invert)n.invert=function(n,i){return n=e.invert(n,i),n&&t.invert(n[0],n[1])};return n}function vC(t,e){return[xE(t)>dE?t+Math.round(-t/gE)*gE:t,e]}vC.invert=vC;function xC(t,e,n){return(t%=gE)?e||n?yC(bC(t),wC(e,n)):bC(t):e||n?wC(e,n):vC}function _C(t){return function(e,n){return e+=t,[e>dE?e-gE:e<-dE?e+gE:e,n]}}function bC(t){var e=_C(t);e.invert=_C(-t);return e}function wC(t,e){var n=wE(t),i=FE(t),r=wE(e),a=FE(e);function o(t,e){var o=wE(e),s=wE(t)*o,u=FE(t)*o,l=FE(e),c=l*n+s*i;return[bE(u*r-c*a,s*n-l*i),zE(c*r+u*a)]}o.invert=function(t,e){var o=wE(e),s=wE(t)*o,u=FE(t)*o,l=FE(e),c=l*r-u*a;return[bE(u*r+l*a,s*n+c*i),zE(c*n-s*i)]};return o}function kC(t){t=xC(t[0]*vE,t[1]*vE,t.length>2?t[2]*vE:0);function e(e){e=t(e[0]*vE,e[1]*vE);return e[0]*=yE,e[1]*=yE,e}e.invert=function(e){e=t.invert(e[0]*vE,e[1]*vE);return e[0]*=yE,e[1]*=yE,e};return e}function MC(t){return{stream:AC(t)}}function AC(t){return function(e){var n=new EC;for(var i in t)n[i]=t[i];n.stream=e;return n}}function EC(){}EC.prototype={constructor:EC,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function DC(t,e,n){var i=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]);if(i!=null)t.clipExtent(null);sE(n,t.stream(eD));e(eD.result());if(i!=null)t.clipExtent(i);return t}function CC(t,e,n){return DC(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],a=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}function FC(t,e,n){return CC(t,[[0,0],e],n)}function SC(t,e,n){return DC(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),a=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];t.scale(150*r).translate([a,o])}),n)}function TC(t,e,n){return DC(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),a=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([a,o])}),n)}var BC=16,NC=wE(30*vE);function zC(t,e){return+e?RC(t,e):OC(t)}function OC(t){return AC({point:function(e,n){e=t(e,n);this.stream.point(e[0],e[1])}})}function RC(t,e){function n(i,r,a,o,s,u,l,c,f,h,d,p,m,g){var y=l-i,v=c-r,x=y*y+v*v;if(x>4*e&&m--){var _=o+h,b=s+d,w=u+p,k=TE(_*_+b*b+w*w),M=zE(w/=k),A=xE(xE(w)-1)<fE||xE(a-f)<fE?(a+f)/2:bE(b,_),E=t(A,M),D=E[0],C=E[1],F=D-i,S=C-r,T=v*F-y*S;if(T*T/x>e||xE((y*F+v*S)/x-.5)>.3||o*h+s*d+u*p<NC){n(i,r,a,o,s,u,D,C,A,_/=k,b/=k,w,m,g);g.point(D,C);n(D,C,A,_,b,w,l,c,f,h,d,p,m,g)}}}return function(e){var i,r,a,o,s,u,l,c,f,h,d,p;var m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart();m.lineStart=_},polygonEnd:function(){e.polygonEnd();m.lineStart=y}};function g(n,i){n=t(n,i);e.point(n[0],n[1])}function y(){c=NaN;m.point=v;e.lineStart()}function v(i,r){var a=HD([i,r]),o=t(i,r);n(c,f,l,h,d,p,c=o[0],f=o[1],l=i,h=a[0],d=a[1],p=a[2],BC,e);e.point(c,f)}function x(){m.point=g;e.lineEnd()}function _(){y();m.point=b;m.lineEnd=w}function b(t,e){v(i=t,e),r=c,a=f,o=h,s=d,u=p;m.point=v}function w(){n(c,f,l,h,d,p,r,a,i,o,s,u,BC,e);m.lineEnd=x;x()}return m}}var UC=AC({point:function(t,e){this.stream.point(t*vE,e*vE)}});function qC(t){return AC({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}function IC(t,e,n,i,r){function a(a,o){a*=i;o*=r;return[e+t*a,n-t*o]}a.invert=function(a,o){return[(a-e)/t*i,(n-o)/t*r]};return a}function LC(t,e,n,i,r,a){if(!a)return IC(t,e,n,i,r);var o=wE(a),s=FE(a),u=o*t,l=s*t,c=o/t,f=s/t,h=(s*n-o*e)/t,d=(s*e+o*n)/t;function p(t,a){t*=i;a*=r;return[u*t-l*a+e,n-l*t-u*a]}p.invert=function(t,e){return[i*(c*t-f*e+h),r*(d-f*t-c*e)]};return p}function PC(t){return jC((function(){return t}))()}function jC(t){var e,n=150,i=480,r=250,a=0,o=0,s=0,u=0,l=0,c,f=0,h=1,d=1,p=null,m=aC,g=null,y,v,x,_=eE,b=.5,w,k,M,A,E;function D(t){return M(t[0]*vE,t[1]*vE)}function C(t){t=M.invert(t[0],t[1]);return t&&[t[0]*yE,t[1]*yE]}D.stream=function(t){return A&&E===t?A:A=UC(qC(c)(m(w(_(E=t)))))};D.preclip=function(t){return arguments.length?(m=t,p=undefined,S()):m};D.postclip=function(t){return arguments.length?(_=t,g=y=v=x=null,S()):_};D.clipAngle=function(t){return arguments.length?(m=+t?hC(p=t*vE):(p=null,aC),S()):p*yE};D.clipExtent=function(t){return arguments.length?(_=t==null?(g=y=v=x=null,eE):gC(g=+t[0][0],y=+t[0][1],v=+t[1][0],x=+t[1][1]),S()):g==null?null:[[g,y],[v,x]]};D.scale=function(t){return arguments.length?(n=+t,F()):n};D.translate=function(t){return arguments.length?(i=+t[0],r=+t[1],F()):[i,r]};D.center=function(t){return arguments.length?(a=t[0]%360*vE,o=t[1]%360*vE,F()):[a*yE,o*yE]};D.rotate=function(t){return arguments.length?(s=t[0]%360*vE,u=t[1]%360*vE,l=t.length>2?t[2]%360*vE:0,F()):[s*yE,u*yE,l*yE]};D.angle=function(t){return arguments.length?(f=t%360*vE,F()):f*yE};D.reflectX=function(t){return arguments.length?(h=t?-1:1,F()):h<0};D.reflectY=function(t){return arguments.length?(d=t?-1:1,F()):d<0};D.precision=function(t){return arguments.length?(w=zC(k,b=t*t),S()):TE(b)};D.fitExtent=function(t,e){return CC(D,t,e)};D.fitSize=function(t,e){return FC(D,t,e)};D.fitWidth=function(t,e){return SC(D,t,e)};D.fitHeight=function(t,e){return TC(D,t,e)};function F(){var t=LC(n,0,0,h,d,f).apply(null,e(a,o)),p=LC(n,i-t[0],r-t[1],h,d,f);c=xC(s,u,l);k=yC(e,p);M=yC(c,k);w=zC(k,b);return S()}function S(){A=E=null;return D}return function(){e=t.apply(this,arguments);D.invert=e.invert&&C;return F()}}function WC(t){var e=0,n=dE/3,i=jC(t),r=i(e,n);r.parallels=function(t){return arguments.length?i(e=t[0]*vE,n=t[1]*vE):[e*yE,n*yE]};return r}function XC(t){var e=wE(t);function n(t,n){return[t*e,FE(n)/e]}n.invert=function(t,n){return[t/e,zE(n*e)]};return n}function $C(t,e){var n=FE(t),i=(n+FE(e))/2;if(xE(i)<fE)return XC(t);var r=1+n*(2*i-n),a=TE(r)/i;function o(t,e){var n=TE(r-2*i*FE(e))/i;return[n*FE(t*=i),a-n*wE(t)]}o.invert=function(t,e){var n=a-e,o=bE(t,xE(n))*SE(n);if(n*i<0)o-=dE*SE(t)*SE(n);return[o/i,zE((r-(t*t+n*n)*i*i)/(2*i))]};return o}function HC(){return WC($C).scale(155.424).center([0,33.6442])}function YC(){return HC().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function JC(t){var e=t.length;return{point:function(n,i){var r=-1;while(++r<e)t[r].point(n,i)},sphere:function(){var n=-1;while(++n<e)t[n].sphere()},lineStart:function(){var n=-1;while(++n<e)t[n].lineStart()},lineEnd:function(){var n=-1;while(++n<e)t[n].lineEnd()},polygonStart:function(){var n=-1;while(++n<e)t[n].polygonStart()},polygonEnd:function(){var n=-1;while(++n<e)t[n].polygonEnd()}}}function VC(){var t,e,n=YC(),i,r=HC().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a,o=HC().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,u,l={point:function(t,e){u=[t,e]}};function c(t){var e=t[0],n=t[1];return u=null,(i.point(e,n),u)||(a.point(e,n),u)||(s.point(e,n),u)}c.invert=function(t){var e=n.scale(),i=n.translate(),a=(t[0]-i[0])/e,s=(t[1]-i[1])/e;return(s>=.12&&s<.234&&a>=-.425&&a<-.214?r:s>=.166&&s<.234&&a>=-.214&&a<-.115?o:n).invert(t)};c.stream=function(i){return t&&e===i?t:t=JC([n.stream(e=i),r.stream(i),o.stream(i)])};c.precision=function(t){if(!arguments.length)return n.precision();n.precision(t),r.precision(t),o.precision(t);return f()};c.scale=function(t){if(!arguments.length)return n.scale();n.scale(t),r.scale(t*.35),o.scale(t);return c.translate(n.translate())};c.translate=function(t){if(!arguments.length)return n.translate();var e=n.scale(),u=+t[0],c=+t[1];i=n.translate(t).clipExtent([[u-.455*e,c-.238*e],[u+.455*e,c+.238*e]]).stream(l);a=r.translate([u-.307*e,c+.201*e]).clipExtent([[u-.425*e+fE,c+.12*e+fE],[u-.214*e-fE,c+.234*e-fE]]).stream(l);s=o.translate([u-.205*e,c+.212*e]).clipExtent([[u-.214*e+fE,c+.166*e+fE],[u-.115*e-fE,c+.234*e-fE]]).stream(l);return f()};c.fitExtent=function(t,e){return CC(c,t,e)};c.fitSize=function(t,e){return FC(c,t,e)};c.fitWidth=function(t,e){return SC(c,t,e)};c.fitHeight=function(t,e){return TC(c,t,e)};function f(){t=e=null;return c}return c.scale(1070)}function GC(t){return function(e,n){var i=wE(e),r=wE(n),a=t(i*r);if(a===Infinity)return[2,0];return[a*r*FE(e),a*FE(n)]}}function KC(t){return function(e,n){var i=TE(e*e+n*n),r=t(i),a=FE(r),o=wE(r);return[bE(e*a,i*o),zE(i&&n*a/i)]}}var ZC=GC((function(t){return TE(2/(1+t))}));ZC.invert=KC((function(t){return 2*zE(t/2)}));function QC(){return PC(ZC).scale(124.75).clipAngle(180-.001)}var tF=GC((function(t){return(t=NE(t))&&t/FE(t)}));tF.invert=KC((function(t){return t}));function eF(){return PC(tF).scale(79.4188).clipAngle(180-.001)}function nF(t,e){return[t,DE(BE((pE+e)/2))]}nF.invert=function(t,e){return[t,2*_E(ME(e))-pE]};function iF(){return rF(nF).scale(961/gE)}function rF(t){var e=PC(t),n=e.center,i=e.scale,r=e.translate,a=e.clipExtent,o=null,s,u,l;e.scale=function(t){return arguments.length?(i(t),c()):i()};e.translate=function(t){return arguments.length?(r(t),c()):r()};e.center=function(t){return arguments.length?(n(t),c()):n()};e.clipExtent=function(t){return arguments.length?(t==null?o=s=u=l=null:(o=+t[0][0],s=+t[0][1],u=+t[1][0],l=+t[1][1]),c()):o==null?null:[[o,s],[u,l]]};function c(){var n=dE*i(),r=e(kC(e.rotate()).invert([0,0]));return a(o==null?[[r[0]-n,r[1]-n],[r[0]+n,r[1]+n]]:t===nF?[[Math.max(r[0]-n,o),s],[Math.min(r[0]+n,u),l]]:[[o,Math.max(r[1]-n,s)],[u,Math.min(r[1]+n,l)]])}return c()}function aF(t){return BE((pE+t)/2)}function oF(t,e){var n=wE(t),i=t===e?FE(t):DE(n/wE(e))/DE(aF(e)/aF(t)),r=n*CE(aF(t),i)/i;if(!i)return nF;function a(t,e){if(r>0){if(e<-pE+fE)e=-pE+fE}else{if(e>pE-fE)e=pE-fE}var n=r/CE(aF(e),i);return[n*FE(i*t),r-n*wE(i*t)]}a.invert=function(t,e){var n=r-e,a=SE(i)*TE(t*t+n*n),o=bE(t,xE(n))*SE(n);if(n*i<0)o-=dE*SE(t)*SE(n);return[o/i,2*_E(CE(r/a,1/i))-pE]};return a}function sF(){return WC(oF).scale(109.5).parallels([30,30])}function uF(t,e){return[t,e]}uF.invert=uF;function lF(){return PC(uF).scale(152.63)}function cF(t,e){var n=wE(t),i=t===e?FE(t):(n-wE(e))/(e-t),r=n/i+t;if(xE(i)<fE)return uF;function a(t,e){var n=r-e,a=i*t;return[n*FE(a),r-n*wE(a)]}a.invert=function(t,e){var n=r-e,a=bE(t,xE(n))*SE(n);if(n*i<0)a-=dE*SE(t)*SE(n);return[a/i,r-SE(i)*TE(t*t+n*n)]};return a}function fF(){return WC(cF).scale(131.154).center([0,13.9389])}var hF=1.340264,dF=-.081106,pF=893e-6,mF=.003796,gF=TE(3)/2,yF=12;function vF(t,e){var n=zE(gF*FE(e)),i=n*n,r=i*i*i;return[t*wE(n)/(gF*(hF+3*dF*i+r*(7*pF+9*mF*i))),n*(hF+dF*i+r*(pF+mF*i))]}vF.invert=function(t,e){var n=e,i=n*n,r=i*i*i;for(var a=0,o,s,u;a<yF;++a){s=n*(hF+dF*i+r*(pF+mF*i))-e;u=hF+3*dF*i+r*(7*pF+9*mF*i);n-=o=s/u,i=n*n,r=i*i*i;if(xE(o)<hE)break}return[gF*t*(hF+3*dF*i+r*(7*pF+9*mF*i))/wE(n),zE(FE(n)/gF)]};function xF(){return PC(vF).scale(177.158)}function _F(t,e){var n=wE(e),i=wE(t)*n;return[n*FE(t)/i,FE(e)/i]}_F.invert=KC(_E);function bF(){return PC(_F).scale(144.049).clipAngle(60)}function wF(){var t=1,e=0,n=0,i=1,r=1,a=0,o,s,u=null,l,c,f,h=1,d=1,p=AC({point:function(t,e){var n=x([t,e]);this.stream.point(n[0],n[1])}}),m=eE,g,y;function v(){h=t*i;d=t*r;g=y=null;return x}function x(t){var i=t[0]*h,r=t[1]*d;if(a){var u=r*o-i*s;i=i*o+r*s;r=u}return[i+e,r+n]}x.invert=function(t){var i=t[0]-e,r=t[1]-n;if(a){var u=r*o+i*s;i=i*o-r*s;r=u}return[i/h,r/d]};x.stream=function(t){return g&&y===t?g:g=p(m(y=t))};x.postclip=function(t){return arguments.length?(m=t,u=l=c=f=null,v()):m};x.clipExtent=function(t){return arguments.length?(m=t==null?(u=l=c=f=null,eE):gC(u=+t[0][0],l=+t[0][1],c=+t[1][0],f=+t[1][1]),v()):u==null?null:[[u,l],[c,f]]};x.scale=function(e){return arguments.length?(t=+e,v()):t};x.translate=function(t){return arguments.length?(e=+t[0],n=+t[1],v()):[e,n]};x.angle=function(t){return arguments.length?(a=t%360*vE,s=FE(a),o=wE(a),v()):a*yE};x.reflectX=function(t){return arguments.length?(i=t?-1:1,v()):i<0};x.reflectY=function(t){return arguments.length?(r=t?-1:1,v()):r<0};x.fitExtent=function(t,e){return CC(x,t,e)};x.fitSize=function(t,e){return FC(x,t,e)};x.fitWidth=function(t,e){return SC(x,t,e)};x.fitHeight=function(t,e){return TC(x,t,e)};return x}function kF(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),e*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}kF.invert=function(t,e){var n=e,i=25,r;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(-.044475+.028874*a-.005916*o)))-e)/(1.007226+a*(.015085*3+o*(-.044475*7+.028874*9*a-.005916*11*o)))}while(xE(r)>fE&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]};function MF(){return PC(kF).scale(175.295)}function AF(t,e){return[wE(e)*FE(t),FE(e)]}AF.invert=KC(zE);function EF(){return PC(AF).scale(249.5).clipAngle(90+fE)}function DF(t,e){var n=wE(e),i=1+wE(t)*n;return[n*FE(t)/i,FE(e)/i]}DF.invert=KC((function(t){return 2*_E(t)}));function CF(){return PC(DF).scale(250).clipAngle(142)}function FF(t,e){return[DE(BE((pE+e)/2)),-t]}FF.invert=function(t,e){return[-e,2*_E(ME(t))-pE]};function SF(){var t=rF(FF),e=t.center,n=t.rotate;t.center=function(t){return arguments.length?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])};t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])};return n([0,0,90]).scale(159.155)}var TF=Math.abs;var BF=Math.atan;var NF=Math.atan2;var zF=Math.ceil;var OF=Math.cos;var RF=Math.exp;var UF=Math.floor;var qF=Math.log;var IF=Math.max;var LF=Math.min;var PF=Math.pow;var jF=Math.round;var WF=Math.sign||function(t){return t>0?1:t<0?-1:0};var XF=Math.sin;var $F=Math.tan;var HF=1e-6;var YF=1e-12;var JF=Math.PI;var VF=JF/2;var GF=JF/4;var KF=Math.SQRT1_2;var ZF=oS(2);var QF=oS(JF);var tS=JF*2;var eS=180/JF;var nS=JF/180;function iS(t){return t?t/Math.sin(t):1}function rS(t){return t>1?VF:t<-1?-VF:Math.asin(t)}function aS(t){return t>1?0:t<-1?JF:Math.acos(t)}function oS(t){return t>0?Math.sqrt(t):0}function sS(t){t=RF(2*t);return(t-1)/(t+1)}function uS(t){return(RF(t)-RF(-t))/2}function lS(t){return(RF(t)+RF(-t))/2}function cS(t){return qF(t+oS(t*t+1))}function fS(t){return qF(t+oS(t*t-1))}function hS(t,e){var n=t*XF(e),i=30,r;do{e-=r=(e+XF(e)-n)/(1+OF(e))}while(TF(r)>HF&&--i>0);return e/2}function dS(t,e,n){function i(i,r){return[t*i*OF(r=hS(n,r)),e*XF(r)]}i.invert=function(i,r){return r=rS(r/e),[i/(t*OF(r)),rS((2*r+XF(2*r))/n)]};return i}var pS=dS(ZF/VF,ZF,JF);function mS(){return PC(pS).scale(169.529)}const gS=ID();const yS=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function vS(t,e){return function n(){const i=e();i.type=t;i.path=ID().projection(i);i.copy=i.copy||function(){const t=n();yS.forEach((e=>{if(i[e])t[e](i[e]())}));t.path.pointRadius(i.path.pointRadius());return t};return i}}function xS(t,e){if(!t||typeof t!=="string"){throw new Error("Projection type must be a name string.")}t=t.toLowerCase();if(arguments.length>1){bS[t]=vS(t,e);return this}else{return bS[t]||null}}function _S(t){return t&&t.path||gS}const bS={albers:YC,albersusa:VC,azimuthalequalarea:QC,azimuthalequidistant:eF,conicconformal:sF,conicequalarea:HC,conicequidistant:fF,equalEarth:xF,equirectangular:lF,gnomonic:bF,identity:wF,mercator:iF,mollweide:mS,naturalEarth1:MF,orthographic:EF,stereographic:CF,transversemercator:SF};for(const QV in bS){xS(QV,bS[QV])}function wS(t,e,n){var i=ru(t,e-fE,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function kS(t,e,n){var i=ru(t,e-fE,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function MS(){var t,e,n,i,r,a,o,s,u=10,l=u,c=90,f=360,h,d,p,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return ru(kE(i/c)*c,n,c).map(p).concat(ru(kE(s/f)*f,o,f).map(m)).concat(ru(kE(e/u)*u,t,u).filter((function(t){return xE(t%c)>fE})).map(h)).concat(ru(kE(a/l)*l,r,l).filter((function(t){return xE(t%f)>fE})).map(d))}y.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))};y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(m(o).slice(1),p(n).reverse().slice(1),m(s).reverse().slice(1))]}};y.extent=function(t){if(!arguments.length)return y.extentMinor();return y.extentMajor(t).extentMinor(t)};y.extentMajor=function(t){if(!arguments.length)return[[i,s],[n,o]];i=+t[0][0],n=+t[1][0];s=+t[0][1],o=+t[1][1];if(i>n)t=i,i=n,n=t;if(s>o)t=s,s=o,o=t;return y.precision(g)};y.extentMinor=function(n){if(!arguments.length)return[[e,a],[t,r]];e=+n[0][0],t=+n[1][0];a=+n[0][1],r=+n[1][1];if(e>t)n=e,e=t,t=n;if(a>r)n=a,a=r,r=n;return y.precision(g)};y.step=function(t){if(!arguments.length)return y.stepMinor();return y.stepMajor(t).stepMinor(t)};y.stepMajor=function(t){if(!arguments.length)return[c,f];c=+t[0],f=+t[1];return y};y.stepMinor=function(t){if(!arguments.length)return[u,l];u=+t[0],l=+t[1];return y};y.precision=function(u){if(!arguments.length)return g;g=+u;h=wS(a,r,90);d=kS(e,t,g);p=wS(s,o,90);m=kS(i,n,g);return y};return y.extentMajor([[-180,-90+fE],[180,90-fE]]).extentMinor([[-180,-80-fE],[180,80+fE]])}function AS(){return MS()()}function ES(){}const DS=[[],[[[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 CS(){var t=1,e=1,n=s;function i(t,e){return e.map((e=>r(t,e)))}function r(t,e){var i=[],r=[];a(t,e,(a=>{n(a,t,e);if(FS(a)>0)i.push([a]);else r.push(a)}));r.forEach((t=>{for(var e=0,n=i.length,r;e<n;++e){if(SS((r=i[e])[0],t)!==-1){r.push(t);return}}}));return{type:"MultiPolygon",value:e,coordinates:i}}function a(n,i,r){var a=new Array,s=new Array,u,l,c,f,h,d;u=l=-1;f=n[0]>=i;DS[f<<1].forEach(p);while(++u<t-1){c=f,f=n[u+1]>=i;DS[c|f<<1].forEach(p)}DS[f<<0].forEach(p);while(++l<e-1){u=-1;f=n[l*t+t]>=i;h=n[l*t]>=i;DS[f<<1|h<<2].forEach(p);while(++u<t-1){c=f,f=n[l*t+t+u+1]>=i;d=h,h=n[l*t+u+1]>=i;DS[c|f<<1|h<<2|d<<3].forEach(p)}DS[f|h<<3].forEach(p)}u=-1;h=n[l*t]>=i;DS[h<<2].forEach(p);while(++u<t-1){d=h,h=n[l*t+u+1]>=i;DS[h<<2|d<<3].forEach(p)}DS[h<<3].forEach(p);function p(t){var e=[t[0][0]+u,t[0][1]+l],n=[t[1][0]+u,t[1][1]+l],i=o(e),c=o(n),f,h;if(f=s[i]){if(h=a[c]){delete s[f.end];delete a[h.start];if(f===h){f.ring.push(n);r(f.ring)}else{a[f.start]=s[h.end]={start:f.start,end:h.end,ring:f.ring.concat(h.ring)}}}else{delete s[f.end];f.ring.push(n);s[f.end=c]=f}}else if(f=a[c]){if(h=s[i]){delete a[f.start];delete s[h.end];if(f===h){f.ring.push(n);r(f.ring)}else{a[h.start]=s[f.end]={start:h.start,end:f.end,ring:h.ring.concat(f.ring)}}}else{delete a[f.start];f.ring.unshift(e);a[f.start=i]=f}}else{a[i]=s[c]={start:i,end:c,ring:[e,n]}}}}function o(e){return e[0]*2+e[1]*(t+1)*4}function s(n,i,r){n.forEach((n=>{var a=n[0],o=n[1],s=a|0,u=o|0,l,c=i[u*t+s];if(a>0&&a<t&&s===a){l=i[u*t+s-1];n[0]=a+(r-l)/(c-l)-.5}if(o>0&&o<e&&u===o){l=i[(u-1)*t+s];n[1]=o+(r-l)/(c-l)-.5}}))}i.contour=r;i.size=function(n){if(!arguments.length)return[t,e];var r=Math.floor(n[0]),a=Math.floor(n[1]);if(!(r>=0&&a>=0))(0,m.vU)("invalid size");return t=r,e=a,i};i.smooth=function(t){return arguments.length?(n=t?s:ES,i):n===s};return i}function FS(t){var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];while(++e<n)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i}function SS(t,e){var n=-1,i=e.length,r;while(++n<i)if(r=TS(t,e[n]))return r;return 0}function TS(t,e){var n=e[0],i=e[1],r=-1;for(var a=0,o=t.length,s=o-1;a<o;s=a++){var u=t[a],l=u[0],c=u[1],f=t[s],h=f[0],d=f[1];if(BS(u,f,e))return 0;if(c>i!==d>i&&n<(h-l)*(i-c)/(d-c)+l)r=-r}return r}function BS(t,e,n){var i;return NS(t,e,n)&&zS(t[i=+(t[0]===e[0])],n[i],e[i])}function NS(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function zS(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function OS(t,e,n){return function(i){var r=(0,m.We)(i),a=n?Math.min(r[0],0):r[0],o=r[1],s=o-a,u=e?_t(a,o,t):s/(t+1);return ru(a+u,o,u)}}function RS(t){jo.call(this,null,t)}RS.Definition={type:"Isocontour",metadata:{generates:true},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:true},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:false},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:true},{name:"smooth",type:"boolean",default:true},{name:"scale",type:"number",expr:true},{name:"translate",type:"number",array:true,expr:true},{name:"as",type:"string",null:true,default:"contour"}]};(0,m.XW)(RS,jo,{transform(t,e){if(this.value&&!e.changed()&&!t.modified()){return e.StopPropagation}var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,r=t.field||m.yR,a=CS().smooth(t.smooth!==false),o=t.thresholds||US(i,r,t),s=t.as===null?null:t.as||"contour",u=[];i.forEach((e=>{const n=r(e);const i=a.size([n.width,n.height])(n.values,(0,m.kJ)(o)?o:o(n.values));qS(i,n,e,t);i.forEach((t=>{u.push(Sa(e,Ca(s!=null?{[s]:t}:t)))}))}));if(this.value)n.rem=this.value;this.value=n.source=n.add=u;return n}});function US(t,e,n){const i=OS(n.levels||10,n.nice,n.zero!==false);return n.resolve!=="shared"?i:i(t.map((t=>Ho(e(t).values))))}function qS(t,e,n,i){let r=i.scale||e.scale,a=i.translate||e.translate;if((0,m.mf)(r))r=r(n,i);if((0,m.mf)(a))a=a(n,i);if((r===1||r==null)&&!a)return;const o=((0,m.hj)(r)?r:r[0])||1,s=((0,m.hj)(r)?r:r[1])||1,u=a&&a[0]||0,l=a&&a[1]||0;t.forEach(IS(e,o,s,u,l))}function IS(t,e,n,i,r){const a=t.x1||0,o=t.y1||0,s=e*n<0;function u(t){t.forEach(l)}function l(t){if(s)t.reverse();t.forEach(c)}function c(t){t[0]=(t[0]-a)*e+i;t[1]=(t[1]-o)*n+r}return function(t){t.coordinates.forEach(u);return t}}function LS(t,e,n){const i=t>=0?t:os(e,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function PS(t){return(0,m.mf)(t)?t:(0,m.a9)(+t)}function jS(){var t=t=>t[0],e=t=>t[1],n=m.kX,i=[-1,-1],r=960,a=500,o=2;function s(s,u){const l=LS(i[0],s,t)>>o,c=LS(i[1],s,e)>>o,f=l?l+2:0,h=c?c+2:0,d=2*f+(r>>o),p=2*h+(a>>o),m=new Float32Array(d*p),g=new Float32Array(d*p);let y=m;s.forEach((i=>{const r=f+(+t(i)>>o),a=h+(+e(i)>>o);if(r>=0&&r<d&&a>=0&&a<p){m[r+a*d]+=+n(i)}}));if(l>0&&c>0){WS(d,p,m,g,l);XS(d,p,g,m,c);WS(d,p,m,g,l);XS(d,p,g,m,c);WS(d,p,m,g,l);XS(d,p,g,m,c)}else if(l>0){WS(d,p,m,g,l);WS(d,p,g,m,l);WS(d,p,m,g,l);y=g}else if(c>0){XS(d,p,m,g,c);XS(d,p,g,m,c);XS(d,p,m,g,c);y=g}const v=u?Math.pow(2,-2*o):1/nA(y);for(let t=0,e=d*p;t<e;++t)y[t]*=v;return{values:y,scale:1<<o,width:d,height:p,x1:f,y1:h,x2:f+(r>>o),y2:h+(a>>o)}}s.x=function(e){return arguments.length?(t=PS(e),s):t};s.y=function(t){return arguments.length?(e=PS(t),s):e};s.weight=function(t){return arguments.length?(n=PS(t),s):n};s.size=function(t){if(!arguments.length)return[r,a];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))(0,m.vU)("invalid size");return r=e,a=n,s};s.cellSize=function(t){if(!arguments.length)return 1<<o;if(!((t=+t)>=1))(0,m.vU)("invalid cell size");o=Math.floor(Math.log(t)/Math.LN2);return s};s.bandwidth=function(t){if(!arguments.length)return i;t=(0,m.IX)(t);if(t.length===1)t=[+t[0],+t[0]];if(t.length!==2)(0,m.vU)("invalid bandwidth");return i=t,s};return s}function WS(t,e,n,i,r){const a=(r<<1)+1;for(let o=0;o<e;++o){for(let e=0,s=0;e<t+r;++e){if(e<t){s+=n[e+o*t]}if(e>=r){if(e>=a){s-=n[e-a+o*t]}i[e-r+o*t]=s/Math.min(e+1,t-1+a-e,a)}}}}function XS(t,e,n,i,r){const a=(r<<1)+1;for(let o=0;o<t;++o){for(let s=0,u=0;s<e+r;++s){if(s<e){u+=n[o+s*t]}if(s>=r){if(s>=a){u-=n[o+(s-a)*t]}i[o+(s-r)*t]=u/Math.min(s+1,e-1+a-s,a)}}}}function $S(t){jo.call(this,null,t)}$S.Definition={type:"KDE2D",metadata:{generates:true},params:[{name:"size",type:"number",array:true,length:2,required:true},{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"weight",type:"field"},{name:"groupby",type:"field",array:true},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:true,length:2},{name:"counts",type:"boolean",default:false},{name:"as",type:"string",default:"grid"}]};const HS=["x","y","weight","size","cellSize","bandwidth"];function YS(t,e){HS.forEach((n=>e[n]!=null?t[n](e[n]):0));return t}(0,m.XW)($S,jo,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,r=JS(i,t.groupby),a=(t.groupby||[]).map(m.el),o=YS(jS(),t),s=t.as||"grid",u=[];function l(t,e){for(let n=0;n<a.length;++n)t[a[n]]=e[n];return t}u=r.map((e=>Ca(l({[s]:o(e,t.counts)},e.dims))));if(this.value)n.rem=this.value;this.value=n.source=n.add=u;return n}});function JS(t,e){var n=[],i=t=>t(s),r,a,o,s,u,l;if(e==null){n.push(t)}else{for(r={},a=0,o=t.length;a<o;++a){s=t[a];u=e.map(i);l=r[u];if(!l){r[u]=l=[];l.dims=u;n.push(l)}l.push(s)}}return n}function VS(t){jo.call(this,null,t)}VS.Definition={type:"Contour",metadata:{generates:true},params:[{name:"size",type:"number",array:true,length:2,required:true},{name:"values",type:"number",array:true},{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:false},{name:"thresholds",type:"number",array:true},{name:"smooth",type:"boolean",default:true}]};(0,m.XW)(VS,jo,{transform(t,e){if(this.value&&!e.changed()&&!t.modified()){return e.StopPropagation}var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=CS().smooth(t.smooth!==false),r=t.values,a=t.thresholds||OS(t.count||10,t.nice,!!r),o=t.size,s,u;if(!r){r=e.materialize(e.SOURCE).source;s=YS(jS(),t)(r,true);u=IS(s,s.scale||1,s.scale||1,0,0);o=[s.width,s.height];r=s.values}a=(0,m.kJ)(a)?a:a(r);r=i.size(o)(r,a);if(u)r.forEach(u);if(this.value)n.rem=this.value;this.value=n.source=n.add=(r||[]).map(Ca);return n}});const GS="Feature";const KS="FeatureCollection";const ZS="MultiPoint";function QS(t){jo.call(this,null,t)}QS.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:true,length:2},{name:"geojson",type:"field"}]};(0,m.XW)(QS,jo,{transform(t,e){var n=this._features,i=this._points,r=t.fields,a=r&&r[0],o=r&&r[1],s=t.geojson||!r&&m.yR,u=e.ADD,l;l=t.modified()||e.changed(e.REM)||e.modified((0,m.Oj)(s))||a&&e.modified((0,m.Oj)(a))||o&&e.modified((0,m.Oj)(o));if(!this.value||l){u=e.SOURCE;this._features=n=[];this._points=i=[]}if(s){e.visit(u,(t=>n.push(s(t))))}if(a&&o){e.visit(u,(t=>{var e=a(t),n=o(t);if(e!=null&&n!=null&&(e=+e)===e&&(n=+n)===n){i.push([e,n])}}));n=n.concat({type:GS,geometry:{type:ZS,coordinates:i}})}this.value={type:KS,features:n}}});function tT(t){jo.call(this,null,t)}tT.Definition={type:"GeoPath",metadata:{modifies:true},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:true},{name:"as",type:"string",default:"path"}]};(0,m.XW)(tT,jo,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.field||m.yR,a=t.as||"path",o=n.SOURCE;if(!i||t.modified()){this.value=i=_S(t.projection);n.materialize().reflow()}else{o=r===m.yR||e.modified(r.fields)?n.ADD_MOD:n.ADD}const s=eT(i,t.pointRadius);n.visit(o,(t=>t[a]=i(r(t))));i.pointRadius(s);return n.modifies(a)}});function eT(t,e){const n=t.pointRadius();t.context(null);if(e!=null){t.pointRadius(e)}return n}function nT(t){jo.call(this,null,t)}nT.Definition={type:"GeoPoint",metadata:{modifies:true},params:[{name:"projection",type:"projection",required:true},{name:"fields",type:"field",array:true,required:true,length:2},{name:"as",type:"string",array:true,length:2,default:["x","y"]}]};(0,m.XW)(nT,jo,{transform(t,e){var n=t.projection,i=t.fields[0],r=t.fields[1],a=t.as||["x","y"],o=a[0],s=a[1],u;function l(t){const e=n([i(t),r(t)]);if(e){t[o]=e[0];t[s]=e[1]}else{t[o]=undefined;t[s]=undefined}}if(t.modified()){e=e.materialize().reflow(true).visit(e.SOURCE,l)}else{u=e.modified(i.fields)||e.modified(r.fields);e.visit(u?e.ADD_MOD:e.ADD,l)}return e.modifies(a)}});function iT(t){jo.call(this,null,t)}iT.Definition={type:"GeoShape",metadata:{modifies:true,nomod:true},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:true},{name:"as",type:"string",default:"shape"}]};(0,m.XW)(iT,jo,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.as||"shape",a=n.ADD;if(!i||t.modified()){this.value=i=rT(_S(t.projection),t.field||(0,m.EP)("datum"),t.pointRadius);n.materialize().reflow();a=n.SOURCE}n.visit(a,(t=>t[r]=i));return n.modifies(r)}});function rT(t,e,n){const i=n==null?n=>t(e(n)):i=>{var r=t.pointRadius(),a=t.pointRadius(n)(e(i));t.pointRadius(r);return a};i.context=e=>{t.context(e);return i};return i}function aT(t){jo.call(this,[],t);this.generator=MS()}aT.Definition={type:"Graticule",metadata:{changes:true,generates:true},params:[{name:"extent",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"extentMajor",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"extentMinor",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"step",type:"number",array:true,length:2},{name:"stepMajor",type:"number",array:true,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:true,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};(0,m.XW)(aT,jo,{transform(t,e){var n=this.value,i=this.generator,r;if(!n.length||t.modified()){for(const e in t){if((0,m.mf)(i[e])){i[e](t[e])}}}r=i();if(n.length){e.mod.push(Ta(n[0],r))}else{e.add.push(Ca(r))}n[0]=r;return e}});function oT(t){jo.call(this,null,t)}oT.Definition={type:"heatmap",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:true},{name:"opacity",type:"number",expr:true},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};(0,m.XW)(oT,jo,{transform(t,e){if(!e.changed()&&!t.modified()){return e.StopPropagation}var n=e.materialize(e.SOURCE).source,i=t.resolve==="shared",r=t.field||m.yR,a=uT(t.opacity,t),o=sT(t.color,t),s=t.as||"image",u={$x:0,$y:0,$value:0,$max:i?Ho(n.map((t=>Ho(r(t).values)))):0};n.forEach((t=>{const e=r(t);const n=(0,m.l7)({},t,u);if(!i)n.$max=Ho(e.values||[]);t[s]=cT(e,n,o.dep?o:(0,m.a9)(o(n)),a.dep?a:(0,m.a9)(a(n)))}));return e.reflow(true).modifies(s)}});function sT(t,e){let n;if((0,m.mf)(t)){n=n=>Dh(t(n,e));n.dep=lT(t)}else{n=(0,m.a9)(Dh(t||"#888"))}return n}function uT(t,e){let n;if((0,m.mf)(t)){n=n=>t(n,e);n.dep=lT(t)}else if(t){n=(0,m.a9)(t)}else{n=t=>t.$value/t.$max||0;n.dep=true}return n}function lT(t){if(!(0,m.mf)(t))return false;const e=(0,m.Rg)((0,m.Oj)(t));return e.$x||e.$y||e.$value||e.$max}function cT(t,e,n,i){const r=t.width,a=t.height,o=t.x1||0,s=t.y1||0,u=t.x2||r,l=t.y2||a,c=t.values,f=c?t=>c[t]:m.bM,h=Hf(u-o,l-s),d=h.getContext("2d"),p=d.getImageData(0,0,u-o,l-s),g=p.data;for(let m=s,y=0;m<l;++m){e.$y=m-s;for(let t=o,a=m*r;t<u;++t,y+=4){e.$x=t-o;e.$value=f(t+a);const r=n(e);g[y+0]=r.r;g[y+1]=r.g;g[y+2]=r.b;g[y+3]=~~(255*i(e))}}d.putImageData(p,0,0);return h}function fT(t){jo.call(this,null,t);this.modified(true)}(0,m.XW)(fT,jo,{transform(t,e){let n=this.value;if(!n||t.modified("type")){this.value=n=dT(t.type);yS.forEach((e=>{if(t[e]!=null)pT(n,e,t[e])}))}else{yS.forEach((e=>{if(t.modified(e))pT(n,e,t[e])}))}if(t.pointRadius!=null)n.path.pointRadius(t.pointRadius);if(t.fit)hT(n,t);return e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function hT(t,e){const n=mT(e.fit);e.extent?t.fitExtent(e.extent,n):e.size?t.fitSize(e.size,n):0}function dT(t){const e=xS((t||"mercator").toLowerCase());if(!e)(0,m.vU)("Unrecognized projection type: "+t);return e()}function pT(t,e,n){if((0,m.mf)(t[e]))t[e](n)}function mT(t){t=(0,m.IX)(t);return t.length===1?t[0]:{type:KS,features:t.reduce(((t,e)=>t.concat(gT(e))),[])}}function gT(t){return t.type===KS?t.features:(0,m.IX)(t).filter((t=>t!=null)).map((t=>t.type===GS?t:{type:GS,geometry:t}))}function yT(t,e){var n,i=1;if(t==null)t=0;if(e==null)e=0;function r(){var r,a=n.length,o,s=0,u=0;for(r=0;r<a;++r){o=n[r],s+=o.x,u+=o.y}for(s=(s/a-t)*i,u=(u/a-e)*i,r=0;r<a;++r){o=n[r],o.x-=s,o.y-=u}}r.initialize=function(t){n=t};r.x=function(e){return arguments.length?(t=+e,r):t};r.y=function(t){return arguments.length?(e=+t,r):e};r.strength=function(t){return arguments.length?(i=+t,r):i};return r}function vT(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return xT(this.cover(e,n),e,n,t)}function xT(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,o={data:i},s=t._x0,u=t._y0,l=t._x1,c=t._y1,f,h,d,p,m,g,y,v;if(!a)return t._root=o,t;while(a.length){if(m=e>=(f=(s+l)/2))s=f;else l=f;if(g=n>=(h=(u+c)/2))u=h;else c=h;if(r=a,!(a=a[y=g<<1|m]))return r[y]=o,t}d=+t._x.call(null,a.data);p=+t._y.call(null,a.data);if(e===d&&n===p)return o.next=a,r?r[y]=o:t._root=o,t;do{r=r?r[y]=new Array(4):t._root=new Array(4);if(m=e>=(f=(s+l)/2))s=f;else l=f;if(g=n>=(h=(u+c)/2))u=h;else c=h}while((y=g<<1|m)===(v=(p>=h)<<1|d>=f));return r[v]=a,r[y]=o,t}function _T(t){var e,n,i=t.length,r,a,o=new Array(i),s=new Array(i),u=Infinity,l=Infinity,c=-Infinity,f=-Infinity;for(n=0;n<i;++n){if(isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e)))continue;o[n]=r;s[n]=a;if(r<u)u=r;if(r>c)c=r;if(a<l)l=a;if(a>f)f=a}if(u>c||l>f)return this;this.cover(u,l).cover(c,f);for(n=0;n<i;++n){xT(this,o[n],s[n],t[n])}return this}function bT(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n)){r=(n=Math.floor(t))+1;a=(i=Math.floor(e))+1}else{var o=r-n||1,s=this._root,u,l;while(n>t||t>=r||i>e||e>=a){l=(e<i)<<1|t<n;u=new Array(4),u[l]=s,s=u,o*=2;switch(l){case 0:r=n+o,a=i+o;break;case 1:n=r-o,a=i+o;break;case 2:r=n+o,i=a-o;break;case 3:n=r-o,i=a-o;break}}if(this._root&&this._root.length)this._root=s}this._x0=n;this._y0=i;this._x1=r;this._y1=a;return this}function wT(){var t=[];this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}));return t}function kT(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?undefined:[[this._x0,this._y0],[this._x1,this._y1]]}function MT(t,e,n,i,r){this.node=t;this.x0=e;this.y0=n;this.x1=i;this.y1=r}function AT(t,e,n){var i,r=this._x0,a=this._y0,o,s,u,l,c=this._x1,f=this._y1,h=[],d=this._root,p,m;if(d)h.push(new MT(d,r,a,c,f));if(n==null)n=Infinity;else{r=t-n,a=e-n;c=t+n,f=e+n;n*=n}while(p=h.pop()){if(!(d=p.node)||(o=p.x0)>c||(s=p.y0)>f||(u=p.x1)<r||(l=p.y1)<a)continue;if(d.length){var g=(o+u)/2,y=(s+l)/2;h.push(new MT(d[3],g,y,u,l),new MT(d[2],o,y,g,l),new MT(d[1],g,s,u,y),new MT(d[0],o,s,g,y));if(m=(e>=y)<<1|t>=g){p=h[h.length-1];h[h.length-1]=h[h.length-1-m];h[h.length-1-m]=p}}else{var v=t-+this._x.call(null,d.data),x=e-+this._y.call(null,d.data),_=v*v+x*x;if(_<n){var b=Math.sqrt(n=_);r=t-b,a=e-b;c=t+b,f=e+b;i=d.data}}}return i}function ET(t){if(isNaN(c=+this._x.call(null,t))||isNaN(f=+this._y.call(null,t)))return this;var e,n=this._root,i,r,a,o=this._x0,s=this._y0,u=this._x1,l=this._y1,c,f,h,d,p,m,g,y;if(!n)return this;if(n.length)while(true){if(p=c>=(h=(o+u)/2))o=h;else u=h;if(m=f>=(d=(s+l)/2))s=d;else l=d;if(!(e=n,n=n[g=m<<1|p]))return this;if(!n.length)break;if(e[g+1&3]||e[g+2&3]||e[g+3&3])i=e,y=g}while(n.data!==t)if(!(r=n,n=n.next))return this;if(a=n.next)delete n.next;if(r)return a?r.next=a:delete r.next,this;if(!e)return this._root=a,this;a?e[g]=a:delete e[g];if((n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length){if(i)i[y]=n;else this._root=n}return this}function DT(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function CT(){return this._root}function FT(){var t=0;this.visit((function(e){if(!e.length)do{++t}while(e=e.next)}));return t}function ST(t){var e=[],n,i=this._root,r,a,o,s,u;if(i)e.push(new MT(i,this._x0,this._y0,this._x1,this._y1));while(n=e.pop()){if(!t(i=n.node,a=n.x0,o=n.y0,s=n.x1,u=n.y1)&&i.length){var l=(a+s)/2,c=(o+u)/2;if(r=i[3])e.push(new MT(r,l,c,s,u));if(r=i[2])e.push(new MT(r,a,c,l,u));if(r=i[1])e.push(new MT(r,l,o,s,c));if(r=i[0])e.push(new MT(r,a,o,l,c))}}return this}function TT(t){var e=[],n=[],i;if(this._root)e.push(new MT(this._root,this._x0,this._y0,this._x1,this._y1));while(i=e.pop()){var r=i.node;if(r.length){var a,o=i.x0,s=i.y0,u=i.x1,l=i.y1,c=(o+u)/2,f=(s+l)/2;if(a=r[0])e.push(new MT(a,o,s,c,f));if(a=r[1])e.push(new MT(a,c,s,u,f));if(a=r[2])e.push(new MT(a,o,f,c,l));if(a=r[3])e.push(new MT(a,c,f,u,l))}n.push(i)}while(i=n.pop()){t(i.node,i.x0,i.y0,i.x1,i.y1)}return this}function BT(t){return t[0]}function NT(t){return arguments.length?(this._x=t,this):this._x}function zT(t){return t[1]}function OT(t){return arguments.length?(this._y=t,this):this._y}function RT(t,e,n){var i=new UT(e==null?BT:e,n==null?zT:n,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function UT(t,e,n,i,r,a){this._x=t;this._y=e;this._x0=n;this._y0=i;this._x1=r;this._y1=a;this._root=undefined}function qT(t){var e={data:t.data},n=e;while(t=t.next)n=n.next={data:t.data};return e}var IT=RT.prototype=UT.prototype;IT.copy=function(){var t=new UT(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=qT(e),t;n=[{source:e,target:t._root=new Array(4)}];while(e=n.pop()){for(var r=0;r<4;++r){if(i=e.source[r]){if(i.length)n.push({source:i,target:e.target[r]=new Array(4)});else e.target[r]=qT(i)}}}return t};IT.add=vT;IT.addAll=_T;IT.cover=bT;IT.data=wT;IT.extent=kT;IT.find=AT;IT.remove=ET;IT.removeAll=DT;IT.root=CT;IT.size=FT;IT.visit=ST;IT.visitAfter=TT;IT.x=NT;IT.y=OT;function LT(t){return function(){return t}}function PT(t){return(t()-.5)*1e-6}function jT(t){return t.x+t.vx}function WT(t){return t.y+t.vy}function XT(t){var e,n,i,r=1,a=1;if(typeof t!=="function")t=LT(t==null?1:+t);function o(){var t,o=e.length,u,l,c,f,h,d;for(var p=0;p<a;++p){u=RT(e,jT,WT).visitAfter(s);for(t=0;t<o;++t){l=e[t];h=n[l.index],d=h*h;c=l.x+l.vx;f=l.y+l.vy;u.visit(m)}}function m(t,e,n,a,o){var s=t.data,u=t.r,p=h+u;if(s){if(s.index>l.index){var m=c-s.x-s.vx,g=f-s.y-s.vy,y=m*m+g*g;if(y<p*p){if(m===0)m=PT(i),y+=m*m;if(g===0)g=PT(i),y+=g*g;y=(p-(y=Math.sqrt(y)))/y*r;l.vx+=(m*=y)*(p=(u*=u)/(d+u));l.vy+=(g*=y)*p;s.vx-=m*(p=1-p);s.vy-=g*p}}return}return e>c+p||a<c-p||n>f+p||o<f-p}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e){if(t[e]&&t[e].r>t.r){t.r=t[e].r}}}function u(){if(!e)return;var i,r=e.length,a;n=new Array(r);for(i=0;i<r;++i)a=e[i],n[a.index]=+t(a,i,e)}o.initialize=function(t,n){e=t;i=n;u()};o.iterations=function(t){return arguments.length?(a=+t,o):a};o.strength=function(t){return arguments.length?(r=+t,o):r};o.radius=function(e){return arguments.length?(t=typeof e==="function"?e:LT(+e),u(),o):t};return o}var $T={value:()=>{}};function HT(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new YT(n)}function YT(t){this._=t}function JT(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0)n=t.slice(i+1),t=t.slice(0,i);if(t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}YT.prototype=HT.prototype={constructor:YT,on:function(t,e){var n=this._,i=JT(t+"",n),r,a=-1,o=i.length;if(arguments.length<2){while(++a<o)if((r=(t=i[a]).type)&&(r=VT(n[r],t.name)))return r;return}if(e!=null&&typeof e!=="function")throw new Error("invalid callback: "+e);while(++a<o){if(r=(t=i[a]).type)n[r]=GT(n[r],t.name,e);else if(e==null)for(r in n)n[r]=GT(n[r],t.name,null)}return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new YT(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function VT(t,e){for(var n=0,i=t.length,r;n<i;++n){if((r=t[n]).name===e){return r.value}}}function GT(t,e,n){for(var i=0,r=t.length;i<r;++i){if(t[i].name===e){t[i]=$T,t=t.slice(0,i).concat(t.slice(i+1));break}}if(n!=null)t.push({name:e,value:n});return t}const KT=HT;var ZT=0,QT=0,tB=0,eB=1e3,nB,iB,rB=0,aB=0,oB=0,sB=typeof performance==="object"&&performance.now?performance:Date,uB=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function lB(){return aB||(uB(cB),aB=sB.now()+oB)}function cB(){aB=0}function fB(){this._call=this._time=this._next=null}fB.prototype=hB.prototype={constructor:fB,restart:function(t,e,n){if(typeof t!=="function")throw new TypeError("callback is not a function");n=(n==null?lB():+n)+(e==null?0:+e);if(!this._next&&iB!==this){if(iB)iB._next=this;else nB=this;iB=this}this._call=t;this._time=n;yB()},stop:function(){if(this._call){this._call=null;this._time=Infinity;yB()}}};function hB(t,e,n){var i=new fB;i.restart(t,e,n);return i}function dB(){lB();++ZT;var t=nB,e;while(t){if((e=aB-t._time)>=0)t._call.call(null,e);t=t._next}--ZT}function pB(){aB=(rB=sB.now())+oB;ZT=QT=0;try{dB()}finally{ZT=0;gB();aB=0}}function mB(){var t=sB.now(),e=t-rB;if(e>eB)oB-=e,rB=t}function gB(){var t,e=nB,n,i=Infinity;while(e){if(e._call){if(i>e._time)i=e._time;t=e,e=e._next}else{n=e._next,e._next=null;e=t?t._next=n:nB=n}}iB=t;yB(i)}function yB(t){if(ZT)return;if(QT)QT=clearTimeout(QT);var e=t-aB;if(e>24){if(t<Infinity)QT=setTimeout(pB,t-sB.now()-oB);if(tB)tB=clearInterval(tB)}else{if(!tB)rB=sB.now(),tB=setInterval(mB,eB);ZT=1,uB(pB)}}const vB=1664525;const xB=1013904223;const _B=4294967296;function bB(){let t=1;return()=>(t=(vB*t+xB)%_B)/_B}function wB(t){return t.x}function kB(t){return t.y}var MB=10,AB=Math.PI*(3-Math.sqrt(5));function EB(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,o=.6,s=new Map,u=hB(f),l=KT("tick","end"),c=bB();if(t==null)t=[];function f(){h();l.call("tick",e);if(n<i){u.stop();l.call("end",e)}}function h(i){var u,l=t.length,c;if(i===undefined)i=1;for(var f=0;f<i;++f){n+=(a-n)*r;s.forEach((function(t){t(n)}));for(u=0;u<l;++u){c=t[u];if(c.fx==null)c.x+=c.vx*=o;else c.x=c.fx,c.vx=0;if(c.fy==null)c.y+=c.vy*=o;else c.y=c.fy,c.vy=0}}return e}function d(){for(var e=0,n=t.length,i;e<n;++e){i=t[e],i.index=e;if(i.fx!=null)i.x=i.fx;if(i.fy!=null)i.y=i.fy;if(isNaN(i.x)||isNaN(i.y)){var r=MB*Math.sqrt(.5+e),a=e*AB;i.x=r*Math.cos(a);i.y=r*Math.sin(a)}if(isNaN(i.vx)||isNaN(i.vy)){i.vx=i.vy=0}}}function p(e){if(e.initialize)e.initialize(t,c);return e}d();return e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(c=t,s.forEach(p),e):c},force:function(t,n){return arguments.length>1?(n==null?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,i){var r=0,a=t.length,o,s,u,l,c;if(i==null)i=Infinity;else i*=i;for(r=0;r<a;++r){l=t[r];o=e-l.x;s=n-l.y;u=o*o+s*s;if(u<i)c=l,i=u}return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}function DB(){var t,e,n,i,r=LT(-30),a,o=1,s=Infinity,u=.81;function l(n){var r,a=t.length,o=RT(t,wB,kB).visitAfter(f);for(i=n,r=0;r<a;++r)e=t[r],o.visit(h)}function c(){if(!t)return;var e,n=t.length,i;a=new Array(n);for(e=0;e<n;++e)i=t[e],a[i.index]=+r(i,e,t)}function f(t){var e=0,n,i,r=0,o,s,u;if(t.length){for(o=s=u=0;u<4;++u){if((n=t[u])&&(i=Math.abs(n.value))){e+=n.value,r+=i,o+=i*n.x,s+=i*n.y}}t.x=o/r;t.y=s/r}else{n=t;n.x=n.data.x;n.y=n.data.y;do{e+=a[n.data.index]}while(n=n.next)}t.value=e}function h(t,r,l,c){if(!t.value)return true;var f=t.x-e.x,h=t.y-e.y,d=c-r,p=f*f+h*h;if(d*d/u<p){if(p<s){if(f===0)f=PT(n),p+=f*f;if(h===0)h=PT(n),p+=h*h;if(p<o)p=Math.sqrt(o*p);e.vx+=f*t.value*i/p;e.vy+=h*t.value*i/p}return true}else if(t.length||p>=s)return;if(t.data!==e||t.next){if(f===0)f=PT(n),p+=f*f;if(h===0)h=PT(n),p+=h*h;if(p<o)p=Math.sqrt(o*p)}do{if(t.data!==e){d=a[t.data.index]*i/p;e.vx+=f*d;e.vy+=h*d}}while(t=t.next)}l.initialize=function(e,i){t=e;n=i;c()};l.strength=function(t){return arguments.length?(r=typeof t==="function"?t:LT(+t),c(),l):r};l.distanceMin=function(t){return arguments.length?(o=t*t,l):Math.sqrt(o)};l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)};l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)};return l}function CB(t){return t.index}function FB(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function SB(t){var e=CB,n=f,i,r=LT(30),a,o,s,u,l,c=1;if(t==null)t=[];function f(t){return 1/Math.min(s[t.source.index],s[t.target.index])}function h(e){for(var n=0,r=t.length;n<c;++n){for(var o=0,s,f,h,d,p,m,g;o<r;++o){s=t[o],f=s.source,h=s.target;d=h.x+h.vx-f.x-f.vx||PT(l);p=h.y+h.vy-f.y-f.vy||PT(l);m=Math.sqrt(d*d+p*p);m=(m-a[o])/m*e*i[o];d*=m,p*=m;h.vx-=d*(g=u[o]);h.vy-=p*g;f.vx+=d*(g=1-g);f.vy+=p*g}}}function d(){if(!o)return;var n,r=o.length,l=t.length,c=new Map(o.map(((t,n)=>[e(t,n,o),t]))),f;for(n=0,s=new Array(r);n<l;++n){f=t[n],f.index=n;if(typeof f.source!=="object")f.source=FB(c,f.source);if(typeof f.target!=="object")f.target=FB(c,f.target);s[f.source.index]=(s[f.source.index]||0)+1;s[f.target.index]=(s[f.target.index]||0)+1}for(n=0,u=new Array(l);n<l;++n){f=t[n],u[n]=s[f.source.index]/(s[f.source.index]+s[f.target.index])}i=new Array(l),p();a=new Array(l),m()}function p(){if(!o)return;for(var e=0,r=t.length;e<r;++e){i[e]=+n(t[e],e,t)}}function m(){if(!o)return;for(var e=0,n=t.length;e<n;++e){a[e]=+r(t[e],e,t)}}h.initialize=function(t,e){o=t;l=e;d()};h.links=function(e){return arguments.length?(t=e,d(),h):t};h.id=function(t){return arguments.length?(e=t,h):e};h.iterations=function(t){return arguments.length?(c=+t,h):c};h.strength=function(t){return arguments.length?(n=typeof t==="function"?t:LT(+t),p(),h):n};h.distance=function(t){return arguments.length?(r=typeof t==="function"?t:LT(+t),m(),h):r};return h}function TB(t){var e=LT(.1),n,i,r;if(typeof t!=="function")t=LT(t==null?0:+t);function a(t){for(var e=0,a=n.length,o;e<a;++e){o=n[e],o.vx+=(r[e]-o.x)*i[e]*t}}function o(){if(!n)return;var a,o=n.length;i=new Array(o);r=new Array(o);for(a=0;a<o;++a){i[a]=isNaN(r[a]=+t(n[a],a,n))?0:+e(n[a],a,n)}}a.initialize=function(t){n=t;o()};a.strength=function(t){return arguments.length?(e=typeof t==="function"?t:LT(+t),o(),a):e};a.x=function(e){return arguments.length?(t=typeof e==="function"?e:LT(+e),o(),a):t};return a}function BB(t){var e=LT(.1),n,i,r;if(typeof t!=="function")t=LT(t==null?0:+t);function a(t){for(var e=0,a=n.length,o;e<a;++e){o=n[e],o.vy+=(r[e]-o.y)*i[e]*t}}function o(){if(!n)return;var a,o=n.length;i=new Array(o);r=new Array(o);for(a=0;a<o;++a){i[a]=isNaN(r[a]=+t(n[a],a,n))?0:+e(n[a],a,n)}}a.initialize=function(t){n=t;o()};a.strength=function(t){return arguments.length?(e=typeof t==="function"?t:LT(+t),o(),a):e};a.y=function(e){return arguments.length?(t=typeof e==="function"?e:LT(+e),o(),a):t};return a}const NB={center:yT,collide:XT,nbody:DB,link:SB,x:TB,y:BB};const zB="forces",OB=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],RB=["static","iterations"],UB=["x","y","vx","vy"];function qB(t){jo.call(this,null,t)}qB.Definition={type:"Force",metadata:{modifies:true},params:[{name:"static",type:"boolean",default:false},{name:"restart",type:"boolean",default:false},{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:true,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:true},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{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:true},{name:"strength",type:"number",expr:true},{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:true,modify:false,default:UB}]};(0,m.XW)(qB,jo,{transform(t,e){var n=this.value,i=e.changed(e.ADD_REM),r=t.modified(OB),a=t.iterations||300;if(!n){this.value=n=LB(e.source,t);n.on("tick",IB(e.dataflow,this));if(!t.static){i=true;n.tick()}e.modifies("index")}else{if(i){e.modifies("index");n.nodes(e.source)}if(r||e.changed(e.MOD)){PB(n,t,0,e)}}if(r||i||t.modified(RB)||e.changed()&&t.restart){n.alpha(Math.max(n.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/a));if(t.static){for(n.stop();--a>=0;)n.tick()}else{if(n.stopped())n.restart();if(!i)return e.StopPropagation}}return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let s=this._argops,u=0,l=s.length,c;u<l;++u){c=s[u];if(c.name!==zB||c.op._argval.force!=="link"){continue}for(var i=c.op._argops,r=0,a=i.length,o;r<a;++r){if(i[r].name==="links"&&(o=i[r].op.source)){n.pulse(o,n.changeset().reflow());break}}}return e.reflow(t.modified()).modifies(UB)}});function IB(t,e){return()=>t.touch(e).run()}function LB(t,e){const n=EB(t),i=n.stop,r=n.restart;let a=false;n.stopped=()=>a;n.restart=()=>(a=false,r());n.stop=()=>(a=true,i());return PB(n,e,true).on("end",(()=>a=true))}function PB(t,e,n,i){var r=(0,m.IX)(e.forces),a,o,s,u;for(a=0,o=OB.length;a<o;++a){s=OB[a];if(s!==zB&&e.modified(s))t[s](e[s])}for(a=0,o=r.length;a<o;++a){u=zB+a;s=n||e.modified(zB,a)?WB(r[a]):i&&jB(r[a],i)?t.force(u):null;if(s)t.force(u,s)}for(o=t.numForces||0;a<o;++a){t.force(zB+a,null)}t.numForces=r.length;return t}function jB(t,e){var n,i;for(n in t){if((0,m.mf)(i=t[n])&&e.modified((0,m.Oj)(i)))return 1}return 0}function WB(t){var e,n;if(!(0,m.nr)(NB,t.force)){(0,m.vU)("Unrecognized force: "+t.force)}e=NB[t.force]();for(n in t){if((0,m.mf)(e[n]))XB(e[n],t[n],t)}return e}function XB(t,e,n){t((0,m.mf)(e)?t=>e(t,n):e)}function $B(t){var e=0,n=t.children,i=n&&n.length;if(!i)e=1;else while(--i>=0)e+=n[i].value;t.value=e}function HB(){return this.eachAfter($B)}function YB(t,e){let n=-1;for(const i of this){t.call(e,i,++n,this)}return this}function JB(t,e){var n=this,i=[n],r,a,o=-1;while(n=i.pop()){t.call(e,n,++o,this);if(r=n.children){for(a=r.length-1;a>=0;--a){i.push(r[a])}}}return this}function VB(t,e){var n=this,i=[n],r=[],a,o,s,u=-1;while(n=i.pop()){r.push(n);if(a=n.children){for(o=0,s=a.length;o<s;++o){i.push(a[o])}}}while(n=r.pop()){t.call(e,n,++u,this)}return this}function GB(t,e){let n=-1;for(const i of this){if(t.call(e,i,++n,this)){return i}}}function KB(t){return this.eachAfter((function(e){var n=+t(e.data)||0,i=e.children,r=i&&i.length;while(--r>=0)n+=i[r].value;e.value=n}))}function ZB(t){return this.eachBefore((function(e){if(e.children){e.children.sort(t)}}))}function QB(t){var e=this,n=tN(e,t),i=[e];while(e!==n){e=e.parent;i.push(e)}var r=i.length;while(t!==n){i.splice(r,0,t);t=t.parent}return i}function tN(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop();e=i.pop();while(t===e){r=t;t=n.pop();e=i.pop()}return r}function eN(){var t=this,e=[t];while(t=t.parent){e.push(t)}return e}function nN(){return Array.from(this)}function iN(){var t=[];this.eachBefore((function(e){if(!e.children){t.push(e)}}));return t}function rN(){var t=this,e=[];t.each((function(n){if(n!==t){e.push({source:n.parent,target:n})}}));return e}function*aN(){var t=this,e,n=[t],i,r,a;do{e=n.reverse(),n=[];while(t=e.pop()){yield t;if(i=t.children){for(r=0,a=i.length;r<a;++r){n.push(i[r])}}}}while(n.length)}function oN(t,e){if(t instanceof Map){t=[undefined,t];if(e===undefined)e=lN}else if(e===undefined){e=uN}var n=new hN(t),i,r=[n],a,o,s,u;while(i=r.pop()){if((o=e(i.data))&&(u=(o=Array.from(o)).length)){i.children=o;for(s=u-1;s>=0;--s){r.push(a=o[s]=new hN(o[s]));a.parent=i;a.depth=i.depth+1}}}return n.eachBefore(fN)}function sN(){return oN(this).eachBefore(cN)}function uN(t){return t.children}function lN(t){return Array.isArray(t)?t[1]:null}function cN(t){if(t.data.value!==undefined)t.value=t.data.value;t.data=t.data.data}function fN(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function hN(t){this.data=t;this.depth=this.height=0;this.parent=null}hN.prototype=oN.prototype={constructor:hN,count:HB,each:YB,eachAfter:VB,eachBefore:JB,find:GB,sum:KB,sort:ZB,path:QB,ancestors:eN,descendants:nN,leaves:iN,links:rN,copy:sN,[Symbol.iterator]:aN};function dN(t){return typeof t==="object"&&"length"in t?t:Array.from(t)}function pN(t){var e=t.length,n,i;while(e){i=Math.random()*e--|0;n=t[e];t[e]=t[i];t[i]=n}return t}function mN(t){var e=0,n=(t=pN(Array.from(t))).length,i=[],r,a;while(e<n){r=t[e];if(a&&vN(a,r))++e;else a=_N(i=gN(i,r)),e=0}return a}function gN(t,e){var n,i;if(xN(e,t))return[e];for(n=0;n<t.length;++n){if(yN(e,t[n])&&xN(wN(t[n],e),t)){return[t[n],e]}}for(n=0;n<t.length-1;++n){for(i=n+1;i<t.length;++i){if(yN(wN(t[n],t[i]),e)&&yN(wN(t[n],e),t[i])&&yN(wN(t[i],e),t[n])&&xN(kN(t[n],t[i],e),t)){return[t[n],t[i],e]}}}throw new Error}function yN(t,e){var n=t.r-e.r,i=e.x-t.x,r=e.y-t.y;return n<0||n*n<i*i+r*r}function vN(t,e){var n=t.r-e.r+Math.max(t.r,e.r,1)*1e-9,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function xN(t,e){for(var n=0;n<e.length;++n){if(!vN(t,e[n])){return false}}return true}function _N(t){switch(t.length){case 1:return bN(t[0]);case 2:return wN(t[0],t[1]);case 3:return kN(t[0],t[1],t[2])}}function bN(t){return{x:t.x,y:t.y,r:t.r}}function wN(t,e){var n=t.x,i=t.y,r=t.r,a=e.x,o=e.y,s=e.r,u=a-n,l=o-i,c=s-r,f=Math.sqrt(u*u+l*l);return{x:(n+a+u/f*c)/2,y:(i+o+l/f*c)/2,r:(f+r+s)/2}}function kN(t,e,n){var i=t.x,r=t.y,a=t.r,o=e.x,s=e.y,u=e.r,l=n.x,c=n.y,f=n.r,h=i-o,d=i-l,p=r-s,m=r-c,g=u-a,y=f-a,v=i*i+r*r-a*a,x=v-o*o-s*s+u*u,_=v-l*l-c*c+f*f,b=d*p-h*m,w=(p*_-m*x)/(b*2)-i,k=(m*g-p*y)/b,M=(d*x-h*_)/(b*2)-r,A=(h*y-d*g)/b,E=k*k+A*A-1,D=2*(a+w*k+M*A),C=w*w+M*M-a*a,F=-(E?(D+Math.sqrt(D*D-4*E*C))/(2*E):C/D);return{x:i+w+k*F,y:r+M+A*F,r:F}}function MN(t,e,n){var i=t.x-e.x,r,a,o=t.y-e.y,s,u,l=i*i+o*o;if(l){a=e.r+n.r,a*=a;u=t.r+n.r,u*=u;if(a>u){r=(l+u-a)/(2*l);s=Math.sqrt(Math.max(0,u/l-r*r));n.x=t.x-r*i-s*o;n.y=t.y-r*o+s*i}else{r=(l+a-u)/(2*l);s=Math.sqrt(Math.max(0,a/l-r*r));n.x=e.x+r*i-s*o;n.y=e.y+r*o+s*i}}else{n.x=e.x+n.r;n.y=e.y}}function AN(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function EN(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,a=(e.y*n.r+n.y*e.r)/i;return r*r+a*a}function DN(t){this._=t;this.next=null;this.previous=null}function CN(t){if(!(r=(t=dN(t)).length))return 0;var e,n,i,r,a,o,s,u,l,c,f;e=t[0],e.x=0,e.y=0;if(!(r>1))return e.r;n=t[1],e.x=-n.r,n.x=e.r,n.y=0;if(!(r>2))return e.r+n.r;MN(n,e,i=t[2]);e=new DN(e),n=new DN(n),i=new DN(i);e.next=i.previous=n;n.next=e.previous=i;i.next=n.previous=e;t:for(s=3;s<r;++s){MN(e._,n._,i=t[s]),i=new DN(i);u=n.next,l=e.previous,c=n._.r,f=e._.r;do{if(c<=f){if(AN(u._,i._)){n=u,e.next=n,n.previous=e,--s;continue t}c+=u._.r,u=u.next}else{if(AN(l._,i._)){e=l,e.next=n,n.previous=e,--s;continue t}f+=l._.r,l=l.previous}}while(u!==l.next);i.previous=e,i.next=n,e.next=n.previous=n=i;a=EN(e);while((i=i.next)!==n){if((o=EN(i))<a){e=i,a=o}}n=e.next}e=[n._],i=n;while((i=i.next)!==n)e.push(i._);i=mN(e);for(s=0;s<r;++s)e=t[s],e.x-=i.x,e.y-=i.y;return i.r}function FN(t){CN(t);return t}function SN(t){return t==null?null:TN(t)}function TN(t){if(typeof t!=="function")throw new Error;return t}function BN(){return 0}function NN(t){return function(){return t}}function zN(t){return Math.sqrt(t.value)}function ON(){var t=null,e=1,n=1,i=BN;function r(r){r.x=e/2,r.y=n/2;if(t){r.eachBefore(RN(t)).eachAfter(UN(i,.5)).eachBefore(qN(1))}else{r.eachBefore(RN(zN)).eachAfter(UN(BN,1)).eachAfter(UN(i,r.r/Math.min(e,n))).eachBefore(qN(Math.min(e,n)/(2*r.r)))}return r}r.radius=function(e){return arguments.length?(t=SN(e),r):t};r.size=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]};r.padding=function(t){return arguments.length?(i=typeof t==="function"?t:NN(+t),r):i};return r}function RN(t){return function(e){if(!e.children){e.r=Math.max(0,+t(e)||0)}}}function UN(t,e){return function(n){if(i=n.children){var i,r,a=i.length,o=t(n)*e||0,s;if(o)for(r=0;r<a;++r)i[r].r+=o;s=CN(i);if(o)for(r=0;r<a;++r)i[r].r-=o;n.r=s+o}}}function qN(t){return function(e){var n=e.parent;e.r*=t;if(n){e.x=n.x+t*e.x;e.y=n.y+t*e.y}}}function IN(t){t.x0=Math.round(t.x0);t.y0=Math.round(t.y0);t.x1=Math.round(t.x1);t.y1=Math.round(t.y1)}function LN(t,e,n,i,r){var a=t.children,o,s=-1,u=a.length,l=t.value&&(i-e)/t.value;while(++s<u){o=a[s],o.y0=n,o.y1=r;o.x0=e,o.x1=e+=o.value*l}}function PN(){var t=1,e=1,n=0,i=false;function r(r){var o=r.height+1;r.x0=r.y0=n;r.x1=t;r.y1=e/o;r.eachBefore(a(e,o));if(i)r.eachBefore(IN);return r}function a(t,e){return function(i){if(i.children){LN(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e)}var r=i.x0,a=i.y0,o=i.x1-n,s=i.y1-n;if(o<r)r=o=(r+o)/2;if(s<a)a=s=(a+s)/2;i.x0=r;i.y0=a;i.x1=o;i.y1=s}}r.round=function(t){return arguments.length?(i=!!t,r):i};r.size=function(n){return arguments.length?(t=+n[0],e=+n[1],r):[t,e]};r.padding=function(t){return arguments.length?(n=+t,r):n};return r}var jN={depth:-1},WN={};function XN(t){return t.id}function $N(t){return t.parentId}function HN(){var t=XN,e=$N;function n(n){var i=Array.from(n),r=i.length,a,o,s,u,l,c,f,h=new Map;for(o=0;o<r;++o){a=i[o],l=i[o]=new hN(a);if((c=t(a,o,n))!=null&&(c+="")){f=l.id=c;h.set(f,h.has(f)?WN:l)}if((c=e(a,o,n))!=null&&(c+="")){l.parent=c}}for(o=0;o<r;++o){l=i[o];if(c=l.parent){u=h.get(c);if(!u)throw new Error("missing: "+c);if(u===WN)throw new Error("ambiguous: "+c);if(u.children)u.children.push(l);else u.children=[l];l.parent=u}else{if(s)throw new Error("multiple roots");s=l}}if(!s)throw new Error("no root");s.parent=jN;s.eachBefore((function(t){t.depth=t.parent.depth+1;--r})).eachBefore(fN);s.parent=null;if(r>0)throw new Error("cycle");return s}n.id=function(e){return arguments.length?(t=TN(e),n):t};n.parentId=function(t){return arguments.length?(e=TN(t),n):e};return n}function YN(t,e){return t.parent===e.parent?1:2}function JN(t){var e=t.children;return e?e[0]:t.t}function VN(t){var e=t.children;return e?e[e.length-1]:t.t}function GN(t,e,n){var i=n/(e.i-t.i);e.c-=i;e.s+=n;t.c+=i;e.z+=n;e.m+=n}function KN(t){var e=0,n=0,i=t.children,r=i.length,a;while(--r>=0){a=i[r];a.z+=e;a.m+=e;e+=a.s+(n+=a.c)}}function ZN(t,e,n){return t.a.parent===e.parent?t.a:n}function QN(t,e){this._=t;this.parent=null;this.children=null;this.A=null;this.a=this;this.z=0;this.m=0;this.c=0;this.s=0;this.t=null;this.i=e}QN.prototype=Object.create(hN.prototype);function tz(t){var e=new QN(t,0),n,i=[e],r,a,o,s;while(n=i.pop()){if(a=n._.children){n.children=new Array(s=a.length);for(o=s-1;o>=0;--o){i.push(r=n.children[o]=new QN(a[o],o));r.parent=n}}}(e.parent=new QN(null,0)).children=[e];return e}function ez(){var t=YN,e=1,n=1,i=null;function r(r){var s=tz(r);s.eachAfter(a),s.parent.m=-s.z;s.eachBefore(o);if(i)r.eachBefore(u);else{var l=r,c=r,f=r;r.eachBefore((function(t){if(t.x<l.x)l=t;if(t.x>c.x)c=t;if(t.depth>f.depth)f=t}));var h=l===c?1:t(l,c)/2,d=h-l.x,p=e/(c.x+h+d),m=n/(f.depth||1);r.eachBefore((function(t){t.x=(t.x+d)*p;t.y=t.depth*m}))}return r}function a(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){KN(e);var a=(n[0].z+n[n.length-1].z)/2;if(r){e.z=r.z+t(e._,r._);e.m=e.z-a}else{e.z=a}}else if(r){e.z=r.z+t(e._,r._)}e.parent.A=s(e,r,e.parent.A||i[0])}function o(t){t._.x=t.z+t.parent.m;t.m+=t.parent.m}function s(e,n,i){if(n){var r=e,a=e,o=n,s=r.parent.children[0],u=r.m,l=a.m,c=o.m,f=s.m,h;while(o=VN(o),r=JN(r),o&&r){s=JN(s);a=VN(a);a.a=e;h=o.z+c-r.z-u+t(o._,r._);if(h>0){GN(ZN(o,e,i),e,h);u+=h;l+=h}c+=o.m;u+=r.m;f+=s.m;l+=a.m}if(o&&!VN(a)){a.t=o;a.m+=c-l}if(r&&!JN(s)){s.t=r;s.m+=u-f;i=e}}return i}function u(t){t.x*=e;t.y=t.depth*n}r.separation=function(e){return arguments.length?(t=e,r):t};r.size=function(t){return arguments.length?(i=false,e=+t[0],n=+t[1],r):i?null:[e,n]};r.nodeSize=function(t){return arguments.length?(i=true,e=+t[0],n=+t[1],r):i?[e,n]:null};return r}function nz(t,e){return t.parent===e.parent?1:2}function iz(t){return t.reduce(rz,0)/t.length}function rz(t,e){return t+e.x}function az(t){return 1+t.reduce(oz,0)}function oz(t,e){return Math.max(t,e.y)}function sz(t){var e;while(e=t.children)t=e[0];return t}function uz(t){var e;while(e=t.children)t=e[e.length-1];return t}function lz(){var t=nz,e=1,n=1,i=false;function r(r){var a,o=0;r.eachAfter((function(e){var n=e.children;if(n){e.x=iz(n);e.y=az(n)}else{e.x=a?o+=t(e,a):0;e.y=0;a=e}}));var s=sz(r),u=uz(r),l=s.x-t(s,u)/2,c=u.x+t(u,s)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e;t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e;t.y=(1-(r.y?t.y/r.y:1))*n})}r.separation=function(e){return arguments.length?(t=e,r):t};r.size=function(t){return arguments.length?(i=false,e=+t[0],n=+t[1],r):i?null:[e,n]};r.nodeSize=function(t){return arguments.length?(i=true,e=+t[0],n=+t[1],r):i?[e,n]:null};return r}function cz(t,e,n,i,r){var a=t.children,o,s=a.length,u,l=new Array(s+1);for(l[0]=u=o=0;o<s;++o){l[o+1]=u+=a[o].value}c(0,s,t.value,e,n,i,r);function c(t,e,n,i,r,o,s){if(t>=e-1){var u=a[t];u.x0=i,u.y0=r;u.x1=o,u.y1=s;return}var f=l[t],h=n/2+f,d=t+1,p=e-1;while(d<p){var m=d+p>>>1;if(l[m]<h)d=m+1;else p=m}if(h-l[d-1]<l[d]-h&&t+1<d)--d;var g=l[d]-f,y=n-g;if(o-i>s-r){var v=n?(i*y+o*g)/n:o;c(t,d,g,i,r,v,s);c(d,e,y,v,r,o,s)}else{var x=n?(r*y+s*g)/n:s;c(t,d,g,i,r,o,x);c(d,e,y,i,x,o,s)}}}function fz(t,e,n,i,r){var a=t.children,o,s=-1,u=a.length,l=t.value&&(r-n)/t.value;while(++s<u){o=a[s],o.x0=e,o.x1=i;o.y0=n,o.y1=n+=o.value*l}}function hz(t,e,n,i,r){(t.depth&1?fz:LN)(t,e,n,i,r)}var dz=(1+Math.sqrt(5))/2;function pz(t,e,n,i,r,a){var o=[],s=e.children,u,l,c=0,f=0,h=s.length,d,p,m=e.value,g,y,v,x,_,b,w;while(c<h){d=r-n,p=a-i;do{g=s[f++].value}while(!g&&f<h);y=v=g;b=Math.max(p/d,d/p)/(m*t);w=g*g*b;_=Math.max(v/w,w/y);for(;f<h;++f){g+=l=s[f].value;if(l<y)y=l;if(l>v)v=l;w=g*g*b;x=Math.max(v/w,w/y);if(x>_){g-=l;break}_=x}o.push(u={value:g,dice:d<p,children:s.slice(c,f)});if(u.dice)LN(u,n,i,r,m?i+=p*g/m:a);else fz(u,n,i,m?n+=d*g/m:r,a);m-=g,c=f}return o}const mz=function t(e){function n(t,n,i,r,a){pz(e,t,n,i,r,a)}n.ratio=function(e){return t((e=+e)>1?e:1)};return n}(dz);const gz=function t(e){function n(t,n,i,r,a){if((o=t._squarify)&&o.ratio===e){var o,s,u,l,c=-1,f,h=o.length,d=t.value;while(++c<h){s=o[c],u=s.children;for(l=s.value=0,f=u.length;l<f;++l)s.value+=u[l].value;if(s.dice)LN(s,n,i,r,d?i+=(a-i)*s.value/d:a);else fz(s,n,i,d?n+=(r-n)*s.value/d:r,a);d-=s.value}}else{t._squarify=o=pz(e,t,n,i,r,a);o.ratio=e}}n.ratio=function(e){return t((e=+e)>1?e:1)};return n}(dz);function yz(){var t=mz,e=false,n=1,i=1,r=[0],a=BN,o=BN,s=BN,u=BN,l=BN;function c(t){t.x0=t.y0=0;t.x1=n;t.y1=i;t.eachBefore(f);r=[0];if(e)t.eachBefore(IN);return t}function f(e){var n=r[e.depth],i=e.x0+n,c=e.y0+n,f=e.x1-n,h=e.y1-n;if(f<i)i=f=(i+f)/2;if(h<c)c=h=(c+h)/2;e.x0=i;e.y0=c;e.x1=f;e.y1=h;if(e.children){n=r[e.depth+1]=a(e)/2;i+=l(e)-n;c+=o(e)-n;f-=s(e)-n;h-=u(e)-n;if(f<i)i=f=(i+f)/2;if(h<c)c=h=(c+h)/2;t(e,i,c,f,h)}}c.round=function(t){return arguments.length?(e=!!t,c):e};c.size=function(t){return arguments.length?(n=+t[0],i=+t[1],c):[n,i]};c.tile=function(e){return arguments.length?(t=TN(e),c):t};c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()};c.paddingInner=function(t){return arguments.length?(a=typeof t==="function"?t:NN(+t),c):a};c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()};c.paddingTop=function(t){return arguments.length?(o=typeof t==="function"?t:NN(+t),c):o};c.paddingRight=function(t){return arguments.length?(s=typeof t==="function"?t:NN(+t),c):s};c.paddingBottom=function(t){return arguments.length?(u=typeof t==="function"?t:NN(+t),c):u};c.paddingLeft=function(t){return arguments.length?(l=typeof t==="function"?t:NN(+t),c):l};return c}function vz(t,e,n){const i={};t.each((t=>{const r=t.data;if(n(r))i[e(r)]=t}));t.lookup=i;return t}function xz(t){jo.call(this,null,t)}xz.Definition={type:"Nest",metadata:{treesource:true,changes:true},params:[{name:"keys",type:"field",array:true},{name:"generate",type:"boolean"}]};const _z=t=>t.values;(0,m.XW)(xz,jo,{transform(t,e){if(!e.source){(0,m.vU)("Nest transform requires an upstream data source.")}var n=t.generate,i=t.modified(),r=e.clone(),a=this.value;if(!a||i||e.changed()){if(a){a.each((t=>{if(t.children&&Aa(t.data)){r.rem.push(t.data)}}))}this.value=a=oN({values:(0,m.IX)(t.keys).reduce(((t,e)=>{t.key(e);return t}),bz()).entries(r.source)},_z);if(n){a.each((t=>{if(t.children){t=Ca(t.data);r.add.push(t);r.source.push(t)}}))}vz(a,Ea,Ea)}r.source.root=a;return r}});function bz(){const t=[],e={entries:t=>i(n(t,0),0),key:n=>(t.push(n),e)};function n(e,i){if(i>=t.length){return e}const r=e.length,a=t[i++],o={},s={};let u=-1,l,c,f;while(++u<r){l=a(c=e[u])+"";if(f=o[l]){f.push(c)}else{o[l]=[c]}}for(l in o){s[l]=n(o[l],i)}return s}function i(e,n){if(++n>t.length)return e;const r=[];for(const t in e){r.push({key:t,values:i(e[t],n)})}return r}return e}function wz(t){jo.call(this,null,t)}const kz=(t,e)=>t.parent===e.parent?1:2;(0,m.XW)(wz,jo,{transform(t,e){if(!e.source||!e.source.root){(0,m.vU)(this.constructor.name+" transform requires a backing tree data source.")}const n=this.layout(t.method),i=this.fields,r=e.source.root,a=t.as||i;if(t.field)r.sum(t.field);else r.count();if(t.sort)r.sort(Ba(t.sort,(t=>t.data)));Mz(n,this.params,t);if(n.separation){n.separation(t.separation!==false?kz:m.kX)}try{this.value=n(r)}catch(o){(0,m.vU)(o)}r.each((t=>Az(t,i,a)));return e.reflow(t.modified()).modifies(a).modifies("leaf")}});function Mz(t,e,n){for(let i,r=0,a=e.length;r<a;++r){i=e[r];if(i in n)t[i](n[i])}}function Az(t,e,n){const i=t.data,r=e.length-1;for(let a=0;a<r;++a){i[n[a]]=t[e[a]]}i[n[r]]=t.children?t.children.length:0}const Ez=["x","y","r","depth","children"];function Dz(t){wz.call(this,t)}Dz.Definition={type:"Pack",metadata:{tree:true,modifies:true},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:true,length:2},{name:"as",type:"string",array:true,length:Ez.length,default:Ez}]};(0,m.XW)(Dz,wz,{layout:ON,params:["radius","size","padding"],fields:Ez});const Cz=["x0","y0","x1","y1","depth","children"];function Fz(t){wz.call(this,t)}Fz.Definition={type:"Partition",metadata:{tree:true,modifies:true},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:false},{name:"size",type:"number",array:true,length:2},{name:"as",type:"string",array:true,length:Cz.length,default:Cz}]};(0,m.XW)(Fz,wz,{layout:PN,params:["size","round","padding"],fields:Cz});function Sz(t){jo.call(this,null,t)}Sz.Definition={type:"Stratify",metadata:{treesource:true},params:[{name:"key",type:"field",required:true},{name:"parentKey",type:"field",required:true}]};(0,m.XW)(Sz,jo,{transform(t,e){if(!e.source){(0,m.vU)("Stratify transform requires an upstream data source.")}let n=this.value;const i=t.modified(),r=e.fork(e.ALL).materialize(e.SOURCE),a=!n||i||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);r.source=r.source.slice();if(a){n=r.source.length?vz(HN().id(t.key).parentId(t.parentKey)(r.source),t.key,m.yb):vz(HN()([{}]),t.key,t.key)}r.source.root=this.value=n;return r}});const Tz={tidy:ez,cluster:lz};const Bz=["x","y","depth","children"];function Nz(t){wz.call(this,t)}Nz.Definition={type:"Tree",metadata:{tree:true,modifies:true},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:true,length:2},{name:"nodeSize",type:"number",array:true,length:2},{name:"separation",type:"boolean",default:true},{name:"as",type:"string",array:true,length:Bz.length,default:Bz}]};(0,m.XW)(Nz,wz,{layout(t){const e=t||"tidy";if((0,m.nr)(Tz,e))return Tz[e]();else(0,m.vU)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:Bz});function zz(t){jo.call(this,[],t)}zz.Definition={type:"TreeLinks",metadata:{tree:true,generates:true,changes:true},params:[]};(0,m.XW)(zz,jo,{transform(t,e){const n=this.value,i=e.source&&e.source.root,r=e.fork(e.NO_SOURCE),a={};if(!i)(0,m.vU)("TreeLinks transform requires a tree data source.");if(e.changed(e.ADD_REM)){r.rem=n;e.visit(e.SOURCE,(t=>a[Ea(t)]=1));i.each((t=>{const e=t.data,n=t.parent&&t.parent.data;if(n&&a[Ea(e)]&&a[Ea(n)]){r.add.push(Ca({source:n,target:e}))}}));this.value=r.add}else if(e.changed(e.MOD)){e.visit(e.MOD,(t=>a[Ea(t)]=1));n.forEach((t=>{if(a[Ea(t.source)]||a[Ea(t.target)]){r.mod.push(t)}}))}return r}});const Oz={binary:cz,dice:LN,slice:fz,slicedice:hz,squarify:mz,resquarify:gz};const Rz=["x0","y0","x1","y1","depth","children"];function Uz(t){wz.call(this,t)}Uz.Definition={type:"Treemap",metadata:{tree:true,modifies:true},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:false},{name:"size",type:"number",array:true,length:2},{name:"as",type:"string",array:true,length:Rz.length,default:Rz}]};(0,m.XW)(Uz,wz,{layout(){const t=yz();t.ratio=e=>{const n=t.tile();if(n.ratio)t.tile(n.ratio(e))};t.method=e=>{if((0,m.nr)(Oz,e))t.tile(Oz[e]);else(0,m.vU)("Unrecognized Treemap layout method: "+e)};return t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Rz});const qz=4278190080;const Iz=268435456;const Lz=.0625;function Pz(t,e){const n=t.bitmap();(e||[]).forEach((e=>n.set(t(e.boundary[0]),t(e.boundary[3]))));return[n,undefined]}function jz(t,e,n,i){const r=t.width,a=t.height,o=n||i,s=Hf(r,a).getContext("2d");e.forEach((t=>Wz(s,t,o)));const u=new Uint32Array(s.getImageData(0,0,r,a).data.buffer),l=t.bitmap(),c=o&&t.bitmap();let f,h,d,p,m;for(h=0;h<a;++h){for(f=0;f<r;++f){m=u[h*r+f]&qz;if(m){d=t(f);p=t(h);if(!i)l.set(d,p);if(o&&m^Iz)c.set(d,p)}}}return[l,c]}function Wz(t,e,n){if(!e.length)return;const i=e[0].mark.marktype;if(i==="group"){e.forEach((e=>{e.items.forEach((e=>Wz(t,e.items,n)))}))}else{sb[i].draw(t,{items:n?e.map(Xz):e})}}function Xz(t){const e=Sa(t,{});if(e.stroke){e.strokeOpacity=1}if(e.fill){e.fillOpacity=Lz;e.stroke="#000";e.strokeOpacity=1;e.strokeWidth=2}return e}const $z=5,Hz=31,Yz=32,Jz=new Uint32Array(Yz+1),Vz=new Uint32Array(Yz+1);Vz[0]=0;Jz[0]=~Vz[0];for(let QV=1;QV<=Yz;++QV){Vz[QV]=Vz[QV-1]<<1|1;Jz[QV]=~Vz[QV]}function Gz(t,e){const n=new Uint32Array(~~((t*e+Yz)/Yz));function i(t,e){n[t]|=e}function r(t,e){n[t]&=e}return{array:n,get:(e,i)=>{const r=i*t+e;return n[r>>>$z]&1<<(r&Hz)},set:(e,n)=>{const r=n*t+e;i(r>>>$z,1<<(r&Hz))},clear:(e,n)=>{const i=n*t+e;r(i>>>$z,~(1<<(i&Hz)))},getRange:(e,i,r,a)=>{let o=a,s,u,l,c;for(;o>=i;--o){s=o*t+e;u=o*t+r;l=s>>>$z;c=u>>>$z;if(l===c){if(n[l]&Jz[s&Hz]&Vz[(u&Hz)+1]){return true}}else{if(n[l]&Jz[s&Hz])return true;if(n[c]&Vz[(u&Hz)+1])return true;for(let t=l+1;t<c;++t){if(n[t])return true}}}return false},setRange:(e,n,r,a)=>{let o,s,u,l,c;for(;n<=a;++n){o=n*t+e;s=n*t+r;u=o>>>$z;l=s>>>$z;if(u===l){i(u,Jz[o&Hz]&Vz[(s&Hz)+1])}else{i(u,Jz[o&Hz]);i(l,Vz[(s&Hz)+1]);for(c=u+1;c<l;++c)i(c,4294967295)}}},clearRange:(e,n,i,a)=>{let o,s,u,l,c;for(;n<=a;++n){o=n*t+e;s=n*t+i;u=o>>>$z;l=s>>>$z;if(u===l){r(u,Vz[o&Hz]|Jz[(s&Hz)+1])}else{r(u,Vz[o&Hz]);r(l,Jz[(s&Hz)+1]);for(c=u+1;c<l;++c)r(c,0)}}},outOfBounds:(n,i,r,a)=>n<0||i<0||a>=e||r>=t}}function Kz(t,e,n){const i=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*n+i)/i),a=~~((e+2*n+i)/i),o=t=>~~((t+n)/i);o.invert=t=>t*i-n;o.bitmap=()=>Gz(r,a);o.ratio=i;o.padding=n;o.width=t;o.height=e;return o}function Zz(t,e,n,i){const r=t.width,a=t.height;return function(t){const e=t.datum.datum.items[i].items,n=e.length,o=t.datum.fontSize,s=z_.width(t.datum,t.datum.text);let u=0,l,c,f,h,d,p,m;for(let i=0;i<n;++i){l=e[i].x;f=e[i].y;c=e[i].x2===undefined?l:e[i].x2;h=e[i].y2===undefined?f:e[i].y2;d=(l+c)/2;p=(f+h)/2;m=Math.abs(c-l+h-f);if(m>=u){u=m;t.x=d;t.y=p}}d=s/2;p=o/2;l=t.x-d;c=t.x+d;f=t.y-p;h=t.y+p;t.align="center";if(l<0&&c<=r){t.align="left"}else if(0<=l&&r<c){t.align="right"}t.baseline="middle";if(f<0&&h<=a){t.baseline="top"}else if(0<=f&&a<h){t.baseline="bottom"}return true}}function Qz(t,e,n,i,r,a){let o=n/2;return t-o<0||t+o>r||e-(o=i/2)<0||e+o>a}function tO(t,e,n,i,r,a,o,s){const u=r*a/(i*2),l=t(e-u),c=t(e+u),f=t(n-(a=a/2)),h=t(n+a);return o.outOfBounds(l,f,c,h)||o.getRange(l,f,c,h)||s&&s.getRange(l,f,c,h)}function eO(t,e,n,i){const r=t.width,a=t.height,o=e[0],s=e[1];function u(e,n,i,u,l){const c=t.invert(e),f=t.invert(n);let h=i,d=a,p;if(!Qz(c,f,u,l,r,a)&&!tO(t,c,f,l,u,h,o,s)&&!tO(t,c,f,l,u,l,o,null)){while(d-h>=1){p=(h+d)/2;if(tO(t,c,f,l,u,p,o,s)){d=p}else{h=p}}if(h>i){return[c,f,h,true]}}}return function(e){const s=e.datum.datum.items[i].items,l=s.length,c=e.datum.fontSize,f=z_.width(e.datum,e.datum.text);let h=n?c:0,d=false,p=false,m=0,g,y,v,x,_,b,w,k,M,A,E,D,C,F,S,T,B;for(let i=0;i<l;++i){g=s[i].x;v=s[i].y;y=s[i].x2===undefined?g:s[i].x2;x=s[i].y2===undefined?v:s[i].y2;if(g>y){B=g;g=y;y=B}if(v>x){B=v;v=x;x=B}M=t(g);E=t(y);A=~~((M+E)/2);D=t(v);F=t(x);C=~~((D+F)/2);for(w=A;w>=M;--w){for(k=C;k>=D;--k){T=u(w,k,h,f,c);if(T){[e.x,e.y,h,d]=T}}}for(w=A;w<=E;++w){for(k=C;k<=F;++k){T=u(w,k,h,f,c);if(T){[e.x,e.y,h,d]=T}}}if(!d&&!n){S=Math.abs(y-g+x-v);_=(g+y)/2;b=(v+x)/2;if(S>=m&&!Qz(_,b,f,c,r,a)&&!tO(t,_,b,c,f,c,o,null)){m=S;e.x=_;e.y=b;p=true}}}if(d||p){_=f/2;b=c/2;o.setRange(t(e.x-_),t(e.y-b),t(e.x+_),t(e.y+b));e.align="center";e.baseline="middle";return true}else{return false}}}const nO=[-1,-1,1,1];const iO=[-1,1,-1,1];function rO(t,e,n,i){const r=t.width,a=t.height,o=e[0],s=e[1],u=t.bitmap();return function(e){const l=e.datum.datum.items[i].items,c=l.length,f=e.datum.fontSize,h=z_.width(e.datum,e.datum.text),d=[];let p=n?f:0,m=false,g=false,y=0,v,x,_,b,w,k,M,A,E,D,C,F;for(let i=0;i<c;++i){v=l[i].x;_=l[i].y;x=l[i].x2===undefined?v:l[i].x2;b=l[i].y2===undefined?_:l[i].y2;d.push([t((v+x)/2),t((_+b)/2)]);while(d.length){[M,A]=d.pop();if(o.get(M,A)||s.get(M,A)||u.get(M,A))continue;u.set(M,A);for(let t=0;t<4;++t){w=M+nO[t];k=A+iO[t];if(!u.outOfBounds(w,k,w,k))d.push([w,k])}w=t.invert(M);k=t.invert(A);E=p;D=a;if(!Qz(w,k,h,f,r,a)&&!tO(t,w,k,f,h,E,o,s)&&!tO(t,w,k,f,h,f,o,null)){while(D-E>=1){C=(E+D)/2;if(tO(t,w,k,f,h,C,o,s)){D=C}else{E=C}}if(E>p){e.x=w;e.y=k;p=E;m=true}}}if(!m&&!n){F=Math.abs(x-v+b-_);w=(v+x)/2;k=(_+b)/2;if(F>=y&&!Qz(w,k,h,f,r,a)&&!tO(t,w,k,f,h,f,o,null)){y=F;e.x=w;e.y=k;g=true}}}if(m||g){w=h/2;k=f/2;o.setRange(t(e.x-w),t(e.y-k),t(e.x+w),t(e.y+k));e.align="center";e.baseline="middle";return true}else{return false}}}const aO=["right","center","left"],oO=["bottom","middle","top"];function sO(t,e,n,i){const r=t.width,a=t.height,o=e[0],s=e[1],u=i.length;return function(e){const l=e.boundary,c=e.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>r||l[3]>a){return false}let f=0,h,d,p,m,g,y,v,x,_,b,w,k,M,A,E;for(let r=0;r<u;++r){h=(n[r]&3)-1;d=(n[r]>>>2&3)-1;p=h===0&&d===0||i[r]<0;m=h&&d?Math.SQRT1_2:1;g=i[r]<0?-1:1;y=l[1+h]+i[r]*h*m;w=l[4+d]+g*c*d/2+i[r]*d*m;x=w-c/2;_=w+c/2;k=t(y);A=t(x);E=t(_);if(!f){if(!uO(k,k,A,E,o,s,y,y,x,_,l,p)){continue}else{f=z_.width(e.datum,e.datum.text)}}b=y+g*f*h/2;y=b-f/2;v=b+f/2;k=t(y);M=t(v);if(uO(k,M,A,E,o,s,y,v,x,_,l,p)){e.x=!h?b:h*g<0?v:y;e.y=!d?w:d*g<0?_:x;e.align=aO[h*g+1];e.baseline=oO[d*g+1];o.setRange(k,A,M,E);return true}}return false}}function uO(t,e,n,i,r,a,o,s,u,l,c,f){return!(r.outOfBounds(t,n,e,i)||(f&&a?a.getRange(t,n,e,i)||!lO(o,u,s,l,c):r.getRange(t,n,e,i)))}function lO(t,e,n,i,r){return r[0]<=t&&n<=r[2]&&r[3]<=e&&i<=r[5]}const cO=0,fO=4,hO=8,dO=0,pO=1,mO=2;const gO={"top-left":cO+dO,top:cO+pO,"top-right":cO+mO,left:fO+dO,middle:fO+pO,right:fO+mO,"bottom-left":hO+dO,bottom:hO+pO,"bottom-right":hO+mO};const yO={naive:Zz,"reduced-search":eO,floodfill:rO};function vO(t,e,n,i,r,a,o,s,u,l,c){if(!t.length)return t;const f=Math.max(i.length,r.length),h=xO(i,f),d=_O(r,f),p=bO(t[0].datum),m=p==="group"&&t[0].datum.items[u].marktype,g=m==="area",y=wO(p,m,s,u),v=Kz(e[0],e[1],l),x=g&&c==="naive";const _=t.map((t=>({datum:t,opacity:0,x:undefined,y:undefined,align:undefined,baseline:undefined,boundary:y(t)})));let b;if(!x){if(n){_.sort(((t,e)=>n(t.datum,e.datum)))}let e=false;for(let t=0;t<d.length&&!e;++t){e=d[t]===5||h[t]<0}if(p&&(o||g)){a=[t.map((t=>t.datum))].concat(a)}b=a.length?jz(v,a,e,g):Pz(v,o&&_)}const w=g?yO[c](v,b,o,u):sO(v,b,d,h);_.forEach((t=>t.opacity=+w(t)));return _}function xO(t,e){const n=new Float64Array(e),i=t.length;for(let r=0;r<i;++r)n[r]=t[r]||0;for(let r=i;r<e;++r)n[r]=n[i-1];return n}function _O(t,e){const n=new Int8Array(e),i=t.length;for(let r=0;r<i;++r)n[r]|=gO[t[r]];for(let r=i;r<e;++r)n[r]=n[i-1];return n}function bO(t){return t&&t.mark&&t.mark.marktype}function wO(t,e,n,i){const r=t=>[t.x,t.x,t.x,t.y,t.y,t.y];if(!t){return r}else if(t==="line"||t==="area"){return t=>r(t.datum)}else if(e==="line"){return t=>{const e=t.datum.items[i].items;return r(e.length?e[n==="start"?0:e.length-1]:{x:NaN,y:NaN})}}else{return t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}}}const kO=["x","y","opacity","align","baseline"];const MO=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function AO(t){jo.call(this,null,t)}AO.Definition={type:"Label",metadata:{modifies:true},params:[{name:"size",type:"number",array:true,length:2,required:true},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:true,default:MO},{name:"offset",type:"number",array:true,default:[1]},{name:"padding",type:"number",default:0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:true},{name:"avoidMarks",type:"data",array:true},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:true,length:kO.length,default:kO}]};(0,m.XW)(AO,jo,{transform(t,e){function n(n){const i=t[n];return(0,m.mf)(i)&&e.modified(i.fields)}const i=t.modified();if(!(i||e.changed(e.ADD_REM)||n("sort")))return;if(!t.size||t.size.length!==2){(0,m.vU)("Size parameter should be specified as a [width, height] array.")}const r=t.as||kO;vO(e.materialize(e.SOURCE).source,t.size,t.sort,(0,m.IX)(t.offset||1),(0,m.IX)(t.anchor||MO),t.avoidMarks||[],t.avoidBaseMark===false?false:true,t.lineAnchor||"end",t.markIndex||0,t.padding||0,t.method||"naive").forEach((t=>{const e=t.datum;e[r[0]]=t.x;e[r[1]]=t.y;e[r[2]]=t.opacity;e[r[3]]=t.align;e[r[4]]=t.baseline}));return e.reflow(i).modifies(r)}});function EO(t,e){var n=[],i=function(t){return t(s)},r,a,o,s,u,l;if(e==null){n.push(t)}else{for(r={},a=0,o=t.length;a<o;++a){s=t[a];u=e.map(i);l=r[u];if(!l){r[u]=l=[];l.dims=u;n.push(l)}l.push(s)}}return n}function DO(t){jo.call(this,null,t)}DO.Definition={type:"Loess",metadata:{generates:true},params:[{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"groupby",type:"field",array:true},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:true}]};(0,m.XW)(DO,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=e.materialize(e.SOURCE).source,r=EO(i,t.groupby),a=(t.groupby||[]).map(m.el),o=a.length,s=t.as||[(0,m.el)(t.x),(0,m.el)(t.y)],u=[];r.forEach((e=>{Gs(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let i=0;i<o;++i){n[a[i]]=e.dims[i]}n[s[0]]=t[0];n[s[1]]=t[1];u.push(Ca(n))}))}));if(this.value)n.rem=this.value;this.value=n.add=n.source=u}return n}});const CO={linear:Ls,log:Ps,exp:js,pow:Ws,quad:Xs,poly:$s};const FO=(t,e)=>t==="poly"?e:t==="quad"?2:1;function SO(t){jo.call(this,null,t)}SO.Definition={type:"Regression",metadata:{generates:true},params:[{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"groupby",type:"field",array:true},{name:"method",type:"string",default:"linear",values:Object.keys(CO)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:true,length:2},{name:"params",type:"boolean",default:false},{name:"as",type:"string",array:true}]};(0,m.XW)(SO,jo,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=e.materialize(e.SOURCE).source,r=EO(i,t.groupby),a=(t.groupby||[]).map(m.el),o=t.method||"linear",s=t.order||3,u=FO(o,s),l=t.as||[(0,m.el)(t.x),(0,m.el)(t.y)],c=CO[o],f=[];let h=t.extent;if(!(0,m.nr)(CO,o)){(0,m.vU)("Invalid regression method: "+o)}if(h!=null){if(o==="log"&&h[0]<=0){e.dataflow.warn("Ignoring extent with values <= 0 for log regression.");h=null}}r.forEach((n=>{const i=n.length;if(i<=u){e.dataflow.warn("Skipping regression with more parameters than data points.");return}const r=c(n,t.x,t.y,s);if(t.params){f.push(Ca({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));return}const d=h||(0,m.We)(n,t.x),p=t=>{const e={};for(let i=0;i<a.length;++i){e[a[i]]=n.dims[i]}e[l[0]]=t[0];e[l[1]]=t[1];f.push(Ca(e))};if(o==="linear"){d.forEach((t=>p([t,r.predict(t)])))}else{eu(r.predict,d,25,200).forEach(p)}}));if(this.value)n.rem=this.value;this.value=n.add=n.source=f}return n}});const TO=Math.pow(2,-52);const BO=new Uint32Array(512);class NO{static from(t,e=WO,n=XO){const i=t.length;const r=new Float64Array(i*2);for(let a=0;a<i;a++){const i=t[a];r[2*a]=e(i);r[2*a+1]=n(i)}return new NO(r)}constructor(t){const e=t.length>>1;if(e>0&&typeof t[0]!=="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(n*3);this._halfedges=new Int32Array(n*3);this._hashSize=Math.ceil(Math.sqrt(e));this._hullPrev=new Uint32Array(e);this._hullNext=new Uint32Array(e);this._hullTri=new Uint32Array(e);this._hullHash=new Int32Array(this._hashSize).fill(-1);this._ids=new Uint32Array(e);this._dists=new Float64Array(e);this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this;const a=t.length>>1;let o=Infinity;let s=Infinity;let u=-Infinity;let l=-Infinity;for(let A=0;A<a;A++){const e=t[2*A];const n=t[2*A+1];if(e<o)o=e;if(n<s)s=n;if(e>u)u=e;if(n>l)l=n;this._ids[A]=A}const c=(o+u)/2;const f=(s+l)/2;let h=Infinity;let d,p,m;for(let A=0;A<a;A++){const e=OO(c,f,t[2*A],t[2*A+1]);if(e<h){d=A;h=e}}const g=t[2*d];const y=t[2*d+1];h=Infinity;for(let A=0;A<a;A++){if(A===d)continue;const e=OO(g,y,t[2*A],t[2*A+1]);if(e<h&&e>0){p=A;h=e}}let v=t[2*p];let x=t[2*p+1];let _=Infinity;for(let A=0;A<a;A++){if(A===d||A===p)continue;const e=IO(g,y,v,x,t[2*A],t[2*A+1]);if(e<_){m=A;_=e}}let b=t[2*m];let w=t[2*m+1];if(_===Infinity){for(let i=0;i<a;i++){this._dists[i]=t[2*i]-t[0]||t[2*i+1]-t[1]}PO(this._ids,this._dists,0,a-1);const e=new Uint32Array(a);let n=0;for(let t=0,i=-Infinity;t<a;t++){const r=this._ids[t];if(this._dists[r]>i){e[n++]=r;i=this._dists[r]}}this.hull=e.subarray(0,n);this.triangles=new Uint32Array(0);this.halfedges=new Uint32Array(0);return}if(UO(g,y,v,x,b,w)){const t=p;const e=v;const n=x;p=m;v=b;x=w;m=t;b=e;w=n}const k=LO(g,y,v,x,b,w);this._cx=k.x;this._cy=k.y;for(let A=0;A<a;A++){this._dists[A]=OO(t[2*A],t[2*A+1],k.x,k.y)}PO(this._ids,this._dists,0,a-1);this._hullStart=d;let M=3;n[d]=e[m]=p;n[p]=e[d]=m;n[m]=e[p]=d;i[d]=0;i[p]=1;i[m]=2;r.fill(-1);r[this._hashKey(g,y)]=d;r[this._hashKey(v,x)]=p;r[this._hashKey(b,w)]=m;this.trianglesLen=0;this._addTriangle(d,p,m,-1,-1,-1);for(let A=0,E,D;A<this._ids.length;A++){const a=this._ids[A];const o=t[2*a];const s=t[2*a+1];if(A>0&&Math.abs(o-E)<=TO&&Math.abs(s-D)<=TO)continue;E=o;D=s;if(a===d||a===p||a===m)continue;let u=0;for(let t=0,e=this._hashKey(o,s);t<this._hashSize;t++){u=r[(e+t)%this._hashSize];if(u!==-1&&u!==n[u])break}u=e[u];let l=u,c;while(c=n[l],!UO(o,s,t[2*l],t[2*l+1],t[2*c],t[2*c+1])){l=c;if(l===u){l=-1;break}}if(l===-1)continue;let f=this._addTriangle(l,a,n[l],-1,-1,i[l]);i[a]=this._legalize(f+2);i[l]=f;M++;let h=n[l];while(c=n[h],UO(o,s,t[2*h],t[2*h+1],t[2*c],t[2*c+1])){f=this._addTriangle(h,a,c,i[a],-1,i[h]);i[a]=this._legalize(f+2);n[h]=h;M--;h=c}if(l===u){while(c=e[l],UO(o,s,t[2*c],t[2*c+1],t[2*l],t[2*l+1])){f=this._addTriangle(c,a,l,-1,i[l],i[c]);this._legalize(f+2);i[c]=f;n[l]=l;M--;l=c}}this._hullStart=e[a]=l;n[l]=e[h]=a;n[a]=h;r[this._hashKey(o,s)]=a;r[this._hashKey(t[2*l],t[2*l+1])]=l}this.hull=new Uint32Array(M);for(let A=0,E=this._hullStart;A<M;A++){this.hull[A]=E;E=n[E]}this.triangles=this._triangles.subarray(0,this.trianglesLen);this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(zO(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0;let a=0;while(true){const o=n[t];const s=t-t%3;a=s+(t+2)%3;if(o===-1){if(r===0)break;t=BO[--r];continue}const u=o-o%3;const l=s+(t+1)%3;const c=u+(o+2)%3;const f=e[a];const h=e[t];const d=e[l];const p=e[c];const m=qO(i[2*f],i[2*f+1],i[2*h],i[2*h+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1]);if(m){e[t]=p;e[o]=f;const i=n[c];if(i===-1){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i);this._link(o,n[a]);this._link(a,c);const s=u+(o+1)%3;if(r<BO.length){BO[r++]=s}}else{if(r===0)break;t=BO[--r]}}return a}_link(t,e){this._halfedges[t]=e;if(e!==-1)this._halfedges[e]=t}_addTriangle(t,e,n,i,r,a){const o=this.trianglesLen;this._triangles[o]=t;this._triangles[o+1]=e;this._triangles[o+2]=n;this._link(o,i);this._link(o+1,r);this._link(o+2,a);this.trianglesLen+=3;return o}}function zO(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function OO(t,e,n,i){const r=t-n;const a=e-i;return r*r+a*a}function RO(t,e,n,i,r,a){const o=(i-e)*(r-t);const s=(n-t)*(a-e);return Math.abs(o-s)>=33306690738754716e-32*Math.abs(o+s)?o-s:0}function UO(t,e,n,i,r,a){const o=RO(r,a,t,e,n,i)||RO(t,e,n,i,r,a)||RO(n,i,r,a,t,e);return o<0}function qO(t,e,n,i,r,a,o,s){const u=t-o;const l=e-s;const c=n-o;const f=i-s;const h=r-o;const d=a-s;const p=u*u+l*l;const m=c*c+f*f;const g=h*h+d*d;return u*(f*g-m*d)-l*(c*g-m*h)+p*(c*d-f*h)<0}function IO(t,e,n,i,r,a){const o=n-t;const s=i-e;const u=r-t;const l=a-e;const c=o*o+s*s;const f=u*u+l*l;const h=.5/(o*l-s*u);const d=(l*c-s*f)*h;const p=(o*f-u*c)*h;return d*d+p*p}function LO(t,e,n,i,r,a){const o=n-t;const s=i-e;const u=r-t;const l=a-e;const c=o*o+s*s;const f=u*u+l*l;const h=.5/(o*l-s*u);const d=t+(l*c-s*f)*h;const p=e+(o*f-u*c)*h;return{x:d,y:p}}function PO(t,e,n,i){if(i-n<=20){for(let r=n+1;r<=i;r++){const i=t[r];const a=e[i];let o=r-1;while(o>=n&&e[t[o]]>a)t[o+1]=t[o--];t[o+1]=i}}else{const r=n+i>>1;let a=n+1;let o=i;jO(t,r,a);if(e[t[n]]>e[t[i]])jO(t,n,i);if(e[t[a]]>e[t[i]])jO(t,a,i);if(e[t[n]]>e[t[a]])jO(t,n,a);const s=t[a];const u=e[s];while(true){do{a++}while(e[t[a]]<u);do{o--}while(e[t[o]]>u);if(o<a)break;jO(t,a,o)}t[n+1]=t[o];t[o]=s;if(i-a+1>=o-n){PO(t,e,a,i);PO(t,e,n,o-1)}else{PO(t,e,n,o-1);PO(t,e,a,i)}}}function jO(t,e,n){const i=t[e];t[e]=t[n];t[n]=i}function WO(t){return t[0]}function XO(t){return t[1]}const $O=1e-6;class HO{constructor(){this._x0=this._y0=this._x1=this._y1=null;this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){if(this._x1!==null){this._x1=this._x0,this._y1=this._y0;this._+="Z"}}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){t=+t,e=+e,n=+n;const i=t+n;const r=e;if(n<0)throw new Error("negative radius");if(this._x1===null)this._+=`M${i},${r}`;else if(Math.abs(this._x1-i)>$O||Math.abs(this._y1-r)>$O)this._+="L"+i+","+r;if(!n)return;this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class YO{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class JO{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t;this._circumcenters=new Float64Array(t.points.length*2);this.vectors=new Float64Array(t.points.length*2);this.xmax=i,this.xmin=e;this.ymax=r,this.ymin=n;this._init()}update(){this.delaunay.update();this._init();return this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this;const r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let h=0,d=0,p=n.length,m,g;h<p;h+=3,d+=2){const e=n[h]*2;const i=n[h+1]*2;const a=n[h+2]*2;const o=t[e];const s=t[e+1];const u=t[i];const l=t[i+1];const c=t[a];const f=t[a+1];const p=u-o;const y=l-s;const v=c-o;const x=f-s;const _=p*p+y*y;const b=v*v+x*x;const w=(p*x-y*v)*2;if(!w){m=(o+c)/2-1e8*x;g=(s+f)/2+1e8*v}else if(Math.abs(w)<1e-8){m=(o+c)/2;g=(s+f)/2}else{const t=1/w;m=o+(x*_-y*b)*t;g=s+(p*b-v*_)*t}r[d]=m;r[d+1]=g}let a=e[e.length-1];let o,s=a*4;let u,l=t[2*a];let c,f=t[2*a+1];i.fill(0);for(let h=0;h<e.length;++h){a=e[h];o=s,u=l,c=f;s=a*4,l=t[2*a],f=t[2*a+1];i[o+2]=i[s]=c-f;i[o+3]=i[s+1]=l-u}}render(t){const e=t==null?t=new HO:undefined;const{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:a,vectors:o}=this;if(r.length<=1)return null;for(let l=0,c=n.length;l<c;++l){const e=n[l];if(e<l)continue;const i=Math.floor(l/3)*2;const r=Math.floor(e/3)*2;const o=a[i];const s=a[i+1];const u=a[r];const c=a[r+1];this._renderSegment(o,s,u,c,t)}let s,u=r[r.length-1];for(let l=0;l<r.length;++l){s=u,u=r[l];const e=Math.floor(i[u]/3)*2;const n=a[e];const c=a[e+1];const f=s*4;const h=this._project(n,c,o[f+2],o[f+3]);if(h)this._renderSegment(n,c,h[0],h[1],t)}return e&&e.value()}renderBounds(t){const e=t==null?t=new HO:undefined;t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin);return e&&e.value()}renderCell(t,e){const n=e==null?e=new HO:undefined;const i=this._clip(t);if(i===null||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;while(i[0]===i[r-2]&&i[1]===i[r-1]&&r>1)r-=2;for(let a=2;a<r;a+=2){if(i[a]!==i[a-2]||i[a+1]!==i[a-1])e.lineTo(i[a],i[a+1])}e.closePath();return n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);if(t)t.index=e,yield t}}cellPolygon(t){const e=new YO;this.renderCell(t,e);return e.value()}_renderSegment(t,e,n,i,r){let a;const o=this._regioncode(t,e);const s=this._regioncode(n,i);if(o===0&&s===0){r.moveTo(t,e);r.lineTo(n,i)}else if(a=this._clipSegment(t,e,n,i,o,s)){r.moveTo(a[0],a[1]);r.lineTo(a[2],a[3])}}contains(t,e,n){if((e=+e,e!==e)||(n=+n,n!==n))return false;return this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2){for(let a=0,o=t.length;a<o;a+=2){if(e[i]==t[a]&&e[i+1]==t[a+1]&&e[(i+2)%r]==t[(a+o-2)%o]&&e[(i+3)%r]==t[(a+o-1)%o]){yield n;break t}}}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this;const a=n[t];if(a===-1)return null;const o=[];let s=a;do{const n=Math.floor(s/3);o.push(e[n*2],e[n*2+1]);s=s%3===2?s-2:s+1;if(r[s]!==t)break;s=i[s]}while(s!==a&&s!==-1);return o}_clip(t){if(t===0&&this.delaunay.hull.length===1){return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin]}const e=this._cell(t);if(e===null)return null;const{vectors:n}=this;const i=t*4;return n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let i=null;let r,a,o=e[n-2],s=e[n-1];let u,l=this._regioncode(o,s);let c,f;for(let h=0;h<n;h+=2){r=o,a=s,o=e[h],s=e[h+1];u=l,l=this._regioncode(o,s);if(u===0&&l===0){c=f,f=0;if(i)i.push(o,s);else i=[o,s]}else{let e,n,h,d,p;if(u===0){if((e=this._clipSegment(r,a,o,s,u,l))===null)continue;[n,h,d,p]=e}else{if((e=this._clipSegment(o,s,r,a,l,u))===null)continue;[d,p,n,h]=e;c=f,f=this._edgecode(n,h);if(c&&f)this._edge(t,c,f,i,i.length);if(i)i.push(n,h);else i=[n,h]}c=f,f=this._edgecode(d,p);if(c&&f)this._edge(t,c,f,i,i.length);if(i)i.push(d,p);else i=[d,p]}}if(i){c=f,f=this._edgecode(i[0],i[1]);if(c&&f)this._edge(t,c,f,i,i.length)}else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)){return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin]}return i}_clipSegment(t,e,n,i,r,a){while(true){if(r===0&&a===0)return[t,e,n,i];if(r&a)return null;let o,s,u=r||a;if(u&8)o=t+(n-t)*(this.ymax-e)/(i-e),s=this.ymax;else if(u&4)o=t+(n-t)*(this.ymin-e)/(i-e),s=this.ymin;else if(u&2)s=e+(i-e)*(this.xmax-t)/(n-t),o=this.xmax;else s=e+(i-e)*(this.xmin-t)/(n-t),o=this.xmin;if(r)t=o,e=s,r=this._regioncode(t,e);else n=o,i=s,a=this._regioncode(n,i)}}_clipInfinite(t,e,n,i,r,a){let o=Array.from(e),s;if(s=this._project(o[0],o[1],n,i))o.unshift(s[0],s[1]);if(s=this._project(o[o.length-2],o[o.length-1],r,a))o.push(s[0],s[1]);if(o=this._clipFinite(t,o)){for(let e=0,n=o.length,i,r=this._edgecode(o[n-2],o[n-1]);e<n;e+=2){i=r,r=this._edgecode(o[e],o[e+1]);if(i&&r)e=this._edge(t,i,r,o,e),n=o.length}}else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)){o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]}return o}_edge(t,e,n,i,r){while(e!==n){let n,a;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,a=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,a=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,a=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,a=this.ymin;break}if((i[r]!==n||i[r+1]!==a)&&this.contains(t,n,a)){i.splice(r,0,n,a),r+=2}}if(i.length>4){for(let t=0;t<i.length;t+=2){const e=(t+2)%i.length,n=(t+4)%i.length;if(i[t]===i[e]&&i[e]===i[n]||i[t+1]===i[e+1]&&i[e+1]===i[n+1])i.splice(e,2),t-=2}}return r}_project(t,e,n,i){let r=Infinity,a,o,s;if(i<0){if(e<=this.ymin)return null;if((a=(this.ymin-e)/i)<r)s=this.ymin,o=t+(r=a)*n}else if(i>0){if(e>=this.ymax)return null;if((a=(this.ymax-e)/i)<r)s=this.ymax,o=t+(r=a)*n}if(n>0){if(t>=this.xmax)return null;if((a=(this.xmax-t)/n)<r)o=this.xmax,s=e+(r=a)*i}else if(n<0){if(t<=this.xmin)return null;if((a=(this.xmin-t)/n)<r)o=this.xmin,s=e+(r=a)*i}return[o,s]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const VO=2*Math.PI,GO=Math.pow;function KO(t){return t[0]}function ZO(t){return t[1]}function QO(t){const{triangles:e,coords:n}=t;for(let i=0;i<e.length;i+=3){const t=2*e[i],r=2*e[i+1],a=2*e[i+2],o=(n[a]-n[t])*(n[r+1]-n[t+1])-(n[r]-n[t])*(n[a+1]-n[t+1]);if(o>1e-10)return false}return true}function tR(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class eR{static from(t,e=KO,n=ZO,i){return new eR("length"in t?nR(t,e,n,i):Float64Array.from(iR(t,e,n,i)))}constructor(t){this._delaunator=new NO(t);this.inedges=new Int32Array(t.length/2);this._hullIndex=new Int32Array(t.length/2);this.points=this._delaunator.coords;this._init()}update(){this._delaunator.update();this._init();return this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&QO(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let a=0,o=e.length/2;a<o;++a){const t=tR(e[2*a],e[2*a+1],r);e[2*a]=t[0];e[2*a+1]=t[1]}this._delaunator=new NO(e)}else{delete this.collinear}const n=this.halfedges=this._delaunator.halfedges;const i=this.hull=this._delaunator.hull;const r=this.triangles=this._delaunator.triangles;const a=this.inedges.fill(-1);const o=this._hullIndex.fill(-1);for(let s=0,u=n.length;s<u;++s){const t=r[s%3===2?s-2:s+1];if(n[s]===-1||a[t]===-1)a[t]=s}for(let s=0,u=i.length;s<u;++s){o[i[s]]=s}if(i.length<=2&&i.length>0){this.triangles=new Int32Array(3).fill(-1);this.halfedges=new Int32Array(3).fill(-1);this.triangles[0]=i[0];this.triangles[1]=i[1];this.triangles[2]=i[1];a[i[0]]=1;if(i.length===2)a[i[1]]=0}}voronoi(t){return new JO(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:a,collinear:o}=this;if(o){const e=o.indexOf(t);if(e>0)yield o[e-1];if(e<o.length-1)yield o[e+1];return}const s=e[t];if(s===-1)return;let u=s,l=-1;do{yield l=a[u];u=u%3===2?u-2:u+1;if(a[u]!==t)return;u=r[u];if(u===-1){const e=n[(i[t]+1)%n.length];if(e!==l)yield e;return}}while(u!==s)}find(t,e,n=0){if((t=+t,t!==t)||(e=+e,e!==e))return-1;const i=n;let r;while((r=this._step(n,t,e))>=0&&r!==n&&r!==i)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:a,halfedges:o,triangles:s,points:u}=this;if(i[t]===-1||!u.length)return(t+1)%(u.length>>1);let l=t;let c=GO(e-u[t*2],2)+GO(n-u[t*2+1],2);const f=i[t];let h=f;do{let i=s[h];const f=GO(e-u[i*2],2)+GO(n-u[i*2+1],2);if(f<c)c=f,l=i;h=h%3===2?h-2:h+1;if(s[h]!==t)break;h=o[h];if(h===-1){h=r[(a[t]+1)%r.length];if(h!==i){if(GO(e-u[h*2],2)+GO(n-u[h*2+1],2)<c)return h}break}}while(h!==f);return l}render(t){const e=t==null?t=new HO:undefined;const{points:n,halfedges:i,triangles:r}=this;for(let a=0,o=i.length;a<o;++a){const e=i[a];if(e<a)continue;const o=r[a]*2;const s=r[e]*2;t.moveTo(n[o],n[o+1]);t.lineTo(n[s],n[s+1])}this.renderHull(t);return e&&e.value()}renderPoints(t,e=2){const n=t==null?t=new HO:undefined;const{points:i}=this;for(let r=0,a=i.length;r<a;r+=2){const n=i[r],a=i[r+1];t.moveTo(n+e,a);t.arc(n,a,e,0,VO)}return n&&n.value()}renderHull(t){const e=t==null?t=new HO:undefined;const{hull:n,points:i}=this;const r=n[0]*2,a=n.length;t.moveTo(i[r],i[r+1]);for(let o=1;o<a;++o){const e=2*n[o];t.lineTo(i[e],i[e+1])}t.closePath();return e&&e.value()}hullPolygon(){const t=new YO;this.renderHull(t);return t.value()}renderTriangle(t,e){const n=e==null?e=new HO:undefined;const{points:i,triangles:r}=this;const a=r[t*=3]*2;const o=r[t+1]*2;const s=r[t+2]*2;e.moveTo(i[a],i[a+1]);e.lineTo(i[o],i[o+1]);e.lineTo(i[s],i[s+1]);e.closePath();return n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e){yield this.trianglePolygon(e)}}trianglePolygon(t){const e=new YO;this.renderTriangle(t,e);return e.value()}}function nR(t,e,n,i){const r=t.length;const a=new Float64Array(r*2);for(let o=0;o<r;++o){const r=t[o];a[o*2]=e.call(i,r,o,t);a[o*2+1]=n.call(i,r,o,t)}return a}function*iR(t,e,n,i){let r=0;for(const a of t){yield e.call(i,a,r,t);yield n.call(i,a,r,t);++r}}function rR(t){jo.call(this,null,t)}rR.Definition={type:"Voronoi",metadata:{modifies:true},params:[{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"size",type:"number",array:true,length:2},{name:"extent",type:"array",array:true,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:true,length:2}},{name:"as",type:"string",default:"path"}]};const aR=[-1e5,-1e5,1e5,1e5];(0,m.XW)(rR,jo,{transform(t,e){const n=t.as||"path",i=e.source;if(!i||!i.length)return e;let r=t.size;r=r?[0,0,r[0],r[1]]:(r=t.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:aR;const a=this.value=eR.from(i,t.x,t.y).voronoi(r);for(let o=0,s=i.length;o<s;++o){const t=a.cellPolygon(o);i[o][n]=t?oR(t):null}return e.reflow(t.modified()).modifies(n)}});function oR(t){const e=t[0][0],n=t[0][1];let i=t.length-1;for(;t[i][0]===e&&t[i][1]===n;--i);return"M"+t.slice(0,i+1).join("L")+"Z"}var sR=Math.PI/180,uR=1<<11>>5,lR=1<<11;function cR(){var t=[256,256],e,n,i,r,a,o,s,u=mR,l=[],c=Math.random,f={};f.layout=function(){var u=h(Hf()),f=yR((t[0]>>5)*t[1]),p=null,m=l.length,g=-1,y=[],v=l.map((t=>({text:e(t),font:n(t),style:r(t),weight:a(t),rotate:o(t),size:~~(i(t)+1e-14),padding:s(t),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:false,sprite:null,datum:t}))).sort(((t,e)=>e.size-t.size));while(++g<m){var x=v[g];x.x=t[0]*(c()+.5)>>1;x.y=t[1]*(c()+.5)>>1;fR(u,x,v,g);if(x.hasText&&d(f,x,p)){y.push(x);if(p)dR(p,x);else p=[{x:x.x+x.x0,y:x.y+x.y0},{x:x.x+x.x1,y:x.y+x.y1}];x.x-=t[0]>>1;x.y-=t[1]>>1}}return y};function h(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(uR<<5)/e;t.height=lR/e;var n=t.getContext("2d");n.fillStyle=n.strokeStyle="red";n.textAlign="center";return{context:n,ratio:e}}function d(e,n,i){var r=n.x,a=n.y,o=Math.sqrt(t[0]*t[0]+t[1]*t[1]),s=u(t),l=c()<.5?1:-1,f=-l,h,d,p;while(h=s(f+=l)){d=~~h[0];p=~~h[1];if(Math.min(Math.abs(d),Math.abs(p))>=o)break;n.x=r+d;n.y=a+p;if(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])continue;if(!i||!hR(n,e,t[0])){if(!i||pR(n,i)){var m=n.sprite,g=n.width>>5,y=t[0]>>5,v=n.x-(g<<4),x=v&127,_=32-x,b=n.y1-n.y0,w=(n.y+n.y0)*y+(v>>5),k;for(var M=0;M<b;M++){k=0;for(var A=0;A<=g;A++){e[w+A]|=k<<_|(A<g?(k=m[M*g+A])>>>x:0)}w+=y}n.sprite=null;return true}}}return false}f.words=function(t){if(arguments.length){l=t;return f}else{return l}};f.size=function(e){if(arguments.length){t=[+e[0],+e[1]];return f}else{return t}};f.font=function(t){if(arguments.length){n=vR(t);return f}else{return n}};f.fontStyle=function(t){if(arguments.length){r=vR(t);return f}else{return r}};f.fontWeight=function(t){if(arguments.length){a=vR(t);return f}else{return a}};f.rotate=function(t){if(arguments.length){o=vR(t);return f}else{return o}};f.text=function(t){if(arguments.length){e=vR(t);return f}else{return e}};f.spiral=function(t){if(arguments.length){u=xR[t]||t;return f}else{return u}};f.fontSize=function(t){if(arguments.length){i=vR(t);return f}else{return i}};f.padding=function(t){if(arguments.length){s=vR(t);return f}else{return s}};f.random=function(t){if(arguments.length){c=t;return f}else{return c}};return f}function fR(t,e,n,i){if(e.sprite)return;var r=t.context,a=t.ratio;r.clearRect(0,0,(uR<<5)/a,lR/a);var o=0,s=0,u=0,l=n.length,c,f,h,d,p;--i;while(++i<l){e=n[i];r.save();r.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;c=r.measureText(e.text+"m").width*a;h=e.size<<1;if(e.rotate){var m=Math.sin(e.rotate*sR),g=Math.cos(e.rotate*sR),y=c*g,v=c*m,x=h*g,_=h*m;c=Math.max(Math.abs(y+_),Math.abs(y-_))+31>>5<<5;h=~~Math.max(Math.abs(v+x),Math.abs(v-x))}else{c=c+31>>5<<5}if(h>u)u=h;if(o+c>=uR<<5){o=0;s+=u;u=0}if(s+h>=lR)break;r.translate((o+(c>>1))/a,(s+(h>>1))/a);if(e.rotate)r.rotate(e.rotate*sR);r.fillText(e.text,0,0);if(e.padding){r.lineWidth=2*e.padding;r.strokeText(e.text,0,0)}r.restore();e.width=c;e.height=h;e.xoff=o;e.yoff=s;e.x1=c>>1;e.y1=h>>1;e.x0=-e.x1;e.y0=-e.y1;e.hasText=true;o+=c}var b=r.getImageData(0,0,(uR<<5)/a,lR/a).data,w=[];while(--i>=0){e=n[i];if(!e.hasText)continue;c=e.width;f=c>>5;h=e.y1-e.y0;for(d=0;d<h*f;d++)w[d]=0;o=e.xoff;if(o==null)return;s=e.yoff;var k=0,M=-1;for(p=0;p<h;p++){for(d=0;d<c;d++){var A=f*p+(d>>5),E=b[(s+p)*(uR<<5)+(o+d)<<2]?1<<31-d%32:0;w[A]|=E;k|=E}if(k)M=p;else{e.y0++;h--;p--;s++}}e.y1=e.y0+M;e.sprite=w.slice(0,(e.y1-e.y0)*f)}}function hR(t,e,n){n>>=5;var i=t.sprite,r=t.width>>5,a=t.x-(r<<4),o=a&127,s=32-o,u=t.y1-t.y0,l=(t.y+t.y0)*n+(a>>5),c;for(var f=0;f<u;f++){c=0;for(var h=0;h<=r;h++){if((c<<s|(h<r?(c=i[f*r+h])>>>o:0))&e[l+h])return true}l+=n}return false}function dR(t,e){var n=t[0],i=t[1];if(e.x+e.x0<n.x)n.x=e.x+e.x0;if(e.y+e.y0<n.y)n.y=e.y+e.y0;if(e.x+e.x1>i.x)i.x=e.x+e.x1;if(e.y+e.y1>i.y)i.y=e.y+e.y1}function pR(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function mR(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function gR(t){var e=4,n=e*t[0]/t[1],i=0,r=0;return function(t){var a=t<0?-1:1;switch(Math.sqrt(1+4*a*t)-a&3){case 0:i+=n;break;case 1:r+=e;break;case 2:i-=n;break;default:r-=e;break}return[i,r]}}function yR(t){var e=[],n=-1;while(++n<t)e[n]=0;return e}function vR(t){return typeof t==="function"?t:function(){return t}}var xR={archimedean:mR,rectangular:gR};const _R=["x","y","font","fontSize","fontStyle","fontWeight","angle"];const bR=["text","font","rotate","fontSize","fontStyle","fontWeight"];function wR(t){jo.call(this,cR(),t)}wR.Definition={type:"Wordcloud",metadata:{modifies:true},params:[{name:"size",type:"number",array:true,length:2},{name:"font",type:"string",expr:true,default:"sans-serif"},{name:"fontStyle",type:"string",expr:true,default:"normal"},{name:"fontWeight",type:"string",expr:true,default:"normal"},{name:"fontSize",type:"number",expr:true,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:true,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:true},{name:"as",type:"string",array:true,length:7,default:_R}]};(0,m.XW)(wR,jo,{transform(t,e){if(t.size&&!(t.size[0]&&t.size[1])){(0,m.vU)("Wordcloud size dimensions must be non-zero.")}function n(n){const i=t[n];return(0,m.mf)(i)&&e.modified(i.fields)}const i=t.modified();if(!(i||e.changed(e.ADD_REM)||bR.some(n)))return;const r=e.materialize(e.SOURCE).source,a=this.value,o=t.as||_R;let s=t.fontSize||14,u;(0,m.mf)(s)?u=t.fontSizeRange:s=(0,m.a9)(s);if(u){const t=s,e=sg("sqrt")().domain((0,m.We)(r,t)).range(u);s=n=>e(t(n))}r.forEach((t=>{t[o[0]]=NaN;t[o[1]]=NaN;t[o[3]]=0}));const l=a.words(r).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(s).random(us).layout();const c=a.size(),f=c[0]>>1,h=c[1]>>1,d=l.length;for(let p=0,m,g;p<d;++p){m=l[p];g=m.datum;g[o[0]]=m.x+f;g[o[1]]=m.y+h;g[o[2]]=m.font;g[o[3]]=m.size;g[o[4]]=m.style;g[o[5]]=m.weight;g[o[6]]=m.rotate}return e.reflow(i).modifies(o)}});function kR(t,e){return Array.from(e,(e=>t[e]))}const MR=t=>new Uint8Array(t);const AR=t=>new Uint16Array(t);const ER=t=>new Uint32Array(t);function DR(){let t=8,e=[],n=ER(0),i=FR(0,t),r=FR(0,t);return{data:()=>e,seen:()=>n=CR(n,e.length),add(t){for(let n=0,i=e.length,r=t.length,a;n<r;++n){a=t[n];a._index=i++;e.push(a)}},remove(t,n){const a=e.length,o=Array(a-t),s=e;let u,l,c;for(l=0;!n[l]&&l<a;++l){o[l]=e[l];s[l]=l}for(c=l;l<a;++l){u=e[l];if(!n[l]){s[l]=c;i[c]=i[l];r[c]=r[l];o[c]=u;u._index=c++}else{s[l]=-1}i[l]=0}e=o;return s},size:()=>e.length,curr:()=>i,prev:()=>r,reset:t=>r[t]=i[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){i[t]|=e},clear(t,e){i[t]&=~e},resize(e,n){const a=i.length;if(e>a||n>t){t=Math.max(n,t);i=FR(e,t,i);r=FR(e,t)}}}}function CR(t,e,n){if(t.length>=e)return t;n=n||new t.constructor(e);n.set(t);return n}function FR(t,e,n){const i=(e<257?MR:e<65537?AR:ER)(t);if(n)i.set(n);return i}function SR(t,e,n){const i=1<<e;return{one:i,zero:~i,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd(t,e){const n=this,r=n.bisect(n.range,t.value),a=t.index,o=r[0],s=r[1],u=a.length;let l;for(l=0;l<o;++l)e[a[l]]|=i;for(l=s;l<u;++l)e[a[l]]|=i;return n}}}function TR(){let t=ER(0),e=[],n=0;function i(i,r,a){if(!r.length)return[];const o=n,s=r.length,u=ER(s);let l=Array(s),c,f,h;for(h=0;h<s;++h){l[h]=i(r[h]);u[h]=h}l=BR(l,u);if(o){c=e;f=t;e=Array(o+s);t=ER(o+s);NR(a,c,f,o,l,u,s,e,t)}else{if(a>0)for(h=0;h<s;++h){u[h]+=a}e=l;t=u}n=o+s;return{index:u,value:l}}function r(i,r){const a=n;let o,s,u;for(s=0;!r[t[s]]&&s<a;++s);for(u=s;s<a;++s){if(!r[o=t[s]]){t[u]=o;e[u]=e[s];++u}}n=a-i}function a(e){for(let i=0,r=n;i<r;++i){t[i]=e[t[i]]}}function o(t,i){let r;if(i){r=i.length}else{i=e;r=n}return[Gf(i,t[0],0,r),Vf(i,t[1],0,r)]}return{insert:i,remove:r,bisect:o,reindex:a,index:()=>t,size:()=>n}}function BR(t,e){t.sort.call(e,((e,n)=>{const i=t[e],r=t[n];return i<r?-1:i>r?1:0}));return kR(t,e)}function NR(t,e,n,i,r,a,o,s,u){let l=0,c=0,f;for(f=0;l<i&&c<o;++f){if(e[l]<r[c]){s[f]=e[l];u[f]=n[l++]}else{s[f]=r[c];u[f]=a[c++]+t}}for(;l<i;++l,++f){s[f]=e[l];u[f]=n[l]}for(;c<o;++c,++f){s[f]=r[c];u[f]=a[c]+t}}function zR(t){jo.call(this,DR(),t);this._indices=null;this._dims=null}zR.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:true,required:true},{name:"query",type:"array",array:true,required:true,content:{type:"number",array:true,length:2}}]};(0,m.XW)(zR,jo,{transform(t,e){if(!this._dims){return this.init(t,e)}else{var n=t.modified("fields")||t.fields.some((t=>e.modified(t.fields)));return n?this.reinit(t,e):this.eval(t,e)}},init(t,e){const n=t.fields,i=t.query,r=this._indices={},a=this._dims=[],o=i.length;let s=0,u,l;for(;s<o;++s){u=n[s].fname;l=r[u]||(r[u]=TR());a.push(SR(l,s,i[s]))}return this.eval(t,e)},reinit(t,e){const n=e.materialize().fork(),i=t.fields,r=t.query,a=this._indices,o=this._dims,s=this.value,u=s.curr(),l=s.prev(),c=s.all(),f=n.rem=n.add,h=n.mod,d=r.length,p={};let m,g,y,v,x,_,b,w,k;l.set(u);if(e.rem.length){x=this.remove(t,e,n)}if(e.add.length){s.add(e.add)}if(e.mod.length){_={};for(v=e.mod,b=0,w=v.length;b<w;++b){_[v[b]._index]=1}}for(b=0;b<d;++b){k=i[b];if(!o[b]||t.modified("fields",b)||e.modified(k.fields)){y=k.fname;if(!(m=p[y])){a[y]=g=TR();p[y]=m=g.insert(k,e.source,0)}o[b]=SR(g,b,r[b]).onAdd(m,u)}}for(b=0,w=s.data().length;b<w;++b){if(x[b]){continue}else if(l[b]!==u[b]){f.push(b)}else if(_[b]&&u[b]!==c){h.push(b)}}s.mask=(1<<d)-1;return n},eval(t,e){const n=e.materialize().fork(),i=this._dims.length;let r=0;if(e.rem.length){this.remove(t,e,n);r|=(1<<i)-1}if(t.modified("query")&&!t.modified("fields")){r|=this.update(t,e,n)}if(e.add.length){this.insert(t,e,n);r|=(1<<i)-1}if(e.mod.length){this.modify(e,n);r|=(1<<i)-1}this.value.mask=r;return n},insert(t,e,n){const i=e.add,r=this.value,a=this._dims,o=this._indices,s=t.fields,u={},l=n.add,c=r.size()+i.length,f=a.length;let h=r.size(),d,p,m;r.resize(c,f);r.add(i);const g=r.curr(),y=r.prev(),v=r.all();for(d=0;d<f;++d){p=s[d].fname;m=u[p]||(u[p]=o[p].insert(s[d],i,h));a[d].onAdd(m,g)}for(;h<c;++h){y[h]=v;if(g[h]!==v)l.push(h)}},modify(t,e){const n=e.mod,i=this.value,r=i.curr(),a=i.all(),o=t.mod;let s,u,l;for(s=0,u=o.length;s<u;++s){l=o[s]._index;if(r[l]!==a)n.push(l)}},remove(t,e,n){const i=this._indices,r=this.value,a=r.curr(),o=r.prev(),s=r.all(),u={},l=n.rem,c=e.rem;let f,h,d,p;for(f=0,h=c.length;f<h;++f){d=c[f]._index;u[d]=1;o[d]=p=a[d];a[d]=s;if(p!==s)l.push(d)}for(d in i){i[d].remove(h,u)}this.reindex(e,h,u);return u},reindex(t,e,n){const i=this._indices,r=this.value;t.runAfter((()=>{const t=r.remove(e,n);for(const e in i)i[e].reindex(t)}))},update(t,e,n){const i=this._dims,r=t.query,a=e.stamp,o=i.length;let s=0,u,l;n.filters=0;for(l=0;l<o;++l){if(t.modified("query",l)){u=l;++s}}if(s===1){s=i[u].one;this.incrementOne(i[u],r[u],n.add,n.rem)}else{for(l=0,s=0;l<o;++l){if(!t.modified("query",l))continue;s|=i[l].one;this.incrementAll(i[l],r[l],a,n.add);n.rem=n.add}}return s},incrementAll(t,e,n,i){const r=this.value,a=r.seen(),o=r.curr(),s=r.prev(),u=t.index(),l=t.bisect(t.range),c=t.bisect(e),f=c[0],h=c[1],d=l[0],p=l[1],m=t.one;let g,y,v;if(f<d){for(g=f,y=Math.min(d,h);g<y;++g){v=u[g];if(a[v]!==n){s[v]=o[v];a[v]=n;i.push(v)}o[v]^=m}}else if(f>d){for(g=d,y=Math.min(f,p);g<y;++g){v=u[g];if(a[v]!==n){s[v]=o[v];a[v]=n;i.push(v)}o[v]^=m}}if(h>p){for(g=Math.max(f,p),y=h;g<y;++g){v=u[g];if(a[v]!==n){s[v]=o[v];a[v]=n;i.push(v)}o[v]^=m}}else if(h<p){for(g=Math.max(d,h),y=p;g<y;++g){v=u[g];if(a[v]!==n){s[v]=o[v];a[v]=n;i.push(v)}o[v]^=m}}t.range=e.slice()},incrementOne(t,e,n,i){const r=this.value,a=r.curr(),o=t.index(),s=t.bisect(t.range),u=t.bisect(e),l=u[0],c=u[1],f=s[0],h=s[1],d=t.one;let p,m,g;if(l<f){for(p=l,m=Math.min(f,c);p<m;++p){g=o[p];a[g]^=d;n.push(g)}}else if(l>f){for(p=f,m=Math.min(l,h);p<m;++p){g=o[p];a[g]^=d;i.push(g)}}if(c>h){for(p=Math.max(l,h),m=c;p<m;++p){g=o[p];a[g]^=d;n.push(g)}}else if(c<h){for(p=Math.max(f,c),m=h;p<m;++p){g=o[p];a[g]^=d;i.push(g)}}t.range=e.slice()}});function OR(t){jo.call(this,null,t)}OR.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:true,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:true,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};(0,m.XW)(OR,jo,{transform(t,e){const n=~(t.ignore||0),i=t.filter,r=i.mask;if((r&n)===0)return e.StopPropagation;const a=e.fork(e.ALL),o=i.data(),s=i.curr(),u=i.prev(),l=t=>!(s[t]&n)?o[t]:null;a.filter(a.MOD,l);if(!(r&r-1)){a.filter(a.ADD,l);a.filter(a.REM,(t=>(s[t]&n)===r?o[t]:null))}else{a.filter(a.ADD,(t=>{const e=s[t]&n,i=!e&&e^u[t]&n;return i?o[t]:null}));a.filter(a.REM,(t=>{const e=s[t]&n,i=e&&!(e^(e^u[t]&n));return i?o[t]:null}))}return a.filter(a.SOURCE,(t=>l(t._index)))}});const RR="RawCode";const UR="Literal";const qR="Property";const IR="Identifier";const LR="ArrayExpression";const PR="BinaryExpression";const jR="CallExpression";const WR="ConditionalExpression";const XR="LogicalExpression";const $R="MemberExpression";const HR="ObjectExpression";const YR="UnaryExpression";function JR(t){this.type=t}JR.prototype.visit=function(t){let e,n,i;if(t(this))return 1;for(e=VR(this),n=0,i=e.length;n<i;++n){if(e[n].visit(t))return 1}};function VR(t){switch(t.type){case LR:return t.elements;case PR:case XR:return[t.left,t.right];case jR:return[t.callee].concat(t.arguments);case WR:return[t.test,t.consequent,t.alternate];case $R:return[t.object,t.property];case HR:return t.properties;case qR:return[t.key,t.value];case YR:return[t.argument];case IR:case UR:case RR:default:return[]}}var GR,KR,ZR,QR,tU;var eU=1,nU=2,iU=3,rU=4,aU=5,oU=6,sU=7,uU=8,lU=9;GR={};GR[eU]="Boolean";GR[nU]="<end>";GR[iU]="Identifier";GR[rU]="Keyword";GR[aU]="Null";GR[oU]="Numeric";GR[sU]="Punctuator";GR[uU]="String";GR[lU]="RegularExpression";var cU="ArrayExpression",fU="BinaryExpression",hU="CallExpression",dU="ConditionalExpression",pU="Identifier",mU="Literal",gU="LogicalExpression",yU="MemberExpression",vU="ObjectExpression",xU="Property",_U="UnaryExpression";var bU="Unexpected token %0",wU="Unexpected number",kU="Unexpected string",MU="Unexpected identifier",AU="Unexpected reserved word",EU="Unexpected end of input",DU="Invalid regular expression",CU="Invalid regular expression: missing /",FU="Octal literals are not allowed in strict mode.",SU="Duplicate data property in object literal not allowed in strict mode";var TU="ILLEGAL",BU="Disabled.";var NU=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),zU=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 OU(t,e){if(!t){throw new Error("ASSERT: "+e)}}function RU(t){return t>=48&&t<=57}function UU(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function qU(t){return"01234567".indexOf(t)>=0}function IU(t){return t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function LU(t){return t===10||t===13||t===8232||t===8233}function PU(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&NU.test(String.fromCharCode(t))}function jU(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&zU.test(String.fromCharCode(t))}const WU={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 XU(){while(ZR<QR){const t=KR.charCodeAt(ZR);if(IU(t)||LU(t)){++ZR}else{break}}}function $U(t){var e,n,i,r=0;n=t==="u"?4:2;for(e=0;e<n;++e){if(ZR<QR&&UU(KR[ZR])){i=KR[ZR++];r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())}else{xq({},bU,TU)}}return String.fromCharCode(r)}function HU(){var t,e,n,i;t=KR[ZR];e=0;if(t==="}"){xq({},bU,TU)}while(ZR<QR){t=KR[ZR++];if(!UU(t)){break}e=e*16+"0123456789abcdef".indexOf(t.toLowerCase())}if(e>1114111||t!=="}"){xq({},bU,TU)}if(e<=65535){return String.fromCharCode(e)}n=(e-65536>>10)+55296;i=(e-65536&1023)+56320;return String.fromCharCode(n,i)}function YU(){var t,e;t=KR.charCodeAt(ZR++);e=String.fromCharCode(t);if(t===92){if(KR.charCodeAt(ZR)!==117){xq({},bU,TU)}++ZR;t=$U("u");if(!t||t==="\\"||!PU(t.charCodeAt(0))){xq({},bU,TU)}e=t}while(ZR<QR){t=KR.charCodeAt(ZR);if(!jU(t)){break}++ZR;e+=String.fromCharCode(t);if(t===92){e=e.substr(0,e.length-1);if(KR.charCodeAt(ZR)!==117){xq({},bU,TU)}++ZR;t=$U("u");if(!t||t==="\\"||!jU(t.charCodeAt(0))){xq({},bU,TU)}e+=t}}return e}function JU(){var t,e;t=ZR++;while(ZR<QR){e=KR.charCodeAt(ZR);if(e===92){ZR=t;return YU()}if(jU(e)){++ZR}else{break}}return KR.slice(t,ZR)}function VU(){var t,e,n;t=ZR;e=KR.charCodeAt(ZR)===92?YU():JU();if(e.length===1){n=iU}else if(WU.hasOwnProperty(e)){n=rU}else if(e==="null"){n=aU}else if(e==="true"||e==="false"){n=eU}else{n=iU}return{type:n,value:e,start:t,end:ZR}}function GU(){var t=ZR,e=KR.charCodeAt(ZR),n,i=KR[ZR],r,a,o;switch(e){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:++ZR;return{type:sU,value:String.fromCharCode(e),start:t,end:ZR};default:n=KR.charCodeAt(ZR+1);if(n===61){switch(e){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:ZR+=2;return{type:sU,value:String.fromCharCode(e)+String.fromCharCode(n),start:t,end:ZR};case 33:case 61:ZR+=2;if(KR.charCodeAt(ZR)===61){++ZR}return{type:sU,value:KR.slice(t,ZR),start:t,end:ZR}}}}o=KR.substr(ZR,4);if(o===">>>="){ZR+=4;return{type:sU,value:o,start:t,end:ZR}}a=o.substr(0,3);if(a===">>>"||a==="<<="||a===">>="){ZR+=3;return{type:sU,value:a,start:t,end:ZR}}r=a.substr(0,2);if(i===r[1]&&"+-<>&|".indexOf(i)>=0||r==="=>"){ZR+=2;return{type:sU,value:r,start:t,end:ZR}}if(r==="//"){xq({},bU,TU)}if("<>=!+-*%&|^/".indexOf(i)>=0){++ZR;return{type:sU,value:i,start:t,end:ZR}}xq({},bU,TU)}function KU(t){let e="";while(ZR<QR){if(!UU(KR[ZR])){break}e+=KR[ZR++]}if(e.length===0){xq({},bU,TU)}if(PU(KR.charCodeAt(ZR))){xq({},bU,TU)}return{type:oU,value:parseInt("0x"+e,16),start:t,end:ZR}}function ZU(t){let e="0"+KR[ZR++];while(ZR<QR){if(!qU(KR[ZR])){break}e+=KR[ZR++]}if(PU(KR.charCodeAt(ZR))||RU(KR.charCodeAt(ZR))){xq({},bU,TU)}return{type:oU,value:parseInt(e,8),octal:true,start:t,end:ZR}}function QU(){var t,e,n;n=KR[ZR];OU(RU(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point");e=ZR;t="";if(n!=="."){t=KR[ZR++];n=KR[ZR];if(t==="0"){if(n==="x"||n==="X"){++ZR;return KU(e)}if(qU(n)){return ZU(e)}if(n&&RU(n.charCodeAt(0))){xq({},bU,TU)}}while(RU(KR.charCodeAt(ZR))){t+=KR[ZR++]}n=KR[ZR]}if(n==="."){t+=KR[ZR++];while(RU(KR.charCodeAt(ZR))){t+=KR[ZR++]}n=KR[ZR]}if(n==="e"||n==="E"){t+=KR[ZR++];n=KR[ZR];if(n==="+"||n==="-"){t+=KR[ZR++]}if(RU(KR.charCodeAt(ZR))){while(RU(KR.charCodeAt(ZR))){t+=KR[ZR++]}}else{xq({},bU,TU)}}if(PU(KR.charCodeAt(ZR))){xq({},bU,TU)}return{type:oU,value:parseFloat(t),start:e,end:ZR}}function tq(){var t="",e,n,i,r,a=false;e=KR[ZR];OU(e==="'"||e==='"',"String literal must starts with a quote");n=ZR;++ZR;while(ZR<QR){i=KR[ZR++];if(i===e){e="";break}else if(i==="\\"){i=KR[ZR++];if(!i||!LU(i.charCodeAt(0))){switch(i){case"u":case"x":if(KR[ZR]==="{"){++ZR;t+=HU()}else{t+=$U(i)}break;case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:if(qU(i)){r="01234567".indexOf(i);if(r!==0){a=true}if(ZR<QR&&qU(KR[ZR])){a=true;r=r*8+"01234567".indexOf(KR[ZR++]);if("0123".indexOf(i)>=0&&ZR<QR&&qU(KR[ZR])){r=r*8+"01234567".indexOf(KR[ZR++])}}t+=String.fromCharCode(r)}else{t+=i}break}}else{if(i==="\r"&&KR[ZR]==="\n"){++ZR}}}else if(LU(i.charCodeAt(0))){break}else{t+=i}}if(e!==""){xq({},bU,TU)}return{type:uU,value:t,octal:a,start:n,end:ZR}}function eq(t,e){let n=t;if(e.indexOf("u")>=0){n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111){return"x"}xq({},DU)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{new RegExp(n)}catch(i){xq({},DU)}try{return new RegExp(t,e)}catch(r){return null}}function nq(){var t,e,n,i,r;t=KR[ZR];OU(t==="/","Regular expression literal must start with a slash");e=KR[ZR++];n=false;i=false;while(ZR<QR){t=KR[ZR++];e+=t;if(t==="\\"){t=KR[ZR++];if(LU(t.charCodeAt(0))){xq({},CU)}e+=t}else if(LU(t.charCodeAt(0))){xq({},CU)}else if(n){if(t==="]"){n=false}}else{if(t==="/"){i=true;break}else if(t==="["){n=true}}}if(!i){xq({},CU)}r=e.substr(1,e.length-2);return{value:r,literal:e}}function iq(){var t,e,n;e="";n="";while(ZR<QR){t=KR[ZR];if(!jU(t.charCodeAt(0))){break}++ZR;if(t==="\\"&&ZR<QR){xq({},bU,TU)}else{n+=t;e+=t}}if(n.search(/[^gimuy]/g)>=0){xq({},DU,n)}return{value:n,literal:e}}function rq(){var t,e,n,i;tU=null;XU();t=ZR;e=nq();n=iq();i=eq(e.value,n.value);return{literal:e.literal+n.literal,value:i,regex:{pattern:e.value,flags:n.value},start:t,end:ZR}}function aq(t){return t.type===iU||t.type===rU||t.type===eU||t.type===aU}function oq(){XU();if(ZR>=QR){return{type:nU,start:ZR,end:ZR}}const t=KR.charCodeAt(ZR);if(PU(t)){return VU()}if(t===40||t===41||t===59){return GU()}if(t===39||t===34){return tq()}if(t===46){if(RU(KR.charCodeAt(ZR+1))){return QU()}return GU()}if(RU(t)){return QU()}return GU()}function sq(){const t=tU;ZR=t.end;tU=oq();ZR=t.end;return t}function uq(){const t=ZR;tU=oq();ZR=t}function lq(t){const e=new JR(cU);e.elements=t;return e}function cq(t,e,n){const i=new JR(t==="||"||t==="&&"?gU:fU);i.operator=t;i.left=e;i.right=n;return i}function fq(t,e){const n=new JR(hU);n.callee=t;n.arguments=e;return n}function hq(t,e,n){const i=new JR(dU);i.test=t;i.consequent=e;i.alternate=n;return i}function dq(t){const e=new JR(pU);e.name=t;return e}function pq(t){const e=new JR(mU);e.value=t.value;e.raw=KR.slice(t.start,t.end);if(t.regex){if(e.raw==="//"){e.raw="/(?:)/"}e.regex=t.regex}return e}function mq(t,e,n){const i=new JR(yU);i.computed=t==="[";i.object=e;i.property=n;if(!i.computed)n.member=true;return i}function gq(t){const e=new JR(vU);e.properties=t;return e}function yq(t,e,n){const i=new JR(xU);i.key=e;i.value=n;i.kind=t;return i}function vq(t,e){const n=new JR(_U);n.operator=t;n.argument=e;n.prefix=true;return n}function xq(t,e){var n,i=Array.prototype.slice.call(arguments,2),r=e.replace(/%(\d)/g,((t,e)=>{OU(e<i.length,"Message reference must be in range");return i[e]}));n=new Error(r);n.index=ZR;n.description=r;throw n}function _q(t){if(t.type===nU){xq(t,EU)}if(t.type===oU){xq(t,wU)}if(t.type===uU){xq(t,kU)}if(t.type===iU){xq(t,MU)}if(t.type===rU){xq(t,AU)}xq(t,bU,t.value)}function bq(t){const e=sq();if(e.type!==sU||e.value!==t){_q(e)}}function wq(t){return tU.type===sU&&tU.value===t}function kq(t){return tU.type===rU&&tU.value===t}function Mq(){const t=[];ZR=tU.start;bq("[");while(!wq("]")){if(wq(",")){sq();t.push(null)}else{t.push(Lq());if(!wq("]")){bq(",")}}}sq();return lq(t)}function Aq(){ZR=tU.start;const t=sq();if(t.type===uU||t.type===oU){if(t.octal){xq(t,FU)}return pq(t)}return dq(t.value)}function Eq(){var t,e,n,i;ZR=tU.start;t=tU;if(t.type===iU){n=Aq();bq(":");i=Lq();return yq("init",n,i)}if(t.type===nU||t.type===sU){_q(t)}else{e=Aq();bq(":");i=Lq();return yq("init",e,i)}}function Dq(){var t=[],e,n,i,r={},a=String;ZR=tU.start;bq("{");while(!wq("}")){e=Eq();if(e.key.type===pU){n=e.key.name}else{n=a(e.key.value)}i="$"+n;if(Object.prototype.hasOwnProperty.call(r,i)){xq({},SU)}else{r[i]=true}t.push(e);if(!wq("}")){bq(",")}}bq("}");return gq(t)}function Cq(){bq("(");const t=Pq();bq(")");return t}const Fq={if:1};function Sq(){var t,e,n;if(wq("(")){return Cq()}if(wq("[")){return Mq()}if(wq("{")){return Dq()}t=tU.type;ZR=tU.start;if(t===iU||Fq[tU.value]){n=dq(sq().value)}else if(t===uU||t===oU){if(tU.octal){xq(tU,FU)}n=pq(sq())}else if(t===rU){throw new Error(BU)}else if(t===eU){e=sq();e.value=e.value==="true";n=pq(e)}else if(t===aU){e=sq();e.value=null;n=pq(e)}else if(wq("/")||wq("/=")){n=pq(rq());uq()}else{_q(sq())}return n}function Tq(){const t=[];bq("(");if(!wq(")")){while(ZR<QR){t.push(Lq());if(wq(")")){break}bq(",")}}bq(")");return t}function Bq(){ZR=tU.start;const t=sq();if(!aq(t)){_q(t)}return dq(t.value)}function Nq(){bq(".");return Bq()}function zq(){bq("[");const t=Pq();bq("]");return t}function Oq(){var t,e,n;t=Sq();for(;;){if(wq(".")){n=Nq();t=mq(".",t,n)}else if(wq("(")){e=Tq();t=fq(t,e)}else if(wq("[")){n=zq();t=mq("[",t,n)}else{break}}return t}function Rq(){const t=Oq();if(tU.type===sU){if(wq("++")||wq("--")){throw new Error(BU)}}return t}function Uq(){var t,e;if(tU.type!==sU&&tU.type!==rU){e=Rq()}else if(wq("++")||wq("--")){throw new Error(BU)}else if(wq("+")||wq("-")||wq("~")||wq("!")){t=sq();e=Uq();e=vq(t.value,e)}else if(kq("delete")||kq("void")||kq("typeof")){throw new Error(BU)}else{e=Rq()}return e}function qq(t){let e=0;if(t.type!==sU&&t.type!==rU){return 0}switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function Iq(){var t,e,n,i,r,a,o,s,u,l;t=tU;u=Uq();i=tU;r=qq(i);if(r===0){return u}i.prec=r;sq();e=[t,tU];o=Uq();a=[u,i,o];while((r=qq(tU))>0){while(a.length>2&&r<=a[a.length-2].prec){o=a.pop();s=a.pop().value;u=a.pop();e.pop();n=cq(s,u,o);a.push(n)}i=sq();i.prec=r;a.push(i);e.push(tU);n=Uq();a.push(n)}l=a.length-1;n=a[l];e.pop();while(l>1){e.pop();n=cq(a[l-1].value,a[l-2],n);l-=2}return n}function Lq(){var t,e,n;t=Iq();if(wq("?")){sq();e=Lq();bq(":");n=Lq();t=hq(t,e,n)}return t}function Pq(){const t=Lq();if(wq(",")){throw new Error(BU)}return t}function jq(t){KR=t;ZR=0;QR=KR.length;tU=null;uq();const e=Pq();if(tU.type!==nU){throw new Error("Unexpect token after expression.")}return e}var Wq={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 Xq(t){function e(e,n,i,r){let a=t(n[0]);if(i){a=i+"("+a+")";if(i.lastIndexOf("new ",0)===0)a="("+a+")"}return a+"."+e+(r<0?"":r===0?"()":"("+n.slice(1).map(t).join(",")+")")}function n(t,n,i){return r=>e(t,r,n,i)}const i="new Date",r="String",a="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",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(e){if(e.length<3)(0,m.vU)("Missing arguments to clamp function.");if(e.length>3)(0,m.vU)("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:a,test:n("test",a),if:function(e){if(e.length<3)(0,m.vU)("Missing arguments to if function.");if(e.length>3)(0,m.vU)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function $q(t){const e=t&&t.length-1;return e&&(t[0]==='"'&&t[e]==='"'||t[0]==="'"&&t[e]==="'")?t.slice(1,-1):t}function Hq(t){t=t||{};const e=t.allowed?(0,m.Rg)(t.allowed):{},n=t.forbidden?(0,m.Rg)(t.forbidden):{},i=t.constants||Wq,r=(t.functions||Xq)(f),a=t.globalvar,o=t.fieldvar,s=(0,m.mf)(a)?a:t=>"".concat(a,'["').concat(t,'"]');let u={},l={},c=0;function f(t){if((0,m.HD)(t))return t;const e=h[t.type];if(e==null)(0,m.vU)("Unsupported type: "+t.type);return e(t)}const h={Literal:t=>t.raw,Identifier:t=>{const r=t.name;if(c>0){return r}else if((0,m.nr)(n,r)){return(0,m.vU)("Illegal identifier: "+r)}else if((0,m.nr)(i,r)){return i[r]}else if((0,m.nr)(e,r)){return r}else{u[r]=1;return s(r)}},MemberExpression:t=>{const e=!t.computed,n=f(t.object);if(e)c+=1;const i=f(t.property);if(n===o){l[$q(i)]=1}if(e)c-=1;return n+(e?"."+i:"["+i+"]")},CallExpression:t=>{if(t.callee.type!=="Identifier"){(0,m.vU)("Illegal callee type: "+t.callee.type)}const e=t.callee.name,n=t.arguments,i=(0,m.nr)(r,e)&&r[e];if(!i)(0,m.vU)("Unrecognized function: "+e);return(0,m.mf)(i)?i(n):i+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+" "+t.operator+" "+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{c+=1;const e=f(t.key);c-=1;return e+":"+f(t.value)}};function d(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(l)};u={};l={};return e}d.functions=r;d.constants=i;return d}var Yq=new uE;var Jq=new uE,Vq,Gq,Kq,Zq,Qq;var tI={point:RE,lineStart:RE,lineEnd:RE,polygonStart:function(){Yq=new uE;tI.lineStart=eI;tI.lineEnd=nI},polygonEnd:function(){var t=+Yq;Jq.add(t<0?gE+t:t);this.lineStart=this.lineEnd=this.point=RE},sphere:function(){Jq.add(gE)}};function eI(){tI.point=iI}function nI(){rI(Vq,Gq)}function iI(t,e){tI.point=rI;Vq=t,Gq=e;t*=vE,e*=vE;Kq=t,Zq=wE(e=e/2+mE),Qq=FE(e)}function rI(t,e){t*=vE,e*=vE;e=e/2+mE;var n=t-Kq,i=n>=0?1:-1,r=i*n,a=wE(e),o=FE(e),s=Qq*o,u=Zq*a+s*wE(r),l=s*i*FE(r);Yq.add(bE(l,u));Kq=t,Zq=a,Qq=o}function aI(t){Jq=new uE;sE(t,tI);return Jq*2}var oI,sI,uI,lI,cI,fI,hI,dI,pI,mI,gI;var yI={point:vI,lineStart:_I,lineEnd:bI,polygonStart:function(){yI.point=wI;yI.lineStart=kI;yI.lineEnd=MI;pI=new uE;tI.polygonStart()},polygonEnd:function(){tI.polygonEnd();yI.point=vI;yI.lineStart=_I;yI.lineEnd=bI;if(Yq<0)oI=-(uI=180),sI=-(lI=90);else if(pI>fE)lI=90;else if(pI<-fE)sI=-90;gI[0]=oI,gI[1]=uI},sphere:function(){oI=-(uI=180),sI=-(lI=90)}};function vI(t,e){mI.push(gI=[oI=t,uI=t]);if(e<sI)sI=e;if(e>lI)lI=e}function xI(t,e){var n=HD([t*vE,e*vE]);if(dI){var i=JD(dI,n),r=[i[1],-i[0],0],a=JD(r,i);KD(a);a=$D(a);var o=t-cI,s=o>0?1:-1,u=a[0]*yE*s,l,c=xE(o)>180;if(c^(s*cI<u&&u<s*t)){l=a[1]*yE;if(l>lI)lI=l}else if(u=(u+360)%360-180,c^(s*cI<u&&u<s*t)){l=-a[1]*yE;if(l<sI)sI=l}else{if(e<sI)sI=e;if(e>lI)lI=e}if(c){if(t<cI){if(AI(oI,t)>AI(oI,uI))uI=t}else{if(AI(t,uI)>AI(oI,uI))oI=t}}else{if(uI>=oI){if(t<oI)oI=t;if(t>uI)uI=t}else{if(t>cI){if(AI(oI,t)>AI(oI,uI))uI=t}else{if(AI(t,uI)>AI(oI,uI))oI=t}}}}else{mI.push(gI=[oI=t,uI=t])}if(e<sI)sI=e;if(e>lI)lI=e;dI=n,cI=t}function _I(){yI.point=xI}function bI(){gI[0]=oI,gI[1]=uI;yI.point=vI;dI=null}function wI(t,e){if(dI){var n=t-cI;pI.add(xE(n)>180?n+(n>0?360:-360):n)}else{fI=t,hI=e}tI.point(t,e);xI(t,e)}function kI(){tI.lineStart()}function MI(){wI(fI,hI);tI.lineEnd();if(xE(pI)>fE)oI=-(uI=180);gI[0]=oI,gI[1]=uI;dI=null}function AI(t,e){return(e-=t)<0?e+360:e}function EI(t,e){return t[0]-e[0]}function DI(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function CI(t){var e,n,i,r,a,o,s;lI=uI=-(oI=sI=Infinity);mI=[];sE(t,yI);if(n=mI.length){mI.sort(EI);for(e=1,i=mI[0],a=[i];e<n;++e){r=mI[e];if(DI(i,r[0])||DI(i,r[1])){if(AI(i[0],r[1])>AI(i[0],i[1]))i[1]=r[1];if(AI(r[0],i[1])>AI(i[0],i[1]))i[0]=r[0]}else{a.push(i=r)}}for(o=-Infinity,n=a.length-1,e=0,i=a[n];e<=n;i=r,++e){r=a[e];if((s=AI(i[1],r[0]))>o)o=s,oI=r[0],uI=i[1]}}mI=gI=null;return oI===Infinity||sI===Infinity?[[NaN,NaN],[NaN,NaN]]:[[oI,sI],[uI,lI]]}var FI,SI,TI,BI,NI,zI,OI,RI,UI,qI,II,LI,PI,jI,WI,XI;var $I={sphere:RE,point:HI,lineStart:JI,lineEnd:KI,polygonStart:function(){$I.lineStart=ZI;$I.lineEnd=QI},polygonEnd:function(){$I.lineStart=JI;$I.lineEnd=KI}};function HI(t,e){t*=vE,e*=vE;var n=wE(e);YI(n*wE(t),n*FE(t),FE(e))}function YI(t,e,n){++FI;TI+=(t-TI)/FI;BI+=(e-BI)/FI;NI+=(n-NI)/FI}function JI(){$I.point=VI}function VI(t,e){t*=vE,e*=vE;var n=wE(e);jI=n*wE(t);WI=n*FE(t);XI=FE(e);$I.point=GI;YI(jI,WI,XI)}function GI(t,e){t*=vE,e*=vE;var n=wE(e),i=n*wE(t),r=n*FE(t),a=FE(e),o=bE(TE((o=WI*a-XI*r)*o+(o=XI*i-jI*a)*o+(o=jI*r-WI*i)*o),jI*i+WI*r+XI*a);SI+=o;zI+=o*(jI+(jI=i));OI+=o*(WI+(WI=r));RI+=o*(XI+(XI=a));YI(jI,WI,XI)}function KI(){$I.point=HI}function ZI(){$I.point=tL}function QI(){eL(LI,PI);$I.point=HI}function tL(t,e){LI=t,PI=e;t*=vE,e*=vE;$I.point=eL;var n=wE(e);jI=n*wE(t);WI=n*FE(t);XI=FE(e);YI(jI,WI,XI)}function eL(t,e){t*=vE,e*=vE;var n=wE(e),i=n*wE(t),r=n*FE(t),a=FE(e),o=WI*a-XI*r,s=XI*i-jI*a,u=jI*r-WI*i,l=EE(o,s,u),c=zE(l),f=l&&-c/l;UI.add(f*o);qI.add(f*s);II.add(f*u);SI+=c;zI+=c*(jI+(jI=i));OI+=c*(WI+(WI=r));RI+=c*(XI+(XI=a));YI(jI,WI,XI)}function nL(t){FI=SI=TI=BI=NI=zI=OI=RI=0;UI=new uE;qI=new uE;II=new uE;sE(t,$I);var e=+UI,n=+qI,i=+II,r=EE(e,n,i);if(r<hE){e=zI,n=OI,i=RI;if(SI<fE)e=TI,n=BI,i=NI;r=EE(e,n,i);if(r<hE)return[NaN,NaN]}return[bE(n,e)*yE,zE(i/r)*yE]}function iL(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function rL(t){let e=t;let n=t;if(t.length===1){e=(e,n)=>t(e)-n;n=aL(t)}function i(t,e,i,r){if(i==null)i=0;if(r==null)r=t.length;while(i<r){const a=i+r>>>1;if(n(t[a],e)<0)i=a+1;else r=a}return i}function r(t,e,i,r){if(i==null)i=0;if(r==null)r=t.length;while(i<r){const a=i+r>>>1;if(n(t[a],e)>0)r=a;else i=a+1}return i}function a(t,n,r,a){if(r==null)r=0;if(a==null)a=t.length;const o=i(t,n,r,a-1);return o>r&&e(t[o-1],n)>-e(t[o],n)?o-1:o}return{left:i,center:a,right:r}}function aL(t){return(e,n)=>iL(t(e),n)}const oL="intersect";const sL="union";const uL="vlMulti";const lL="vlPoint";const cL="or";const fL="and";const hL="_vgsid_",dL="E",pL="R",mL="R-E",gL="R-LE",yL="R-RE",vL="index:unit";function xL(t,e){var n=e.fields,i=e.values,r=n.length,a=0,o,s;for(;a<r;++a){s=n[a];s.getter=m.EP.getter||(0,m.EP)(s.field);o=s.getter(t);if((0,m.J_)(o))o=(0,m.He)(o);if((0,m.J_)(i[a]))i[a]=(0,m.He)(i[a]);if((0,m.J_)(i[a][0]))i[a]=i[a].map(m.He);if(s.type===dL){if((0,m.kJ)(i[a])?i[a].indexOf(o)<0:o!==i[a]){return false}}else{if(s.type===pL){if(!(0,m.u5)(o,i[a]))return false}else if(s.type===yL){if(!(0,m.u5)(o,i[a],true,false))return false}else if(s.type===mL){if(!(0,m.u5)(o,i[a],false,false))return false}else if(s.type===gL){if(!(0,m.u5)(o,i[a],false,true))return false}}}return true}function _L(t,e,n){var i=this.context.data[t],r=i?i.values.value:[],a=i?i[vL]&&i[vL].value:undefined,o=n===oL,s=r.length,u=0,l,c,f,h,d;for(;u<s;++u){l=r[u];if(a&&o){c=c||{};f=c[h=l.unit]||0;if(f===-1)continue;d=xL(e,l);c[h]=d?-1:++f;if(d&&a.size===1)return true;if(!d&&f===a.get(h).count)return false}else{d=xL(e,l);if(o^d)return d}}return s&&o}const bL=(0,m.EP)(hL),wL=rL(bL),kL=wL.left,ML=wL.right;function AL(t,e,n){const i=this.context.data[t],r=i?i.values.value:[],a=i?i[vL]&&i[vL].value:undefined,o=n===oL,s=bL(e),u=kL(r,s);if(u===r.length)return false;if(bL(r[u])!==s)return false;if(a&&o){if(a.size===1)return true;if(ML(r,s)-u<a.size)return false}return true}function EL(t,e){return t.map((t=>(0,m.l7)({values:e.fields.map((e=>(e.getter||(e.getter=(0,m.EP)(e.field)))(t.datum)))},e)))}function DL(t,e,n,i){var r=this.context.data[t],a=r?r.values.value:[],o={},s={},u={},l,c,f,h,d,p,g,y,v,x=a.length,_=0,b,w;for(;_<x;++_){l=a[_];h=l.unit;c=l.fields;f=l.values;for(b=0,w=c.length;b<w;++b){d=c[b];p=o[d.field]||(o[d.field]={});g=p[h]||(p[h]=[]);u[d.field]=y=d.type.charAt(0);v=CL[y+"_union"];p[h]=v(g,(0,m.IX)(f[b]))}if(n){g=s[h]||(s[h]=[]);g.push((0,m.IX)(f).reduce(((t,e,n)=>(t[c[n].field]=e,t)),{}))}}e=e||sL;Object.keys(o).forEach((t=>{o[t]=Object.keys(o[t]).map((e=>o[t][e])).reduce(((n,i)=>n===undefined?i:CL[u[t]+"_"+e](n,i)))}));a=Object.keys(s);if(n&&a.length){const t=i?lL:uL;o[t]=e===sL?{[cL]:a.reduce(((t,e)=>(t.push(...s[e]),t)),[])}:{[fL]:a.map((t=>({[cL]:s[t]})))}}return o}var CL={E_union:function(t,e){if(!t.length)return e;var n=0,i=e.length;for(;n<i;++n)if(t.indexOf(e[n])<0)t.push(e[n]);return t},E_intersect:function(t,e){return!t.length?e:t.filter((t=>e.indexOf(t)>=0))},R_union:function(t,e){var n=(0,m.He)(e[0]),i=(0,m.He)(e[1]);if(n>i){n=e[1];i=e[0]}if(!t.length)return[n,i];if(t[0]>n)t[0]=n;if(t[1]<i)t[1]=i;return t},R_intersect:function(t,e){var n=(0,m.He)(e[0]),i=(0,m.He)(e[1]);if(n>i){n=e[1];i=e[0]}if(!t.length)return[n,i];if(i<t[0]||t[1]<n){return[]}else{if(t[0]<n)t[0]=n;if(t[1]>i)t[1]=i}return t}};const FL=":",SL="@";function TL(t,e,n,i){if(e[0].type!==UR)(0,m.vU)("First argument to selection functions must be a string literal.");const r=e[0].value,a=e.length>=2&&(0,m.fj)(e).value,o="unit",s=SL+o,u=FL+r;if(a===oL&&!(0,m.nr)(i,s)){i[s]=n.getData(r).indataRef(n,o)}if(!(0,m.nr)(i,u)){i[u]=n.getData(r).tuplesRef()}}function BL(t){const e=this.context.data[t];return e?e.values.value:[]}function NL(t,e,n){const i=this.context.data[t]["index:"+e],r=i?i.value.get(n):undefined;return r?r.count:r}function zL(t,e){const n=this.context.dataflow,i=this.context.data[t],r=i.input;n.pulse(r,n.changeset().remove(m.yb).insert(e));return 1}function OL(t,e,n){if(t){const n=this.context.dataflow,i=t.mark.source;n.pulse(i,n.changeset().encode(t,e))}return n!==undefined?n:t}const RL=t=>function(e,n){const i=this.context.dataflow.locale();return i[t](n)(e)};const UL=RL("format");const qL=RL("timeFormat");const IL=RL("utcFormat");const LL=RL("timeParse");const PL=RL("utcParse");const jL=new Date(2e3,0,1);function WL(t,e,n){if(!Number.isInteger(t)||!Number.isInteger(e))return"";jL.setYear(2e3);jL.setMonth(t);jL.setDate(e);return qL.call(this,jL,n)}function XL(t){return WL.call(this,t,1,"%B")}function $L(t){return WL.call(this,t,1,"%b")}function HL(t){return WL.call(this,0,2+t,"%A")}function YL(t){return WL.call(this,0,2+t,"%a")}const JL=":";const VL="@";const GL="%";const KL="$";function ZL(t,e,n,i){if(e[0].type!==UR){(0,m.vU)("First argument to data functions must be a string literal.")}const r=e[0].value,a=JL+r;if(!(0,m.nr)(a,i)){try{i[a]=n.getData(r).tuplesRef()}catch(o){}}}function QL(t,e,n,i){if(e[0].type!==UR)(0,m.vU)("First argument to indata must be a string literal.");if(e[1].type!==UR)(0,m.vU)("Second argument to indata must be a string literal.");const r=e[0].value,a=e[1].value,o=VL+a;if(!(0,m.nr)(o,i)){i[o]=n.getData(r).indataRef(n,a)}}function tP(t,e,n,i){if(e[0].type===UR){eP(n,i,e[0].value)}else{for(t in n.scales){eP(n,i,t)}}}function eP(t,e,n){const i=GL+n;if(!(0,m.nr)(e,i)){try{e[i]=t.scaleRef(n)}catch(r){}}}function nP(t,e){let n;return(0,m.mf)(t)?t:(0,m.HD)(t)?(n=e.scales[t])&&n.value:undefined}function iP(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0;n._bandwidth=tP;n._range=tP;n._scale=tP;const i=e=>"_["+(e.type===UR?(0,m.m8)(GL+e.value):(0,m.m8)(GL)+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(i(t[0]),")"),_range:t=>"".concat(i(t[0]),".range()"),_scale:e=>"".concat(i(e[0]),"(").concat(t(e[1]),")")}}function rP(t,e){return function(n,i,r){if(n){const e=nP(n,(r||this).context);return e&&e.path[t](i)}else{return e(i)}}}const aP=rP("area",aI);const oP=rP("bounds",CI);const sP=rP("centroid",nL);function uP(t){const e=this.context.group;let n=false;if(e)while(t){if(t===e){n=true;break}t=t.mark.group}return n}function lP(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(i){t.warn(i)}return n[n.length-1]}function cP(){return lP(this.context.dataflow,"warn",arguments)}function fP(){return lP(this.context.dataflow,"info",arguments)}function hP(){return lP(this.context.dataflow,"debug",arguments)}function dP(t){const e=t/255;if(e<=.03928){return e/12.92}return Math.pow((e+.055)/1.055,2.4)}function pP(t){const e=Dh(t),n=dP(e.r),i=dP(e.g),r=dP(e.b);return.2126*n+.7152*i+.0722*r}function mP(t,e){const n=pP(t),i=pP(e),r=Math.max(n,i),a=Math.min(n,i);return(r+.05)/(a+.05)}function gP(){const t=[].slice.call(arguments);t.unshift({});return(0,m.l7)(...t)}function yP(t,e){return t===e||t!==t&&e!==e?true:(0,m.kJ)(t)?(0,m.kJ)(e)&&t.length===e.length?vP(t,e):false:(0,m.Kn)(t)&&(0,m.Kn)(e)?xP(t,e):false}function vP(t,e){for(let n=0,i=t.length;n<i;++n){if(!yP(t[n],e[n]))return false}return true}function xP(t,e){for(const n in t){if(!yP(t[n],e[n]))return false}return true}function _P(t){return e=>xP(t,e)}function bP(t,e,n,i,r,a){const o=this.context.dataflow,s=this.context.data[t],u=s.input,l=o.stamp();let c=s.changes,f,h;if(o._trigger===false||!(u.value.length||e||i)){return 0}if(!c||c.stamp<l){s.changes=c=o.changeset();c.stamp=l;o.runAfter((()=>{s.modified=true;o.pulse(u,c).run()}),true,1)}if(n){f=n===true?m.yb:(0,m.kJ)(n)||Aa(n)?n:_P(n);c.remove(f)}if(e){c.insert(e)}if(i){f=_P(i);if(u.value.some(f)){c.remove(f)}else{c.insert(i)}}if(r){for(h in a){c.modify(r,h,a[h])}}return 1}function wP(t){const e=t.touches,n=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+i*i)}function kP(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const MP={};function AP(t,e){const n=MP[e]||(MP[e]=(0,m.EP)(e));return(0,m.kJ)(t)?t.map(n):n(t)}function EP(t){return(0,m.kJ)(t)||ArrayBuffer.isView(t)?t:null}function DP(t){return EP(t)||((0,m.HD)(t)?t:null)}function CP(t,...e){return EP(t).join(...e)}function FP(t,...e){return DP(t).indexOf(...e)}function SP(t,...e){return DP(t).lastIndexOf(...e)}function TP(t,...e){return DP(t).slice(...e)}function BP(t,e,n){if((0,m.mf)(n))(0,m.vU)("Function argument passed to replace.");return String(t).replace(e,n)}function NP(t){return EP(t).slice().reverse()}function zP(t,e,n){return Dm(t||0,e||0,n||0)}function OP(t,e){const n=nP(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}function RP(t,e){const n=nP(t,(e||this).context);return n?n.copy():undefined}function UP(t,e){const n=nP(t,(e||this).context);return n?n.domain():[]}function qP(t,e,n){const i=nP(t,(n||this).context);return!i?undefined:(0,m.kJ)(e)?(i.invertRange||i.invert)(e):(i.invert||i.invertExtent)(e)}function IP(t,e){const n=nP(t,(e||this).context);return n&&n.range?n.range():[]}function LP(t,e,n){const i=nP(t,(n||this).context);return i?i(e):undefined}function PP(t,e,n,i,r){t=nP(t,(r||this).context);const a=cy(e,n);let o=t.domain(),s=o[0],u=(0,m.fj)(o),l=m.yR;if(!(u-s)){t=(t.interpolator?sg("sequential")().interpolator(t.interpolator()):sg("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1])}else{l=wg(t,s,u)}if(t.ticks){o=t.ticks(+i||15);if(s!==o[0])o.unshift(s);if(u!==(0,m.fj)(o))o.push(u)}o.forEach((e=>a.stop(l(e),t(e))));return a}function jP(t,e,n){const i=nP(t,(n||this).context);return function(t){return i?i.path.context(t)(e):""}}function WP(t){let e=null;return function(n){return n?Cy(n,e=e||my(t)):t}}const XP=t=>t.data;function $P(t,e){const n=BL.call(e,t);return n.root&&n.root.lookup||{}}function HP(t,e,n){const i=$P(t,this),r=i[e],a=i[n];return r&&a?r.path(a).map(XP):undefined}function YP(t,e){const n=$P(t,this)[e];return n?n.ancestors().map(XP):undefined}const JP=()=>typeof window!=="undefined"&&window||null;function VP(){const t=JP();return t?t.screen:{}}function GP(){const t=JP();return t?[t.innerWidth,t.innerHeight]:[undefined,undefined]}function KP(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[undefined,undefined]}function ZP(t,e,n){if(!t)return[];const[i,r]=t,a=(new Fv).set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return hk(o,a,QP(e))}function QP(t){let e=null;if(t){const n=(0,m.IX)(t.marktype),i=(0,m.IX)(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!i.length||i.some((e=>t.name===e)))}return e}const tj={random(){return us()},cumulativeNormal:_s,cumulativeLogNormal:Ds,cumulativeUniform:Ns,densityNormal:xs,densityLogNormal:Es,densityUniform:Bs,quantileNormal:bs,quantileLogNormal:Cs,quantileUniform:zs,sampleNormal:vs,sampleLogNormal:As,sampleUniform:Ts,isArray:m.kJ,isBoolean:m.jn,isDate:m.J_,isDefined(t){return t!==undefined},isNumber:m.hj,isObject:m.Kn,isRegExp:m.Kj,isString:m.HD,isTuple:Aa,isValid(t){return t!=null&&t===t},toBoolean:m.sw,toDate:m.ZU,toNumber:m.He,toString:m.BB,indexof:FP,join:CP,lastindexof:SP,replace:BP,reverse:NP,slice:TP,flush:m.yl,lerp:m.t7,merge:gP,pad:m.vk,peek:m.fj,pluck:AP,span:m.yP,inrange:m.u5,truncate:m.$G,rgb:Dh,lab:Kp,hcl:am,hsl:zh,luminance:pP,contrast:mP,sequence:ru,format:UL,utcFormat:IL,utcParse:PL,utcOffset:oi,utcSequence:li,timeFormat:qL,timeParse:LL,timeOffset:ai,timeSequence:ui,timeUnitSpecifier:Sn,monthFormat:XL,monthAbbrevFormat:$L,dayFormat:HL,dayAbbrevFormat:YL,quarter:m.mS,utcquarter:m.N3,week:zn,utcweek:Ln,dayofyear:Nn,utcdayofyear:In,warn:cP,info:fP,debug:hP,extent:m.We,inScope:uP,intersect:ZP,clampRange:m.l$,pinchDistance:wP,pinchAngle:kP,screen:VP,containerSize:KP,windowSize:GP,bandspace:zP,setdata:zL,pathShape:WP,panLinear:m.Dw,panLog:m.mJ,panPow:m.QA,panSymlog:m.Zw,zoomLinear:m.ay,zoomLog:m.dH,zoomPow:m.mK,zoomSymlog:m.bV,encode:OL,modify:bP};const ej=["view","item","group","xy","x","y"],nj="event.vega.",ij="this.",rj={};const aj={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat((0,m.m8)(KL+t),"]"),functions:sj,constants:Wq,visitors:rj};const oj=Hq(aj);function sj(t){const e=Xq(t);ej.forEach((t=>e[t]=nj+t));for(const n in tj){e[n]=ij+n}(0,m.l7)(e,iP(t,tj,rj));return e}function uj(t,e,n){if(arguments.length===1){return tj[t]}tj[t]=e;if(n)rj[t]=n;if(oj)oj.functions[t]=ij+t;return this}uj("bandwidth",OP,tP);uj("copy",RP,tP);uj("domain",UP,tP);uj("range",IP,tP);uj("invert",qP,tP);uj("scale",LP,tP);uj("gradient",PP,tP);uj("geoArea",aP,tP);uj("geoBounds",oP,tP);uj("geoCentroid",sP,tP);uj("geoShape",jP,tP);uj("indata",NL,QL);uj("data",BL,ZL);uj("treePath",HP,ZL);uj("treeAncestors",YP,ZL);uj("vlSelectionTest",_L,TL);uj("vlSelectionIdTest",AL,TL);uj("vlSelectionResolve",DL,TL);uj("vlSelectionTuples",EL);function lj(t,e){const n={};let i;try{t=(0,m.HD)(t)?t:(0,m.m8)(t)+"";i=jq(t)}catch(a){(0,m.vU)("Expression parse error: "+t)}i.visit((t=>{if(t.type!==jR)return;const i=t.callee.name,r=aj.visitors[i];if(r)r(i,t.arguments,e,n)}));const r=oj(i);r.globals.forEach((t=>{const i=KL+t;if(!(0,m.nr)(n,i)&&e.getSignal(t)){n[i]=e.signalRef(t)}}));return{$expr:(0,m.l7)({code:r.code},e.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function cj(t){const e=this,n=t.operators||[];if(t.background){e.background=t.background}if(t.eventConfig){e.eventConfig=t.eventConfig}if(t.locale){e.locale=t.locale}n.forEach((t=>e.parseOperator(t)));n.forEach((t=>e.parseOperatorParameters(t)));(t.streams||[]).forEach((t=>e.parseStream(t)));(t.updates||[]).forEach((t=>e.parseUpdate(t)));return e.resolve()}const fj=(0,m.Rg)(["rule"]),hj=(0,m.Rg)(["group","image","rect"]);function dj(t,e){let n="";if(fj[e])return n;if(t.x2){if(t.x){if(hj[e]){n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"}n+="o.width=o.x2-o.x;"}else{n+="o.x=o.x2-(o.width||0);"}}if(t.xc){n+="o.x=o.xc-(o.width||0)/2;"}if(t.y2){if(t.y){if(hj[e]){n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"}n+="o.height=o.y2-o.y;"}else{n+="o.y=o.y2-(o.height||0);"}}if(t.yc){n+="o.y=o.yc-(o.height||0)/2;"}return n}function pj(t){return(t+"").toLowerCase()}function mj(t){return pj(t)==="operator"}function gj(t){return pj(t)==="collect"}function yj(t,e,n){if(n[n.length-1]!==";"){n="return("+n+");"}const i=Function(...e.concat(n));return t&&t.functions?i.bind(t.functions):i}function vj(t,e,n,i){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n  : (u > v || v == null) && u != null ? ").concat(i,"\n  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n  : v !== v && u === u ? ").concat(i," : ")}var xj={operator:(t,e)=>yj(t,["_"],e.code),parameter:(t,e)=>yj(t,["datum","_"],e.code),event:(t,e)=>yj(t,["event"],e.code),handler:(t,e)=>{const n="var datum=event.item&&event.item.datum;return ".concat(e.code,";");return yj(t,["_","event"],n)},encode:(t,e)=>{const{marktype:n,channels:i}=e;let r="var o=item,datum=o.datum,m=0,$;";for(const a in i){const t="o["+(0,m.m8)(a)+"]";r+="$=".concat(i[a].code,";if(").concat(t,"!==$)").concat(t,"=$,m=1;")}r+=dj(i,n);r+="return m;";return yj(t,["item","_"],r)},codegen:{get(t){const e="[".concat(t.map(m.m8).join("]["),"]");const n=Function("_","return _".concat(e,";"));n.path=e;return n},comparator(t,e){let n;const i=(t,i)=>{const r=e[i];let a,o;if(t.path){a="a".concat(t.path);o="b".concat(t.path)}else{(n=n||{})["f"+i]=t;a="this.f".concat(i,"(a)");o="this.f".concat(i,"(b)")}return vj(a,o,-r,r)};const r=Function("a","b","var u, v; return "+t.map(i).join("")+"0;");return n?r.bind(n):r}}};function _j(t){const e=this;if(mj(t.type)||!t.type){e.operator(t,t.update?e.operatorExpression(t.update):null)}else{e.transform(t,t.type)}}function bj(t){const e=this;if(t.params){const n=e.get(t.id);if(!n)(0,m.vU)("Invalid operator id: "+t.id);e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}}function wj(t,e){e=e||{};const n=this;for(const i in t){const r=t[i];e[i]=(0,m.kJ)(r)?r.map((t=>kj(t,n,e))):kj(r,n,e)}return e}function kj(t,e,n){if(!t||!(0,m.Kn)(t))return t;for(let i=0,r=Mj.length,a;i<r;++i){a=Mj[i];if((0,m.nr)(t,a.key)){return a.parse(t,e,n)}}return t}var Mj=[{key:"$ref",parse:Aj},{key:"$key",parse:Dj},{key:"$expr",parse:Ej},{key:"$field",parse:Cj},{key:"$encode",parse:Sj},{key:"$compare",parse:Fj},{key:"$context",parse:Tj},{key:"$subflow",parse:Bj},{key:"$tupleid",parse:Nj}];function Aj(t,e){return e.get(t.$ref)||(0,m.vU)("Operator not defined: "+t.$ref)}function Ej(t,e,n){if(t.$params){e.parseParameters(t.$params,n)}const i="e:"+t.$expr.code+"_"+t.$name;return e.fn[i]||(e.fn[i]=(0,m.ZE)(e.parameterExpression(t.$expr),t.$fields,t.$name))}function Dj(t,e){const n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=(0,m.Jy)(t.$key,t.$flat,e.expr.codegen))}function Cj(t,e){if(!t.$field)return null;const n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=(0,m.EP)(t.$field,t.$name,e.expr.codegen))}function Fj(t,e){const n="c:"+t.$compare+"_"+t.$order,i=(0,m.IX)(t.$compare).map((t=>t&&t.$tupleid?Ea:t));return e.fn[n]||(e.fn[n]=(0,m.qu)(i,t.$order,e.expr.codegen))}function Sj(t,e){const n=t.$encode,i={};for(const r in n){const t=n[r];i[r]=(0,m.ZE)(e.encodeExpression(t.$expr),t.$fields);i[r].output=t.$output}return i}function Tj(t,e){return e}function Bj(t,e){const n=t.$subflow;return function(t,i,r){const a=e.fork().parse(n),o=a.get(n.operators[0].id),s=a.signals.parent;if(s)s.set(r);o.detachSubflow=()=>e.detach(a);return o}}function Nj(){return Ea}function zj(t){var e=this,n=t.filter!=null?e.eventExpression(t.filter):undefined,i=t.stream!=null?e.get(t.stream):undefined,r;if(t.source){i=e.events(t.source,t.type,n)}else if(t.merge){r=t.merge.map((t=>e.get(t)));i=r[0].merge.apply(r[0],r.slice(1))}if(t.between){r=t.between.map((t=>e.get(t)));i=i.between(r[0],r[1])}if(t.filter){i=i.filter(n)}if(t.throttle!=null){i=i.throttle(+t.throttle)}if(t.debounce!=null){i=i.debounce(+t.debounce)}if(i==null){(0,m.vU)("Invalid stream definition: "+JSON.stringify(t))}if(t.consume)i.consume(true);e.stream(t,i)}function Oj(t){var e=this,n=(0,m.Kn)(n=t.source)?n.$ref:n,i=e.get(n),r=null,a=t.update,o=undefined;if(!i)(0,m.vU)("Source not defined: "+t.source);r=t.target&&t.target.$expr?e.eventExpression(t.target.$expr):e.get(t.target);if(a&&a.$expr){if(a.$params){o=e.parseParameters(a.$params)}a=e.handlerExpression(a.$expr)}e.update(t,i,r,a,o)}const Rj={skip:true};function Uj(t){var e=this,n={};if(t.signals){var i=n.signals={};Object.keys(e.signals).forEach((n=>{const r=e.signals[n];if(t.signals(n,r)){i[n]=r.value}}))}if(t.data){var r=n.data={};Object.keys(e.data).forEach((n=>{const i=e.data[n];if(t.data(n,i)){r[n]=i.input.value}}))}if(e.subcontext&&t.recurse!==false){n.subcontext=e.subcontext.map((e=>e.getState(t)))}return n}function qj(t){var e=this,n=e.dataflow,i=t.data,r=t.signals;Object.keys(r||{}).forEach((t=>{n.update(e.signals[t],r[t],Rj)}));Object.keys(i||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(m.yb).insert(i[t]))}));(t.subcontext||[]).forEach(((t,n)=>{const i=e.subcontext[n];if(i)i.setState(t)}))}function Ij(t,e,n,i){return new Lj(t,e,n,i)}function Lj(t,e,n,i){this.dataflow=t;this.transforms=e;this.events=t.events.bind(t);this.expr=i||xj,this.signals={};this.scales={};this.nodes={};this.data={};this.fn={};if(n){this.functions=Object.create(n);this.functions.context=this}}function Pj(t){this.dataflow=t.dataflow;this.transforms=t.transforms;this.events=t.events;this.expr=t.expr;this.signals=Object.create(t.signals);this.scales=Object.create(t.scales);this.nodes=Object.create(t.nodes);this.data=Object.create(t.data);this.fn=Object.create(t.fn);if(t.functions){this.functions=Object.create(t.functions);this.functions.context=this}}Lj.prototype=Pj.prototype={fork(){const t=new Pj(this);(this.subcontext||(this.subcontext=[])).push(t);return t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,i=n.dataflow,r=t.value;n.set(t.id,e);if(gj(t.type)&&r){if(r.$ingest){i.ingest(e,r.$ingest,r.$format)}else if(r.$request){i.preload(e,r.$request,r.$format)}else{i.pulse(e,i.changeset().insert(r))}}if(t.root){n.root=e}if(t.parent){let r=n.get(t.parent.$ref);if(r){i.connect(r,[e]);e.targets().add(r)}else{(n.unresolved=n.unresolved||[]).push((()=>{r=n.get(t.parent.$ref);i.connect(r,[e]);e.targets().add(r)}))}}if(t.signal){n.signals[t.signal]=e}if(t.scale){n.scales[t.scale]=e}if(t.data){for(const i in t.data){const r=n.data[i]||(n.data[i]={});t.data[i].forEach((t=>r[t]=e))}}},resolve(){(this.unresolved||[]).forEach((t=>t()));delete this.unresolved;return this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[pj(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,i,r){this.dataflow.on(e,n,i,r,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:cj,parseOperator:_j,parseOperatorParameters:bj,parseParameters:wj,parseStream:zj,parseUpdate:Oj,getState:Uj,setState:qj};function jj(t,e,n){var i=new fB,r=e;if(e==null)return i.restart(t,e,n),i;i._restart=i.restart;i.restart=function(t,e,n){e=+e,n=n==null?lB():+n;i._restart((function a(o){o+=r;i._restart(a,r+=e,n);t(o)}),e,n)};i.restart(t,e,n);return i}function Wj(t){const e=t.container();if(e){e.setAttribute("role","graphics-document");e.setAttribute("aria-roleDescription","visualization");Xj(e,t.description())}}function Xj(t,e){if(t)e==null?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e)}function $j(t){t.add(null,(e=>{t._background=e.bg;t._resize=1;return e.bg}),{bg:t._signals.background})}const Hj="default";function Yj(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:Hj,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const i=e.value,r=i?(0,m.HD)(i)?i:i.user:Hj,a=n.item&&n.item.cursor||null;return i&&r===i.user&&a==i.item?i:{user:r,item:a}}));t.add(null,(function(e){let n=e.cursor,i=this.value;if(!(0,m.HD)(n)){i=n.item;n=n.user}Jj(t,n&&n!==Hj?n:i||n);return i}),{cursor:e})}function Jj(t,e){const n=t.globalCursor()?typeof document!=="undefined"&&document.body:t.container();if(n){return e==null?n.style.removeProperty("cursor"):n.style.cursor=e}}function Vj(t,e){var n=t._runtime.data;if(!(0,m.nr)(n,e)){(0,m.vU)("Unrecognized data set: "+e)}return n[e]}function Gj(t,e){return arguments.length<2?Vj(this,t).values.value:Kj.call(this,t,za().remove(m.yb).insert(e))}function Kj(t,e){if(!Na(e)){(0,m.vU)("Second argument to changes must be a changeset.")}const n=Vj(this,t);n.modified=true;return this.pulse(n.input,e)}function Zj(t,e){return Kj.call(this,t,za().insert(e))}function Qj(t,e){return Kj.call(this,t,za().remove(e))}function tW(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function eW(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function nW(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function iW(t){var e=nW(t),n=tW(t),i=eW(t);t._renderer.background(t.background());t._renderer.resize(n,i,e);t._handler.origin(e);t._resizeListeners.forEach((e=>{try{e(n,i)}catch(r){t.error(r)}}))}function rW(t,e,n){var i=t._renderer,r=i&&i.canvas(),a,o,s;if(r){s=nW(t);o=e.changedTouches?e.changedTouches[0]:e;a=wb(o,r);a[0]-=s[0];a[1]-=s[1]}e.dataflow=t;e.item=n;e.vega=aW(t,n,a);return e}function aW(t,e,n){const i=e?e.mark.marktype==="group"?e:e.mark.group:null;function r(t){var n=i,r;if(t)for(r=e;r;r=r.mark.group){if(r.mark.name===t){n=r;break}}return n&&n.mark&&n.mark.interactive?n:{}}function a(t){if(!t)return n;if((0,m.HD)(t))t=r(t);const e=n.slice();while(t){e[0]-=t.x||0;e[1]-=t.y||0;t=t.mark&&t.mark.group}return e}return{view:(0,m.a9)(t),item:(0,m.a9)(e||{}),group:r,xy:a,x:t=>a(t)[0],y:t=>a(t)[1]}}const oW="view",sW="timer",uW="window",lW={trap:false};function cW(t){const e=(0,m.l7)({defaults:{}},t);const n=(t,e)=>{e.forEach((e=>{if((0,m.kJ)(t[e]))t[e]=(0,m.Rg)(t[e])}))};n(e.defaults,["prevent","allow"]);n(e,["view","window","selector"]);return e}function fW(t,e,n,i){t._eventListeners.push({type:n,sources:(0,m.IX)(e),handler:i})}function hW(t,e){var n=t._eventConfig.defaults,i=n.prevent,r=n.allow;return i===false||r===true?false:i===true||r===false?true:i?i[e]:r?!r[e]:t.preventDefault()}function dW(t,e,n){const i=t._eventConfig&&t._eventConfig[e];if(i===false||(0,m.Kn)(i)&&!i[n]){t.warn(`Blocked ${e} ${n} event listener.`);return false}return true}function pW(t,e,n){var i=this,r=new Ya(n),a=function(n,a){i.runAsync(null,(()=>{if(t===oW&&hW(i,e)){n.preventDefault()}r.receive(rW(i,n,a))}))},o;if(t===sW){if(dW(i,"timer",e)){i.timer(a,e)}}else if(t===oW){if(dW(i,"view",e)){i.addEventListener(e,a,lW)}}else{if(t===uW){if(dW(i,"window",e)&&typeof window!=="undefined"){o=[window]}}else if(typeof document!=="undefined"){if(dW(i,"selector",e)){o=document.querySelectorAll(t)}}if(!o){i.warn("Can not resolve event source: "+t)}else{for(var s=0,u=o.length;s<u;++s){o[s].addEventListener(e,a)}fW(i,o,e,a)}}return r}function mW(t){return t.item}function gW(t){return t.item.mark.source}function yW(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function vW(t,e){t=[t||"hover"];e=[e||"update",t[0]];this.on(this.events("view","mouseover",mW),gW,yW(t));this.on(this.events("view","mouseout",mW),gW,yW(e));return this}function xW(){var t=this._tooltip,e=this._timers,n=this._eventListeners,i,r,a;i=e.length;while(--i>=0){e[i].stop()}i=n.length;while(--i>=0){a=n[i];r=a.sources.length;while(--r>=0){a.sources[r].removeEventListener(a.type,a.handler)}}if(t){t.call(this,this._handler,null,null,null)}return this}function _W(t,e,n){const i=document.createElement(t);for(const r in e)i.setAttribute(r,e[r]);if(n!=null)i.textContent=n;return i}const bW="vega-bind",wW="vega-bind-name",kW="vega-bind-radio";function MW(t,e,n){if(!e)return;const i=n.param;let r=n.state;if(!r){r=n.state={elements:null,active:false,set:null,update:e=>{if(e!=t.signal(i.signal)){t.runAsync(null,(()=>{r.source=true;t.signal(i.signal,e)}))}}};if(i.debounce){r.update=(0,m.Ds)(i.debounce,r.update)}}const a=i.input==null&&i.element?AW:DW;a(r,e,i,t);if(!r.active){t.on(t._signals[i.signal],null,(()=>{r.source?r.source=false:r.set(t.signal(i.signal))}));r.active=true}return r}function AW(t,e,n,i){const r=n.event||"input";const a=()=>t.update(e.value);i.signal(n.signal,e.value);e.addEventListener(r,a);fW(i,e,r,a);t.set=t=>{e.value=t;e.dispatchEvent(EW(r))}}function EW(t){return typeof Event!=="undefined"?new Event(t):{type:t}}function DW(t,e,n,i){const r=i.signal(n.signal);const a=_W("div",{class:bW});const o=n.input==="radio"?a:a.appendChild(_W("label"));o.appendChild(_W("span",{class:wW},n.name||n.signal));e.appendChild(a);let s=CW;switch(n.input){case"checkbox":s=FW;break;case"select":s=SW;break;case"radio":s=TW;break;case"range":s=BW;break}s(t,o,n,r)}function CW(t,e,n,i){const r=_W("input");for(const a in n){if(a!=="signal"&&a!=="element"){r.setAttribute(a==="input"?"type":a,n[a])}}r.setAttribute("name",n.signal);r.value=i;e.appendChild(r);r.addEventListener("input",(()=>t.update(r.value)));t.elements=[r];t.set=t=>r.value=t}function FW(t,e,n,i){const r={type:"checkbox",name:n.signal};if(i)r.checked=true;const a=_W("input",r);e.appendChild(a);a.addEventListener("change",(()=>t.update(a.checked)));t.elements=[a];t.set=t=>a.checked=!!t||null}function SW(t,e,n,i){const r=_W("select",{name:n.signal}),a=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};if(NW(t,i))n.selected=true;r.appendChild(_W("option",n,(a[e]||t)+""))}));e.appendChild(r);r.addEventListener("change",(()=>{t.update(n.options[r.selectedIndex])}));t.elements=[r];t.set=t=>{for(let e=0,i=n.options.length;e<i;++e){if(NW(n.options[e],t)){r.selectedIndex=e;return}}}}function TW(t,e,n,i){const r=_W("span",{class:kW}),a=n.labels||[];e.appendChild(r);t.elements=n.options.map(((e,o)=>{const s={type:"radio",name:n.signal,value:e};if(NW(e,i))s.checked=true;const u=_W("input",s);u.addEventListener("change",(()=>t.update(e)));const l=_W("label",{},(a[o]||e)+"");l.prepend(u);r.appendChild(l);return u}));t.set=e=>{const n=t.elements,i=n.length;for(let t=0;t<i;++t){if(NW(n[t].value,e))n[t].checked=true}}}function BW(t,e,n,i){i=i!==undefined?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,a=n.min||Math.min(0,r,+i)||0,o=n.step||_t(a,r,100);const s=_W("input",{type:"range",name:n.signal,min:a,max:r,step:o});s.value=i;const u=_W("span",{},+i);e.appendChild(s);e.appendChild(u);const l=()=>{u.textContent=s.value;t.update(+s.value)};s.addEventListener("input",l);s.addEventListener("change",l);t.elements=[s];t.set=t=>{s.value=t;u.textContent=t}}function NW(t,e){return t===e||t+""===e+""}function zW(t,e,n,i,r,a){e=e||new i(t.loader());return e.initialize(n,tW(t),eW(t),nW(t),r,a).background(t.background())}function OW(t,e){return!e?null:function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}}function RW(t,e,n,i){const r=new i(t.loader(),OW(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,nW(t),t);if(e){e.handlers().forEach((t=>{r.on(t.type,t.handler)}))}return r}function UW(t,e){const n=this,i=n._renderType,r=n._eventConfig.bind,a=fk(i);t=n._el=t?qW(n,t):null;Wj(n);if(!a)n.error("Unrecognized renderer type: "+i);const o=a.handler||Vb,s=t?a.renderer:a.headless;n._renderer=!s?null:zW(n,n._renderer,t,s);n._handler=RW(n,n._handler,t,o);n._redraw=true;if(t&&r!=="none"){e=e?n._elBind=qW(n,e,true):t.appendChild(_W("form",{class:"vega-bindings"}));n._bind.forEach((t=>{if(t.param.element&&r!=="container"){t.element=qW(n,t.param.element,!!t.param.input)}}));n._bind.forEach((t=>{MW(n,t.element||e,t)}))}return n}function qW(t,e,n){if(typeof e==="string"){if(typeof document!=="undefined"){e=document.querySelector(e);if(!e){t.error("Signal bind element not found: "+e);return null}}else{t.error("DOM document instance not found.");return null}}if(e&&n){try{e.innerHTML=""}catch(i){e=null;t.error(i)}}return e}const IW=t=>+t||0;const LW=t=>({top:t,bottom:t,left:t,right:t});function PW(t){return(0,m.Kn)(t)?{top:IW(t.top),bottom:IW(t.bottom),left:IW(t.left),right:IW(t.right)}:LW(IW(t))}async function jW(t,e,n,i){const r=fk(e),a=r&&r.headless;if(!a)(0,m.vU)("Unrecognized renderer type: "+e);await t.runAsync();return zW(t,null,null,a,n,i).renderAsync(t._scenegraph.root)}async function WW(t,e){if(t!==lk.Canvas&&t!==lk.SVG&&t!==lk.PNG){(0,m.vU)("Unrecognized image type: "+t)}const n=await jW(this,t,e);return t===lk.SVG?XW(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function XW(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}async function $W(t,e){const n=await jW(this,lk.Canvas,t,e);return n.canvas()}async function HW(t){const e=await jW(this,lk.SVG,t);return e.svg()}function YW(t,e,n){return Ij(t,Wo,tj,n).parse(e)}function JW(t){var e=this._runtime.scales;if(!(0,m.nr)(e,t)){(0,m.vU)("Unrecognized scale or projection: "+t)}return e[t].value}var VW="width",GW="height",KW="padding",ZW={skip:true};function QW(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===KW?i.left+i.right:0)}function tX(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===KW?i.top+i.bottom:0)}function eX(t){var e=t._signals,n=e[VW],i=e[GW],r=e[KW];function a(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size;t._viewWidth=QW(t,e.size);a()}),{size:n});t._resizeHeight=t.add(null,(e=>{t._height=e.size;t._viewHeight=tX(t,e.size);a()}),{size:i});const o=t.add(null,a,{pad:r});t._resizeWidth.rank=n.rank+1;t._resizeHeight.rank=i.rank+1;o.rank=r.rank+1}function nX(t,e,n,i,r,a){this.runAfter((o=>{let s=0;o._autosize=0;if(o.width()!==n){s=1;o.signal(VW,n,ZW);o._resizeWidth.skip(true)}if(o.height()!==i){s=1;o.signal(GW,i,ZW);o._resizeHeight.skip(true)}if(o._viewWidth!==t){o._resize=1;o._viewWidth=t}if(o._viewHeight!==e){o._resize=1;o._viewHeight=e}if(o._origin[0]!==r[0]||o._origin[1]!==r[1]){o._resize=1;o._origin=r}if(s)o.run("enter");if(a)o.runAfter((t=>t.resize()))}),false,1)}function iX(t){return this._runtime.getState(t||{data:rX,signals:aX,recurse:true})}function rX(t,e){return e.modified&&(0,m.kJ)(e.input.value)&&t.indexOf("_:vega:_")}function aX(t,e){return!(t==="parent"||e instanceof Wo.proxy)}function oX(t){this.runAsync(null,(e=>{e._trigger=false;e._runtime.setState(t)}),(t=>{t._trigger=true}));return this}function sX(t,e){function n(e){t({timestamp:Date.now(),elapsed:e})}this._timers.push(jj(n,e))}function uX(t,e,n,i){const r=t.element();if(r)r.setAttribute("title",lX(i))}function lX(t){return t==null?"":(0,m.kJ)(t)?fX(t):(0,m.Kn)(t)&&!(0,m.J_)(t)?cX(t):t+""}function cX(t){return Object.keys(t).map((e=>{const n=t[e];return e+": "+((0,m.kJ)(n)?fX(n):hX(n))})).join("\n")}function fX(t){return"["+t.map(hX).join(", ")+"]"}function hX(t){return(0,m.kJ)(t)?"[…]":(0,m.Kn)(t)&&!(0,m.J_)(t)?"{…}":t}function dX(t,e){const n=this;e=e||{};Lo.call(n);if(e.loader)n.loader(e.loader);if(e.logger)n.logger(e.logger);if(e.logLevel!=null)n.logLevel(e.logLevel);if(e.locale||t.locale){const i=(0,m.l7)({},t.locale,e.locale);n.locale(ma(i.number,i.time))}n._el=null;n._elBind=null;n._renderType=e.renderer||lk.Canvas;n._scenegraph=new mb;const i=n._scenegraph.root;n._renderer=null;n._tooltip=e.tooltip||uX,n._redraw=true;n._handler=(new Vb).scene(i);n._globalCursor=false;n._preventDefault=false;n._timers=[];n._eventListeners=[];n._resizeListeners=[];n._eventConfig=cW(t.eventConfig);n.globalCursor(n._eventConfig.globalCursor);const r=YW(n,t,e.expr);n._runtime=r;n._signals=r.signals;n._bind=(t.bindings||[]).map((t=>({state:null,param:(0,m.l7)({},t)})));if(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=QW(n,n._width);n._viewHeight=tX(n,n._height);n._origin=[0,0];n._resize=0;n._autosize=1;eX(n);$j(n);Yj(n);n.description(t.description);if(e.hover)n.hover();if(e.container)n.initialize(e.container,e.bind)}function pX(t,e){return(0,m.nr)(t._signals,e)?t._signals[e]:(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(e))}function mX(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function gX(t,e,n,i){let r=mX(n,i);if(!r){r=OW(t,(()=>i(e,n.value)));r.handler=i;t.on(n,null,r)}return t}function yX(t,e,n){const i=mX(e,n);if(i)e._targets.remove(i);return t}(0,m.XW)(dX,Lo,{async evaluate(t,e,n){await Lo.prototype.evaluate.call(this,t,e);if(this._redraw||this._resize){try{if(this._renderer){if(this._resize){this._resize=0;iW(this)}await this._renderer.renderAsync(this._scenegraph.root)}this._redraw=false}catch(i){this.error(i)}}if(n)wa(this,n);return this},dirty(t){this._redraw=true;this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=t!=null?t+"":null;if(e!==this._desc)Xj(this._el,this._desc=e);return this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const i=pX(this,t);return arguments.length===1?i.value:this.update(i,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",PW(t)):PW(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){if(!arguments.length)return this._renderType;if(!fk(t))(0,m.vU)("Unrecognized renderer type: "+t);if(t!==this._renderType){this._renderType=t;this._resetRenderer()}return this},tooltip(t){if(!arguments.length)return this._tooltip;if(t!==this._tooltip){this._tooltip=t;this._resetRenderer()}return this},loader(t){if(!arguments.length)return this._loader;if(t!==this._loader){Lo.prototype.loader.call(this,t);this._resetRenderer()}return this},resize(){this._autosize=1;return this.touch(pX(this,"autosize"))},_resetRenderer(){if(this._renderer){this._renderer=null;this.initialize(this._el,this._elBind)}},_resizeView:nX,addEventListener(t,e,n){let i=e;if(!(n&&n.trap===false)){i=OW(this,e);i.raw=e}this._handler.on(t,i);return this},removeEventListener(t,e){var n=this._handler.handlers(t),i=n.length,r,a;while(--i>=0){a=n[i].type;r=n[i].handler;if(t===a&&(e===r||e===r.raw)){this._handler.off(a,r);break}}return this},addResizeListener(t){const e=this._resizeListeners;if(e.indexOf(t)<0){e.push(t)}return this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);if(n>=0){e.splice(n,1)}return this},addSignalListener(t,e){return gX(this,t,pX(this,t),e)},removeSignalListener(t,e){return yX(this,pX(this,t),e)},addDataListener(t,e){return gX(this,t,Vj(this,t).values,e)},removeDataListener(t,e){return yX(this,Vj(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=Jj(this,null);this._globalCursor=!!t;if(e)Jj(this,e)}return this}else{return this._globalCursor}},preventDefault(t){if(arguments.length){this._preventDefault=t;return this}else{return this._preventDefault}},timer:sX,events:pW,finalize:xW,hover:vW,data:Gj,change:Kj,insert:Zj,remove:Qj,scale:JW,initialize:UW,toImageURL:WW,toCanvas:$W,toSVG:HW,getState:iX,setState:oX});var vX=n(83082);function xX(t){return(0,m.Kn)(t)?t:{type:t||"pad"}}const _X=t=>+t||0;const bX=t=>({top:t,bottom:t,left:t,right:t});function wX(t){return!(0,m.Kn)(t)?bX(_X(t)):t.signal?t:{top:_X(t.top),bottom:_X(t.bottom),left:_X(t.left),right:_X(t.right)}}const kX=t=>(0,m.Kn)(t)&&!(0,m.kJ)(t)?(0,m.l7)({},t):{value:t};function MX(t,e,n,i){if(n!=null){const r=(0,m.Kn)(n)&&!(0,m.kJ)(n)||(0,m.kJ)(n)&&n.length&&(0,m.Kn)(n[0]);if(r){t.update[e]=n}else{t[i||"enter"][e]={value:n}}return 1}else{return 0}}function AX(t,e,n){for(const i in e){MX(t,i,e[i])}for(const i in n){MX(t,i,n[i],"update")}}function EX(t,e,n){for(const i in e){if(n&&(0,m.nr)(n,i))continue;t[i]=(0,m.l7)(t[i]||{},e[i])}return t}function DX(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const CX="mark";const FX="frame";const SX="scope";const TX="axis";const BX="axis-domain";const NX="axis-grid";const zX="axis-label";const OX="axis-tick";const RX="axis-title";const UX="legend";const qX="legend-band";const IX="legend-entry";const LX="legend-gradient";const PX="legend-label";const jX="legend-symbol";const WX="legend-title";const XX="title";const $X="title-text";const HX="title-subtitle";function YX(t,e,n,i,r){const a={},o={};let s,u,l,c;u="lineBreak";if(e==="text"&&r[u]!=null&&!DX(u,t)){JX(a,u,r[u])}if(n=="legend"||String(n).startsWith("axis")){n=null}c=n===FX?r.group:n===CX?(0,m.l7)({},r.mark,r[e]):null;for(u in c){l=DX(u,t)||(u==="fill"||u==="stroke")&&(DX("fill",t)||DX("stroke",t));if(!l)JX(a,u,c[u])}(0,m.IX)(i).forEach((e=>{const n=r.style&&r.style[e];for(const i in n){if(!DX(i,t)){JX(a,i,n[i])}}}));t=(0,m.l7)({},t);for(u in a){c=a[u];if(c.signal){(s=s||{})[u]=c}else{o[u]=c}}t.enter=(0,m.l7)(o,t.enter);if(s)t.update=(0,m.l7)(s,t.update);return t}function JX(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const VX=t=>(0,m.HD)(t)?(0,m.m8)(t):t.signal?"(".concat(t.signal,")"):e$(t);function GX(t){if(t.gradient!=null){return QX(t)}let e=t.signal?"(".concat(t.signal,")"):t.color?ZX(t.color):t.field!=null?e$(t.field):t.value!==undefined?(0,m.m8)(t.value):undefined;if(t.scale!=null){e=i$(t,e)}if(e===undefined){e=null}if(t.exponent!=null){e="pow(".concat(e,",").concat(t$(t.exponent),")")}if(t.mult!=null){e+="*".concat(t$(t.mult))}if(t.offset!=null){e+="+".concat(t$(t.offset))}if(t.round){e="round(".concat(e,")")}return e}const KX=(t,e,n,i)=>"(".concat(t,"(").concat([e,n,i].map(GX).join(","),")+'')");function ZX(t){return t.c?KX("hcl",t.h,t.c,t.l):t.h||t.s?KX("hsl",t.h,t.s,t.l):t.l||t.a?KX("lab",t.l,t.a,t.b):t.r||t.g||t.b?KX("rgb",t.r,t.g,t.b):null}function QX(t){const e=[t.start,t.stop,t.count].map((t=>t==null?null:(0,m.m8)(t)));while(e.length&&(0,m.fj)(e)==null)e.pop();e.unshift(VX(t.gradient));return"gradient(".concat(e.join(","),")")}function t$(t){return(0,m.Kn)(t)?"("+GX(t)+")":t}function e$(t){return n$((0,m.Kn)(t)?t:{datum:t})}function n$(t){let e,n,i;if(t.signal){e="datum";i=t.signal}else if(t.group||t.parent){n=Math.max(1,t.level||1);e="item";while(n-- >0){e+=".mark.group"}if(t.parent){i=t.parent;e+=".datum"}else{i=t.group}}else if(t.datum){e="datum";i=t.datum}else{(0,m.vU)("Invalid field reference: "+(0,m.m8)(t))}if(!t.signal){i=(0,m.HD)(i)?(0,m._k)(i).map(m.m8).join("]["):n$(i)}return e+"["+i+"]"}function i$(t,e){const n=VX(t.scale);if(t.range!=null){e="lerp(_range(".concat(n,"), ").concat(+t.range,")")}else{if(e!==undefined)e="_scale(".concat(n,", ").concat(e,")");if(t.band){e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(+t.band===1?"":"*"+t$(t.band));if(t.extra){e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")")}}if(e==null)e="0"}return e}function r$(t){let e="";t.forEach((t=>{const n=GX(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n}));if((0,m.fj)(e)===":"){e+="null"}return e}function a$(t,e,n,i,r,a){const o={};a=a||{};a.encoders={$encode:o};t=YX(t,e,n,i,r.config);for(const s in t){o[s]=o$(t[s],e,a,r)}return a}function o$(t,e,n,i){const r={},a={};for(const o in t){if(t[o]!=null){r[o]=u$(s$(t[o]),i,n,a)}}return{$expr:{marktype:e,channels:r},$fields:Object.keys(a),$output:Object.keys(t)}}function s$(t){return(0,m.kJ)(t)?r$(t):GX(t)}function u$(t,e,n,i){const r=lj(t,e);r.$fields.forEach((t=>i[t]=1));(0,m.l7)(n,r.$params);return r.$expr}const l$="outer",c$=["value","update","init","react","bind"];function f$(t,e){(0,m.vU)(t+' for "outer" push: '+(0,m.m8)(e))}function h$(t,e){const n=t.name;if(t.push===l$){if(!e.signals[n])f$("No prior signal definition",n);c$.forEach((e=>{if(t[e]!==undefined)f$("Invalid property ",e)}))}else{const i=e.addSignal(n,t.value);if(t.react===false)i.react=false;if(t.bind)e.addBinding(n,t.bind)}}function d$(t,e,n,i){this.id=-1;this.type=t;this.value=e;this.params=n;if(i)this.parent=i}function p$(t,e,n,i){return new d$(t,e,n,i)}function m$(t,e){return p$("operator",t,e)}function g$(t){const e={$ref:t.id};if(t.id<0)(t.refs=t.refs||[]).push(e);return e}function y$(t,e){return e?{$field:t,$name:e}:{$field:t}}const v$=y$("key");function x$(t,e){return{$compare:t,$order:e}}function _$(t,e){const n={$key:t};if(e)n.$flat=true;return n}const b$="ascending";const w$="descending";function k$(t){return!(0,m.Kn)(t)?"":(t.order===w$?"-":"+")+M$(t.op,t.field)}function M$(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const A$="scope";const E$="view";function D$(t){return t&&t.signal}function C$(t){return t&&t.expr}function F$(t){if(D$(t))return true;if((0,m.Kn)(t))for(const e in t){if(F$(t[e]))return true}return false}function S$(t,e){return t!=null?t:e}function T$(t){return t&&t.signal||t}const B$="timer";function N$(t,e){const n=t.merge?O$:t.stream?R$:t.type?U$:(0,m.vU)("Invalid stream specification: "+(0,m.m8)(t));return n(t,e)}function z$(t){return t===A$?E$:t||E$}function O$(t,e){const n=t.merge.map((t=>N$(t,e))),i=q$({merge:n},t,e);return e.addStream(i).id}function R$(t,e){const n=N$(t.stream,e),i=q$({stream:n},t,e);return e.addStream(i).id}function U$(t,e){let n;if(t.type===B$){n=e.event(B$,t.throttle);t={between:t.between,filter:t.filter}}else{n=e.event(z$(t.source),t.type)}const i=q$({stream:n},t,e);return Object.keys(i).length===1?n:e.addStream(i).id}function q$(t,e,n){let i=e.between;if(i){if(i.length!==2){(0,m.vU)('Stream "between" parameter must have 2 entries: '+(0,m.m8)(e))}t.between=[N$(i[0],n),N$(i[1],n)]}i=e.filter?[].concat(e.filter):[];if(e.marktype||e.markname||e.markrole){i.push(I$(e.marktype,e.markname,e.markrole))}if(e.source===A$){i.push("inScope(event.item)")}if(i.length){t.filter=lj("("+i.join(")&&(")+")",n).$expr}if((i=e.throttle)!=null){t.throttle=+i}if((i=e.debounce)!=null){t.debounce=+i}if(e.consume){t.consume=true}return t}function I$(t,e,n){const i="event.item";return i+(t&&t!=="*"?"&&"+i+".mark.marktype==='"+t+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(e?"&&"+i+".mark.name==='"+e+"'":"")}const L$={code:"_.$value",ast:{type:"Identifier",value:"value"}};function P$(t,e,n){const i=t.encode,r={target:n};let a=t.events,o=t.update,s=[];if(!a){(0,m.vU)("Signal update missing events specification.")}if((0,m.HD)(a)){a=(0,vX.n)(a,e.isSubscope()?A$:E$)}a=(0,m.IX)(a).filter((t=>t.signal||t.scale?(s.push(t),0):1));if(s.length>1){s=[W$(s)]}if(a.length){s.push(a.length>1?{merge:a}:a[0])}if(i!=null){if(o)(0,m.vU)("Signal encode and update are mutually exclusive.");o="encode(item(),"+(0,m.m8)(i)+")"}r.update=(0,m.HD)(o)?lj(o,e):o.expr!=null?lj(o.expr,e):o.value!=null?o.value:o.signal!=null?{$expr:L$,$params:{$value:e.signalRef(o.signal)}}:(0,m.vU)("Invalid signal update specification.");if(t.force){r.options={force:true}}s.forEach((t=>e.addUpdate((0,m.l7)(j$(t,e),r))))}function j$(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):N$(t,e)}}function W$(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}function X$(t,e){const n=e.getSignal(t.name);let i=t.update;if(t.init){if(i){(0,m.vU)("Signals can not include both init and update expressions.")}else{i=t.init;n.initonly=true}}if(i){i=lj(i,e);n.update=i.$expr;n.params=i.$params}if(t.on){t.on.forEach((t=>P$(t,e,n.id)))}}const $$=t=>(e,n,i)=>p$(t,n,e||undefined,i);const H$=$$("aggregate");const Y$=$$("axisticks");const J$=$$("bound");const V$=$$("collect");const G$=$$("compare");const K$=$$("datajoin");const Z$=$$("encode");const Q$=$$("expression");const tH=$$("facet");const eH=$$("field");const nH=$$("key");const iH=$$("legendentries");const rH=$$("load");const aH=$$("mark");const oH=$$("multiextent");const sH=$$("multivalues");const uH=$$("overlap");const lH=$$("params");const cH=$$("prefacet");const fH=$$("projection");const hH=$$("proxy");const dH=$$("relay");const pH=$$("render");const mH=$$("scale");const gH=$$("sieve");const yH=$$("sortitems");const vH=$$("viewlayout");const xH=$$("values");let _H=0;const bH={min:"min",max:"max",count:"sum"};function wH(t,e){const n=t.type||"linear";if(!ug(n)){(0,m.vU)("Unrecognized scale type: "+(0,m.m8)(n))}e.addScale(t.name,{type:n,domain:undefined})}function kH(t,e){const n=e.getScale(t.name).params;let i;n.domain=DH(t.domain,t,e);if(t.range!=null){n.range=IH(t,e,n)}if(t.interpolate!=null){qH(t.interpolate,n)}if(t.nice!=null){n.nice=UH(t.nice)}if(t.bins!=null){n.bins=RH(t.bins,e)}for(i in t){if((0,m.nr)(n,i)||i==="name")continue;n[i]=MH(t[i],e)}}function MH(t,e){return!(0,m.Kn)(t)?t:t.signal?e.signalRef(t.signal):(0,m.vU)("Unsupported object: "+(0,m.m8)(t))}function AH(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>MH(t,e)))}function EH(t){(0,m.vU)("Can not find data set: "+(0,m.m8)(t))}function DH(t,e,n){if(!t){if(e.domainMin!=null||e.domainMax!=null){(0,m.vU)("No scale domain defined for domainMin/domainMax to override.")}return}return t.signal?n.signalRef(t.signal):((0,m.kJ)(t)?CH:t.fields?SH:FH)(t,e,n)}function CH(t,e,n){return t.map((t=>MH(t,n)))}function FH(t,e,n){const i=n.getData(t.data);if(!i)EH(t.data);return fg(e.type)?i.valuesRef(n,t.field,NH(t.sort,false)):gg(e.type)?i.domainRef(n,t.field):i.extentRef(n,t.field)}function SH(t,e,n){const i=t.data,r=t.fields.reduce(((t,e)=>{e=(0,m.HD)(e)?{data:i,field:e}:(0,m.kJ)(e)||e.signal?TH(e,n):e;t.push(e);return t}),[]);return(fg(e.type)?BH:gg(e.type)?zH:OH)(t,n,r)}function TH(t,e){const n="_:vega:_"+_H++,i=V$({});if((0,m.kJ)(t)){i.value={$ingest:t}}else if(t.signal){const r="setdata("+(0,m.m8)(n)+","+t.signal+")";i.params.input=e.signalRef(r)}e.addDataPipeline(n,[i,gH({})]);return{data:n,field:"data"}}function BH(t,e,n){const i=NH(t.sort,true);let r,a;const o=n.map((t=>{const n=e.getData(t.data);if(!n)EH(t.data);return n.countsRef(e,t.field,i)}));const s={groupby:v$,pulse:o};if(i){r=i.op||"count";a=i.field?M$(r,i.field):"count";s.ops=[bH[r]];s.fields=[e.fieldRef(a)];s.as=[a]}r=e.add(H$(s));const u=e.add(V$({pulse:g$(r)}));a=e.add(xH({field:v$,sort:e.sortRef(i),pulse:g$(u)}));return g$(a)}function NH(t,e){if(t){if(!t.field&&!t.op){if((0,m.Kn)(t))t.field="key";else t={field:"key"}}else if(!t.field&&t.op!=="count"){(0,m.vU)("No field provided for sort aggregate op: "+t.op)}else if(e&&t.field){if(t.op&&!bH[t.op]){(0,m.vU)("Multiple domain scales can not be sorted using "+t.op)}}}return t}function zH(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);if(!n)EH(t.data);return n.domainRef(e,t.field)}));return g$(e.add(sH({values:i})))}function OH(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);if(!n)EH(t.data);return n.extentRef(e,t.field)}));return g$(e.add(oH({extents:i})))}function RH(t,e){return t.signal||(0,m.kJ)(t)?AH(t,e):e.objectProperty(t)}function UH(t){return(0,m.Kn)(t)?{interval:MH(t.interval),step:MH(t.step)}:MH(t)}function qH(t,e){e.interpolate=MH(t.type||t);if(t.gamma!=null){e.interpolateGamma=MH(t.gamma)}}function IH(t,e,n){const i=e.config.range;let r=t.range;if(r.signal){return e.signalRef(r.signal)}else if((0,m.HD)(r)){if(i&&(0,m.nr)(i,r)){t=(0,m.l7)({},t,{range:i[r]});return IH(t,e,n)}else if(r==="width"){r=[0,{signal:"width"}]}else if(r==="height"){r=fg(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]}else{(0,m.vU)("Unrecognized scale range value: "+(0,m.m8)(r))}}else if(r.scheme){n.scheme=(0,m.kJ)(r.scheme)?AH(r.scheme,e):MH(r.scheme,e);if(r.extent)n.schemeExtent=AH(r.extent,e);if(r.count)n.schemeCount=MH(r.count,e);return}else if(r.step){n.rangeStep=MH(r.step,e);return}else if(fg(t.type)&&!(0,m.kJ)(r)){return DH(r,t,e)}else if(!(0,m.kJ)(r)){(0,m.vU)("Unsupported range type: "+(0,m.m8)(r))}return r.map((t=>((0,m.kJ)(t)?AH:MH)(t,e)))}function LH(t,e){const n=e.config.projection||{},i={};for(const r in t){if(r==="name")continue;i[r]=PH(t[r],r,e)}for(const r in n){if(i[r]==null){i[r]=PH(n[r],r,e)}}e.addProjection(t.name,i)}function PH(t,e,n){return(0,m.kJ)(t)?t.map((t=>PH(t,e,n))):!(0,m.Kn)(t)?t:t.signal?n.signalRef(t.signal):e==="fit"?t:(0,m.vU)("Unsupported parameter object: "+(0,m.m8)(t))}const jH="top";const WH="left";const XH="right";const $H="bottom";const HH="center";const YH="vertical";const JH="start";const VH="middle";const GH="end";const KH="index";const ZH="label";const QH="offset";const tY="perc";const eY="perc2";const nY="value";const iY="guide-label";const rY="guide-title";const aY="group-title";const oY="group-subtitle";const sY="symbol";const uY="gradient";const lY="discrete";const cY="size";const fY="shape";const hY="fill";const dY="stroke";const pY="strokeWidth";const mY="strokeDash";const gY="opacity";const yY=[cY,fY,hY,dY,pY,mY,gY];const vY={name:1,style:1,interactive:1};const xY={value:0};const _Y={value:1};const bY="group";const wY="rect";const kY="rule";const MY="symbol";const AY="text";function EY(t){t.type=bY;t.interactive=t.interactive||false;return t}function DY(t,e){const n=(n,i)=>S$(t[n],S$(e[n],i));n.isVertical=n=>YH===S$(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection));n.gradientLength=()=>S$(t.gradientLength,e.gradientLength||e.gradientWidth);n.gradientThickness=()=>S$(t.gradientThickness,e.gradientThickness||e.gradientHeight);n.entryColumns=()=>S$(t.columns,S$(e.columns,+n.isVertical(true)));return n}function CY(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function FY(t,e,n){const i=e.config.style[n];return i&&i[t]}function SY(t,e,n){return"item.anchor === '".concat(JH,"' ? ").concat(t," : item.anchor === '").concat(GH,"' ? ").concat(e," : ").concat(n)}const TY=SY((0,m.m8)(WH),(0,m.m8)(XH),(0,m.m8)(HH));function BY(t){const e=t("tickBand");let n=t("tickOffset"),i,r;if(!e){i=t("bandPosition");r=t("tickExtra")}else if(e.signal){i={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")};r={signal:"(".concat(e.signal,") === 'extent'")};if(!(0,m.Kn)(n)){n={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(n)}}}else if(e==="extent"){i=1;r=true;n=0}else{i=.5;r=false}return{extra:r,band:i,offset:n}}function NY(t,e){return!e?t:!t?e:!(0,m.Kn)(t)?{value:t,offset:e}:Object.assign({},t,{offset:NY(t.offset,e)})}function zY(t,e){if(e){t.name=e.name;t.style=e.style||t.style;t.interactive=!!e.interactive;t.encode=EX(t.encode,e,vY)}else{t.interactive=false}return t}function OY(t,e,n,i){const r=DY(t,n),a=r.isVertical(),o=r.gradientThickness(),s=r.gradientLength();let u,l,c,f,h;if(a){l=[0,1];c=[0,0];f=o;h=s}else{l=[0,0];c=[1,0];f=s;h=o}const d={enter:u={opacity:xY,x:xY,y:xY,width:kX(f),height:kX(h)},update:(0,m.l7)({},u,{opacity:_Y,fill:{gradient:e,start:l,stop:c}}),exit:{opacity:xY}};AX(d,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")});return zY({type:wY,role:LX,encode:d},i)}function RY(t,e,n,i,r){const a=DY(t,n),o=a.isVertical(),s=a.gradientThickness(),u=a.gradientLength();let l,c,f,h,d="";o?(l="y",f="y2",c="x",h="width",d="1-"):(l="x",f="x2",c="y",h="height");const p={opacity:xY,fill:{scale:e,field:nY}};p[l]={signal:d+"datum."+tY,mult:u};p[c]=xY;p[f]={signal:d+"datum."+eY,mult:u};p[h]=kX(s);const g={enter:p,update:(0,m.l7)({},p,{opacity:_Y}),exit:{opacity:xY}};AX(g,{stroke:a("gradientStrokeColor"),strokeWidth:a("gradientStrokeWidth")},{opacity:a("gradientOpacity")});return zY({type:wY,role:qX,key:nY,from:r,encode:g},i)}const UY="datum.".concat(tY,'<=0?"').concat(WH,'":datum.').concat(tY,'>=1?"').concat(XH,'":"').concat(HH,'"'),qY="datum.".concat(tY,'<=0?"').concat($H,'":datum.').concat(tY,'>=1?"').concat(jH,'":"').concat(VH,'"');function IY(t,e,n,i){const r=DY(t,e),a=r.isVertical(),o=kX(r.gradientThickness()),s=r.gradientLength();let u=r("labelOverlap"),l,c,f,h,d="";const p={enter:l={opacity:xY},update:c={opacity:_Y,text:{field:ZH}},exit:{opacity:xY}};AX(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:S$(t.labelLimit,e.gradientLabelLimit)});if(a){l.align={value:"left"};l.baseline=c.baseline={signal:qY};f="y";h="x";d="1-"}else{l.align=c.align={signal:UY};l.baseline={value:"top"};f="x";h="y"}l[f]=c[f]={signal:d+"datum."+tY,mult:s};l[h]=c[h]=o;o.offset=S$(t.labelOffset,e.gradientLabelOffset)||0;u=u?{separation:r("labelSeparation"),method:u,order:"datum."+KH}:undefined;return zY({type:AY,role:PX,style:iY,key:nY,from:i,encode:p,overlap:u},n)}function LY(t,e,n,i,r){const a=DY(t,e),o=n.entries,s=!!(o&&o.interactive),u=o?o.name:undefined,l=a("clipHeight"),c=a("symbolOffset"),f={data:"value"},h="(".concat(r,") ? datum.").concat(QH," : datum.").concat(cY),d=l?kX(l):{field:cY},p="datum.".concat(KH),m="max(1, ".concat(r,")");let g,y,v,x,_;d.mult=.5;g={enter:y={opacity:xY,x:{signal:h,mult:.5,offset:c},y:d},update:v={opacity:_Y,x:y.x,y:y.y},exit:{opacity:xY}};let b=null,w=null;if(!t.fill){b=e.symbolBaseFillColor;w=e.symbolBaseStrokeColor}AX(g,{fill:a("symbolFillColor",b),shape:a("symbolType"),size:a("symbolSize"),stroke:a("symbolStrokeColor",w),strokeDash:a("symbolDash"),strokeDashOffset:a("symbolDashOffset"),strokeWidth:a("symbolStrokeWidth")},{opacity:a("symbolOpacity")});yY.forEach((e=>{if(t[e]){v[e]=y[e]={scale:t[e],field:nY}}}));const k=zY({type:MY,role:jX,key:nY,from:f,clip:l?true:undefined,encode:g},n.symbols);const M=kX(c);M.offset=a("labelOffset");g={enter:y={opacity:xY,x:{signal:h,offset:M},y:d},update:v={opacity:_Y,text:{field:ZH},x:y.x,y:y.y},exit:{opacity:xY}};AX(g,{align:a("labelAlign"),baseline:a("labelBaseline"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontStyle:a("labelFontStyle"),fontWeight:a("labelFontWeight"),limit:a("labelLimit")});const A=zY({type:AY,role:PX,style:iY,key:nY,from:f,encode:g},n.labels);g={enter:{noBound:{value:!l},width:xY,height:l?kX(l):xY,opacity:xY},exit:{opacity:xY},update:v={opacity:_Y,row:{signal:null},column:{signal:null}}};if(a.isVertical(true)){x="ceil(item.mark.items.length / ".concat(m,")");v.row.signal="".concat(p,"%").concat(x);v.column.signal="floor(".concat(p," / ").concat(x,")");_={field:["row",p]}}else{v.row.signal="floor(".concat(p," / ").concat(m,")");v.column.signal="".concat(p," % ").concat(m);_={field:p}}v.column.signal="(".concat(r,")?").concat(v.column.signal,":").concat(p);i={facet:{data:i,name:"value",groupby:KH}};return EY({role:SX,from:i,encode:EX(g,o,vY),marks:[k,A],name:u,interactive:s,sort:_})}function PY(t,e){const n=DY(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:true,column:false},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const jY='item.orient === "left"',WY='item.orient === "right"',XY="(".concat(jY," || ").concat(WY,")"),$Y="datum.vgrad && ".concat(XY),HY=SY('"top"','"bottom"','"middle"'),YY=SY('"right"','"left"','"center"'),JY="datum.vgrad && ".concat(WY," ? (").concat(YY,") : (").concat(XY," && !(datum.vgrad && ").concat(jY,')) ? "left" : ').concat(TY),VY="item._anchor || (".concat(XY,' ? "middle" : "start")'),GY="".concat($Y," ? (").concat(jY," ? -90 : 90) : 0"),KY="".concat(XY," ? (datum.vgrad ? (").concat(WY,' ? "bottom" : "top") : ').concat(HY,') : "top"');function ZY(t,e,n,i){const r=DY(t,e);const a={enter:{opacity:xY},update:{opacity:_Y,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:xY}};AX(a,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:VY},angle:{signal:GY},align:{signal:JY},baseline:{signal:KY},text:t.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")});return zY({type:AY,role:WX,style:rY,from:i,encode:a},n)}function QY(t,e){let n;if((0,m.Kn)(t)){if(t.signal){n=t.signal}else if(t.path){n="pathShape("+tJ(t.path)+")"}else if(t.sphere){n="geoShape("+tJ(t.sphere)+', {type: "Sphere"})'}}return n?e.signalRef(n):!!t}function tJ(t){return(0,m.Kn)(t)&&t.signal?t.signal:(0,m.m8)(t)}function eJ(t){const e=t.role||"";return!e.indexOf("axis")||!e.indexOf("legend")||!e.indexOf("title")?e:t.type===bY?SX:e||CX}function nJ(t){return{marktype:t.type,name:t.name||undefined,role:t.role||eJ(t),zindex:+t.zindex||undefined,aria:t.aria,description:t.description}}function iJ(t,e){return t&&t.signal?e.signalRef(t.signal):t===false?false:true}function rJ(t,e){const n=Xo(t.type);if(!n)(0,m.vU)("Unrecognized transform type: "+(0,m.m8)(t.type));const i=p$(n.type.toLowerCase(),null,aJ(n,t,e));if(t.signal)e.addSignal(t.signal,e.proxy(i));i.metadata=n.metadata||{};return i}function aJ(t,e,n){const i={},r=t.params.length;for(let a=0;a<r;++a){const r=t.params[a];i[r.name]=oJ(r,e,n)}return i}function oJ(t,e,n){const i=t.type,r=e[t.name];if(i==="index"){return uJ(t,e,n)}else if(r===undefined){if(t.required){(0,m.vU)("Missing required "+(0,m.m8)(e.type)+" parameter: "+(0,m.m8)(t.name))}return}else if(i==="param"){return lJ(t,e,n)}else if(i==="projection"){return n.projectionRef(e[t.name])}return t.array&&!D$(r)?r.map((e=>sJ(t,e,n))):sJ(t,r,n)}function sJ(t,e,n){const i=t.type;if(D$(e)){return pJ(i)?(0,m.vU)("Expression references can not be signals."):mJ(i)?n.fieldRef(e):gJ(i)?n.compareRef(e):n.signalRef(e.signal)}else{const r=t.expr||mJ(i);return r&&fJ(e)?n.exprRef(e.expr,e.as):r&&hJ(e)?y$(e.field,e.as):pJ(i)?lj(e,n):dJ(i)?g$(n.getData(e).values):mJ(i)?y$(e):gJ(i)?n.compareRef(e):e}}function uJ(t,e,n){if(!(0,m.HD)(e.from)){(0,m.vU)('Lookup "from" parameter must be a string literal.')}return n.getData(e.from).lookupRef(n,e.key)}function lJ(t,e,n){const i=e[t.name];if(t.array){if(!(0,m.kJ)(i)){(0,m.vU)("Expected an array of sub-parameters. Instead: "+(0,m.m8)(i))}return i.map((e=>cJ(t,e,n)))}else{return cJ(t,i,n)}}function cJ(t,e,n){const i=t.params.length;let r;for(let o=0;o<i;++o){r=t.params[o];for(const t in r.key){if(r.key[t]!==e[t]){r=null;break}}if(r)break}if(!r)(0,m.vU)("Unsupported parameter: "+(0,m.m8)(e));const a=(0,m.l7)(aJ(r,e,n),r.key);return g$(n.add(lH(a)))}const fJ=t=>t&&t.expr;const hJ=t=>t&&t.field;const dJ=t=>t==="data";const pJ=t=>t==="expr";const mJ=t=>t==="field";const gJ=t=>t==="compare";function yJ(t,e,n){let i,r,a,o,s;if(!t){o=g$(n.add(V$(null,[{}])))}else if(i=t.facet){if(!e)(0,m.vU)("Only group marks can be faceted.");if(i.field!=null){o=s=vJ(i,n)}else{if(!t.data){a=rJ((0,m.l7)({type:"aggregate",groupby:(0,m.IX)(i.groupby)},i.aggregate),n);a.params.key=n.keyRef(i.groupby);a.params.pulse=vJ(i,n);o=s=g$(n.add(a))}else{s=g$(n.getData(t.data).aggregate)}r=n.keyRef(i.groupby,true)}}if(!o){o=vJ(t,n)}return{key:r,pulse:o,parent:s}}function vJ(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:g$(e.getData(t.data).output)}function xJ(t,e,n,i,r){this.scope=t;this.input=e;this.output=n;this.values=i;this.aggregate=r;this.index={}}xJ.fromEntries=function(t,e){const n=e.length,i=e[n-1],r=e[n-2];let a=e[0],o=null,s=1;if(a&&a.type==="load"){a=e[1]}t.add(e[0]);for(;s<n;++s){e[s].params.pulse=g$(e[s-1]);t.add(e[s]);if(e[s].type==="aggregate")o=e[s]}return new xJ(t,a,r,i,o)};function _J(t){return(0,m.HD)(t)?t:null}function bJ(t,e,n){const i=M$(n.op,n.field);let r;if(e.ops){for(let t=0,n=e.as.length;t<n;++t){if(e.as[t]===i)return}}else{e.ops=["count"];e.fields=[null];e.as=["count"]}if(n.op){e.ops.push((r=n.op.signal)?t.signalRef(r):n.op);e.fields.push(t.fieldRef(n.field));e.as.push(i)}}function wJ(t,e,n,i,r,a,o){const s=e[n]||(e[n]={}),u=k$(a);let l=_J(r),c,f;if(l!=null){t=e.scope;l=l+(u?"|"+u:"");c=s[l]}if(!c){const n=a?{field:v$,pulse:e.countsRef(t,r,a)}:{field:t.fieldRef(r),pulse:g$(e.output)};if(u)n.sort=t.sortRef(a);f=t.add(p$(i,undefined,n));if(o)e.index[r]=f;c=g$(f);if(l!=null)s[l]=c}return c}xJ.prototype={countsRef(t,e,n){const i=this,r=i.counts||(i.counts={}),a=_J(e);let o,s,u;if(a!=null){t=i.scope;o=r[a]}if(!o){u={groupby:t.fieldRef(e,"key"),pulse:g$(i.output)};if(n&&n.field)bJ(t,u,n);s=t.add(H$(u));o=t.add(V$({pulse:g$(s)}));o={agg:s,ref:g$(o)};if(a!=null)r[a]=o}else if(n&&n.field){bJ(t,o.agg.params,n)}return o.ref},tuplesRef(){return g$(this.values)},extentRef(t,e){return wJ(t,this,"extent","extent",e,false)},domainRef(t,e){return wJ(t,this,"domain","values",e,false)},valuesRef(t,e,n){return wJ(t,this,"vals","values",e,n||true)},lookupRef(t,e){return wJ(t,this,"lookup","tupleindex",e,false)},indataRef(t,e){return wJ(t,this,"indata","tupleindex",e,true,true)}};function kJ(t,e,n){const i=t.from.facet,r=i.name,a=vJ(i,e);let o;if(!i.name){(0,m.vU)("Facet must have a name: "+(0,m.m8)(i))}if(!i.data){(0,m.vU)("Facet must reference a data set: "+(0,m.m8)(i))}if(i.field){o=e.add(cH({field:e.fieldRef(i.field),pulse:a}))}else if(i.groupby){o=e.add(tH({key:e.keyRef(i.groupby),group:g$(e.proxy(n.parent)),pulse:a}))}else{(0,m.vU)("Facet must specify groupby or field: "+(0,m.m8)(i))}const s=e.fork(),u=s.add(V$()),l=s.add(gH({pulse:g$(u)}));s.addData(r,new xJ(s,u,u,l));s.addSignal("parent",null);o.params.subflow={$subflow:s.parse(t).toRuntime()}}function MJ(t,e,n){const i=e.add(cH({pulse:n.pulse})),r=e.fork();r.add(gH());r.addSignal("parent",null);i.params.subflow={$subflow:r.parse(t).toRuntime()}}function AJ(t,e,n){const i=t.remove,r=t.insert,a=t.toggle,o=t.modify,s=t.values,u=e.add(m$());const l="if("+t.trigger+',modify("'+n+'",'+[r,i,a,o,s].map((t=>t==null?"null":t)).join(",")+"),0)";const c=lj(l,e);u.update=c.$expr;u.params=c.$params}function EJ(t,e){const n=eJ(t),i=t.type===bY,r=t.from&&t.from.facet,a=t.overlap;let o=t.layout||n===SX||n===FX,s,u,l,c,f,h,d;const p=n===CX||o||r;const g=yJ(t.from,i,e);u=e.add(K$({key:g.key||(t.key?y$(t.key):undefined),pulse:g.pulse,clean:!i}));const y=g$(u);u=l=e.add(V$({pulse:y}));u=e.add(aH({markdef:nJ(t),interactive:iJ(t.interactive,e),clip:QY(t.clip,e),context:{$context:true},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:g$(u)}));const v=g$(u);u=c=e.add(Z$(a$(t.encode,t.type,n,t.style,e,{mod:false,pulse:v})));u.params.parent=e.encode();if(t.transform){t.transform.forEach((t=>{const n=rJ(t,e),i=n.metadata;if(i.generates||i.changes){(0,m.vU)("Mark transforms should not generate new data.")}if(!i.nomod)c.params.mod=true;n.params.pulse=g$(u);e.add(u=n)}))}if(t.sort){u=e.add(yH({sort:e.compareRef(t.sort),pulse:g$(u)}))}const x=g$(u);if(r||o){o=e.add(vH({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:x}));h=g$(o)}const _=e.add(J$({mark:v,pulse:h||x}));d=g$(_);if(i){if(p){s=e.operators;s.pop();if(o)s.pop()}e.pushState(x,h||d,y);r?kJ(t,e,g):p?MJ(t,e,g):e.parse(t);e.popState();if(p){if(o)s.push(o);s.push(_)}}if(a){d=DJ(a,d,e)}const b=e.add(pH({pulse:d})),w=e.add(gH({pulse:g$(b)},undefined,e.parent()));if(t.name!=null){f=t.name;e.addData(f,new xJ(e,l,b,w));if(t.on)t.on.forEach((t=>{if(t.insert||t.remove||t.toggle){(0,m.vU)("Marks only support modify triggers.")}AJ(t,e,f)}))}}function DJ(t,e,n){const i=t.method,r=t.bound,a=t.separation;const o={separation:D$(a)?n.signalRef(a.signal):a,method:D$(i)?n.signalRef(i.signal):i,pulse:e};if(t.order){o.sort=n.compareRef({field:t.order})}if(r){const t=r.tolerance;o.boundTolerance=D$(t)?n.signalRef(t.signal):+t;o.boundScale=n.scaleRef(r.scale);o.boundOrient=r.orient}return g$(n.add(uH(o)))}function CJ(t,e){const n=e.config.legend,i=t.encode||{},r=DY(t,n),a=i.legend||{},o=a.name||undefined,s=a.interactive,u=a.style,l={};let c=0,f,h,d;yY.forEach((e=>t[e]?(l[e]=t[e],c=c||t[e]):0));if(!c)(0,m.vU)("Missing valid scale for legend.");const p=FJ(t,e.scaleType(c));const g={title:t.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()};const y=g$(e.add(V$(null,[g])));const v={enter:{x:{value:0},y:{value:0}}};const x=g$(e.add(iH(h={type:p,scale:e.scaleRef(c),count:e.objectProperty(r("tickCount")),limit:e.property(r("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));if(p===uY){d=[OY(t,c,n,i.gradient),IY(t,n,i.labels,x)];h.count=h.count||e.signalRef("max(2,2*floor((".concat(T$(r.gradientLength()),")/100))"))}else if(p===lY){d=[RY(t,c,n,i.gradient,x),IY(t,n,i.labels,x)]}else{f=PY(t,n);d=[LY(t,n,i,x,T$(f.columns))];h.size=BJ(t,e,d[0].marks)}d=[EY({role:IX,from:y,encode:v,marks:d,layout:f,interactive:s})];if(g.title){d.push(ZY(t,n,i.title,y))}return EJ(EY({role:UX,from:y,encode:EX(TJ(r,t,n),a,vY),marks:d,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:s,style:u}),e)}function FJ(t,e){let n=t.type||sY;if(!t.type&&SJ(t)===1&&(t.fill||t.stroke)){n=cg(e)?uY:hg(e)?lY:sY}return n!==uY?n:hg(e)?lY:uY}function SJ(t){return yY.reduce(((e,n)=>e+(t[n]?1:0)),0)}function TJ(t,e,n){const i={enter:{},update:{}};AX(i,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType});return i}function BJ(t,e,n){const i=T$(NJ("size",t,n)),r=T$(NJ("strokeWidth",t,n)),a=T$(zJ(n[1].encode,e,iY));return lj("max(ceil(sqrt(".concat(i,")+").concat(r,"),").concat(a,")"),e)}function NJ(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):CY(t,n[0].encode)}function zJ(t,e,n){return CY("fontSize",t)||FY("fontSize",e,n)}const OJ='item.orient==="'.concat(WH,'"?-90:item.orient==="').concat(XH,'"?90:0');function RJ(t,e){t=(0,m.HD)(t)?{text:t}:t;const n=DY(t,e.config.title),i=t.encode||{},r=i.group||{},a=r.name||undefined,o=r.interactive,s=r.style,u=[];const l={},c=g$(e.add(V$(null,[l])));u.push(IJ(t,n,UJ(t),c));if(t.subtitle){u.push(LJ(t,n,i.subtitle,c))}return EJ(EY({role:XX,from:c,encode:qJ(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:a,interactive:o,style:s}),e)}function UJ(t){const e=t.encode;return e&&e.title||(0,m.l7)({name:t.name,interactive:t.interactive,style:t.style},e)}function qJ(t,e){const n={enter:{},update:{}};AX(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:TY},angle:{signal:OJ},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")});return EX(n,e,vY)}function IJ(t,e,n,i){const r={value:0},a=t.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};AX(o,{text:a,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")});return zY({type:AY,role:$X,style:aY,from:i,encode:o},n)}function LJ(t,e,n,i){const r={value:0},a=t.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};AX(o,{text:a,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")});return zY({type:AY,role:HX,style:oY,from:i,encode:o},n)}function PJ(t,e){const n=[];if(t.transform){t.transform.forEach((t=>{n.push(rJ(t,e))}))}if(t.on){t.on.forEach((n=>{AJ(n,e,t.name)}))}e.addDataPipeline(t.name,jJ(t,e,n))}function jJ(t,e,n){const i=[];let r=null,a=false,o=false,s,u,l,c,f;if(t.values){if(D$(t.values)||F$(t.format)){i.push(XJ(e,t));i.push(r=WJ())}else{i.push(r=WJ({$ingest:t.values,$format:t.format}))}}else if(t.url){if(F$(t.url)||F$(t.format)){i.push(XJ(e,t));i.push(r=WJ())}else{i.push(r=WJ({$request:t.url,$format:t.format}))}}else if(t.source){r=s=(0,m.IX)(t.source).map((t=>g$(e.getData(t).output)));i.push(null)}for(u=0,l=n.length;u<l;++u){c=n[u];f=c.metadata;if(!r&&!f.source){i.push(r=WJ())}i.push(c);if(f.generates)o=true;if(f.modifies&&!o)a=true;if(f.source)r=c;else if(f.changes)r=null}if(s){l=s.length-1;i[0]=dH({derive:a,pulse:l?s:s[0]});if(a||l){i.splice(1,0,WJ())}}if(!r)i.push(WJ());i.push(gH({}));return i}function WJ(t){const e=V$({},t);e.metadata={source:true};return e}function XJ(t,e){return rH({url:e.url?t.property(e.url):undefined,async:e.async?t.property(e.async):undefined,values:e.values?t.property(e.values):undefined,format:t.objectProperty(e.format)})}const $J=t=>t===$H||t===jH;const HJ=(t,e,n)=>D$(t)?QJ(t.signal,e,n):t===WH||t===jH?e:n;const YJ=(t,e,n)=>D$(t)?KJ(t.signal,e,n):$J(t)?e:n;const JJ=(t,e,n)=>D$(t)?ZJ(t.signal,e,n):$J(t)?n:e;const VJ=(t,e,n)=>D$(t)?tV(t.signal,e,n):t===jH?{value:e}:{value:n};const GJ=(t,e,n)=>D$(t)?eV(t.signal,e,n):t===XH?{value:e}:{value:n};const KJ=(t,e,n)=>nV("".concat(t," === '").concat(jH,"' || ").concat(t," === '").concat($H,"'"),e,n);const ZJ=(t,e,n)=>nV("".concat(t," !== '").concat(jH,"' && ").concat(t," !== '").concat($H,"'"),e,n);const QJ=(t,e,n)=>rV("".concat(t," === '").concat(WH,"' || ").concat(t," === '").concat(jH,"'"),e,n);const tV=(t,e,n)=>rV("".concat(t," === '").concat(jH,"'"),e,n);const eV=(t,e,n)=>rV("".concat(t," === '").concat(XH,"'"),e,n);const nV=(t,e,n)=>{e=e!=null?kX(e):e;n=n!=null?kX(n):n;if(iV(e)&&iV(n)){e=e?e.signal||(0,m.m8)(e.value):null;n=n?n.signal||(0,m.m8)(n.value):null;return{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}}else{return[(0,m.l7)({test:t},e)].concat(n||[])}};const iV=t=>t==null||Object.keys(t).length===1;const rV=(t,e,n)=>({signal:"".concat(t," ? (").concat(oV(e),") : (").concat(oV(n),")")});const aV=(t,e,n,i,r)=>({signal:(i!=null?"".concat(t," === '").concat(WH,"' ? (").concat(oV(i),") : "):"")+(n!=null?"".concat(t," === '").concat($H,"' ? (").concat(oV(n),") : "):"")+(r!=null?"".concat(t," === '").concat(XH,"' ? (").concat(oV(r),") : "):"")+(e!=null?"".concat(t," === '").concat(jH,"' ? (").concat(oV(e),") : "):"")+"(null)"});const oV=t=>D$(t)?t.signal:t==null?null:(0,m.m8)(t);const sV=(t,e)=>e===0?0:D$(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e};const uV=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function lV(t,e,n,i){let r;if(e&&(0,m.nr)(e,t)){return e[t]}else if((0,m.nr)(n,t)){return n[t]}else if(t.startsWith("title")){switch(t){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=t[5].toLowerCase()+t.slice(6)}return i[rY][r]}else if(t.startsWith("label")){switch(t){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=t[5].toLowerCase()+t.slice(6)}return i[iY][r]}return null}function cV(t){const e={};for(const n of t){if(!n)continue;for(const t in n)e[t]=1}return Object.keys(e)}function fV(t,e){var n=e.config,i=n.style,r=n.axis,a=e.scaleType(t.scale)==="band"&&n.axisBand,o=t.orient,s,u,l;if(D$(o)){const t=cV([n.axisX,n.axisY]),e=cV([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);s={};for(l of t){s[l]=YJ(o,lV(l,n.axisX,r,i),lV(l,n.axisY,r,i))}u={};for(l of e){u[l]=aV(o.signal,lV(l,n.axisTop,r,i),lV(l,n.axisBottom,r,i),lV(l,n.axisLeft,r,i),lV(l,n.axisRight,r,i))}}else{s=o===jH||o===$H?n.axisX:n.axisY;u=n["axis"+o[0].toUpperCase()+o.slice(1)]}const c=s||u||a?(0,m.l7)({},r,s,u,a):r;return c}function hV(t,e,n,i){const r=DY(t,e),a=t.orient;let o,s;const u={enter:o={opacity:xY},update:s={opacity:_Y},exit:{opacity:xY}};AX(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=dV(t,0);const c=dV(t,1);o.x=s.x=YJ(a,l,xY);o.x2=s.x2=YJ(a,c);o.y=s.y=JJ(a,l,xY);o.y2=s.y2=JJ(a,c);return zY({type:kY,role:BX,from:i,encode:u},n)}function dV(t,e){return{scale:t.scale,range:e}}function pV(t,e,n,i,r){const a=DY(t,e),o=t.orient,s=t.gridScale,u=HJ(o,1,-1),l=mV(t.offset,u);let c,f,h;const d={enter:c={opacity:xY},update:h={opacity:_Y},exit:f={opacity:xY}};AX(d,{stroke:a("gridColor"),strokeCap:a("gridCap"),strokeDash:a("gridDash"),strokeDashOffset:a("gridDashOffset"),strokeOpacity:a("gridOpacity"),strokeWidth:a("gridWidth")});const p={scale:t.scale,field:nY,band:r.band,extra:r.extra,offset:r.offset,round:a("tickRound")};const g=YJ(o,{signal:"height"},{signal:"width"});const y=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l};const v=s?{scale:s,range:1,mult:u,offset:l}:(0,m.l7)(g,{mult:u,offset:l});c.x=h.x=YJ(o,p,y);c.y=h.y=JJ(o,p,y);c.x2=h.x2=JJ(o,v);c.y2=h.y2=YJ(o,v);f.x=YJ(o,p);f.y=JJ(o,p);return zY({type:kY,role:NX,key:nY,from:i,encode:d},n)}function mV(t,e){if(e===1);else if(!(0,m.Kn)(t)){t=D$(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0)}else{let n=t=(0,m.l7)({},t);while(n.mult!=null){if(!(0,m.Kn)(n.mult)){n.mult=D$(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e;return t}else{n=n.mult=(0,m.l7)({},n.mult)}}n.mult=e}return t}function gV(t,e,n,i,r,a){const o=DY(t,e),s=t.orient,u=HJ(s,-1,1);let l,c,f;const h={enter:l={opacity:xY},update:f={opacity:_Y},exit:c={opacity:xY}};AX(h,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const d=kX(r);d.mult=u;const p={scale:t.scale,field:nY,band:a.band,extra:a.extra,offset:a.offset,round:o("tickRound")};f.y=l.y=YJ(s,xY,p);f.y2=l.y2=YJ(s,d);c.x=YJ(s,p);f.x=l.x=JJ(s,xY,p);f.x2=l.x2=JJ(s,d);c.y=JJ(s,p);return zY({type:kY,role:OX,key:nY,from:i,encode:h},n)}function yV(t,e,n,i,r){return{signal:'flush(range("'+t+'"), '+'scale("'+t+'", datum.value), '+e+","+n+","+i+","+r+")"}}function vV(t,e,n,i,r,a){const o=DY(t,e),s=t.orient,u=t.scale,l=HJ(s,-1,1),c=T$(o("labelFlush")),f=T$(o("labelFlushOffset")),h=o("labelAlign"),d=o("labelBaseline");let p=c===0||!!c,m;const g=kX(r);g.mult=l;g.offset=kX(o("labelPadding")||0);g.offset.mult=l;const y={scale:u,field:nY,band:.5,offset:NY(a.offset,o("labelOffset"))};const v=YJ(s,p?yV(u,c,'"left"','"right"','"center"'):{value:"center"},GJ(s,"left","right"));const x=YJ(s,VJ(s,"bottom","top"),p?yV(u,c,'"top"','"bottom"','"middle"'):{value:"middle"});const _=yV(u,c,"-(".concat(f,")"),f,0);p=p&&f;const b={opacity:xY,x:YJ(s,y,g),y:JJ(s,y,g)};const w={enter:b,update:m={opacity:_Y,text:{field:ZH},x:b.x,y:b.y,align:v,baseline:x},exit:{opacity:xY,x:b.x,y:b.y}};AX(w,{dx:!h&&p?YJ(s,_):null,dy:!d&&p?JJ(s,_):null});AX(w,{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:h,baseline:d});const k=o("labelBound");let M=o("labelOverlap");M=M||k?{separation:o("labelSeparation"),method:M,order:"datum.index",bound:k?{scale:u,orient:s,tolerance:k}:null}:undefined;if(m.align!==v){m.align=uV(m.align,v)}if(m.baseline!==x){m.baseline=uV(m.baseline,x)}return zY({type:AY,role:zX,style:iY,key:nY,from:i,encode:w,overlap:M},n)}function xV(t,e,n,i){const r=DY(t,e),a=t.orient,o=HJ(a,-1,1);let s,u;const l={enter:s={opacity:xY,anchor:kX(r("titleAnchor",null)),align:{signal:TY}},update:u=(0,m.l7)({},s,{opacity:_Y,text:kX(t.title)}),exit:{opacity:xY}};const c={signal:'lerp(range("'.concat(t.scale,'"), ').concat(SY(0,1,.5),")")};u.x=YJ(a,c);u.y=JJ(a,c);s.angle=YJ(a,xY,sV(o,90));s.baseline=YJ(a,VJ(a,$H,jH),{value:$H});u.angle=s.angle;u.baseline=s.baseline;AX(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")});_V(r,a,l,n);l.update.align=uV(l.update.align,s.align);l.update.angle=uV(l.update.angle,s.angle);l.update.baseline=uV(l.update.baseline,s.baseline);return zY({type:AY,role:RX,style:rY,from:i,encode:l},n)}function _V(t,e,n,i){const r=(t,e)=>t!=null?(n.update[e]=uV(kX(t),n.update[e]),false):!DX(e,i)?true:false;const a=r(t("titleX"),"x"),o=r(t("titleY"),"y");n.enter.auto=o===a?kX(o):YJ(e,kX(o),kX(a))}function bV(t,e){const n=fV(t,e),i=t.encode||{},r=i.axis||{},a=r.name||undefined,o=r.interactive,s=r.style,u=DY(t,n),l=BY(u);const c={scale:t.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:t.title!=null};const f=g$(e.add(V$({},[c])));const h=g$(e.add(Y$({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));const d=[];let p;if(c.grid){d.push(pV(t,n,i.grid,h,l))}if(c.ticks){p=u("tickSize");d.push(gV(t,n,i.ticks,h,p,l))}if(c.labels){p=c.ticks?p:0;d.push(vV(t,n,i.labels,h,p,l))}if(c.domain){d.push(hV(t,n,i.domain,f))}if(c.title){d.push(xV(t,n,i.title,f))}return EJ(EY({role:TX,from:f,encode:EX(wV(u,t),r,vY),marks:d,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:a,interactive:o,style:s}),e)}function wV(t,e){const n={enter:{},update:{}};AX(n,{orient:t("orient"),offset:t("offset")||0,position:S$(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType});return n}function kV(t,e,n){const i=(0,m.IX)(t.signals),r=(0,m.IX)(t.scales);if(!n)i.forEach((t=>h$(t,e)));(0,m.IX)(t.projections).forEach((t=>LH(t,e)));r.forEach((t=>wH(t,e)));(0,m.IX)(t.data).forEach((t=>PJ(t,e)));r.forEach((t=>kH(t,e)));(n||i).forEach((t=>X$(t,e)));(0,m.IX)(t.axes).forEach((t=>bV(t,e)));(0,m.IX)(t.marks).forEach((t=>EJ(t,e)));(0,m.IX)(t.legends).forEach((t=>CJ(t,e)));if(t.title)RJ(t.title,e);e.parseLambdas();return e}const MV=t=>EX({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function AV(t,e){const n=e.config;const i=g$(e.root=e.add(m$()));const r=DV(t,n);r.forEach((t=>h$(t,e)));e.description=t.description||n.description;e.eventConfig=n.events;e.legends=e.objectProperty(n.legend&&n.legend.layout);e.locale=n.locale;const a=e.add(V$());const o=e.add(Z$(a$(MV(t.encode),bY,FX,t.style,e,{pulse:g$(a)})));const s=e.add(vH({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:i,pulse:g$(o)}));e.operators.pop();e.pushState(g$(o),g$(s),null);kV(t,e,r);e.operators.push(s);let u=e.add(J$({mark:i,pulse:g$(s)}));u=e.add(pH({pulse:g$(u)}));u=e.add(gH({pulse:g$(u)}));e.addData("root",new xJ(e,a,a,u));return e}function EV(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function DV(t,e){const n=n=>S$(t[n],e[n]),i=[EV("background",n("background")),EV("autosize",xX(n("autosize"))),EV("padding",wX(n("padding"))),EV("width",n("width")||0),EV("height",n("height")||0)],r=i.reduce(((t,e)=>(t[e.name]=e,t)),{}),a={};(0,m.IX)(t.signals).forEach((t=>{if((0,m.nr)(r,t.name)){t=(0,m.l7)(r[t.name],t)}else{i.push(t)}a[t.name]=t}));(0,m.IX)(e.signals).forEach((t=>{if(!(0,m.nr)(a,t.name)&&!(0,m.nr)(r,t.name)){i.push(t)}}));return i}function CV(t,e){this.config=t||{};this.options=e||{};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 FV(t){this.config=t.config;this.options=t.options;this.legends=t.legends;this.field=Object.create(t.field);this.signals=Object.create(t.signals);this.lambdas=Object.create(t.lambdas);this.scales=Object.create(t.scales);this.events=Object.create(t.events);this.data=Object.create(t.data);this.streams=[];this.updates=[];this.operators=[];this._id=0;this._subid=++t._nextsub[0];this._nextsub=t._nextsub;this._parent=t._parent.slice();this._encode=t._encode.slice();this._lookup=t._lookup.slice();this._markpath=t._markpath}CV.prototype=FV.prototype={parse(t){return kV(t,this)},fork(){return new FV(this)},isSubscope(){return this._subid>0},toRuntime(){this.finish();return{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(t){this.operators.push(t);t.id=this.id();if(t.refs){t.refs.forEach((e=>{e.$ref=t.id}));t.refs=null}return t},proxy(t){const e=t instanceof d$?g$(t):t;return this.add(hH({value:e}))},addStream(t){this.streams.push(t);t.id=this.id();return t},addUpdate(t){this.updates.push(t);return t},finish(){let t,e;if(this.root)this.root.root=true;for(t in this.signals){this.signals[t].signal=t}for(t in this.scales){this.scales[t].scale=t}function n(t,e,n){let i,r;if(t){i=t.data||(t.data={});r=i[e]||(i[e]=[]);r.push(n)}}for(t in this.data){e=this.data[t];n(e.input,t,"input");n(e.output,t,"output");n(e.values,t,"values");for(const i in e.index){n(e.index[i],t,"index:"+i)}}return this},pushState(t,e,n){this._encode.push(g$(this.add(gH({pulse:t}))));this._parent.push(e);this._lookup.push(n?g$(this.proxy(n)):null);this._markpath.push(-1)},popState(){this._encode.pop();this._parent.pop();this._lookup.pop();this._markpath.pop()},parent(){return(0,m.fj)(this._parent)},encode(){return(0,m.fj)(this._encode)},lookup(){return(0,m.fj)(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if((0,m.HD)(t))return y$(t,e);if(!t.signal){(0,m.vU)("Unsupported field reference: "+(0,m.m8)(t))}const n=t.signal;let i=this.field[n];if(!i){const t={name:this.signalRef(n)};if(e)t.as=e;this.field[n]=i=g$(this.add(eH(t)))}return i},compareRef(t){let e=false;const n=t=>D$(t)?(e=true,this.signalRef(t.signal)):C$(t)?(e=true,this.exprRef(t.expr)):t;const i=(0,m.IX)(t.field).map(n),r=(0,m.IX)(t.order).map(n);return e?g$(this.add(G$({fields:i,orders:r}))):x$(i,r)},keyRef(t,e){let n=false;const i=t=>D$(t)?(n=true,g$(r[t.signal])):t;const r=this.signals;t=(0,m.IX)(t).map(i);return n?g$(this.add(nH({fields:t,flat:e}))):_$(t,e)},sortRef(t){if(!t)return t;const e=M$(t.op,t.field),n=t.order||b$;return n.signal?g$(this.add(G$({fields:e,orders:this.signalRef(n.signal)}))):x$(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:t,type:e});this.events[n]=i}return this.events[n]},hasOwnSignal(t){return(0,m.nr)(this.signals,t)},addSignal(t,e){if(this.hasOwnSignal(t)){(0,m.vU)("Duplicate signal name: "+(0,m.m8)(t))}const n=e instanceof d$?e:this.add(m$(e));return this.signals[t]=n},getSignal(t){if(!this.signals[t]){(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(t))}return this.signals[t]},signalRef(t){if(this.signals[t]){return g$(this.signals[t])}else if(!(0,m.nr)(this.lambdas,t)){this.lambdas[t]=this.add(m$(null))}return g$(this.lambdas[t])},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e<n;++e){const n=t[e],i=lj(n,this),r=this.lambdas[n];r.params=i.$params;r.update=i.$expr}},property(t){return t&&t.signal?this.signalRef(t.signal):t},objectProperty(t){return!t||!(0,m.Kn)(t)?t:this.signalRef(t.signal||SV(t))},exprRef(t,e){const n={expr:lj(t,this)};if(e)n.expr.$name=e;return g$(this.add(Q$(n)))},addBinding(t,e){if(!this.bindings){(0,m.vU)("Nested signals do not support binding: "+(0,m.m8)(t))}this.bindings.push((0,m.l7)({signal:t},e))},addScaleProj(t,e){if((0,m.nr)(this.scales,t)){(0,m.vU)("Duplicate scale or projection name: "+(0,m.m8)(t))}this.scales[t]=this.add(e)},addScale(t,e){this.addScaleProj(t,mH(e))},addProjection(t,e){this.addScaleProj(t,fH(e))},getScale(t){if(!this.scales[t]){(0,m.vU)("Unrecognized scale name: "+(0,m.m8)(t))}return this.scales[t]},scaleRef(t){return g$(this.getScale(t))},scaleType(t){return this.getScale(t).params.type},projectionRef(t){return this.scaleRef(t)},projectionType(t){return this.scaleType(t)},addData(t,e){if((0,m.nr)(this.data,t)){(0,m.vU)("Duplicate data set name: "+(0,m.m8)(t))}return this.data[t]=e},getData(t){if(!this.data[t]){(0,m.vU)("Undefined data set name: "+(0,m.m8)(t))}return this.data[t]},addDataPipeline(t,e){if((0,m.nr)(this.data,t)){(0,m.vU)("Duplicate data set name: "+(0,m.m8)(t))}return this.addData(t,xJ.fromEntries(this,e))}};function SV(t){return((0,m.kJ)(t)?TV:BV)(t)}function TV(t){const e=t.length;let n="[";for(let i=0;i<e;++i){const e=t[i];n+=(i>0?",":"")+((0,m.Kn)(e)?e.signal||SV(e):(0,m.m8)(e))}return n+"]"}function BV(t){let e="{",n=0,i,r;for(i in t){r=t[i];e+=(++n>1?",":"")+(0,m.m8)(i)+":"+((0,m.Kn)(r)?r.signal||SV(r):(0,m.m8)(r))}return e+"}"}function NV(){const t="sans-serif",e=30,n=2,i="#4c78a8",r="#000",a="#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:n},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:t,fontSize:11},trail:{fill:i,size:n},style:{"guide-label":{fill:r,font:t,fontSize:10},"guide-title":{fill:r,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:t,fontSize:12},point:{size:e,strokeWidth:n,shape:"circle"},circle:{size:e,strokeWidth:n},square:{size:e,strokeWidth:n,shape:"square"},cell:{fill:"transparent",stroke:o}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:true,domainWidth:1,domainColor:a,grid:false,gridWidth:1,gridColor:o,labels:true,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:true,tickColor:a,tickOffset:0,tickRound:true,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:true,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:a,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 zV(t,e,n){if(!(0,m.Kn)(t)){(0,m.vU)("Input Vega specification must be an object.")}e=(0,m.fE)(NV(),e,t.config);return AV(t,new CV(e,n)).toRuntime()}var OV="vega";var RV="5.20.0";var UV="The Vega visualization grammar.";var qV=["vega","visualization","interaction","dataflow","library","data","d3"];var IV="BSD-3-Clause";var LV="UW Interactive Data Lab (http://idl.cs.washington.edu)";var PV="build/vega-node.js";var jV="build/vega.module.js";var WV="build/vega.min.js";var XV="build/vega.min.js";var $V="index.d.ts";var HV="vega/vega";var YV={bundle:"rollup -c --config-bundle",prebuild:"rimraf build && rimraf build-es5",build:"rollup -c --config-core --config-bundle --config-ie",postbuild:"node schema-copy",pretest:"yarn build --config-test",test:"TZ=America/Los_Angeles tape 'test/**/*-test.js'",prepublishOnly:"yarn test && yarn build",postpublish:"./schema-deploy.sh"};var JV={"vega-crossfilter":"~4.0.5","vega-dataflow":"~5.7.3","vega-encode":"~4.8.3","vega-event-selector":"~2.0.6","vega-expression":"~4.0.1","vega-force":"~4.0.7","vega-format":"~1.0.4","vega-functions":"~5.12.0","vega-geo":"~4.3.8","vega-hierarchy":"~4.0.9","vega-label":"~1.0.0","vega-loader":"~4.4.0","vega-parser":"~6.1.3","vega-projection":"~1.4.5","vega-regression":"~1.0.9","vega-runtime":"~6.1.3","vega-scale":"~7.1.1","vega-scenegraph":"~4.9.4","vega-statistics":"~1.7.9","vega-time":"~2.0.4","vega-transforms":"~4.9.3","vega-typings":"~0.20.0","vega-util":"~1.16.1","vega-view":"~5.10.0","vega-view-transforms":"~4.5.8","vega-voronoi":"~4.1.5","vega-wordcloud":"~4.1.3"};var VV={"vega-schema":"*"};var GV="f262105e75449760b0f35fda70e6b576a31d68a4";var KV={name:OV,version:RV,description:UV,keywords:qV,license:IV,author:LV,main:PV,module:jV,unpkg:WV,jsdelivr:XV,types:$V,repository:HV,scripts:YV,dependencies:JV,devDependencies:VV,gitHead:GV};(0,m.l7)(Wo,i,a,o,s,u,c,l,f,h,d,p);const ZV=KV.version}}]);