// https://cdnjs.cloudflare.com/ajax/libs/vega/3.0.8/vega.min.js

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.vega=t.vega||{})}(this,function(t){"use strict";function e(t){return null==t?null:t.fname}function n(t){return null==t?null:t.fields}function r(t){return Zh(t)?"["+t.map(r)+"]":Qh(t)||Kh(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function i(t,e,n){var r=[e].concat([].slice.call(n));console[t].apply(console,r)}function a(t){return function(e){return t*Math.exp(e)}}function o(t){return function(e){return Math.log(t*e)}}function u(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function s(t,e,n,r){var i=n(t[0]),a=n(hd(t)),o=(a-i)*e;return[r(i-o),r(a-o)]}function f(t,e){return s(t,e,dd,rd)}function c(t,e){var n=Math.sign(t[0]);return s(t,e,o(n),a(n))}function l(t,e,n){return s(t,e,u(n),u(1/n))}function h(t,e,n,r,i){var a=r(t[0]),o=r(hd(t)),u=null!=e?r(e):(a+o)/2;return[i(u+(a-u)*n),i(u+(o-u)*n)]}function d(t,e,n){return h(t,e,n,dd,rd)}function p(t,e,n){var r=Math.sign(t[0]);return h(t,e,n,o(r),a(r))}function g(t,e,n,r){return h(t,e,n,u(r),u(1/r))}function v(t){var e=t||rd,n=[],r={};return n.add=function(t){var i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=function(t){var i,a=e(t);return r[a]&&(r[a]=0,(i=n.indexOf(t))>=0&&n.splice(i,1)),n},n}function m(t){return!(!t||!y(t))}function y(t){return t[Ud]}function b(t,e){return t[Ud]=e,t}function _(t){var e=t===Object(t)?t:{data:t};return y(e)?e:b(e,Fd++)}function x(t){return w(t,_({}))}function w(t,e){for(var n in t)e[n]=t[n];return e}function M(t,e){return b(e,y(t))}function k(t){return t&&t.constructor===E}function E(){var t=[],e=[],n=[],r=[],i=[],a=!1;return{constructor:E,insert:function(e){for(var n=pd(e),r=0,i=n.length;r<i;++r)t.push(n[r]);return this},remove:function(t){for(var n=gd(t)?r:e,i=pd(t),a=0,o=i.length;a<o;++a)n.push(i[a]);return this},modify:function(t,e,r){var a={field:e,value:md(r)};return gd(t)?(a.filter=t,i.push(a)):(a.tuple=t,n.push(a)),this},encode:function(t,e){return gd(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},reflow:function(){return a=!0,this},pulse:function(o,u){function s(t,e,n){n?t[e]=n(t):o.encode=e,a||(f[y(t)]=t)}var f,c,l,h,d,p,g;for(c=0,l=t.length;c<l;++c)o.add.push(_(t[c]));for(f={},c=0,l=e.length;c<l;++c)f[y(p=e[c])]=p;for(c=0,l=r.length;c<l;++c)d=r[c],u.forEach(function(t){d(t)&&(f[y(t)]=t)});for(g in f)o.rem.push(f[g]);for(f={},c=0,l=n.length;c<l;++c)s((h=n[c]).tuple,h.field,h.value),o.modifies(h.field);for(c=0,l=i.length;c<l;++c)h=i[c],d=h.filter,u.forEach(function(t){d(t)&&s(t,h.field,h.value)}),o.modifies(h.field);if(a)o.mod=e.length||r.length?u.filter(function(t){return f.hasOwnProperty(y(t))}):u.slice();else for(g in f)o.mod.push(f[g]);return o}}}function S(){Object.defineProperty(this,jd,{writable:!0,value:{}})}function A(t,e,n,r){this.id=++$d,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function C(t){return function(e){var n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}function D(t,e,n){this.id=++Yd,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function z(t,e,n){return new D(t,e,n)}function O(){}function N(t,e){var n=new O;if(t instanceof O)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i<a;)n.set(i,t[i]);else for(;++i<a;)n.set(e(r=t[i],i,t),r)}else if(t)for(var o in t)n.set(o,t[o]);return n}function T(){return{}}function R(t,e,n){t[e]=n}function P(){return N()}function L(t,e,n){t.set(e,n)}function q(){}function U(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new F(r)}function F(t){this._=t}function j(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Vd,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}function I(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}")}function $(t,e){return bd({},t.options,e)}function B(t,e){var n=this;return n.sanitize(t,e).then(function(t){var r=t.href;return t.localFile?n.file(r):n.http(r,e)})}function W(t,e){return e=$(this,e),new Promise(function(n,i){var a,o,u,s,f={href:null};null!=t&&"string"==typeof t?(o=np.test(t),(s=e.baseURL)&&!o&&(V(t,"/")||"/"===s[s.length-1]||(t="/"+t),t=s+t),u=(a=V(t,rp))||"file"===e.mode||"http"!==e.mode&&!o&&G(),a?t=t.slice(rp.length):V(t,"//")&&("file"===e.defaultProtocol?(t=t.slice(2),u=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(f,"localFile",{value:!!u}),f.href=t,n(f)):i("Sanitize failure, invalid URI: "+r(t))})}function Y(t,e){return e=$(this,e),new Promise(function(n,r){var i,a=Xd(t);for(i in e.headers)a.header(i,e.headers[i]);ip.forEach(function(t){e[t]&&a[t](e[t])}),a.on("error",function(e){r(e||"Error loading URL: "+t)}).on("load",function(t){var e=t&&t.responseText;t&&0!==t.status?n(e):r(e||"Error")}).get()})}function H(t){return new Promise(function(e,n){var r=G();r?r.readFile(t,function(t,r){t?n(t):e(r)}):n("No file system access for "+t)})}function G(){var t="function"==typeof require&&require("fs");return t&&gd(t.readFile)?t:null}function V(t,e){return null!=t&&0===t.lastIndexOf(e,0)}function X(t,e){if(!t||!t.length)return"unknown";var n,r,i,a,o=up.slice();for(r=0,i=t.length;r<i;++r){for(n=e?t[r][e]:t[r],a=0;a<o.length;++a)(function(t){return null!=t&&t==t})(n)&&!o[a](n)&&(o.splice(a,1),--a);if(0===o.length)return"string"}return sp[up.indexOf(o[0])]}function J(t,e){return e.reduce(function(e,n){return e[n]=X(t,n),e},{})}function Z(t){return!(isNaN(+t)||t instanceof Date)}function Q(t){return function(e,n){var r={delimiter:t};return K(e,n?bd(n,r):r)}}function K(t,e){return e.header&&(t=e.header.map(r).join(e.delimiter)+"\n"+t),ep(e.delimiter).parse(t+"")}function tt(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,a=et(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:a}:null==r?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function et(t,e){function n(t,e){e.length&&e.pop();for(var n=f[t<0?~t:t],r=0,i=n.length;r<i;++r)e.push(s(n[r],r));t<0&&hp(e,i)}function r(t){return s(t)}function i(t){for(var e=[],r=0,i=t.length;r<i;++r)n(t[r],e);return e.length<2&&e.push(e[0]),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0]);return e}function o(t){return t.map(a)}function u(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(u)};case"Point":e=r(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(r);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=o(t.arcs);break;case"MultiPolygon":e=t.arcs.map(o);break;default:return null}return{type:n,coordinates:e}}var s=lp(t.transform),f=t.arcs;return u(e)}function nt(t,e,n,r){function i(e){return t(e=new Date(+e)),e}return i.floor=i,i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,a){var o,u=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return u;do{u.push(o=new Date(+n)),e(n,a),t(n)}while(o<n&&n<r);return u},i.filter=function(n){return nt(function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})},n&&(i.count=function(e,r){return mp.setTime(+e),yp.setTime(+r),t(mp),t(yp),Math.floor(n(mp,yp))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}function rt(t){return nt(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*_p)/xp})}function it(t){return nt(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/xp})}function at(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ot(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ut(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function st(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function ft(t){return t.replace(Gp,"\\$&")}function ct(t){return new RegExp("^(?:"+t.map(ft).join("|")+")","i")}function lt(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function ht(t,e,n){var r=Yp.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function dt(t,e,n){var r=Yp.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function pt(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function gt(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function vt(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function mt(t,e,n){var r=Yp.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function yt(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bt(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function _t(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function xt(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function wt(t,e,n){var r=Yp.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Mt(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function kt(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Et(t,e,n){var r=Yp.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function St(t,e,n){var r=Yp.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function At(t,e,n){var r=Yp.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ct(t,e,n){var r=Hp.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Dt(t,e,n){var r=Yp.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function zt(t,e,n){var r=Yp.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function Ot(t,e){return st(t.getDate(),e,2)}function Nt(t,e){return st(t.getHours(),e,2)}function Tt(t,e){return st(t.getHours()%12||12,e,2)}function Rt(t,e){return st(1+Ep.count(zp(t),t),e,3)}function Pt(t,e){return st(t.getMilliseconds(),e,3)}function Lt(t,e){return Pt(t,e)+"000"}function qt(t,e){return st(t.getMonth()+1,e,2)}function Ut(t,e){return st(t.getMinutes(),e,2)}function Ft(t,e){return st(t.getSeconds(),e,2)}function jt(t){var e=t.getDay();return 0===e?7:e}function It(t,e){return st(Sp.count(zp(t),t),e,2)}function $t(t,e){var n=t.getDay();return t=n>=4||0===n?Cp(t):Cp.ceil(t),st(Cp.count(zp(t),t)+(4===zp(t).getDay()),e,2)}function Bt(t){return t.getDay()}function Wt(t,e){return st(Ap.count(zp(t),t),e,2)}function Yt(t,e){return st(t.getFullYear()%100,e,2)}function Ht(t,e){return st(t.getFullYear()%1e4,e,4)}function Gt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+st(e/60|0,"0",2)+st(e%60,"0",2)}function Vt(t,e){return st(t.getUTCDate(),e,2)}function Xt(t,e){return st(t.getUTCHours(),e,2)}function Jt(t,e){return st(t.getUTCHours()%12||12,e,2)}function Zt(t,e){return st(1+Tp.count(Up(t),t),e,3)}function Qt(t,e){return st(t.getUTCMilliseconds(),e,3)}function Kt(t,e){return Qt(t,e)+"000"}function te(t,e){return st(t.getUTCMonth()+1,e,2)}function ee(t,e){return st(t.getUTCMinutes(),e,2)}function ne(t,e){return st(t.getUTCSeconds(),e,2)}function re(t){var e=t.getUTCDay();return 0===e?7:e}function ie(t,e){return st(Rp.count(Up(t),t),e,2)}function ae(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Lp(t):Lp.ceil(t),st(Lp.count(Up(t),t)+(4===Up(t).getUTCDay()),e,2)}function oe(t){return t.getUTCDay()}function ue(t,e){return st(Pp.count(Up(t),t),e,2)}function se(t,e){return st(t.getUTCFullYear()%100,e,2)}function fe(t,e){return st(t.getUTCFullYear()%1e4,e,4)}function ce(){return"+0000"}function le(){return"%"}function he(t){return+t}function de(t){return Math.floor(+t/1e3)}function pe(t){return Fp=function(t){function e(t,e){return function(n){var r,i,a,o=[],u=-1,s=0,f=t.length;for(n instanceof Date||(n=new Date(+n));++u<f;)37===t.charCodeAt(u)&&(o.push(t.slice(s,u)),null!=(i=Wp[r=t.charAt(++u)])?r=t.charAt(++u):i="e"===r?" ":"0",(a=e[r])&&(r=a(n,i)),o.push(r),s=u+1);return o.push(t.slice(s,u)),o.join("")}}function n(t,e){return function(n){var i,a,o=ut(1900);if(r(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(a=(i=ot(ut(o.y))).getUTCDay())>4||0===a?Pp.ceil(i):Pp(i),i=Tp.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(i=(a=(i=e(ut(o.y))).getDay())>4||0===a?Ap.ceil(i):Ap(i),i=Ep.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),a="Z"in o?ot(ut(o.y)).getUTCDay():e(ut(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(a+5)%7:o.w+7*o.U-(a+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ot(o)):e(o)}}function r(t,e,n,r){for(var i,a,o=0,u=e.length,s=n.length;o<u;){if(r>=s)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=k[i in Wp?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}var i=t.dateTime,a=t.date,o=t.time,u=t.periods,s=t.days,f=t.shortDays,c=t.months,l=t.shortMonths,h=ct(u),d=lt(u),p=ct(s),g=lt(s),v=ct(f),m=lt(f),y=ct(c),b=lt(c),_=ct(l),x=lt(l),w={a:function(t){return f[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:null,d:Ot,e:Ot,f:Lt,H:Nt,I:Tt,j:Rt,L:Pt,m:qt,M:Ut,p:function(t){return u[+(t.getHours()>=12)]},Q:he,s:de,S:Ft,u:jt,U:It,V:$t,w:Bt,W:Wt,x:null,X:null,y:Yt,Y:Ht,Z:Gt,"%":le},M={a:function(t){return f[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return c[t.getUTCMonth()]},c:null,d:Vt,e:Vt,f:Kt,H:Xt,I:Jt,j:Zt,L:Qt,m:te,M:ee,p:function(t){return u[+(t.getUTCHours()>=12)]},Q:he,s:de,S:ne,u:re,U:ie,V:ae,w:oe,W:ue,x:null,X:null,y:se,Y:fe,Z:ce,"%":le},k={a:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.w=m[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.w=g[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=_.exec(e.slice(n));return r?(t.m=x[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=b[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,e,n){return r(t,i,e,n)},d:xt,e:xt,f:At,H:Mt,I:Mt,j:wt,L:St,m:_t,M:kt,p:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.p=d[r[0].toLowerCase()],n+r[0].length):-1},Q:Dt,s:zt,S:Et,u:dt,U:pt,V:gt,w:ht,W:vt,x:function(t,e,n){return r(t,a,e,n)},X:function(t,e,n){return r(t,o,e,n)},y:yt,Y:mt,Z:bt,"%":Ct};return w.x=e(a,w),w.X=e(o,w),w.c=e(i,w),M.x=e(a,M),M.X=e(o,M),M.c=e(i,M),{format:function(t){var n=e(t+="",w);return n.toString=function(){return t},n},parse:function(t){var e=n(t+="",at);return e.toString=function(){return t},e},utcFormat:function(t){var n=e(t+="",M);return n.toString=function(){return t},n},utcParse:function(t){var e=n(t,ot);return e.toString=function(){return t},e}}}(t),jp=Fp.format,Ip=Fp.parse,$p=Fp.utcFormat,Bp=Fp.utcParse,Fp}function ge(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function ve(t,e){return t?function(n,r){return t(n,r)&&e(n,r)}:e}function me(t,e){var n=[];return qd(t,e,function(t){n.push(t)}),n}function ye(t,e){var n={};return t.visit(e,function(t){n[y(t)]=1}),function(t){return n[y(t)]?null:t}}function be(t,e,n,r){var i,a,o,u,s,f=0;for(this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n,o=0,u=n.length;o<u;++o)if((i=n[o]).stamp===e){if(i.fields){a=this.fields||(this.fields={});for(s in i.fields)a[s]=1}i.changed(this.ADD)&&(f|=this.ADD),i.changed(this.REM)&&(f|=this.REM),i.changed(this.MOD)&&(f|=this.MOD)}this.changes=f}function _e(t){this.cmp=t,this.nodes=[]}function xe(t,e,n,r){var i,a,o;for(i=t[n];n>e&&r(i,a=t[o=n-1>>1])<0;)t[n]=a,n=o;return t[n]=i}function we(t,e,n){for(var r,i=e,a=t.length,o=t[e],u=2*e+1;u<a;)(r=u+1)<a&&n(t[u],t[r])>=0&&(u=r),t[e]=t[u],u=2*(e=u)+1;return t[e]=o,xe(t,i,e,n)}function Me(){this._log=ld(),this.logLevel(sd),this._clock=0,this._rank=0;try{this._loader=ap()}catch(t){}this._touched=v(nd),this._pulses={},this._pulse=null,this._heap=new _e(function(t,e){return t.qrank-e.qrank}),this._postrun=[]}function ke(t){return function(){return this._log[t].apply(this,arguments)}}function Ee(t,e){A.call(this,t,null,e)}function Se(t){var e=Ae(t);return e&&e.Definition||null}function Ae(t){return t=t&&t.toLowerCase(),ig.hasOwnProperty(t)?ig[t]:null}function Ce(t){return t&&t.length?1===t.length?t[0]:function(t){return function(e){for(var n=t.length,r=1,i=String(t[0](e));r<n;++r)i+="|"+t[r](e);return i}}(t):function(){return""}}function De(t,e,n){return n||t+(e?"_"+e:"")}function ze(t,e){return ag[t](e)}function Oe(t){return function(e){var n=bd({init:"",add:"",rem:"",idx:0},t);return n.out=e||t.name,n}}function Ne(t,e){return t.idx-e.idx}function Te(t,e){var n=e||rd,r="var cell = this.cell; this.valid = 0; this.missing = 0;",i="this.cell = cell; this.init();",a="if(v==null){++this.missing; return;} if(v!==v) return; ++this.valid;",o="if(v==null){--this.missing; return;} if(v!==v) return; --this.valid;",u="var cell = this.cell;";return function(t,e){function n(t,r){function i(e){t[e]||n(t,t[e]=ag[e]())}return r.req&&r.req.forEach(i),e&&r.str&&r.str.forEach(i),t}var r,i=t.reduce(n,t.reduce(function(t,e){return t[e.name]=e,t},{})),a=[];for(r in i)a.push(i[r]);return a.sort(Ne)}(t,!0).forEach(function(t){r+=t.init,a+=t.add,o+=t.rem}),t.slice().sort(Ne).forEach(function(t){u+="t['"+t.out+"']="+t.set+";"}),u+="return t;",i=Function("cell",i),i.prototype.init=Function(r),i.prototype.add=Function("v","t",a),i.prototype.rem=Function("v","t",o),i.prototype.set=Function("t",u),i.prototype.get=n,i.fields=t.map(function(t){return t.out}),i}function Re(t){return null===t?NaN:+t}function Pe(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=yg?10:a>=bg?5:a>=_g?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=yg?10:a>=bg?5:a>=_g?2:1)}function Le(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=yg?i*=10:a>=bg?i*=5:a>=_g&&(i*=2),e<t?-i:i}function qe(t){this._key=t?td(t):y,this.reset()}function Ue(t){Ee.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}function Fe(t){Ee.call(this,null,t)}function je(t){Ee.call(this,[],t)}function Ie(t){A.call(this,null,$e,t)}function $e(t){return this.value&&!t.modified()?this.value:vd(t.fields,t.orders)}function Be(t){Ee.call(this,null,t)}function We(t){Ee.call(this,null,t)}function Ye(t,e){var n=t[jg];Ug.hasOwnProperty(n)||Xh("Unknown distribution function: "+n);var r=Ug[n]();for(var i in t)i===Ig?r.data((t.from||e()).map(t[i])):i===Fg?r[i](t[i].map(function(t){return Ye(t,e)})):typeof r[i]===jg&&r[i](t[i]);return r}function He(t){Ee.call(this,null,t)}function Ge(t){Ee.call(this,[1/0,-1/0],t)}function Ve(t,e){A.call(this,t),this.parent=e}function Xe(t){Ee.call(this,{},t),this._keys=wd();var e=this._targets=[];e.active=0,e.forEach=function(t){for(var n=0,r=e.active;n<r;++n)t(e[n],n,e)}}function Je(t){A.call(this,null,Ze,t)}function Ze(t){return this.value&&!t.modified()?this.value:Zh(t.name)?pd(t.name).map(function(t){return td(t)}):td(t.name,t.as)}function Qe(t){Ee.call(this,wd(),t)}function Ke(t){Ee.call(this,{},t)}function tn(t){return t.fields.join("|")}function en(t){Ee.call(this,null,t)}function nn(t){Ee.call(this,[],t)}function rn(t){Ee.call(this,[],t)}function an(t){Ue.call(this,t)}function on(t){A.call(this,null,un,t)}function un(t){return this.value&&!t.modified()?this.value:Cd(t.fields,t.flat)}function sn(t){Ee.call(this,{},t)}function fn(t){A.call(this,null,cn,t)}function cn(t){if(this.value&&!t.modified())return this.value;var e,n,r,i=1/0,a=-1/0,o=t.extents;for(e=0,n=o.length;e<n;++e)(r=o[e])[0]<i&&(i=r[0]),r[1]>a&&(a=r[1]);return[i,a]}function ln(t){A.call(this,null,hn,t)}function hn(t){return this.value&&!t.modified()?this.value:t.values.reduce(function(t,e){return t.concat(e)},[])}function dn(t){Ee.call(this,null,t)}function pn(t){Xe.call(this,t)}function gn(t){Ee.call(this,null,t)}function vn(t){Ee.call(this,null,t)}function mn(t){Ee.call(this,null,t)}function yn(t){Ee.call(this,[],t),this.count=0}function bn(t){Ee.call(this,null,t)}function _n(t){Ee.call(this,null,t),this.modified(!0)}function xn(t){Ee.call(this,wd(),t)}function wn(t){Ee.call(this,null,t)}function Mn(t){function r(t){pd(n(t)).forEach(function(t){c[t]=1})}var i=pd(t.ops),a=pd(t.fields),o=pd(t.params),u=pd(t.as),s=this.outputs=[],f=this.windows=[],c={},l={},h=!0,d=[],p=[];r(t.sort),i.forEach(function(t,n){var i=a[n],c=e(i),g=De(t,c,u[n]);if(r(i),s.push(g),Xg.hasOwnProperty(t))f.push(function(t,e,n,r){var i=Xg[t](e,n);return{init:i.init||id,update:function(t,e){e[r]=i.next(t)}}}(t,a[n],o[n],g));else{if(null==i&&"count"!==t&&Xh("Null aggregate field specified."),"count"===t)return void d.push(g);h=!1;var v=l[c];v||((v=l[c]=[]).field=i,p.push(v)),v.push(ze(t,g))}}),(d.length||p.length)&&(this.cell=function(t,e,n){t=t.map(function(t){return Te(t,t.field)});var r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,a=r.agg=Array(i),o=0;o<i;++o)a[o]=new t[o](r);if(r.store)var u=r.data=new qe;return r.add=function(t){if(r.num+=1,!n){u&&u.add(t);for(var e=0;e<i;++e)a[e].add(a[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){u&&u.rem(t);for(var e=0;e<i;++e)a[e].rem(a[e].get(t),t)}},r.set=function(t){var i,o;for(u&&u.values(),i=0,o=e.length;i<o;++i)t[e[i]]=r.num;if(!n)for(i=0,o=a.length;i<o;++i)a[i].set(t)},r.init=function(){r.num=0,u&&u.reset();for(var t=0;t<i;++t)a[t].init()},r}(p,d,h)),this.inputs=Object.keys(c)}function kn(t){Ee.call(this,{},t),this._mlen=0,this._mods=[]}function En(t,e,n){var r=n.sort,i=r&&!n.ignorePeers,a=n.frame||[null,0],o=t.data(r),u=o.length,s=0,f=i?cg(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:o,compare:r||md(-1)};for(e.init();s<u;++s)!function(t,e,n,r){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}(c,a,s,u),i&&function(t,e){var n=t.i0,r=t.i1-1,i=t.compare,a=t.data,o=a.length-1;n>0&&!i(a[n],a[n-1])&&(t.i0=e.left(a,a[n]));r<o&&!i(a[r],a[r+1])&&(t.i1=e.right(a,a[r]))}(c,f),e.update(c,o[s])}function Sn(t){this.clear(),t&&this.union(t)}function An(t){this.mark=t,this.bounds=this.bounds||new Sn}function Cn(t){An.call(this,t),this.items=this.items||[]}function Dn(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function zn(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function On(t,e,n,r){var i,a=t.childNodes[e];return a&&a.tagName.toLowerCase()===n.toLowerCase()||(i=a||null,a=Dn(t.ownerDocument,n,r),t.insertBefore(a,i)),a}function Nn(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function Tn(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function Rn(t){this._pending=0,this._loader=t||ap()}function Pn(t){t._pending+=1}function Ln(t){t._pending-=1}function qn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Un(){return new qn}function Fn(t){return t>=1?_v:t<=-1?-_v:Math.asin(t)}function jn(t){return t.innerRadius}function In(t){return t.outerRadius}function $n(t){return t.startAngle}function Bn(t){return t.endAngle}function Wn(t){return t&&t.padAngle}function Yn(t,e,n,r,i,a,o){var u=t-n,s=e-r,f=(o?a:-a)/mv(u*u+s*s),c=f*s,l=-f*u,h=t+c,d=e+l,p=n+c,g=r+l,v=(h+p)/2,m=(d+g)/2,y=p-h,b=g-d,_=y*y+b*b,x=i-a,w=h*g-p*d,M=(b<0?-1:1)*mv(pv(0,x*x*_-w*w)),k=(w*b-y*M)/_,E=(-w*y-b*M)/_,S=(w*b+y*M)/_,A=(-w*y+b*M)/_,C=k-v,D=E-m,z=S-v,O=A-m;return C*C+D*D>z*z+O*O&&(k=S,E=A),{cx:k,cy:E,x01:-c,y01:-l,x11:k*(i/x-1),y11:E*(i/x-1)}}function Hn(t){this._context=t}function Gn(t){return t[0]}function Vn(t){return t[1]}function Xn(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 Jn(t){this._context=t}function Zn(t){this._context=t}function Qn(t){this._context=t}function Kn(t,e){this._basis=new Jn(t),this._beta=e}function tr(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 er(t,e){this._context=t,this._k=(1-e)/6}function nr(t,e){this._context=t,this._k=(1-e)/6}function rr(t,e){this._context=t,this._k=(1-e)/6}function ir(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>yv){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>yv){var f=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*f+t._x1*t._l23_2a-e*t._l12_2a)/c,o=(o*f+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function ar(t,e){this._context=t,this._alpha=e}function or(t,e){this._context=t,this._alpha=e}function ur(t,e){this._context=t,this._alpha=e}function sr(t){this._context=t}function fr(t){return t<0?-1:1}function cr(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),u=(a*i+o*r)/(r+i);return(fr(a)+fr(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function lr(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function hr(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,u=(a-r)/3;t._context.bezierCurveTo(r+u,i+u*e,a-u,o-u*n,a,o)}function dr(t){this._context=t}function pr(t){this._context=new gr(t)}function gr(t){this._context=t}function vr(t){this._context=t}function mr(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(i[r-1]=o[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function yr(t,e){this._context=t,this._t=e}function br(t,e,n){var r=Pv.hasOwnProperty(t)&&Pv[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}function _r(t){var e=Iv.call(t);if(jv[e])return jv[e];var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],f=t[7],c=f*o,l=-s*u,h=s*o,d=f*u,p=Math.cos(i),g=Math.sin(i),v=Math.cos(a),m=Math.sin(a),y=.5*(a-i),b=Math.sin(.5*y),_=8/3*b*b/Math.sin(y),x=n+p-_*g,w=r+g+_*p,M=n+v,k=r+m,E=M+_*m,S=k-_*v;return jv[e]=[c*x+l*w,h*x+d*w,c*E+l*S,h*E+d*S,c*M+l*k,h*M+d*k]}function xr(t,e){var n=$v[0]=t[0];if("a"===n||"A"===n)$v[1]=e*t[1],$v[2]=e*t[2],$v[6]=e*t[6],$v[7]=e*t[7];else for(var r=1,i=t.length;r<i;++r)$v[r]=e*t[r];return $v}function wr(t,e,n,r){for(var i=function(t,e,n,r,i,a,o,u,s){var f=Iv.call(arguments);if(Fv[f])return Fv[f];var c=o*(Math.PI/180),l=Math.sin(c),h=Math.cos(c),d=h*(u-t)*.5+l*(s-e)*.5,p=h*(s-e)*.5-l*(u-t)*.5,g=d*d/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);g>1&&(n*=g=Math.sqrt(g),r*=g);var v=h/n,m=l/n,y=-l/r,b=h/r,_=v*u+m*s,x=y*u+b*s,w=v*t+m*e,M=y*t+b*e,k=1/((w-_)*(w-_)+(M-x)*(M-x))-.25;k<0&&(k=0);var E=Math.sqrt(k);a==i&&(E=-E);var S=.5*(_+w)-E*(M-x),A=.5*(x+M)+E*(w-_),C=Math.atan2(x-A,_-S),D=Math.atan2(M-A,w-S)-C;D<0&&1===a?D+=2*Math.PI:D>0&&0===a&&(D-=2*Math.PI);for(var z=Math.ceil(Math.abs(D/(.5*Math.PI+.001))),O=[],N=0;N<z;++N){var T=C+N*D/z,R=C+(N+1)*D/z;O[N]=[S,A,T,R,n,r,l,h]}return Fv[f]=O}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n),a=0;a<i.length;++a){var o=_r(i[a]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}function Mr(t){return Hv.hasOwnProperty(t)?Hv[t]:function(t){if(!Gv.hasOwnProperty(t)){var e=Uv(t);Gv[t]={draw:function(t,n){Bv(t,e,0,0,Math.sqrt(n)/2)}}}return Gv[t]}(t)}function kr(t){return t.x}function Er(t){return t.y}function Sr(t){return t.width}function Ar(t){return t.height}function Cr(t){return function(){return t}}function Dr(t){return t.x||0}function zr(t){return t.y||0}function Or(t){return t.cornerRadius||0}function Nr(t){return!(!1===t.defined)}function Tr(t,e,n,r){return em.context(t)(e,n,r)}function Rr(t){return Rv=t,Rr}function Pr(){}function Lr(t,e){Rv.add(t,e)}function qr(t,e){return t.zindex-e.zindex||t.index-e.index}function Ur(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,a=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&a.push(e);return t.zdirty=!1,t.zitems=a.sort(qr)}function Fr(t,e){var n,r,i=t.items;if(i&&i.length){var a=Ur(t);if(a&&a.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=a}for(n=0,r=i.length;n<r;++n)e(i[n])}}function jr(t,e){var n,r,i=t.items;if(!i||!i.length)return null;var a=Ur(t);for(a&&a.length&&(i=a),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===a)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function Ir(t){return function(e,n,r){Fr(n,function(n){r&&!r.intersects(n.bounds)||$r(t,e,n,n)})}}function $r(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(n.fill&&lm(e,n,i)&&e.fill(),n.stroke&&dm(e,n,i)&&e.stroke()))}function Br(t){return t||(t=pm),function(e,n,r,i,a,o){return e.pixelRatio>1&&(r*=e.pixelRatio,i*=e.pixelRatio),jr(n,function(n){var u=n.bounds;if((!u||u.contains(a,o))&&u)return t(e,n,r,i,a,o)?n:void 0})}}function Wr(t,e){return function(n,r,i,a){var o,u,s=Array.isArray(r)?r[0]:r,f=null==e?s.fill:e,c=s.stroke&&n.isPointInStroke;return c&&(o=s.strokeWidth,u=s.strokeCap,n.lineWidth=null!=o?o:1,n.lineCap=null!=u?u:"butt"),!t(n,r)&&(f&&n.isPointInPath(i,a)||c&&n.isPointInStroke(i,a))}}function Yr(t){return Br(Wr(t))}function Hr(t,e){var n=t.image;return n&&n.url===t.url||(n={loaded:!1,width:0,height:0},e.loadImage(t.url).then(function(e){t.image=e,t.image.url=t.url})),n}function Gr(t,e){return"center"===t?e/2:"right"===t?e:0}function Vr(t,e){return"middle"===t?e/2:"bottom"===t?e:0}function Xr(t,e){var n=e.path;if(null==n)return!0;var r=e.pathCache;r&&r.path===n||((e.pathCache=r=Uv(n)).path=n),Bv(t,r,e.x,e.y)}function Jr(t,e){t.beginPath(),Tr(t,e)}function Zr(t,e,n){var r,i,a,o;return!(!e.stroke||!dm(t,e,n))&&(r=e.x||0,i=e.y||0,a=null!=e.x2?e.x2:r,o=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(a,o),!0)}function Qr(t){return fm=ni(t),Kr(ii(t))}function Kr(t){return~~(.8*t.length*fm)}function ti(t){return sm.font=ai(t),ei(ii(t))}function ei(t){return sm.measureText(t).width}function ni(t){return null!=t.fontSize?t.fontSize:11}function ri(t){sm=t&&(sm=iv(1,1))?sm.getContext("2d"):null,Nm.width=sm?ti:Qr}function ii(t){var e=t.text;return null==e?"":t.limit>0?function(t){var e,n=+t.limit,r=t.text+"";sm?(sm.font=ai(t),e=ei):(fm=ni(t),e=Kr);if(e(r)<n)return r;var i,a=t.ellipsis||"…",o="rtl"===t.dir,u=0,s=r.length;{if(n-=e(a),o){for(;u<s;)i=u+s>>>1,e(r.slice(i))>n?u=i+1:s=i;return a+r.slice(u)}for(;u<s;)i=1+(u+s>>>1),e(r.slice(0,i))<n?u=i:s=i-1;return r.slice(0,u)+a}}(t):e+""}function ai(t,e){var n=t.font;return e&&n&&(n=String(n).replace(/"/g,"'")),(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+ni(t)+"px "+(n||"sans-serif")}function oi(t){var e=t.baseline,n=ni(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}function ui(t,e,n){var r,i,a=Nm.height(e),o=e.align,u=e.radius||0,s=e.x||0,f=e.y||0,c=e.dx||0,l=(e.dy||0)+oi(e)-Math.round(.8*a);return u&&(i=(e.theta||0)-Math.PI/2,s+=u*Math.cos(i),f+=u*Math.sin(i)),r=Nm.width(e),"center"===o?c-=r/2:"right"===o&&(c-=r),t.set(c+=s,l+=f,c+r,l+a),e.angle&&!n&&t.rotate(e.angle*Math.PI/180,s,f),t.expand(n||!r?0:1)}function si(t,e){return JSON.stringify(t,Fm,e)}function fi(t){return ci("string"==typeof t?JSON.parse(t):t)}function ci(t){var e,n,r,i=t.marktype,a=t.items;if(a)for(n=0,r=a.length;n<r;++n)e=i?"mark":"group",a[n][e]=t,a[n].zindex&&(a[n][e].zdirty=!0),"group"===(i||e)&&ci(a[n]);return i&&Um(t),t}function li(t){arguments.length?this.root=fi(t):(this.root=hi({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Cn(this.root)])}function hi(t,e){return{bounds:new Sn,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0}}function di(t){this._active=null,this._handlers={},this._loader=t||ap()}function pi(t){this._el=null,this._bgcolor=null,this._loader=new Rn(t)}function gi(t){di.call(this,t),this._down=null,this._touch=null,this._first=!0}function vi(t,e,n){return function(r){var i=this._active,a=this.pickEvent(r);a===i?this.fire(t,r):(i&&i.exit||this.fire(n,r),this._active=a,this.fire(e,r),this.fire(t,r))}}function mi(t){return function(e){this.fire(t,e),this._active=null}}function yi(t){pi.call(this,t),this._redraw=!1,this._dirty=new Sn}function bi(t){di.call(this,t);var e=this;e._hrefHandler=_i(e,function(t,n){n&&n.href&&e.handleHref(t,n,n.href)}),e._tooltipHandler=_i(e,function(t,n){n&&n.tooltip&&e.handleTooltip(t,n,"mouseover"===t.type?n.tooltip:null)})}function _i(t,e){return function(n){var r=n.target.__data__;n.vegaType=n.type,r=Array.isArray(r)?r[0]:r,e.call(t._obj,n,r)}}function xi(t,e,n){var r,i,a="<"+t;if(e)for(r in e)null!=(i=e[r])&&(a+=" "+r+'="'+i+'"');return n&&(a+=" "+n),a+">"}function wi(t){return"</"+t+">"}function Mi(t){pi.call(this,t),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}function ki(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function Ei(t,e,n,r){var i,a=t._svg;if(!a&&(i=e.ownerDocument,a=Dn(i,r,Km),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){var o=Dn(i,"path",Km);o.setAttribute("class","background"),a.appendChild(o),o.__data__=t;var u=Dn(i,"g",Km);a.appendChild(u),u.__data__=t}return!i&&a.previousSibling===n&&n||e.insertBefore(a,n?n.nextSibling:e.firstChild),a}function Si(t,e,n){e!==ry[t]&&(null!=e?n?ny.setAttributeNS(n,t,e):ny.setAttribute(t,e):n?ny.removeAttributeNS(n,t):ny.removeAttribute(t),ry[t]=e)}function Ai(t){pi.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}function Ci(t,e,n,r){uy[r||t]=e}function Di(t,e,n,r){if(null==t)return"";var i,a,o,u,s,f="";for("bgrect"===n&&!1===e.interactive&&(f+="pointer-events: none;"),"text"===n&&(f+="font: "+ai(t)+";"),i=0,a=Qm.length;i<a;++i)o=Qm[i],u=Zm[o],null==(s=t[o])?"fill"===u&&(f+=(f.length?" ":"")+"fill: none;"):(s.id&&(r.gradient[s.id]=s,s="url(#"+s.id+")"),f+=(f.length?" ":"")+u+": "+s+";");return f?'style="'+f+'"':null}function zi(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(fy[t]=e,this):fy[t]}function Oi(t,e,n){return t===e||("path"===n?Ni(t,e):t instanceof Date&&e instanceof Date?+t==+e:Sd(t)&&Sd(e)?Math.abs(t-e)<=cy:t&&e&&(Qh(t)||Qh(e))?null!=t&&null!=e&&function(t,e){var n,r,i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(i.sort(),a.sort(),r=i.length-1;r>=0;r--)if(i[r]!=a[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!Oi(t[n],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Ni(t,e){return Oi(Uv(t),Uv(e))}function Ti(t){Ee.call(this,null,t)}function Ri(t,e,n){return e(t.bounds.clear(),t,n)}function Pi(t){Ee.call(this,0,t)}function Li(t){Ee.call(this,null,t)}function qi(t){Ee.call(this,null,t)}function Ui(t,e){return!(t.x2-1<e.x1||t.x1+1>e.x2||t.y2-1<e.y1||t.y1+1>e.y2)}function Fi(t){for(var e,n=1,r=t.length,i=t[0].bounds;n<r;i=e,++n)if(Ui(i,e=t[n].bounds))return!0}function ji(t){var e=t.bounds;return e.width()>1&&e.height()>1}function Ii(t){Ee.call(this,null,t)}function $i(t,e){for(var n=0,r=t.length;n<r;++n)e.push(t[n])}function Bi(t,e,n){var r=Qh(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function Wi(t){return t<0?Math.ceil(-t):0}function Yi(t,e,n){function r(t,e){return Math.floor(Math.min(t,e))}function i(t,e){return Math.ceil(Math.max(t,e))}var a,o,u,s,f,c,l,h,d,p,g,v,m,y=function(t){for(var e,n,r=t.items,i=r.length,a=0,o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};a<i;++a)if(e=r[a],n=e.items,"group"===e.marktype)switch(e.role){case by:case _y:break;case xy:$i(n,o.rowheaders);break;case wy:$i(n,o.rowfooters);break;case ky:$i(n,o.colheaders);break;case Ey:$i(n,o.colfooters);break;case My:o.rowtitle=n[0];break;case Sy:o.coltitle=n[0];break;default:$i(n,o.marks)}return o}(e),b=y.marks,_="flush"===n.bounds,x=_?function(t){return{x1:0,y1:0,x2:t.width||0,y2:t.height||0}}:function(t){var e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))},w=new Sn(0,0,0,0),M=Bi(n.align,"column"),k=Bi(n.align,"row"),E=Bi(n.padding,"column"),S=Bi(n.padding,"row"),A=n.offset,C=e.columns||n.columns||b.length,D=C<0?1:Math.ceil(b.length/C),z=D*C,O=[],N=[],T=[],R=[],P=b.length;for(o=0;o<C;++o)N[o]=0;for(o=0;o<D;++o)R[o]=0;for(o=0;o<P;++o)f=x(b[o]),s=~~(o/C),l=(u=o%C)?Math.ceil(x(b[o-1]).x2):0,h=s?Math.ceil(x(b[o-C]).y2):0,N[u]=Math.max(N[u],l),R[s]=Math.max(R[s],h),O.push(E+Wi(f.x1)),T.push(S+Wi(f.y1)),t.dirty(b[o]);for(o=0;o<P;++o)o%C==0&&(O[o]=0),o<C&&(T[o]=0);if("each"===M)for(u=1;u<C;++u){for(m=0,o=u;o<P;o+=C)m<O[o]&&(m=O[o]);for(o=u;o<P;o+=C)O[o]=m+N[u]}else if("all"===M){for(v=0,u=1;u<C;++u)v<N[u]&&(v=N[u]);for(m=0,o=0;o<P;++o)o%C&&m<O[o]&&(m=O[o]);for(o=0;o<P;++o)o%C&&(O[o]=m+v)}else for(u=1;u<C;++u)for(o=u;o<P;o+=C)O[o]+=N[u];if("each"===k)for(s=1;s<D;++s){for(m=0,a=(o=s*C)+C;o<a;++o)m<T[o]&&(m=T[o]);for(o=s*C;o<a;++o)T[o]=m+R[s]}else if("all"===k){for(v=0,s=1;s<D;++s)v<R[s]&&(v=R[s]);for(m=0,o=C;o<P;++o)m<T[o]&&(m=T[o]);for(o=C;o<P;++o)T[o]=m+v}else for(s=1;s<D;++s)for(a=(o=s*C)+C;o<a;++o)T[o]+=R[s];for(d=0,o=0;o<P;++o)l=(c=b[o]).x||0,c.x=d=O[o]+(o%C?d:0),c.bounds.translate(d-l,0);for(u=0;u<C;++u)for(p=0,o=u;o<P;o+=C)h=(c=b[o]).y||0,c.y=p+=T[o],c.bounds.translate(0,p-h);for(o=0;o<P;++o)b[o].mark.bounds.clear();for(o=0;o<P;++o)c=b[o],t.dirty(c),w.union(c.mark.bounds.union(c.bounds));x=_?function(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}:function(t,e){return t.bounds[e]},g=Bi(n.headerBand,"row",null),d=Hi(t,y.rowheaders,b,C,D,-Bi(A,"rowHeader"),r,0,x,"x1",0,C,1,g),g=Bi(n.headerBand,"column",null),p=Hi(t,y.colheaders,b,C,C,-Bi(A,"columnHeader"),r,1,x,"y1",0,1,C,g),g=Bi(n.footerBand,"row",null),Hi(t,y.rowfooters,b,C,D,Bi(A,"rowFooter"),i,0,x,"x2",C-1,C,1,g),g=Bi(n.footerBand,"column",null),Hi(t,y.colfooters,b,C,C,Bi(A,"columnFooter"),i,1,x,"y2",z-C,1,C,g),y.rowtitle&&(m=d-Bi(A,"rowTitle"),g=Bi(n.titleBand,"row",.5),Gi(t,y.rowtitle,m,0,w,g)),y.coltitle&&(m=p-Bi(A,"columnTitle"),g=Bi(n.titleBand,"column",.5),Gi(t,y.coltitle,m,1,w,g))}function Hi(t,e,n,r,i,a,o,u,s,f,c,l,h,d){var p,g,v,m,y,b,_,x,w,M=n.length,k=0,E=0;if(!M)return k;for(p=c;p<M;p+=l)n[p]&&(k=o(k,s(n[p],f)));if(!e.length)return k;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),k+=a,g=0,m=e.length;g<m;++g)t.dirty(e[g]),e[g].mark.bounds.clear();for(p=c,g=0,m=e.length;g<m;++g,p+=l){for(y=(b=e[g]).mark.bounds,v=p;v>=0&&null==(_=n[v]);v-=h);u?(x=null==d?_.x:Math.round(_.bounds.x1+d*_.bounds.width()),w=k):(x=k,w=null==d?_.y:Math.round(_.bounds.y1+d*_.bounds.height())),y.union(b.bounds.translate(x-(b.x||0),w-(b.y||0))),b.x=x,b.y=w,t.dirty(b),E=o(E,y[f])}return E}function Gi(t,e,n,r,i,a){if(e){t.dirty(e);var o=n,u=n;r?o=Math.round(i.x1+a*i.width()):u=Math.round(i.y1+a*i.height()),e.bounds.translate(o-(e.x||0),u-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=o,e.y=u,t.dirty(e)}}function Vi(t){Ee.call(this,null,t)}function Xi(t,e,n){var r,i,a,o,u,s,f=e.items,c=Math.max(0,e.width||0),l=Math.max(0,e.height||0),h=(new Sn).set(0,0,c,l),d=h.clone(),p=h.clone(),g=h.clone(),v=[];for(u=0,s=f.length;u<s;++u)switch((i=f[u]).role){case Oy:d.union(o=function(t,e,n,r){var i,a,o=e.items[0],u=o.datum,s=u.orient,f=function(t){var e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(u),c=o.range,l=o.offset,h=o.position,d=o.minExtent,p=o.maxExtent,g=u.title&&o.items[f[2]].items[0],v=o.titlePadding,m=o.bounds,y=0,b=0;Iy.clear().union(m),m.clear(),(i=f[0])>-1&&m.union(o.items[i].bounds);(i=f[1])>-1&&m.union(o.items[i].bounds);switch(s){case py:y=h||0,b=-l,a=Math.max(d,Math.min(p,-m.y1)),g&&(g.auto?(a+=v,g.y=-a,a+=g.bounds.height(),m.add(g.bounds.x1,0).add(g.bounds.x2,0)):m.union(g.bounds)),m.add(0,-a).add(c,0);break;case gy:y=-l,b=h||0,a=Math.max(d,Math.min(p,-m.x1)),g&&(g.auto?(a+=v,g.x=-a,a+=g.bounds.width(),m.add(0,g.bounds.y1).add(0,g.bounds.y2)):m.union(g.bounds)),m.add(-a,0).add(0,c);break;case vy:y=n+l,b=h||0,a=Math.max(d,Math.min(p,m.x2)),g&&(g.auto?(a+=v,g.x=a,a+=g.bounds.width(),m.add(0,g.bounds.y1).add(0,g.bounds.y2)):m.union(g.bounds)),m.add(0,0).add(a,c);break;case my:y=h||0,b=r+l,a=Math.max(d,Math.min(p,m.y2)),g&&(g.auto?(a+=v,g.y=a,a+=g.bounds.height(),m.add(g.bounds.x1,0).add(g.bounds.x2,0)):m.union(g.bounds)),m.add(0,0).add(c,a);break;default:y=o.x,b=o.y}im(m.translate(y,b),o),Ji(o,"x",y+jy)|Ji(o,"y",b+jy)&&(o.bounds=Iy,t.dirty(o),o.bounds=m,t.dirty(o));return o.mark.bounds.clear().union(m)}(t,i,c,l)),(Zi(i)?p:g).union(o);break;case Ny:r=i;break;case Ry:v.push(i);break;case Ty:case Py:case Ly:case qy:case Uy:case Fy:p.union(i.bounds),g.union(i.bounds);break;default:h.union(i.bounds)}if(r&&(d.union(o=function(t,e,n){var r=e.items[0],i=r.datum.orient,a=r.offset,o=r.bounds,u=0,s=0;switch(Iy.clear().union(o),i){case py:u=r.x,s=n.y1-a;break;case gy:u=n.x1-a,s=r.y;break;case vy:u=n.x2+a,s=r.y;break;case my:u=r.x,s=n.y2+a;break;default:u=r.x,s=r.y}o.translate(u-r.x,s-r.y),Ji(r,"x",u)|Ji(r,"y",s)&&(r.bounds=Iy,t.dirty(r),r.bounds=o,t.dirty(r));return e.bounds.clear().union(o)}(t,r,d)),(Zi(r)?p:g).union(o)),v.length)for(a={left:0,right:0,top:0,bottom:0,margin:n.legendMargin||8},u=0,s=v.length;u<s;++u)if(o=function(t,e,n,r,i,a,o){var u,s,f,c=e.items[0],l=c.datum.orient,h=c.offset,d=c.bounds,p=0,g=0;l===py||l===my?(f=i,p=n[l]):l!==gy&&l!==vy||(f=r,g=n[l]);switch(Iy.clear().union(d),d.clear(),c.items.forEach(function(t){d.union(t.bounds)}),u=Math.round(d.width())+2*c.padding-1,s=Math.round(d.height())+2*c.padding-1,l){case gy:p-=u+h-Math.floor(f.x1),n.left+=s+n.margin;break;case vy:p+=h+Math.ceil(f.x2),n.right+=s+n.margin;break;case py:g-=s+h-Math.floor(f.y1),n.top+=u+n.margin;break;case my:g+=h+Math.ceil(f.y2),n.bottom+=u+n.margin;break;case"top-left":p+=h,g+=h;break;case"top-right":p+=a-u-h,g+=h;break;case"bottom-left":p+=h,g+=o-s-h;break;case"bottom-right":p+=a-u-h,g+=o-s-h;break;default:p=c.x,g=c.y}im(d.set(p,g,p+u,g+s),c),Ji(c,"x",p)|Ji(c,"width",u)|Ji(c,"y",g)|Ji(c,"height",s)&&(c.bounds=Iy,t.dirty(c),c.bounds=d,t.dirty(c));return c.mark.bounds.clear().union(d)}(t,v[u],a,p,g,c,l),n.autosize&&n.autosize.type===Ay){var m=v[u].items[0].datum.orient;m===gy||m===vy?h.add(o.x1,0).add(o.x2,0):m!==py&&m!==my||h.add(0,o.y1).add(0,o.y2)}else h.union(o);h.union(p).union(g).union(d),function(t,e,n,r){var i=r.autosize||{},a=i.type,o=t._width,u=t._height,s=t.padding();if(t._autosize<1||!a)return;var f=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),l=Math.max(0,Math.ceil(n.x2-f)),h=Math.max(0,e.height||0),d=Math.max(0,Math.ceil(-n.y1)),p=Math.max(0,Math.ceil(n.y2-h));i.contains===zy&&(o-=s.left+s.right,u-=s.top+s.bottom);a===Dy?(c=0,d=0,f=o,h=u):a===Ay?(f=Math.max(0,o-c-l),h=Math.max(0,u-d-p)):a===Cy&&(o=f+c+l,u=h+d+p);t._resizeView(o,u,f,h,[c,d],i.resize)}(t,e,h,n)}function Ji(t,e,n){return t[e]===n?0:(t[e]=n,1)}function Zi(t){var e=t.items[0].datum.orient;return e===gy||e===vy}function Qi(t){function e(e){var a=e+"",o=n.get(a);if(!o){if(i!==ob)return i;n.set(a,o=r.push(e))}return t[(o-1)%t.length]}var n=N(),r=[],i=ob;return t=null==t?[]:ab.call(t),e.domain=function(t){if(!arguments.length)return r.slice();r=[],n=N();for(var i,a,o=-1,u=t.length;++o<u;)n.has(a=(i=t[o])+"")||n.set(a,r.push(i));return e},e.range=function(n){return arguments.length?(t=ab.call(n),e):t.slice()},e.unknown=function(t){return arguments.length?(i=t,e):i},e.copy=function(){return Qi().domain(r).range(t).unknown(i)},e}function Ki(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ta(){}function ea(t){var e;return t=(t+"").trim().toLowerCase(),(e=lb.exec(t))?(e=parseInt(e[1],16),new oa(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=hb.exec(t))?na(parseInt(e[1],16)):(e=db.exec(t))?new oa(e[1],e[2],e[3],1):(e=pb.exec(t))?new oa(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gb.exec(t))?ra(e[1],e[2],e[3],e[4]):(e=vb.exec(t))?ra(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=mb.exec(t))?ua(e[1],e[2]/100,e[3]/100,1):(e=yb.exec(t))?ua(e[1],e[2]/100,e[3]/100,e[4]):bb.hasOwnProperty(t)?na(bb[t]):"transparent"===t?new oa(NaN,NaN,NaN,0):null}function na(t){return new oa(t>>16&255,t>>8&255,255&t,1)}function ra(t,e,n,r){return r<=0&&(t=e=n=NaN),new oa(t,e,n,r)}function ia(t){return t instanceof ta||(t=ea(t)),t?(t=t.rgb(),new oa(t.r,t.g,t.b,t.opacity)):new oa}function aa(t,e,n,r){return 1===arguments.length?ia(t):new oa(t,e,n,null==r?1:r)}function oa(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ua(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new fa(t,e,n,r)}function sa(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof fa)return new fa(t.h,t.s,t.l,t.opacity);if(t instanceof ta||(t=ea(t)),!t)return new fa;if(t instanceof fa)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(o=e===a?(n-r)/u+6*(n<r):n===a?(r-e)/u+2:(e-n)/u+4,u/=s<.5?a+i:2-a-i,o*=60):u=s>0&&s<1?0:o,new fa(o,u,s,t.opacity)}(t):new fa(t,e,n,null==r?1:r)}function fa(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ca(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function la(t){if(t instanceof da)return new da(t.l,t.a,t.b,t.opacity);if(t instanceof ba){var e=t.h*_b;return new da(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof oa||(t=ia(t));var n=ma(t.r),r=ma(t.g),i=ma(t.b),a=pa((.4124564*n+.3575761*r+.1804375*i)/wb),o=pa((.2126729*n+.7151522*r+.072175*i)/Mb);return new da(116*o-16,500*(a-o),200*(o-pa((.0193339*n+.119192*r+.9503041*i)/kb)),t.opacity)}function ha(t,e,n,r){return 1===arguments.length?la(t):new da(t,e,n,null==r?1:r)}function da(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function pa(t){return t>Cb?Math.pow(t,1/3):t/Ab+Eb}function ga(t){return t>Sb?t*t*t:Ab*(t-Eb)}function va(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ma(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ya(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof ba)return new ba(t.h,t.c,t.l,t.opacity);t instanceof da||(t=la(t));var e=Math.atan2(t.b,t.a)*xb;return new ba(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ba(t,e,n,null==r?1:r)}function ba(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function _a(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof xa)return new xa(t.h,t.s,t.l,t.opacity);t instanceof oa||(t=ia(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Rb*r+Nb*e-Tb*n)/(Rb+Nb-Tb),a=r-i,o=(Ob*(n-i)-Db*a)/zb,u=Math.sqrt(o*o+a*a)/(Ob*i*(1-i)),s=u?Math.atan2(o,a)*xb-120:NaN;return new xa(s<0?s+360:s,u,i,t.opacity)}(t):new xa(t,e,n,null==r?1:r)}function xa(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function wa(t,e,n,r,i){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)*r+o*i)/6}function Ma(t,e){return function(n){return t+n*e}}function ka(t,e){var n=e-t;return n?Ma(t,n>180||n<-180?n-360*Math.round(n/360):n):$b(isNaN(t)?e:t)}function Ea(t){return 1==(t=+t)?Sa:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):$b(isNaN(e)?n:e)}}function Sa(t,e){var n=e-t;return n?Ma(t,n):$b(isNaN(t)?e:t)}function Aa(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),u=new Array(i);for(n=0;n<i;++n)r=aa(e[n]),a[n]=r.r||0,o[n]=r.g||0,u[n]=r.b||0;return a=t(a),o=t(o),u=t(u),r.opacity=1,function(t){return r.r=a(t),r.g=o(t),r.b=u(t),r+""}}}function Ca(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var u=[],s=[];return a=t(a),o=t(o),function(t,r,i,a,o,u){if(t!==i||r!==a){var s=o.push("translate(",null,e,null,n);u.push({i:s-4,x:Vb(t,i)},{i:s-2,x:Vb(r,a)})}else(i||a)&&o.push("translate("+i+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,u,s),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Vb(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,u,s),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Vb(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,u,s),function(t,e,n,r,a,o){if(t!==n||e!==r){var u=a.push(i(a)+"scale(",null,",",null,")");o.push({i:u-4,x:Vb(t,n)},{i:u-2,x:Vb(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,u,s),a=o=null,function(t){for(var e,n=-1,r=s.length;++n<r;)u[(e=s[n]).i]=e.x(t);return u.join("")}}}function Da(t){return((t=Math.exp(t))+1/t)/2}function za(t){return function(e,n){var r=t((e=sa(e)).h,(n=sa(n)).h),i=Sa(e.s,n.s),a=Sa(e.l,n.l),o=Sa(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=a(t),e.opacity=o(t),e+""}}}function Oa(t){return function(e,n){var r=t((e=ya(e)).h,(n=ya(n)).h),i=Sa(e.c,n.c),a=Sa(e.l,n.l),o=Sa(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}function Na(t){return function e(n){function r(e,r){var i=t((e=_a(e)).h,(r=_a(r)).h),a=Sa(e.s,r.s),o=Sa(e.l,r.l),u=Sa(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=u(t),e+""}}return n=+n,r.gamma=e,r}(1)}function Ta(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:p_(e)}function Ra(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function Pa(t,e){function n(){return i=Math.min(u.length,s.length)>2?function(t,e,n,r){var i=Math.min(t.length,e.length)-1,a=new Array(i),o=new Array(i),u=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++u<i;)a[u]=n(t[u],t[u+1]),o[u]=r(e[u],e[u+1]);return function(e){var n=hg(t,e,1,i)-1;return o[n](a[n](e))}}:function(t,e,n,r){var i=t[0],a=t[1],o=e[0],u=e[1];return a<i?(i=n(a,i),o=r(u,o)):(i=n(i,a),o=r(o,u)),function(t){return o(i(t))}},a=o=null,r}function r(e){return(a||(a=i(u,s,c?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:r(t)}}}(t):t,f)))(+e)}var i,a,o,u=v_,s=v_,f=Kb,c=!1;return r.invert=function(t){return(o||(o=i(s,u,Ta,c?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:r(t)}}}(e):e)))(+t)},r.domain=function(t){return arguments.length?(u=ib.call(t,g_),n()):u.slice()},r.range=function(t){return arguments.length?(s=ab.call(t),n()):s.slice()},r.rangeRound=function(t){return s=ab.call(t),f=t_,n()},r.clamp=function(t){return arguments.length?(c=!!t,n()):c},r.interpolate=function(t){return arguments.length?(f=t,n()):f},n()}function La(t){return new qa(t)}function qa(t){if(!(e=x_.exec(t)))throw new Error("invalid format: "+t);var e,n=e[1]||" ",r=e[2]||">",i=e[3]||"-",a=e[4]||"",o=!!e[5],u=e[6]&&+e[6],s=!!e[7],f=e[8]&&+e[8].slice(1),c=e[9]||"";"n"===c?(s=!0,c="g"):__[c]||(c=""),(o||"0"===n&&"="===r)&&(o=!0,n="0",r="="),this.fill=n,this.align=r,this.sign=i,this.symbol=a,this.zero=o,this.width=u,this.comma=s,this.precision=f,this.type=c}function Ua(t){return w_=A_(t),M_=w_.format,k_=w_.formatPrefix,w_}function Fa(t){var e=t.domain;return t.ticks=function(t){var n=e();return xg(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){return C_(e(),t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,o=i.length-1,u=i[a],s=i[o];return s<u&&(r=u,u=s,s=r,r=a,a=o,o=r),(r=Pe(u,s,n))>0?r=Pe(u=Math.floor(u/r)*r,s=Math.ceil(s/r)*r,n):r<0&&(r=Pe(u=Math.ceil(u*r)/r,s=Math.floor(s*r)/r,n)),r>0?(i[a]=Math.floor(u/r)*r,i[o]=Math.ceil(s/r)*r,e(i)):r<0&&(i[a]=Math.ceil(u*r)/r,i[o]=Math.floor(s*r)/r,e(i)),t},t}function ja(){var t=Pa(Ta,Vb);return t.copy=function(){return Ra(t,ja())},Fa(t)}function Ia(){function t(t){return+t}var e=[0,1];return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=ib.call(n,g_),t):e.slice()},t.copy=function(){return Ia().domain(e)},Fa(t)}function $a(t,e){return(e=Math.log(e/t))?function(n){return Math.log(n/t)/e}:p_(e)}function Ba(t,e){return t<0?function(n){return-Math.pow(-e,n)*Math.pow(-t,1-n)}:function(n){return Math.pow(e,n)*Math.pow(t,1-n)}}function Wa(t){return 10===t?function(t){return isFinite(t)?+("1e"+t):t<0?0:t}:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}function Ya(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}function Ha(t){return function(e){return-t(-e)}}function Ga(){function t(){return i=Ya(r),a=Wa(r),n()[0]<0&&(i=Ha(i),a=Ha(a)),e}var e=Pa($a,Ba).domain([1,10]),n=e.domain,r=10,i=Ya(10),a=Wa(10);return e.base=function(e){return arguments.length?(r=+e,t()):r},e.domain=function(e){return arguments.length?(n(e),t()):n()},e.ticks=function(t){var e,o=n(),u=o[0],s=o[o.length-1];(e=s<u)&&(h=u,u=s,s=h);var f,c,l,h=i(u),d=i(s),p=null==t?10:+t,g=[];if(!(r%1)&&d-h<p){if(h=Math.round(h)-1,d=Math.round(d)+1,u>0){for(;h<d;++h)for(c=1,f=a(h);c<r;++c)if(!((l=f*c)<u)){if(l>s)break;g.push(l)}}else for(;h<d;++h)for(c=r-1,f=a(h);c>=1;--c)if(!((l=f*c)<u)){if(l>s)break;g.push(l)}}else g=xg(h,d,Math.min(d-h,p)).map(a);return e?g.reverse():g},e.tickFormat=function(t,n){if(null==n&&(n=10===r?".0e":","),"function"!=typeof n&&(n=M_(n)),t===1/0)return n;null==t&&(t=10);var o=Math.max(1,r*t/e.ticks().length);return function(t){var e=t/a(Math.round(i(t)));return e*r<r-.5&&(e*=r),e<=o?n(t):""}},e.nice=function(){return n(D_(n(),{floor:function(t){return a(Math.floor(i(t)))},ceil:function(t){return a(Math.ceil(i(t)))}}))},e.copy=function(){return Ra(e,Ga().base(r))},e}function Va(t,e){return t<0?-Math.pow(-t,e):Math.pow(t,e)}function Xa(){var t=1,e=Pa(function(e,n){return(n=Va(n,t)-(e=Va(e,t)))?function(r){return(Va(r,t)-e)/n}:p_(n)},function(e,n){return n=Va(n,t)-(e=Va(e,t)),function(r){return Va(e+n*r,1/t)}}),n=e.domain;return e.exponent=function(e){return arguments.length?(t=+e,n(n())):t},e.copy=function(){return Ra(e,Xa().exponent(t))},Fa(e)}function Ja(){function t(){var t=0,a=Math.max(1,r.length);for(i=new Array(a-1);++t<a;)i[t-1]=Mg(n,t/a);return e}function e(t){if(!isNaN(t=+t))return r[hg(i,t)]}var n=[],r=[],i=[];return e.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},e.domain=function(e){if(!arguments.length)return n.slice();n=[];for(var r,i=0,a=e.length;i<a;++i)null==(r=e[i])||isNaN(r=+r)||n.push(r);return n.sort(fg),t()},e.range=function(e){return arguments.length?(r=ab.call(e),t()):r.slice()},e.quantiles=function(){return i.slice()},e.copy=function(){return Ja().domain(n).range(r)},e}function Za(){function t(t){if(t<=t)return o[hg(a,t,0,i)]}function e(){var e=-1;for(a=new Array(i);++e<i;)a[e]=((e+1)*r-(e-i)*n)/(i+1);return t}var n=0,r=1,i=1,a=[.5],o=[0,1];return t.domain=function(t){return arguments.length?(n=+t[0],r=+t[1],e()):[n,r]},t.range=function(t){return arguments.length?(i=(o=ab.call(t)).length-1,e()):o.slice()},t.invertExtent=function(t){var e=o.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,a[0]]:e>=i?[a[i-1],r]:[a[e-1],a[e]]},t.copy=function(){return Za().domain([n,r]).range(o)},Fa(t)}function Qa(){function t(t){if(t<=t)return n[hg(e,t,0,r)]}var e=[.5],n=[0,1],r=1;return t.domain=function(i){return arguments.length?(e=ab.call(i),r=Math.min(e.length,n.length-1),t):e.slice()},t.range=function(i){return arguments.length?(n=ab.call(i),r=Math.min(e.length,n.length-1),t):n.slice()},t.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},t.copy=function(){return Qa().domain(e).range(n)},t}function Ka(t){return new Date(t)}function to(t){return t instanceof Date?+t:+new Date(+t)}function eo(t,e,n,r,i,a,o,u,s){function f(e,n,r,i){if(null==e&&(e=10),"number"==typeof e){var a=Math.abs(r-n)/e,o=cg(function(t){return t[2]}).right(x,a);o===x.length?(i=Le(n/L_,r/L_,e),e=t):o?(i=(o=x[a/x[o-1][2]<x[o][2]/a?o-1:o])[1],e=o[0]):(i=Math.max(Le(n,r,e),1),e=u)}return null==i?e:e.every(i)}var c=Pa(Ta,Vb),l=c.invert,h=c.domain,d=s(".%L"),p=s(":%S"),g=s("%I:%M"),v=s("%I %p"),m=s("%a %d"),y=s("%b %d"),b=s("%B"),_=s("%Y"),x=[[o,1,z_],[o,5,5*z_],[o,15,15*z_],[o,30,30*z_],[a,1,O_],[a,5,5*O_],[a,15,15*O_],[a,30,30*O_],[i,1,N_],[i,3,3*N_],[i,6,6*N_],[i,12,12*N_],[r,1,T_],[r,2,2*T_],[n,1,R_],[e,1,P_],[e,3,3*P_],[t,1,L_]];return c.invert=function(t){return new Date(l(t))},c.domain=function(t){return arguments.length?h(ib.call(t,to)):h().map(Ka)},c.ticks=function(t,e){var n,r=h(),i=r[0],a=r[r.length-1],o=a<i;return o&&(n=i,i=a,a=n),n=f(t,i,a,e),n=n?n.range(i,a+1):[],o?n.reverse():n},c.tickFormat=function(u,f){return null==f?function(u){return(o(u)<u?d:a(u)<u?p:i(u)<u?g:r(u)<u?v:e(u)<u?n(u)<u?m:y:t(u)<u?b:_)(u)}:s(f)},c.nice=function(t,e){var n=h();return(t=f(t,n[0],n[n.length-1],e))?h(D_(n,t)):c},c.copy=function(){return Ra(c,eo(t,e,n,r,i,a,o,u,s))},c}function no(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function ro(){function t(){var t=i().length,r=o[1]<o[0],l=o[r-0],h=o[1-r],d=nb(t,s,f);e=(h-l)/(d||1),u&&(e=Math.floor(e)),l+=(h-l-e*(t-s))*c,n=e*(1-s),u&&(l=Math.round(l),n=Math.round(n));var p=mg(t).map(function(t){return l+e*t});return a(r?p.reverse():p)}var e,n,r=Qi().unknown(void 0),i=r.domain,a=r.range,o=[0,1],u=!1,s=0,f=0,c=.5;return delete r.unknown,r.domain=function(e){return arguments.length?(i(e),t()):i()},r.range=function(e){return arguments.length?(o=[+e[0],+e[1]],t()):o.slice()},r.rangeRound=function(e){return o=[+e[0],+e[1]],u=!0,t()},r.bandwidth=function(){return n},r.step=function(){return e},r.round=function(e){return arguments.length?(u=!!e,t()):u},r.padding=function(e){return arguments.length?(f=Math.max(0,Math.min(1,e)),s=f,t()):s},r.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),t()):s},r.paddingOuter=function(e){return arguments.length?(f=Math.max(0,Math.min(1,e)),t()):f},r.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),t()):c},r.invertRange=function(t){if(null!=t[0]&&null!=t[1]){var e,r,u,s=+t[0],f=+t[1],c=o[1]<o[0],l=c?a().reverse():a(),h=l.length-1;if(s==s&&f==f&&(f<s&&(u=s,s=f,f=u),!(f<l[0]||s>o[1-c])))return e=Math.max(0,hg(l,s)-1),r=s===f?e:hg(l,f)-1,s-l[e]>n+1e-10&&++e,c&&(u=e,e=h-r,r=h-u),e>r?void 0:i().slice(e,r+1)}},r.invert=function(t){var e=r.invertRange([t,t]);return e?e[0]:e},r.copy=function(){return ro().domain(i()).range(o).round(u).paddingInner(s).paddingOuter(f).align(c)},t()}function io(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return io(e())},t}function ao(t){return H_.call(t,function(t){return+t})}function oo(){function t(t){return e(t)}var e=ja(),n=[];return t.domain=function(r){return arguments.length?(function(t){n=ao(t),e.domain([n[0],hd(n)])}(r),t):n.slice()},t.range=function(n){return arguments.length?(e.range(n),t):e.range()},t.rangeRound=function(n){return arguments.length?(e.rangeRound(n),t):e.rangeRound()},t.interpolate=function(n){return arguments.length?(e.interpolate(n),t):e.interpolate()},t.invert=function(t){return e.invert(t)},t.ticks=function(e){var r=n.length,i=~~(r/(e||r));return i<2?t.domain():n.filter(function(t,e){return!(e%i)})},t.tickFormat=function(){return e.tickFormat.apply(e,arguments)},t.copy=function(){return oo().domain(t.domain()).range(t.range())},t}function uo(){function t(t){return null==t||t!=t?void 0:n[(hg(e,t)-1)%n.length]}var e=[],n=[];return t.domain=function(n){return arguments.length?(e=ao(n),t):e.slice()},t.range=function(e){return arguments.length?(n=G_.call(e),t):n.slice()},t.copy=function(){return uo().domain(t.domain()).range(t.range())},t}function so(t){function e(){var t=r.domain();i=t[0],a=hd(t)-i}function n(e){var n=(e-i)/a;return t(o?Math.max(0,Math.min(1,n)):n)}var r=ja(),i=0,a=1,o=!1;return n.clamp=function(t){return arguments.length?(o=!!t,n):o},n.domain=function(t){return arguments.length?(r.domain(t),e(),n):r.domain()},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return so().domain(r.domain()).clamp(o).interpolator(t)},n.ticks=function(t){return r.ticks(t)},n.tickFormat=function(t,e){return r.tickFormat(t,e)},n.nice=function(t){return r.nice(t),e(),n},n}function fo(t,e){return arguments.length>1?(V_[t]=function(t,e){return function(){var n=e();return n.invertRange||(n.invertRange=n.invert?tb(n):n.invertExtent?eb(n):void 0),n.type=t,n}}(t,e),this):V_.hasOwnProperty(t)?V_[t]:void 0}function co(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function lo(t,e){lw[t]=fw["interpolate"+e],cw[t]=fw["scheme"+e]}function ho(t,e){var n=e[0],r=hd(e)-n;return function(e){return t(n+e*r)}}function po(t,e,n){var r=n-e;return r?"linear"===t.type||"sequential"===t.type?function(t){return(t-e)/r}:t.copy().domain([e,n]).range([0,1]).interpolate(go):md(0)}function go(t,e){var n=e-t;return function(e){return t+e*n}}function vo(t,e){var n=d_[function(t){return"interpolate"+t.toLowerCase().split("-").map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function mo(t){return dw.hasOwnProperty(t)&&dw[t]}function yo(t){return pw.hasOwnProperty(t)&&pw[t]}function bo(t,e){var n;return Qh(e)&&(n=e.step,e=e.interval),Kh(e)&&(e="time"===t.type?mo(e):"utc"===t.type?yo(e):Xh("Only time and utc scales accept interval strings."),n&&(e=e.every(n))),e}function _o(t,e,n){var r=t.range(),i=r[0],a=hd(r);if(i>a&&(r=a,a=i,i=r),e=e.filter(function(e){return!((e=t(e))<i||e>a)}),n>0&&e.length>1){for(var o=[e[0],hd(e)];e.length>n&&e.length>=3;)e=e.filter(function(t,e){return!(e%2)});e.length<3&&(e=o)}return e}function xo(t,e){return t.ticks?t.ticks(e):t.domain()}function wo(t,e,n){var r=t.tickFormat?t.tickFormat(e,n):String;return t.type===By?function(t,e){return function(n){return t(n)?e(n):""}}(r,function(t){var e=La(t||",");{if(null==e.precision){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1}return function(t,e){return function(n){var r,i,a=t(n),o=a.indexOf(e);if(o<0)return a;for(r=function(t,e){var n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if((n=t.charCodeAt(r))>=48&&n<=57)return r+1}(a,o),i=r<a.length?a.slice(r):"";--r>o;)if("0"!==a[r]){++r;break}return a.slice(0,r)+i}}(M_(e),M_(".1f")(1)[1])}return M_(e)}}(n)):r}function Mo(t){Ee.call(this,null,t)}function ko(t){Ee.call(this,null,t)}function Eo(t){return t.exit}function So(t){Ee.call(this,null,t)}function Ao(t){var e=t.domain();return e.max=e.pop(),e}function Co(t,e){return gw[t.type]?function(t){return function(e,n,r){var i=r[n+1]||r.max||1/0,a=Do(e,t),o=Do(i,t);return a&&o?a+"–"+o:o?"< "+o:"≥ "+a}}(e):function(t){return function(e){return t(e)}}(e)}function Do(t,e){return isFinite(t)?e(t):null}function zo(t){Ee.call(this,[],t)}function Oo(t){Ee.call(this,{},t)}function No(t,e,n,r){return"M"+t+","+e+"L"+n+","+r}function To(t,e,n,r){var i=n-t,a=r-e,o=Math.sqrt(i*i+a*a)/2;return"M"+t+","+e+"A"+o+","+o+" "+180*Math.atan2(a,i)/Math.PI+" 0 1 "+n+","+r}function Ro(t,e,n,r){var i=n-t,a=r-e,o=.2*(i+a),u=.2*(a-i);return"M"+t+","+e+"C"+(t+o)+","+(e+u)+" "+(n+u)+","+(r-o)+" "+n+","+r}function Po(t){Ee.call(this,null,t)}function Lo(t){Ee.call(this,null,t),this.modified(!0)}function qo(t,e,n){var r=function(t,e){return e?(t.domain(e),e.length):-1}(t,e.domainRaw);if(r>-1)return r;var i,a,o=e.domain,u=t.type,s=e.zero||void 0===e.zero&&yw[u];return o?(bw[u]&&e.padding&&o[0]!==hd(o)&&(o=function(t,e,n,r,i){var a=Math.abs(hd(n)-n[0]),o=a/(a-2*r),u=t===By?p(e,null,o):t===Yy?g(e,null,o,.5):t===Wy?g(e,null,o,i):d(e,null,o);return e=e.slice(),e[0]=u[0],e[e.length-1]=u[1],e}(u,o,e.range,e.padding,e.exponent)),(s||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(o=o.slice()).length-1||1,s&&(o[0]>0&&(o[0]=0),o[i]<0&&(o[i]=0)),null!=e.domainMin&&(o[0]=e.domainMin),null!=e.domainMax&&(o[i]=e.domainMax),null!=e.domainMid&&(((a=e.domainMid)<o[0]||a>o[i])&&n.warn("Scale domainMid exceeds domain min or max.",a),o.splice(i,0,a))),t.domain(o),e.nice&&t.nice&&t.nice(!0!==e.nice&&bo(t,e.nice)||null),o.length):0}function Uo(t,e,n){var r=e.round||!1,i=e.range;if(null!=e.rangeStep)i=function(t,e,n){t!==Hy&&t!==Gy&&Xh("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i=t===Gy?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*nb(n,i,r)]}(t.type,e,n);else if(e.scheme){if(i=function(t,e,n){var r,i=e.scheme.toLowerCase(),a=hw(i),o=e.schemeExtent;a||Xh("Unrecognized scheme name: "+e.scheme);return n=t===Zy?n+1:t===Qy?n-1:t===Xy||t===Jy?+e.schemeCount||mw:n,t===Ky?Fo(a,o,e.reverse):!o&&(r=hw(i+"-"+n))?r:gd(a)?function(t,e){for(var n=new Array(e),r=e-1||1,i=0;i<e;++i)n[i]=t(i/r);return n}(Fo(a,o),n):t===Vy?a:a.slice(0,n)}(t.type,e,n),gd(i))return t.interpolator(i)}else if(i&&t.type===Ky)return t.interpolator(Wb(jo(i,e.reverse)));i&&e.interpolate&&t.interpolate?t.interpolate(vo(e.interpolate,e.interpolateGamma)):gd(t.round)?t.round(r):gd(t.rangeRound)&&t.interpolate(r?t_:Kb),i&&t.range(jo(i,e.reverse))}function Fo(t,e,n){return gd(t)&&(e||n)?ho(t,jo(e||[0,1],n)):t}function jo(t,e){return e?t.slice().reverse():t}function Io(t){Ee.call(this,null,t)}function $o(t){Ee.call(this,null,t)}function Bo(t,e){for(var n=e[0],r=e[1],i=-1,a=0,o=t.length,u=o-1;a<o;u=a++){var s=t[a],f=s[0],c=s[1],l=t[u],h=l[0],d=l[1];if(function(t,e,n){var r;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&function(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}(t[r=+(t[0]===e[0])],n[r],e[r])}(s,l,e))return 0;c>r!=d>r&&n<(h-f)*(r-c)/(d-c)+f&&(i=-i)}return i}function Wo(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o<i;++o)for(var u=0,s=0;u<r+n;++u)u<r&&(s+=t.data[u+o*r]),u>=n&&(u>=a&&(s-=t.data[u-a+o*r]),e.data[u-n+o*r]=s/Math.min(u+1,r-1+a-u,a))}function Yo(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o<r;++o)for(var u=0,s=0;u<i+n;++u)u<i&&(s+=t.data[o+u*r]),u>=n&&(u>=a&&(s-=t.data[o+(u-a)*r]),e.data[o+(u-n)*r]=s/Math.min(u+1,i-1+a-u,a))}function Ho(t){return t[0]}function Go(t){return t[1]}function Vo(t){Ee.call(this,null,t)}function Xo(t){Ee.call(this,null,t)}function Jo(){this.reset()}function Zo(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}function Qo(t){return t>1?0:t<-1?Pw:Math.acos(t)}function Ko(t){return t>1?Lw:t<-1?-Lw:Math.asin(t)}function tu(){}function eu(t,e){t&&tM.hasOwnProperty(t.type)&&tM[t.type](t,e)}function nu(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function ru(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)nu(t[n],e,1);e.polygonEnd()}function iu(t){return[Bw(t[1],t[0]),Ko(t[2])]}function au(t){var e=t[0],n=t[1],r=Ww(n);return[r*Ww(e),r*Xw(e),Xw(n)]}function ou(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function uu(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 su(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function fu(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function cu(t){var e=Zw(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function lu(t,e){return[t>Pw?t-Uw:t<-Pw?t+Uw:t,e]}function hu(t,e,n){return(t%=Uw)?e||n?nM(pu(t),gu(e,n)):pu(t):e||n?gu(e,n):lu}function du(t){return function(e,n){return e+=t,[e>Pw?e-Uw:e<-Pw?e+Uw:e,n]}}function pu(t){var e=du(t);return e.invert=du(-t),e}function gu(t,e){function n(t,e){var n=Ww(e),u=Ww(t)*n,s=Xw(t)*n,f=Xw(e),c=f*r+u*i;return[Bw(s*a-c*o,u*r-f*i),Ko(c*a+s*o)]}var r=Ww(t),i=Xw(t),a=Ww(e),o=Xw(e);return n.invert=function(t,e){var n=Ww(e),u=Ww(t)*n,s=Xw(t)*n,f=Xw(e),c=f*a-s*o;return[Bw(s*a+f*o,u*r+c*i),Ko(c*r-u*i)]},n}function vu(t,e){(e=au(e))[0]-=t,cu(e);var n=Qo(-e[1]);return((-e[2]<0?-n:n)+Uw-Rw)%Uw}function mu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function yu(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function bu(t){return t.length>1}function _u(t,e){return((t=t.x)[0]<0?t[1]-Lw-Rw:Lw-t[1])-((e=e.x)[0]<0?e[1]-Lw-Rw:Lw-e[1])}function xu(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,u,f){var c=0,l=0;if(null==i||(c=o(i,u))!==(l=o(a,u))||s(i,a)<0^u>0)do{f.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+u+4)%4)!==l);else f.point(a[0],a[1])}function o(r,i){return Iw(r[0]-t)<Rw?i>0?0:3:Iw(r[0]-n)<Rw?i>0?2:1:Iw(r[1]-e)<Rw?i>0?1:0:i>0?3:2}function u(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){function s(t,e){i(t,e)&&x.point(t,e)}function f(a,o){var u=i(a,o);if(l&&h.push([a,o]),b)d=a,p=o,g=u,b=!1,u&&(x.lineStart(),x.point(a,o));else if(u&&y)x.point(a,o);else{var s=[v=Math.max(wM,Math.min(xM,v)),m=Math.max(wM,Math.min(xM,m))],f=[a=Math.max(wM,Math.min(xM,a)),o=Math.max(wM,Math.min(xM,o))];_M(s,f,t,e,n,r)?(y||(x.lineStart(),x.point(s[0],s[1])),x.point(f[0],f[1]),u||x.lineEnd(),_=!1):u&&(x.lineStart(),x.point(a,o),_=!1)}v=a,m=o,y=u}var c,l,h,d,p,g,v,m,y,b,_,x=o,w=hM(),M={point:s,lineStart:function(){M.point=f,l&&l.push(h=[]),b=!0,y=!1,v=m=NaN},lineEnd:function(){c&&(f(d,p),g&&y&&w.rejoin(),c.push(w.result())),M.point=s,y&&x.lineEnd()},polygonStart:function(){x=w,c=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var a,o,u=l[n],s=1,f=u.length,c=u[0],h=c[0],d=c[1];s<f;++s)a=h,o=d,h=(c=u[s])[0],d=c[1],o<=r?d>r&&(h-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(h-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=_&&e,i=(c=Eg(c)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&pM(c,u,e,a,o),o.polygonEnd()),x=o,c=l=h=null}};return M}}function wu(t,e,n){var r=mg(t,e-Rw,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function Mu(t,e,n){var r=mg(t,e-Rw,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function ku(){SM.point=Eu}function Eu(t,e){SM.point=Su,rM=aM=t,iM=oM=e}function Su(t,e){EM.add(oM*t-aM*e),aM=t,oM=e}function Au(){Su(rM,iM)}function Cu(t,e){NM+=t,TM+=e,++RM}function Du(){IM.point=zu}function zu(t,e){IM.point=Ou,Cu(fM=t,cM=e)}function Ou(t,e){var n=t-fM,r=e-cM,i=Zw(n*n+r*r);PM+=i*(fM+t)/2,LM+=i*(cM+e)/2,qM+=i,Cu(fM=t,cM=e)}function Nu(){IM.point=Cu}function Tu(){IM.point=Pu}function Ru(){Lu(uM,sM)}function Pu(t,e){IM.point=Lu,Cu(uM=fM=t,sM=cM=e)}function Lu(t,e){var n=t-fM,r=e-cM,i=Zw(n*n+r*r);PM+=i*(fM+t)/2,LM+=i*(cM+e)/2,qM+=i,UM+=(i=cM*t-fM*e)*(fM+t),FM+=i*(cM+e),jM+=3*i,Cu(fM=t,cM=e)}function qu(t){this._context=t}function Uu(t,e){VM.point=Fu,BM=YM=t,WM=HM=e}function Fu(t,e){YM-=t,HM-=e,GM.add(Zw(YM*YM+HM*HM)),YM=t,HM=e}function ju(){this._string=[]}function Iu(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function $u(t){return function(e){var n=new Bu;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Bu(){}function Wu(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),eM(n,t.stream(OM)),e(OM.result()),null!=r&&t.clipExtent(r),t}function Yu(t,e,n){return Wu(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,u])},n)}function Hu(t,e,n){return Yu(t,[[0,0],e],n)}function Gu(t,e,n){return Wu(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])},n)}function Vu(t,e,n){return Wu(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])},n)}function Xu(t){return Ju(function(){return t})()}function Ju(t){function e(t){return t=f(t[0]*jw,t[1]*jw),[t[0]*g+o,u-t[1]*g]}function n(t,e){return t=a(t,e),[t[0]*g+o,u-t[1]*g]}function r(){f=nM(s=hu(_,x,w),a);var t=a(y,b);return o=v-t[0]*g,u=m+t[1]*g,i()}function i(){return d=p=null,e}var a,o,u,s,f,c,l,h,d,p,g=150,v=480,m=250,y=0,b=0,_=0,x=0,w=0,M=null,k=yM,E=null,S=MM,A=.5,C=QM(n,A);return e.stream=function(t){return d&&p===t?d:d=KM(function(t){return $u({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(s)(k(C(S(p=t)))))},e.preclip=function(t){return arguments.length?(k=t,M=void 0,i()):k},e.postclip=function(t){return arguments.length?(S=t,E=c=l=h=null,i()):S},e.clipAngle=function(t){return arguments.length?(k=+t?bM(M=t*jw):(M=null,yM),i()):M*Fw},e.clipExtent=function(t){return arguments.length?(S=null==t?(E=c=l=h=null,MM):xu(E=+t[0][0],c=+t[0][1],l=+t[1][0],h=+t[1][1]),i()):null==E?null:[[E,c],[l,h]]},e.scale=function(t){return arguments.length?(g=+t,r()):g},e.translate=function(t){return arguments.length?(v=+t[0],m=+t[1],r()):[v,m]},e.center=function(t){return arguments.length?(y=t[0]%360*jw,b=t[1]%360*jw,r()):[y*Fw,b*Fw]},e.rotate=function(t){return arguments.length?(_=t[0]%360*jw,x=t[1]%360*jw,w=t.length>2?t[2]%360*jw:0,r()):[_*Fw,x*Fw,w*Fw]},e.precision=function(t){return arguments.length?(C=QM(n,A=t*t),i()):Zw(A)},e.fitExtent=function(t,n){return Yu(e,t,n)},e.fitSize=function(t,n){return Hu(e,t,n)},e.fitWidth=function(t,n){return Gu(e,t,n)},e.fitHeight=function(t,n){return Vu(e,t,n)},function(){return a=t.apply(this,arguments),e.invert=a.invert&&function(t){return(t=f.invert((t[0]-o)/g,(u-t[1])/g))&&[t[0]*Fw,t[1]*Fw]},r()}}function Zu(t){var e=0,n=Pw/3,r=Ju(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*jw,n=t[1]*jw):[e*Fw,n*Fw]},i}function Qu(t,e){function n(t,e){var n=Zw(a-2*i*Xw(e))/i;return[n*Xw(t*=i),o-n*Ww(t)]}var r=Xw(t),i=(r+Xw(e))/2;if(Iw(i)<Rw)return function(t){function e(t,e){return[t*n,Xw(e)/n]}var n=Ww(t);return e.invert=function(t,e){return[t/n,Ko(e*n)]},e}(t);var a=1+r*(2*i-r),o=Zw(a)/i;return n.invert=function(t,e){var n=o-e;return[Bw(t,Iw(n))/i*Jw(n),Ko((a-(t*t+n*n)*i*i)/(2*i))]},n}function Ku(t){return function(e,n){var r=Ww(e),i=Ww(n),a=t(r*i);return[a*i*Xw(e),a*Xw(n)]}}function ts(t){return function(e,n){var r=Zw(e*e+n*n),i=t(r),a=Xw(i),o=Ww(i);return[Bw(e*a,r*o),Ko(r&&n*a/r)]}}function es(t,e){return[t,Gw(Qw((Lw+e)/2))]}function ns(t){function e(){var e=Pw*u(),o=a(lM(a.rotate()).invert([0,0]));return f(null==c?[[o[0]-e,o[1]-e],[o[0]+e,o[1]+e]]:t===es?[[Math.max(o[0]-e,c),n],[Math.min(o[0]+e,r),i]]:[[c,Math.max(o[1]-e,n)],[r,Math.min(o[1]+e,i)]])}var n,r,i,a=Xu(t),o=a.center,u=a.scale,s=a.translate,f=a.clipExtent,c=null;return a.scale=function(t){return arguments.length?(u(t),e()):u()},a.translate=function(t){return arguments.length?(s(t),e()):s()},a.center=function(t){return arguments.length?(o(t),e()):o()},a.clipExtent=function(t){return arguments.length?(null==t?c=n=r=i=null:(c=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),e()):null==c?null:[[c,n],[r,i]]},e()}function rs(t){return Qw((Lw+t)/2)}function is(t,e){function n(t,e){a>0?e<-Lw+Rw&&(e=-Lw+Rw):e>Lw-Rw&&(e=Lw-Rw);var n=a/Vw(rs(e),i);return[n*Xw(i*t),a-n*Ww(i*t)]}var r=Ww(t),i=t===e?Xw(t):Gw(r/Ww(e))/Gw(rs(e)/rs(t)),a=r*Vw(rs(t),i)/i;return i?(n.invert=function(t,e){var n=a-e,r=Jw(i)*Zw(t*t+n*n);return[Bw(t,Iw(n))/i*Jw(n),2*$w(Vw(a/r,1/i))-Lw]},n):es}function as(t,e){return[t,e]}function os(t,e){function n(t,e){var n=a-e,r=i*t;return[n*Xw(r),a-n*Ww(r)]}var r=Ww(t),i=t===e?Xw(t):(r-Ww(e))/(e-t),a=r/i+t;return Iw(i)<Rw?as:(n.invert=function(t,e){var n=a-e;return[Bw(t,Iw(n))/i*Jw(n),a-Jw(i)*Zw(t*t+n*n)]},n)}function us(t,e){var n=Ww(e),r=Ww(t)*n;return[n*Xw(t)/r,Xw(e)/r]}function ss(t,e){return[Ww(e)*Xw(t),Xw(e)]}function fs(t,e){var n=Ww(e),r=1+Ww(t)*n;return[n*Xw(t)/r,Xw(e)/r]}function cs(t,e){return[Gw(Qw((Lw+e)/2)),-t]}function ls(t,e){return arguments.length>1?(ok[t]=function(t,e){return function n(){var r=e();return r.type=t,r.path=XM().projection(r),r.copy=r.copy||function(){var t=n();return ak.forEach(function(e){r.hasOwnProperty(e)&&t[e](r[e]())}),t.path.pointRadius(r.path.pointRadius()),t},r}}(t,e),this):ok.hasOwnProperty(t)?ok[t]:null}function hs(t){return t&&t.path||ik}function ds(t){Ee.call(this,null,t)}function ps(t){Ee.call(this,null,t)}function gs(t){Ee.call(this,null,t)}function vs(t){Ee.call(this,[],t),this.generator=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return mg(Yw(a/v)*v,i,v).map(h).concat(mg(Yw(f/m)*m,s,m).map(d)).concat(mg(Yw(r/p)*p,n,p).filter(function(t){return Iw(t%v)>Rw}).map(c)).concat(mg(Yw(u/g)*g,o,g).filter(function(t){return Iw(t%m)>Rw}).map(l))}var n,r,i,a,o,u,s,f,c,l,h,d,p=10,g=p,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(s).slice(1),h(i).reverse().slice(1),d(f).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.extentMajor(e).extentMinor(e):t.extentMinor()},t.extentMajor=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],f=+e[0][1],s=+e[1][1],a>i&&(e=a,a=i,i=e),f>s&&(e=f,f=s,s=e),t.precision(y)):[[a,f],[i,s]]},t.extentMinor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],u=+e[0][1],o=+e[1][1],r>n&&(e=r,r=n,n=e),u>o&&(e=u,u=o,o=e),t.precision(y)):[[r,u],[n,o]]},t.step=function(e){return arguments.length?t.stepMajor(e).stepMinor(e):t.stepMinor()},t.stepMajor=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.stepMinor=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(y=+e,c=wu(u,o,90),l=Mu(r,n,y),h=wu(f,s,90),d=Mu(a,i,y),t):y},t.extentMajor([[-180,-90+Rw],[180,90-Rw]]).extentMinor([[-180,-80-Rw],[180,80+Rw]])}()}function ms(t){Ee.call(this,null,t),this.modified(!0)}function ys(t,e){var n=function(t){return 1===(t=pd(t)).length?t[0]:{type:Ow,features:t.reduce(function(t,e){return e&&e.type===Ow?t.push.apply(t,e.features):Zh(e)?t.push.apply(t,e):t.push(e),t},[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}function bs(t,e,n){gd(t[e])&&t[e](n)}function _s(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,o,u,s,f,c,l,h,d=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((f=e>=(a=(g+m)/2))?g=a:m=a,(c=n>=(o=(v+y)/2))?v=o:y=o,i=d,!(d=d[l=c<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===u&&n===s)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=e>=(a=(g+m)/2))?g=a:m=a,(c=n>=(o=(v+y)/2))?v=o:y=o}while((l=c<<1|f)==(h=(s>=o)<<1|u>=a));return i[h]=d,i[l]=p,t}function xs(t,e,n){var r=new ws(null==e?function(t){return t[0]}:e,null==n?function(t){return t[1]}:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ws(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Ms(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}function ks(t){return t.x+t.vx}function Es(t){return t.y+t.vy}function Ss(t){return t.index}function As(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function Cs(){return _k||(Mk(Ds),_k=wk.now()+xk)}function Ds(){_k=0}function zs(){this._call=this._time=this._next=null}function Os(t,e,n){var r=new zs;return r.restart(t,e,n),r}function Ns(){_k=(bk=wk.now())+xk,gk=vk=0;try{!function(){Cs(),++gk;for(var t,e=dk;e;)(t=_k-e._time)>=0&&e._call.call(null,t),e=e._next;--gk}()}finally{gk=0,function(){var t,e,n=dk,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:dk=e);pk=t,Rs(r)}(),_k=0}}function Ts(){var t=wk.now(),e=t-bk;e>yk&&(xk-=e,bk=t)}function Rs(t){if(!gk){vk&&(vk=clearTimeout(vk));t-_k>24?(t<1/0&&(vk=setTimeout(Ns,t-wk.now()-xk)),mk&&(mk=clearInterval(mk))):(mk||(bk=wk.now(),mk=setInterval(Ts,yk)),gk=1,Mk(Ns))}}function Ps(t){return t.x}function Ls(t){return t.y}function qs(t){Ee.call(this,null,t)}function Us(t,e,r,i){var a,o,u,s,f=pd(e.forces);for(a=0,o=Dk.length;a<o;++a)(u=Dk[a])!==Ck&&e.modified(u)&&t[u](e[u]);for(a=0,o=f.length;a<o;++a)s=Ck+a,(u=r||e.modified(Ck,a)?function(t){var e,n;Ak.hasOwnProperty(t.force)||Xh("Unrecognized force: "+t.force);e=Ak[t.force]();for(n in t)gd(e[n])&&function(t,e,n){t(gd(e)?function(t){return e(t,n)}:e)}(e[n],t[n],t);return e}(f[a]):i&&function(t,e){var r,i;for(r in t)if(gd(i=t[r])&&e.modified(n(i)))return 1;return 0}(f[a],i)?t.force(s):null)&&t.force(s,u);for(o=t.numForces||0;a<o;++a)t.force(Ck+a,null);return t.numForces=f.length,t}function Fs(t,e){return t.parent===e.parent?1:2}function js(t,e){return t+e.x}function Is(t,e){return Math.max(t,e.y)}function $s(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Bs(t,e){var n,r,i,a,o,u=new Gs(t),s=+t.value&&(u.value=t.value),f=[u];for(null==e&&(e=Ws);n=f.pop();)if(s&&(n.value=+n.data.value),(i=e(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)f.push(r=n.children[a]=new Gs(i[a])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(Hs)}function Ws(t){return t.children}function Ys(t){t.data=t.data.data}function Hs(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Gs(t){this.data=t,this.depth=this.height=0,this.parent=null}function Vs(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function Xs(t,e){var n=t.r-e.r+1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Js(t,e){for(var n=0;n<e.length;++n)if(!Xs(t,e[n]))return!1;return!0}function Zs(t,e){var n=t.x,r=t.y,i=t.r,a=e.x,o=e.y,u=e.r,s=a-n,f=o-r,c=u-i,l=Math.sqrt(s*s+f*f);return{x:(n+a+s/l*c)/2,y:(r+o+f/l*c)/2,r:(l+i+u)/2}}function Qs(t,e,n){var r=t.x,i=t.y,a=t.r,o=e.x,u=e.y,s=e.r,f=n.x,c=n.y,l=n.r,h=r-o,d=r-f,p=i-u,g=i-c,v=s-a,m=l-a,y=r*r+i*i-a*a,b=y-o*o-u*u+s*s,_=y-f*f-c*c+l*l,x=d*p-h*g,w=(p*_-g*b)/(2*x)-r,M=(g*v-p*m)/x,k=(d*b-h*_)/(2*x)-i,E=(h*m-d*v)/x,S=M*M+E*E-1,A=2*(a+w*M+k*E),C=w*w+k*k-a*a,D=-(S?(A+Math.sqrt(A*A-4*S*C))/(2*S):C/A);return{x:r+w+M*D,y:i+k+E*D,r:D}}function Ks(t,e,n){var r=t.x,i=t.y,a=e.r+n.r,o=t.r+n.r,u=e.x-r,s=e.y-i,f=u*u+s*s;if(f){var c=.5+((o*=o)-(a*=a))/(2*f),l=Math.sqrt(Math.max(0,2*a*(o+f)-(o-=f)*o-a*a))/(2*f);n.x=r+c*u+l*s,n.y=i+c*s-l*u}else n.x=r+o,n.y=i}function tf(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return i*i-1e-6>n*n+r*r}function ef(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,a=(e.y*n.r+n.y*e.r)/r;return i*i+a*a}function nf(t){this._=t,this.next=null,this.previous=null}function rf(t){if("function"!=typeof t)throw new Error;return t}function af(){return 0}function of(t){return Math.sqrt(t.value)}function uf(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function sf(t,e){return function(n){if(r=n.children){var r,i,a,o=r.length,u=t(n)*e||0;if(u)for(i=0;i<o;++i)r[i].r+=u;if(a=function(t){if(!(i=t.length))return 0;var e,n,r,i,a,o,u,s,f,c,l;if(e=t[0],e.x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;Ks(n,e,r=t[2]),e=new nf(e),n=new nf(n),r=new nf(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(u=3;u<i;++u){Ks(e._,n._,r=t[u]),r=new nf(r),s=n.next,f=e.previous,c=n._.r,l=e._.r;do{if(c<=l){if(tf(s._,r._)){n=s,e.next=n,n.previous=e,--u;continue t}c+=s._.r,s=s.next}else{if(tf(f._,r._)){(e=f).next=n,n.previous=e,--u;continue t}l+=f._.r,f=f.previous}}while(s!==f.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,a=ef(e);(r=r.next)!==n;)(o=ef(r))<a&&(e=r,a=o);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=Pk(e),u=0;u<i;++u)e=t[u],e.x-=r.x,e.y-=r.y;return r.r}(r),u)for(i=0;i<o;++i)r[i].r-=u;n.r=a+u}}}function ff(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function cf(t){return t.id}function lf(t){return t.parentId}function hf(t,e){return t.parent===e.parent?1:2}function df(t){var e=t.children;return e?e[0]:t.t}function pf(t){var e=t.children;return e?e[e.length-1]:t.t}function gf(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function vf(t,e,n){return t.a.parent===e.parent?t.a:n}function mf(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}function yf(t,e,n,r,i,a){for(var o,u,s,f,c,l,h,d,p,g,v,m=[],y=e.children,b=0,_=0,x=y.length,w=e.value;b<x;){s=i-n,f=a-r;do{c=y[_++].value}while(!c&&_<x);for(l=h=c,v=c*c*(g=Math.max(f/s,s/f)/(w*t)),p=Math.max(h/v,v/l);_<x;++_){if(c+=u=y[_].value,u<l&&(l=u),u>h&&(h=u),v=c*c*g,(d=Math.max(h/v,v/l))>p){c-=u;break}p=d}m.push(o={value:c,dice:s<f,children:y.slice(b,_)}),o.dice?Uk(o,n,r,i,w?r+=f*c/w:a):$k(o,n,r,w?n+=s*c/w:i,a),w-=c,b=_}return m}function bf(t){Ee.call(this,null,t)}function _f(t){return t.values}function xf(t){Ee.call(this,null,t)}function wf(t){xf.call(this,t)}function Mf(t){xf.call(this,t)}function kf(t){Ee.call(this,null,t)}function Ef(t){xf.call(this,t)}function Sf(t){Ee.call(this,{},t)}function Af(t){xf.call(this,t)}function Cf(t){return t[0]}function Df(t){return t[1]}function zf(){this._=null}function Of(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Nf(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Tf(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Rf(t){for(;t.L;)t=t.L;return t}function Pf(t,e,n,r){var i=[null,null],a=sE.push(i)-1;return i.left=t,i.right=e,n&&qf(i,t,e,n),r&&qf(i,e,t,r),oE[t.index].halfedges.push(a),oE[e.index].halfedges.push(a),i}function Lf(t,e,n){var r=[e,n];return r.left=t,r}function qf(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function Uf(t,e,n,r,i){var a,o=t[0],u=t[1],s=o[0],f=o[1],c=0,l=1,h=u[0]-s,d=u[1]-f;if(a=e-s,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<l&&(l=a)}else if(h>0){if(a>l)return;a>c&&(c=a)}if(a=r-s,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<l&&(l=a)}if(a=n-f,d||!(a>0)){if(a/=d,d<0){if(a<c)return;a<l&&(l=a)}else if(d>0){if(a>l)return;a>c&&(c=a)}if(a=i-f,d||!(a<0)){if(a/=d,d<0){if(a>l)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<l&&(l=a)}return!(c>0||l<1)||(c>0&&(t[0]=[s+c*h,f+c*d]),l<1&&(t[1]=[s+l*h,f+l*d]),!0)}}}}}function Ff(t,e,n,r,i){var a=t[1];if(a)return!0;var o,u,s=t[0],f=t.left,c=t.right,l=f[0],h=f[1],d=c[0],p=c[1],g=(l+d)/2,v=(h+p)/2;if(p===h){if(g<e||g>=r)return;if(l>d){if(s){if(s[1]>=i)return}else s=[g,n];a=[g,i]}else{if(s){if(s[1]<n)return}else s=[g,i];a=[g,n]}}else if(o=(l-d)/(p-h),u=v-o*g,o<-1||o>1)if(l>d){if(s){if(s[1]>=i)return}else s=[(n-u)/o,n];a=[(i-u)/o,i]}else{if(s){if(s[1]<n)return}else s=[(i-u)/o,i];a=[(n-u)/o,n]}else if(h<p){if(s){if(s[0]>=r)return}else s=[e,o*e+u];a=[r,o*r+u]}else{if(s){if(s[0]<e)return}else s=[r,o*r+u];a=[e,o*e+u]}return t[0]=s,t[1]=a,!0}function jf(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function If(t,e){return e[+(e.left!==t.site)]}function $f(t,e){return e[+(e.left===t.site)]}function Bf(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,a=n.site;if(r!==a){var o=i[0],u=i[1],s=r[0]-o,f=r[1]-u,c=a[0]-o,l=a[1]-u,h=2*(s*l-f*c);if(!(h>=-hE)){var d=s*s+f*f,p=c*c+l*l,g=(l*d-f*p)/h,v=(s*p-c*d)/h,m=fE.pop()||new function(){Of(this),this.x=this.y=this.arc=this.site=this.cy=null};m.arc=t,m.site=i,m.x=g+o,m.y=(m.cy=v+u)+Math.sqrt(g*g+v*v),t.circle=m;for(var y=null,b=uE._;b;)if(m.y<b.y||m.y===b.y&&m.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}uE.insert(y,m),y||(iE=m)}}}}function Wf(t){var e=t.circle;e&&(e.P||(iE=e.N),uE.remove(e),fE.push(e),Of(e),t.circle=null)}function Yf(t){var e=cE.pop()||new function(){Of(this),this.edge=this.site=this.circle=null};return e.site=t,e}function Hf(t){Wf(t),aE.remove(t),cE.push(t),Of(t)}function Gf(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],a=t.P,o=t.N,u=[t];Hf(t);for(var s=a;s.circle&&Math.abs(n-s.circle.x)<lE&&Math.abs(r-s.circle.cy)<lE;)a=s.P,u.unshift(s),Hf(s),s=a;u.unshift(s),Wf(s);for(var f=o;f.circle&&Math.abs(n-f.circle.x)<lE&&Math.abs(r-f.circle.cy)<lE;)o=f.N,u.push(f),Hf(f),f=o;u.push(f),Wf(f);var c,l=u.length;for(c=1;c<l;++c)f=u[c],s=u[c-1],qf(f.edge,s.site,f.site,i);s=u[0],(f=u[l-1]).edge=Pf(s.site,f.site,null,i),Bf(s),Bf(f)}function Vf(t){for(var e,n,r,i,a=t[0],o=t[1],u=aE._;u;)if((r=Xf(u,o)-a)>lE)u=u.L;else{if(!((i=a-function(t,e){var n=t.N;if(n)return Xf(n,e);var r=t.site;return r[1]===e?r[0]:1/0}(u,o))>lE)){r>-lE?(e=u.P,n=u):i>-lE?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}!function(t){oE[t.index]={site:t,halfedges:[]}}(t);var s=Yf(t);if(aE.insert(e,s),e||n){if(e===n)return Wf(e),n=Yf(e.site),aE.insert(s,n),s.edge=n.edge=Pf(e.site,s.site),Bf(e),void Bf(n);if(n){Wf(e),Wf(n);var f=e.site,c=f[0],l=f[1],h=t[0]-c,d=t[1]-l,p=n.site,g=p[0]-c,v=p[1]-l,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,_=[(v*y-d*b)/m+c,(h*b-g*y)/m+l];qf(n.edge,f,p,_),s.edge=Pf(f,t,null,_),n.edge=Pf(t,p,null,_),Bf(e),Bf(n)}else s.edge=Pf(e.site,s.site)}}function Xf(t,e){var n=t.site,r=n[0],i=n[1],a=i-e;if(!a)return r;var o=t.P;if(!o)return-1/0;var u=(n=o.site)[0],s=n[1],f=s-e;if(!f)return u;var c=u-r,l=1/a-1/f,h=c/f;return l?(-h+Math.sqrt(h*h-2*l*(c*c/(-2*f)-s+f/2+i-a/2)))/l+r:(r+u)/2}function Jf(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Zf(t,e){return e[1]-t[1]||e[0]-t[0]}function Qf(t,e){var n,r,i,a=t.sort(Zf).pop();for(sE=[],oE=new Array(t.length),aE=new zf,uE=new zf;;)if(i=iE,a&&(!i||a[1]<i.y||a[1]===i.y&&a[0]<i.x))a[0]===n&&a[1]===r||(Vf(a),n=a[0],r=a[1]),a=t.pop();else{if(!i)break;Gf(i.arc)}if(function(){for(var t,e,n,r,i=0,a=oE.length;i<a;++i)if((t=oE[i])&&(r=(e=t.halfedges).length)){var o=new Array(r),u=new Array(r);for(n=0;n<r;++n)o[n]=n,u[n]=jf(t,sE[e[n]]);for(o.sort(function(t,e){return u[e]-u[t]}),n=0;n<r;++n)u[n]=e[o[n]];for(n=0;n<r;++n)e[n]=u[n]}}(),e){var o=+e[0][0],u=+e[0][1],s=+e[1][0],f=+e[1][1];!function(t,e,n,r){for(var i,a=sE.length;a--;)Ff(i=sE[a],t,e,n,r)&&Uf(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>lE||Math.abs(i[0][1]-i[1][1])>lE)||delete sE[a]}(o,u,s,f),function(t,e,n,r){var i,a,o,u,s,f,c,l,h,d,p,g,v=oE.length,m=!0;for(i=0;i<v;++i)if(a=oE[i]){for(o=a.site,u=(s=a.halfedges).length;u--;)sE[s[u]]||s.splice(u,1);for(u=0,f=s.length;u<f;)p=(d=$f(a,sE[s[u]]))[0],g=d[1],l=(c=If(a,sE[s[++u%f]]))[0],h=c[1],(Math.abs(p-l)>lE||Math.abs(g-h)>lE)&&(s.splice(u,0,sE.push(Lf(o,d,Math.abs(p-t)<lE&&r-g>lE?[t,Math.abs(l-t)<lE?h:r]:Math.abs(g-r)<lE&&n-p>lE?[Math.abs(h-r)<lE?l:n,r]:Math.abs(p-n)<lE&&g-e>lE?[n,Math.abs(l-n)<lE?h:e]:Math.abs(g-e)<lE&&p-t>lE?[Math.abs(h-e)<lE?l:t,e]:null))-1),++f);f&&(m=!1)}if(m){var y,b,_,x=1/0;for(i=0,m=null;i<v;++i)(a=oE[i])&&(_=(y=(o=a.site)[0]-t)*y+(b=o[1]-e)*b)<x&&(x=_,m=a);if(m){var w=[t,e],M=[t,r],k=[n,r],E=[n,e];m.halfedges.push(sE.push(Lf(o=m.site,w,M))-1,sE.push(Lf(o,M,k))-1,sE.push(Lf(o,k,E))-1,sE.push(Lf(o,E,w))-1)}}for(i=0;i<v;++i)(a=oE[i])&&(a.halfedges.length||delete oE[i])}(o,u,s,f)}this.edges=sE,this.cells=oE,aE=uE=sE=oE=null}function Kf(t){Ee.call(this,null,t)}function tc(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function ec(){try{var t="undefined"!=typeof document&&document.createElement?document.createElement("canvas"):0;if(t&&t.getContext)return t;try{return new(require("canvas"))}catch(t){return new(require("canvas-prebuilt"))}}catch(t){Xh("Canvas unavailable. Run in browser or install node-canvas.")}}function nc(t){return"function"==typeof t?t:function(){return t}}function rc(t){Ee.call(this,yE(),t)}function ic(t){return new Uint32Array(t)}function ac(t,e,n){var r=(e<257?function(t){return new Uint8Array(t)}:e<65537?function(t){return new Uint16Array(t)}:ic)(t);return n&&r.set(n),r}function oc(){var t=ic(0),e=[],n=0;return{insert:function(r,i,a){if(!i.length)return[];var o,u,s,f=n,c=i.length,l=Array(c),h=ic(c);for(s=0;s<c;++s)l[s]=r(i[s]),h[s]=s;if(l=function(t,e){return t.sort.call(e,function(e,n){var r=t[e],i=t[n];return r<i?-1:r>i?1:0}),Sg(t,e)}(l,h),f)o=e,u=t,e=Array(f+c),t=ic(f+c),function(t,e,n,r,i,a,o,u,s){var f,c=0,l=0;for(f=0;c<r&&l<o;++f)e[c]<i[l]?(u[f]=e[c],s[f]=n[c++]):(u[f]=i[l],s[f]=a[l++]+t);for(;c<r;++c,++f)u[f]=e[c],s[f]=n[c];for(;l<o;++l,++f)u[f]=i[l],s[f]=a[l]+t}(a,o,u,f,l,h,c,e,t);else{if(a>0)for(s=0;s<c;++s)h[s]+=a;e=l,t=h}return n=f+c,{index:h,value:l}},remove:function(r,i){var a,o,u,s=n;for(o=0;!i[t[o]]&&o<s;++o);for(u=o;o<s;++o)i[a=t[o]]||(t[u]=a,e[u]=e[o],++u);n=s-r},bisect:function(t,r){var i;return r?i=r.length:(r=e,i=n),[dg(r,t[0],0,i),hg(r,t[1],0,i)]},reindex:function(e){for(var r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:function(){return t},size:function(){return n}}}function uc(t){Ee.call(this,function(){var t=8,e=[],n=ic(0),r=ac(0,t),i=ac(0,t);return{data:function(){return e},seen:function(){return n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length)},add:function(t){for(var n,r=0,i=e.length,a=t.length;r<a;++r)(n=t[r])._index=i++,e.push(n)},remove:function(t,n){var a,o,u,s=e.length,f=Array(s-t),c=e;for(o=0;!n[o]&&o<s;++o)f[o]=e[o],c[o]=o;for(u=o;o<s;++o)a=e[o],n[o]?c[o]=-1:(c[o]=u,r[u]=r[o],i[u]=i[o],f[u]=a,a._index=u++),r[o]=0;return e=f,c},size:function(){return e.length},curr:function(){return r},prev:function(){return i},reset:function(t){i[t]=r[t]},all:function(){return t<257?255:t<65537?65535:4294967295},set:function(t,e){r[t]|=e},clear:function(t,e){r[t]&=~e},resize:function(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=ac(e,t,r),i=ac(e,t))}}}(),t),this._indices=null,this._dims=null}function sc(t){Ee.call(this,null,t)}function fc(t,e){var n=t._runtime.data;return n.hasOwnProperty(e)||Xh("Unrecognized data set: "+e),n[e]}function cc(t,e){k(e)||Xh("Second argument to changes must be a changeset.");var n=fc(this,t);return n.modified=!0,this.pulse(n.input,e)}function lc(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function hc(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function dc(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function pc(t){return t.item}function gc(t){var e=t.item.mark.source;return e.source||e}function vc(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function mc(t,e,n,r){var i=zE("input");for(var a in n)"signal"!==a&&"element"!==a&&i.setAttribute("input"===a?"type":a,n[a]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",function(){t.update(i.value)}),t.elements=[i],t.set=function(t){i.value=t}}function yc(t,e,n,r){var i={type:"checkbox",name:n.signal};r&&(i.checked=!0);var a=zE("input",i);e.appendChild(a),a.addEventListener("change",function(){t.update(a.checked)}),t.elements=[a],t.set=function(t){a.checked=!!t||null}}function bc(t,e,n,r){var i=zE("select",{name:n.signal});n.options.forEach(function(t){var e={value:t};wc(t,r)&&(e.selected=!0),i.appendChild(zE("option",e,t+""))}),e.appendChild(i),i.addEventListener("change",function(){t.update(n.options[i.selectedIndex])}),t.elements=[i],t.set=function(t){for(var e=0,r=n.options.length;e<r;++e)if(wc(n.options[e],t))return void(i.selectedIndex=e)}}function _c(t,e,n,r){var i=zE("span",{class:TE});e.appendChild(i),t.elements=n.options.map(function(e){var a=RE+n.signal+"-"+e,o={id:a,type:"radio",name:n.signal,value:e};wc(e,r)&&(o.checked=!0);var u=zE("input",o);return u.addEventListener("change",function(){t.update(e)}),i.appendChild(u),i.appendChild(zE("label",{for:a},e+"")),u}),t.set=function(e){for(var n=t.elements,r=0,i=n.length;r<i;++r)wc(n[r].value,e)&&(n[r].checked=!0)}}function xc(t,e,n,r){function i(){f.textContent=s.value,t.update(+s.value)}r=void 0!==r?r:(+n.max+ +n.min)/2;var a=n.min||Math.min(0,+r)||0,o=n.max||Math.max(100,+r)||100,u=n.step||Le(a,o,100),s=zE("input",{type:"range",name:n.signal,min:a,max:o,step:u});s.value=r;var f=zE("label",{},+r);e.appendChild(s),e.appendChild(f),s.addEventListener("input",i),s.addEventListener("change",i),t.elements=[s],t.set=function(t){s.value=t,f.textContent=t}}function wc(t,e){return t===e||t+""==e+""}function Mc(t,e){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e)try{e.innerHTML=""}catch(n){e=null,t.error(n)}return e}function kc(t){return+t||0}function Ec(t,e){Xh(t+' for "outer" push: '+r(e))}function Sc(t){this.type=t}function Ac(t,e){if(!t)throw new Error("ASSERT: "+e)}function Cc(t){return t>=48&&t<=57}function Dc(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function zc(t){return"01234567".indexOf(t)>=0}function Oc(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function Nc(t){return 10===t||13===t||8232===t||8233===t}function Tc(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&MS.test(String.fromCharCode(t))}function Rc(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&kS.test(String.fromCharCode(t))}function Pc(){for(var t;BE<WE&&(t=$E.charCodeAt(BE),Oc(t)||Nc(t));)++BE}function Lc(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)BE<WE&&Dc($E[BE])?(r=$E[BE++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):Qc({},lS,xS);return String.fromCharCode(i)}function qc(){var t,e,n,r;for(e=0,"}"===(t=$E[BE])&&Qc({},lS,xS);BE<WE&&(t=$E[BE++],Dc(t));)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&Qc({},lS,xS),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function Uc(){var t,e;for(t=$E.charCodeAt(BE++),e=String.fromCharCode(t),92===t&&(117!==$E.charCodeAt(BE)&&Qc({},lS,xS),++BE,(t=Lc("u"))&&"\\"!==t&&Tc(t.charCodeAt(0))||Qc({},lS,xS),e=t);BE<WE&&(t=$E.charCodeAt(BE),Rc(t));)++BE,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==$E.charCodeAt(BE)&&Qc({},lS,xS),++BE,(t=Lc("u"))&&"\\"!==t&&Rc(t.charCodeAt(0))||Qc({},lS,xS),e+=t);return e}function Fc(){var t,e,n;return t=BE,e=92===$E.charCodeAt(BE)?Uc():function(){var t,e;for(t=BE++;BE<WE;){if(92===(e=$E.charCodeAt(BE)))return BE=t,Uc();if(!Rc(e))break;++BE}return $E.slice(t,BE)}(),n=1===e.length?VE:ES.hasOwnProperty(e)?XE:"null"===e?JE:"true"===e||"false"===e?HE:VE,{type:n,value:e,start:t,end:BE}}function jc(){var t,e,n,r,i=BE,a=$E.charCodeAt(BE),o=$E[BE];switch(a){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++BE,{type:QE,value:String.fromCharCode(a),start:i,end:BE};default:if(61===(t=$E.charCodeAt(BE+1)))switch(a){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return BE+=2,{type:QE,value:String.fromCharCode(a)+String.fromCharCode(t),start:i,end:BE};case 33:case 61:return BE+=2,61===$E.charCodeAt(BE)&&++BE,{type:QE,value:$E.slice(i,BE),start:i,end:BE}}}return">>>="===(r=$E.substr(BE,4))?(BE+=4,{type:QE,value:r,start:i,end:BE}):">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?(BE+=3,{type:QE,value:n,start:i,end:BE}):(e=n.substr(0,2),o===e[1]&&"+-<>&|".indexOf(o)>=0||"=>"===e?(BE+=2,{type:QE,value:e,start:i,end:BE}):"<>=!+-*%&|^/".indexOf(o)>=0?(++BE,{type:QE,value:o,start:i,end:BE}):void Qc({},lS,xS))}function Ic(){var t,e,n;if(n=$E[BE],Ac(Cc(n.charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=BE,t="","."!==n){if(t=$E[BE++],n=$E[BE],"0"===t){if("x"===n||"X"===n)return++BE,function(t){for(var e="";BE<WE&&Dc($E[BE]);)e+=$E[BE++];return 0===e.length&&Qc({},lS,xS),Tc($E.charCodeAt(BE))&&Qc({},lS,xS),{type:ZE,value:parseInt("0x"+e,16),start:t,end:BE}}(e);if(zc(n))return function(t){for(var e="0"+$E[BE++];BE<WE&&zc($E[BE]);)e+=$E[BE++];return(Tc($E.charCodeAt(BE))||Cc($E.charCodeAt(BE)))&&Qc({},lS,xS),{type:ZE,value:parseInt(e,8),octal:!0,start:t,end:BE}}(e);n&&Cc(n.charCodeAt(0))&&Qc({},lS,xS)}for(;Cc($E.charCodeAt(BE));)t+=$E[BE++];n=$E[BE]}if("."===n){for(t+=$E[BE++];Cc($E.charCodeAt(BE));)t+=$E[BE++];n=$E[BE]}if("e"===n||"E"===n)if(t+=$E[BE++],"+"!==(n=$E[BE])&&"-"!==n||(t+=$E[BE++]),Cc($E.charCodeAt(BE)))for(;Cc($E.charCodeAt(BE));)t+=$E[BE++];else Qc({},lS,xS);return Tc($E.charCodeAt(BE))&&Qc({},lS,xS),{type:ZE,value:parseFloat(t),start:e,end:BE}}function $c(){var t,e,n,r;return YE=null,Pc(),t=BE,e=function(){var t,e,n,r,i;for(Ac("/"===(t=$E[BE]),"Regular expression literal must start with a slash"),e=$E[BE++],n=!1,r=!1;BE<WE;)if(t=$E[BE++],e+=t,"\\"===t)Nc((t=$E[BE++]).charCodeAt(0))&&Qc({},yS),e+=t;else if(Nc(t.charCodeAt(0)))Qc({},yS);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||Qc({},yS),i=e.substr(1,e.length-2),{value:i,literal:e}}(),n=function(){var t,e,n;for(e="",n="";BE<WE&&(t=$E[BE],Rc(t.charCodeAt(0)));)++BE,"\\"===t&&BE<WE?Qc({},lS,xS):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&Qc({},mS,n),{value:n,literal:e}}(),r=function(t,e){var n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(t,e){if(parseInt(e,16)<=1114111)return"x";Qc({},mS)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){Qc({},mS)}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:BE}}function Bc(){var t;return Pc(),BE>=WE?{type:GE,start:BE,end:BE}:(t=$E.charCodeAt(BE),Tc(t)?Fc():40===t||41===t||59===t?jc():39===t||34===t?function(){var t,e,n,r,i="",a=!1;for(Ac("'"===(t=$E[BE])||'"'===t,"String literal must starts with a quote"),e=BE,++BE;BE<WE;){if((n=$E[BE++])===t){t="";break}if("\\"===n)if((n=$E[BE++])&&Nc(n.charCodeAt(0)))"\r"===n&&"\n"===$E[BE]&&++BE;else switch(n){case"u":case"x":"{"===$E[BE]?(++BE,i+=qc()):i+=Lc(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:zc(n)?(0!==(r="01234567".indexOf(n))&&(a=!0),BE<WE&&zc($E[BE])&&(a=!0,r=8*r+"01234567".indexOf($E[BE++]),"0123".indexOf(n)>=0&&BE<WE&&zc($E[BE])&&(r=8*r+"01234567".indexOf($E[BE++]))),i+=String.fromCharCode(r)):i+=n}else{if(Nc(n.charCodeAt(0)))break;i+=n}}return""!==t&&Qc({},lS,xS),{type:KE,value:i,octal:a,start:e,end:BE}}():46===t?Cc($E.charCodeAt(BE+1))?Ic():jc():Cc(t)?Ic():jc())}function Wc(){var t;return t=YE,BE=t.end,YE=Bc(),BE=t.end,t}function Yc(){var t;t=BE,YE=Bc(),BE=t}function Hc(t,e,n){var r=new Sc("||"===t||"&&"===t?oS:eS);return r.operator=t,r.left=e,r.right=n,r}function Gc(t,e){var n=new Sc(nS);return n.callee=t,n.arguments=e,n}function Vc(t){var e=new Sc(iS);return e.name=t,e}function Xc(t){var e=new Sc(aS);return e.value=t.value,e.raw=$E.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function Jc(t,e,n){var r=new Sc(uS);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function Zc(t,e,n){var r=new Sc(fS);return r.key=e,r.value=n,r.kind=t,r}function Qc(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,function(t,e){return Ac(e<r.length,"Message reference must be in range"),r[e]});throw n=new Error(i),n.index=BE,n.description=i,n}function Kc(t){t.type===GE&&Qc(t,vS),t.type===ZE&&Qc(t,hS),t.type===KE&&Qc(t,dS),t.type===VE&&Qc(t,pS),t.type===XE&&Qc(t,gS),Qc(t,lS,t.value)}function tl(t){var e=Wc();e.type===QE&&e.value===t||Kc(e)}function el(t){return YE.type===QE&&YE.value===t}function nl(t){return YE.type===XE&&YE.value===t}function rl(){var t=[];for(BE=YE.start,tl("[");!el("]");)el(",")?(Wc(),t.push(null)):(t.push(gl()),el("]")||tl(","));return Wc(),function(t){var e=new Sc(tS);return e.elements=t,e}(t)}function il(){var t;return BE=YE.start,(t=Wc()).type===KE||t.type===ZE?(t.octal&&Qc(t,bS),Xc(t)):Vc(t.value)}function al(){var t,e,n,r;return BE=YE.start,(t=YE).type===VE?(n=il(),tl(":"),r=gl(),Zc("init",n,r)):t.type!==GE&&t.type!==QE?(e=il(),tl(":"),r=gl(),Zc("init",e,r)):void Kc(t)}function ol(){var t,e,n=[],r={},i=String;for(BE=YE.start,tl("{");!el("}");)e="$"+((t=al()).key.type===iS?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?Qc({},_S):r[e]=!0,n.push(t),el("}")||tl(",");return tl("}"),function(t){var e=new Sc(sS);return e.properties=t,e}(n)}function ul(){var t,e,n;if(el("("))return function(){var t;return tl("("),t=vl(),tl(")"),t}();if(el("["))return rl();if(el("{"))return ol();if(t=YE.type,BE=YE.start,t===VE||SS[YE.value])n=Vc(Wc().value);else if(t===KE||t===ZE)YE.octal&&Qc(YE,bS),n=Xc(Wc());else{if(t===XE)throw new Error(wS);t===HE?((e=Wc()).value="true"===e.value,n=Xc(e)):t===JE?((e=Wc()).value=null,n=Xc(e)):el("/")||el("/=")?(n=Xc($c()),Yc()):Kc(Wc())}return n}function sl(){var t=[];if(tl("("),!el(")"))for(;BE<WE&&(t.push(gl()),!el(")"));)tl(",");return tl(")"),t}function fl(){var t;return BE=YE.start,t=Wc(),function(t){return t.type===VE||t.type===XE||t.type===HE||t.type===JE}(t)||Kc(t),Vc(t.value)}function cl(){return tl("."),fl()}function ll(){var t;return tl("["),t=vl(),tl("]"),t}function hl(){var t=function(){var t;for(t=ul();;)if(el("."))t=Jc(".",t,cl());else if(el("("))t=Gc(t,sl());else{if(!el("["))break;t=Jc("[",t,ll())}return t}();if(YE.type===QE&&(el("++")||el("--")))throw new Error(wS);return t}function dl(){var t,e;if(YE.type!==QE&&YE.type!==XE)e=hl();else{if(el("++")||el("--"))throw new Error(wS);if(el("+")||el("-")||el("~")||el("!"))t=Wc(),e=dl(),e=function(t,e){var n=new Sc(cS);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(nl("delete")||nl("void")||nl("typeof"))throw new Error(wS);e=hl()}}return e}function pl(t){var e=0;if(t.type!==QE&&t.type!==XE)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}return e}function gl(){var t,e;return t=function(){var t,e,n,r,i,a,o,u,s,f;if(t=YE,s=dl(),r=YE,0===(i=pl(r)))return s;for(r.prec=i,Wc(),e=[t,YE],a=[s,r,o=dl()];(i=pl(YE))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),u=a.pop().value,s=a.pop(),e.pop(),n=Hc(u,s,o),a.push(n);(r=Wc()).prec=i,a.push(r),e.push(YE),n=dl(),a.push(n)}for(n=a[f=a.length-1],e.pop();f>1;)e.pop(),n=Hc(a[f-1].value,a[f-2],n),f-=2;return n}(),el("?")&&(Wc(),e=gl(),tl(":"),t=function(t,e,n){var r=new Sc(rS);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,gl())),t}function vl(){var t=gl();if(el(","))throw new Error(wS);return t}function ml(t,e,n){var r=t+":"+n,i=DS[r];return i&&i[0]===e||(DS[r]=i=[e,e(n)]),i[1]}function yl(t,e){return ml("timeFormat",jp,e)(t)}function bl(t,e,n){return zS.setMonth(t),zS.setDate(e),yl(zS,n)}function _l(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function xl(t,e){var n;return gd(t)?t:Kh(t)?(n=e.scales[t])&&n.value:void 0}function wl(t,e,n){var r=PS+n;if(!e.hasOwnProperty(r))try{e[r]=t.scaleRef(n)}catch(t){}}function Ml(t,e,n,r){if(e[0].type===NS)wl(n,r,e[0].value);else if(e[0].type===TS)for(t in n.scales)wl(n,r,t)}function kl(t){return function(e,n,r){var i=xl(e,(r||this).context);return i&&i.path[t](n)}}function El(t){var e=this.context.data[t];return e?e.values.value:[]}function Sl(t,e,n,r){e[0].type!==NS&&Xh("First argument to data functions must be a string literal.");var i=e[0].value,a=LS+i;r.hasOwnProperty(a)||(r[a]=n.getData(i).tuplesRef())}function Al(t){return t.data}function Cl(t,e){var n=El.call(e,t);return n.root&&n.root.lookup||jS}function Dl(t,e){return t===e||t!=t&&e!=e||!(!Zh(t)||!Zh(e)||t.length!==e.length)&&function(t,e){for(var n=0,r=t.length;n<r;++n)if(!Dl(t[n],e[n]))return!1;return!0}(t,e)}function zl(t){return function(e){for(var n in t)if(!Dl(e[n],t[n]))return!1;return!0}}function Ol(t,e){for(var n,r=e.fields,i=e.values,a=e.getter||(e.getter=[]),o=r.length,u=0;u<o;++u)if(a[u]=a[u]||td(r[u]),n=a[u](t),Ed(n)&&(n=dd(n)),Ed(i[u])&&(i[u]=dd(i[u])),e[$S+r[u]]){if(Ed(i[u][0])&&(i[u]=i[u].map(dd)),!IS(n,i[u],!0,!1))return!1}else if(n!==i[u])return!1;return!0}function Nl(t,e){for(var n,r,i,a=e.intervals,o=a.length,u=0;u<o;++u){if(r=a[u].extent,n=a[u].getter||(a[u].getter=td(a[u].field)),i=n(t),!r||r[0]===r[1])return!1;if(Ed(i)&&(i=dd(i)),Ed(r[0])&&(r=a[u].extent=r.map(dd)),Sd(r[0])&&!IS(i,r))return!1;if(Kh(r[0])&&r.indexOf(i)<0)return!1}return!0}function Tl(t,e,n,r){for(var i,a,o,u,s,f=this.context.data[t],c=f?f.values.value:[],l=f?f[YS]&&f[YS].value:void 0,h=n===BS,d=c.length,p=0;p<d;++p)if(i=c[p],l&&h){if(a=a||{},-1===(o=a[u=i.unit]||0))continue;if(s=r(e,i),a[u]=s?-1:++o,s&&1===l.size)return!0;if(!s&&o===l.get(u).count)return!1}else if(s=r(e,i),h^s)return s;return d&&h}function Rl(t,e,n){return Tl.call(this,t,e,n,Ol)}function Pl(t,e,n,r){e[0].type!==NS&&Xh("First argument to indata must be a string literal.");var i=e[0].value,a=e.length>=2&&e[e.length-1].value,o=RS+"unit";a!==BS||r.hasOwnProperty(o)||(r[o]=n.getData(i).indataRef(n,"unit")),Sl(0,e,n,r)}function Ll(t,e,n,r){var i,a,o,u,s,f=this.context.data[t],c=f?f.values.value:[],l=f?f[YS]&&f[YS].value:void 0,h=c[0],d=0;if(h){for(i=e?h.encodings.length:h.fields.length;d<i;++d)if(e&&h.encodings[d]===e||n&&h.fields[d]===n){a=d,u=h[$S+h.fields[d]];break}return l&&1===l.size&&(r=WS),l&&r===BS?(s=c.reduce(function(t,e){return(t[e.unit]||(t[e.unit]=[])).push({unit:e.unit,value:e.values[a]}),t},{}),o=Object.keys(s).map(function(t){return{unit:t,value:u?Ul(s[t],WS):ql(s[t],WS)}})):o=c.map(function(t){return{unit:t.unit,value:t.values[a]}}),u?Ul(o,r):ql(o,r)}}function ql(t,e){for(var n,r,i,a,o={},u=0,s={},f=[],c=0,l=t.length;c<l;++c)r=(n=t[c]).unit,a=n.value,o[r]||(o[r]=++u),(i=s[a])||(s[a]=i={value:a,units:{},count:0}),i.units[r]||(i.units[r]=++i.count);for(a in s)i=s[a],e===BS&&i.count!==u||f.push(i.value);return f.length?f:void 0}function Ul(t,e){for(var n,r,i,a,o=e===BS?function(t,e,n){{if(n<t[0]||t[1]<e)return[];t[0]<e&&(t[0]=e),t[1]>n&&(t[1]=n)}return t}:function(t,e,n){t[0]>e&&(t[0]=e);t[1]<n&&(t[1]=n);return t},u=0,s=t.length;u<s;++u)n=t[u].value,Ed(n[0])&&(n=n.map(dd)),(i=n[0])>(a=n[1])&&(a=n[0],i=n[1]),r=r?o(r,i,a):[i,a];return r&&r.length&&+r[0]!=+r[1]?r:void 0}function Fl(t,e,n){return 1===arguments.length?HS[t]:(HS[t]=e,n&&(JS[t]=n),tA&&(tA.functions[t]=XS+t),this)}function jl(t,e){return(t.merge?function(t,e){var n=Il({merge:t.merge.map(function(t){return jl(t,e)})},t,e);return e.addStream(n).id}:t.stream?function(t,e){var n=Il({stream:jl(t.stream,e)},t,e);return e.addStream(n).id}:t.type?function(t,e){var n=e.event(function(t){return t===rA?nA:t||nA}(t.source),t.type),r=Il({stream:n},t,e);return 1===Object.keys(r).length?n:e.addStream(r).id}:Xh("Invalid stream specification: "+r(t)))(t,e)}function Il(t,e,n){var i=e.between;return i&&(2!==i.length&&Xh('Stream "between" parameter must have 2 entries: '+r(e)),t.between=[jl(i[0],n),jl(i[1],n)]),i=e.filter?pd(e.filter):[],(e.marktype||e.markname||e.markrole)&&i.push(function(t,e,n){var r="event.item";return r+(t&&"*"!==t?"&&event.item.mark.marktype==='"+t+"'":"")+(n?"&&event.item.mark.role==='"+n+"'":"")+(e?"&&event.item.mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===rA&&i.push("inScope(event.item)"),i.length&&(t.filter=eA("("+i.join(")&&(")+")").$expr),null!=(i=e.throttle)&&(t.throttle=+i),null!=(i=e.debounce)&&(t.debounce=+i),e.consume&&(t.consume=!0),t}function $l(t,e,n,r,i){for(var a,o=0,u=t.length;e<u;++e){if(a=t[e],!o&&a===n)return e;i&&i.indexOf(a)>=0?--o:r&&r.indexOf(a)>=0&&++o}return e}function Bl(t){for(var e=[],n=0,r=t.length,i=0;i<r;)i=$l(t,i,cA,aA+uA,oA+sA),e.push(t.substring(n,i).trim()),n=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function Wl(t){return"["===t[0]?function(t){var e,n,r=t.length,i=1;if((i=$l(t,i,oA,aA,oA))===r)throw"Empty between selector: "+t;if(2!==(e=Bl(t.substring(1,i))).length)throw"Between selector must have two elements: "+t;if((t=t.slice(i+1).trim())[0]!==hA)throw"Expected '>' after between selector: "+t;{if(e=e.map(Wl),(n=Wl(t.slice(1).trim())).between)return{between:e,stream:n};n.between=e}return n}(t):function(t){var e,n,r={source:ZS},i=[],a=[0,0],o=0,u=0,s=t.length,f=0;if(t[s-1]===sA){if(!((f=t.lastIndexOf(uA))>=0))throw"Unmatched right brace: "+t;try{a=function(t){var e=t.split(cA);if(!t.length||e.length>2)throw t;return e.map(function(e){var n=+e;if(n!=n)throw t;return n})}(t.substring(f+1,s-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,f).trim(),s=t.length,f=0}if(!s)throw t;t[0]===lA&&(o=++f);(e=$l(t,f,fA))<s&&(i.push(t.substring(u,e).trim()),u=f=++e);if((f=$l(t,f,aA))===s)i.push(t.substring(u,s).trim());else if(i.push(t.substring(u,f).trim()),n=[],(u=++f)===s)throw"Unmatched left bracket: "+t;for(;f<s;){if((f=$l(t,f,oA))===s)throw"Unmatched left bracket: "+t;if(n.push(t.substring(u,f).trim()),f<s-1&&t[++f]!==aA)throw"Expected left bracket: "+t;u=++f}if(!(s=i.length)||dA.test(i[s-1]))throw"Invalid event selector: "+t;s>1?(r.type=i[1],o?r.markname=i[0].slice(1):!function(t){return QS.hasOwnProperty(t)}(i[0])?r.source=i[0]:r.marktype=i[0]):r.type=i[0];"!"===r.type.slice(-1)&&(r.consume=!0,r.type=r.type.slice(0,-1));null!=n&&(r.filter=n);a[0]&&(r.throttle=a[0]);a[1]&&(r.debounce=a[1]);return r}(t)}function Yl(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function Hl(t,e,n,r){return new Yl(t,e,n,r)}function Gl(t,e){return Hl("operator",t,e)}function Vl(t){var e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function Xl(t,e){return e?{$field:t,$name:e}:{$field:t}}function Jl(t,e){return{$compare:t,$order:e}}function Zl(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}function Ql(t){return t&&t.signal}function Kl(t,e){return null!=t?t:e}function th(t){return function(e,n,r){return Hl(t,n,e||void 0,r)}}function eh(t){return XA.hasOwnProperty(t)}function nh(t){return"quantile"===t}function rh(t,e){var n,r=e.getScale(t.name).params;r.domain=oh(t.domain,t,e),null!=t.range&&(r.range=sh(t,e,r)),null!=t.interpolate&&function(t,e){e.interpolate=ih(t.type||t),null!=t.gamma&&(e.interpolateGamma=ih(t.gamma))}(t.interpolate,r),null!=t.nice&&function(t,e){e.nice=Qh(t)?{interval:ih(t.interval),step:ih(t.step)}:ih(t)}(t.nice,r);for(n in t)r.hasOwnProperty(n)||"name"===n||(r[n]=ih(t[n],e))}function ih(t,e){return Qh(t)?t.signal?e.signalRef(t.signal):Xh("Unsupported object: "+r(t)):t}function ah(t){Xh("Can not find data set: "+r(t))}function oh(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(Zh(t)?function(t,e,n){return t.map(function(t){return ih(t,n)})}:t.fields?function(t,e,n){var i=t.data,a=t.fields.reduce(function(t,e){return e=Kh(e)?{data:i,field:e}:Zh(e)||e.signal?function(t,e){var n="_:vega:_"+HA++,i=MA({});Zh(t)?i.value={$ingest:t}:t.signal&&e.signalRef("setdata("+r(n)+","+t.signal+")");return e.addDataPipeline(n,[i,$A({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t},[]);return(eh(e.type)?function(t,e,n){var r,i,a,o;return r=n.map(function(t){var n=e.getData(t.data);return n||ah(t.data),n.countsRef(e,t.field)}),i=e.add(_A({groupby:yA,ops:["sum"],fields:[e.fieldRef("count")],as:["count"],pulse:r})),a=e.add(MA({pulse:Vl(i)})),o=e.add(YA({field:yA,sort:e.sortRef(uh(t.sort,!0)),pulse:Vl(a)})),Vl(o)}:nh(e.type)?function(t,e,n){var r=n.map(function(t){var n=e.getData(t.data);return n||ah(t.data),n.domainRef(e,t.field)});return Vl(e.add(TA({values:r})))}:function(t,e,n){var r=n.map(function(t){var n=e.getData(t.data);return n||ah(t.data),n.extentRef(e,t.field)});return Vl(e.add(NA({extents:r})))})(t,n,a)}:function(t,e,n){var r=n.getData(t.data);r||ah(t.data);return eh(e.type)?r.valuesRef(n,t.field,uh(t.sort,!1)):nh(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)})(t,e,n);null==e.domainMin&&null==e.domainMax||Xh("No scale domain defined for domainMin/domainMax to override.")}function uh(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field?Xh("Multiple domain scales can not sort by field."):e&&t.op&&"count"!==t.op&&Xh("Multiple domain scales support op count only."):Xh("No field provided for sort aggregate op: "+t.op):Qh(t)?t.field="key":t={field:"key"}),t}function sh(t,e,n){var i=t.range,a=e.config.range;if(i.signal)return e.signalRef(i.signal);if(Kh(i)){if(a&&a.hasOwnProperty(i))return t=bd({},t,{range:a[i]}),sh(t,e,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=eh(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Xh("Unrecognized scale range value: "+r(i))}else{if(i.scheme)return n.scheme=ih(i.scheme,e),i.extent&&(n.schemeExtent=function(t,e){return t.signal?e.signalRef(t.signal):t.map(function(t){return ih(t,e)})}(i.extent,e)),void(i.count&&(n.schemeCount=ih(i.count,e)));if(i.step)return void(n.rangeStep=ih(i.step,e));if(eh(t.type)&&!Zh(i))return oh(i,t,e);Zh(i)||Xh("Unsupported range type: "+r(i))}return i.map(function(t){return ih(t,e)})}function fh(t,e){return Zh(t)?t.map(function(t){return fh(t,e)}):Qh(t)?t.signal?e.signalRef(t.signal):Xh("Unsupported parameter object: "+r(t)):t}function ch(t,e,n,i){var a,o,u;if(t.signal)a="datum",u=oC(t.signal,e,n,i);else if(t.group||t.parent){for(o=Math.max(1,t.level||1),a="item";o-- >0;)a+=".mark.group";t.parent?(u=t.parent,a+=".datum"):u=t.group}else t.datum?(a="datum",u=t.datum):Xh("Invalid field reference: "+r(t));return t.signal||(Kh(u)?(i[u]=1,u=Jh(u).map(r).join("][")):u=ch(u,e,n,i)),a+"["+u+"]"}function lh(t,e,n,i){var a;if(Kh(t))a=PS+t,n.hasOwnProperty(a)||(n[a]=e.scaleRef(t)),a=r(a);else{for(a in e.scales)n[PS+a]=e.scaleRef(a);a=r(PS)+"+"+(t.signal?"("+oC(t.signal,e,n,i)+")":uC(t,e,n,i))}return"_["+a+"]"}function hh(t,e,n,r){var i,a,o,u={},s="var o=item,datum=o.datum,$;";for(i in t)a=t[i],Zh(a)?s+=hC(i,a,r,n,u):(o=cC(i,a,r,n,u),s+=lC("o",i,o));return s+=aC(t,e),s+="return 1;",{$expr:s,$fields:Object.keys(u),$output:Object.keys(t)}}function dh(t){return Qh(t)?t:{value:t}}function ph(t,e,n){return null!=n?(t[e]=Qh(n)&&!Zh(n)?n:{value:n},1):0}function gh(t,e,n){for(var r in e)n&&n.hasOwnProperty(r)||(t[r]=bd(t[r]||{},e[r]));return t}function vh(t,e,n,r,i,a){var o,u;(a=a||{}).encoders={$encode:o={}},t=function(t,e,n,r,i){var a,o,u={};"legend"!=n&&0!==String(n).indexOf("axis")||(n=null);o=n===pC?i.group:n===dC?bd({},i.mark,i[e]):null;for(a in o)mh(a,t)||("fill"===a||"stroke"===a)&&(mh("fill",t)||mh("stroke",t))||(u[a]={value:o[a]});return pd(r).forEach(function(e){var n=i.style&&i.style[e];for(var r in n)mh(r,t)||(u[r]={value:n[r]})}),t=bd({},t),t.enter=bd(u,t.enter),t}(t,e,n,r,i.config);for(u in t)o[u]=hh(t[u],e,a,i);return a}function mh(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}function yh(t,e,n){var i,a,o,u={};for(a=0,o=t.params.length;a<o;++a)u[(i=t.params[a]).name]=function(t,e,n){var i=t.type,a=e[t.name];{if("index"===i)return function(t,e,n){Kh(e.from)||Xh('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n);if(void 0===a)return void(t.required&&Xh("Missing required "+r(e.type)+" parameter: "+r(t.name)));if("param"===i)return function(t,e,n){var i=e[t.name];return t.array?(Zh(i)||Xh("Expected an array of sub-parameters. Instead: "+r(i)),i.map(function(e){return _h(t,e,n)})):_h(t,i,n)}(t,e,n);if("projection"===i)return n.projectionRef(e[t.name])}return t.array&&!Ql(a)?a.map(function(e){return bh(t,e,n)}):bh(t,a,n)}(i,e,n);return u}function bh(t,e,n){var r=t.type;if(Ql(e))return xh(r)?Xh("Expression references can not be signals."):wh(r)?n.fieldRef(e):Mh(r)?n.compareRef(e):n.signalRef(e.signal);var i=t.expr||wh(r);return i&&function(t){return t&&t.expr}(e)?eA(e.expr,n):i&&function(t){return t&&t.field}(e)?Xl(e.field):xh(r)?eA(e,n):function(t){return"data"===t}(r)?Vl(n.getData(e).values):wh(r)?Xl(e):Mh(r)?n.compareRef(e):e}function _h(t,e,n){var i,a,o,u,s;for(u=0,s=t.params.length;u<s;++u){a=t.params[u];for(o in a.key)if(a.key[o]!==e[o]){a=null;break}if(a)break}return a||Xh("Unsupported parameter: "+r(e)),i=bd(yh(a,e,n),a.key),Vl(n.add(PA(i)))}function xh(t){return"expr"===t}function wh(t){return"field"===t}function Mh(t){return"compare"===t}function kh(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}function Eh(t){return Kh(t)?t:null}function Sh(t,e,n){var r,i=Zl(n.op,n.field);if(e.ops){for(var a=0,o=e.as.length;a<o;++a)if(e.as[a]===i)return}else e.ops=["count"],e.fields=[null],e.as=["count"];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 Ah(t,e,n,r,i,a,o){var u,s,f=e[n]||(e[n]={}),c=function(t){return Qh(t)?(t.order===bA?"-":"+")+Zl(t.op,t.field):""}(a),l=Eh(i);if(null!=l&&(t=e.scope,u=f[l+=c?"|"+c:""]),!u){var h=a?{field:yA,pulse:e.countsRef(t,i,a)}:{field:t.fieldRef(i),pulse:Vl(e.output)};c&&(h.sort=t.sortRef(a)),s=t.add(Hl(r,void 0,h)),o&&(e.index[i]=s),u=Vl(s),null!=l&&(f[l]=u)}return u}function Ch(t,e,n,r){var i=e&&(e.update&&e.update[n]||e.enter&&e.enter[n]);return+(i?i.value:r&&(i=t.config.style[r])&&i[n])}function Dh(t,e){var n=[];t.transform&&t.transform.forEach(function(t){n.push(xC(t,e))}),t.on&&t.on.forEach(function(n){MC(n,e,t.name)}),e.addDataPipeline(t.name,function(t,e,n){var r,i,a,o,u,s=[],f=null,c=!1,l=!1;t.values?s.push(f=zh({$ingest:t.values,$format:t.format})):t.url?s.push(f=zh({$request:t.url,$format:t.format})):t.source&&(f=r=pd(t.source).map(function(t){return Vl(e.getData(t).output)}),s.push(null));for(i=0,a=n.length;i<a;++i)o=n[i],u=o.metadata,f||u.source||s.push(f=zh()),s.push(o),u.generates&&(l=!0),u.modifies&&!l&&(c=!0),u.source?f=o:u.changes&&(f=null);r&&(a=r.length-1,s[0]=FA({derive:c,pulse:a?r:r[0]}),(c||a)&&s.splice(1,0,zh()));f||s.push(zh());return s.push($A({})),s}(t,e,n))}function zh(t){var e=MA({},t);return e.metadata={source:!0},e}function Oh(t,e){return{scale:t.scale,range:e}}function Nh(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function Th(t){this.config=t,this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.background=null,this.eventConfig=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Rh(t){this.config=t.config,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}function Ph(t){return(Zh(t)?function(t){for(var e,n="[",i=0,a=t.length;i<a;++i)e=t[i],n+=(i>0?",":"")+(Qh(e)?e.signal||Ph(e):r(e));return n+"]"}:function(t){var e,n,i="{",a=0;for(e in t)n=t[e],i+=(++a>1?",":"")+r(e)+":"+(Qh(n)?n.signal||Ph(n):r(n));return i+"}"})(t)}function Lh(t,e,n){";"!==e[e.length-1]&&(e="return("+e+");");var r=Function.apply(null,t.concat(e));return n&&n.functions?r.bind(n.functions):r}function qh(t,e){return Lh(["event"],t,e)}function Uh(t,e){return Lh(["item","_"],t,e)}function Fh(t,e,n){n=n||{};var r,i;for(r in t)(i=t[r])&&i.$expr&&i.$params&&Fh(i.$params,e,n),n[r]=Zh(i)?i.map(function(t){return jh(t,e)}):jh(i,e);return n}function jh(t,e){if(!t||!Qh(t))return t;for(var n,r=0,i=FC.length;r<i;++r)if(n=FC[r],t.hasOwnProperty(n.key))return n.parse(t,e);return t}function Ih(t){return(t+"").toLowerCase()}function $h(t,e,n){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Bh(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.functions=t.functions,this.events=t.events,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),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function Wh(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===HC?r.left+r.right:0)}function Yh(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===HC?r.top+r.bottom:0)}function Hh(t,e){e=e||{},Me.call(this),this.loader(e.loader||this._loader),this.logLevel(e.logLevel||0),this._el=null,this._renderType=e.renderer||sy.Canvas,this._scenegraph=new li;var n=this._scenegraph.root;this._renderer=null,this._redraw=!0,this._handler=(new gi).scene(n),this._eventListeners=[],this._preventDefault=!1;var r=YC(this,t,e.functions);this._runtime=r,this._signals=r.signals,this._bind=(t.bindings||[]).map(function(t){return{state:null,param:bd({},t)}}),r.root&&r.root.set(n),n.source=r.data.root.input,this.pulse(r.data.root.input,this.changeset().insert(n.items)),this._background=r.background||null,this._eventConfig=function(t){var e=(t=bd({},t)).defaults;return e&&(Zh(e.prevent)&&(e.prevent=Pd(e.prevent)),Zh(e.allow)&&(e.allow=Pd(e.allow))),t}(r.eventConfig),this._width=this.width(),this._height=this.height(),this._viewWidth=Wh(this,this._width),this._viewHeight=Yh(this,this._height),this._origin=[0,0],this._resize=0,this._autosize=1,function(t){function e(){t._autosize=t._resize=1}var n=t._signals,r=n.width,i=n.height,a=n.padding;t._resizeWidth=t.add(null,function(n){t._width=n.size,t._viewWidth=Wh(t,n.size),e()},{size:r}),t._resizeHeight=t.add(null,function(n){t._height=n.size,t._viewHeight=Yh(t,n.size),e()},{size:i});var o=t.add(null,e,{pad:a});t._resizeWidth.rank=r.rank+1,t._resizeHeight.rank=i.rank+1,o.rank=a.rank+1}(this),SE(this)}function Gh(t,e){return t._signals.hasOwnProperty(e)?t._signals[e]:Xh("Unrecognized signal name: "+r(e))}var Vh=function(t,e,n){return t.fields=e||[],t.fname=n,t},Xh=function(t){throw Error(t)},Jh=function(t){function e(){a.push(f+t.substring(n,r)),f="",n=r+1}var n,r,i,a=[],o=null,u=0,s=t.length,f="";for(t+="",n=r=0;r<s;++r)if("\\"===(i=t[r]))f+=t.substring(n,r),n=++r;else if(i===o)e(),o=null,u=-1;else{if(o)continue;n===u&&'"'===i?(n=r+1,o=i):n===u&&"'"===i?(n=r+1,o=i):"."!==i||u?"["===i?(r>n&&e(),u=n=r+1):"]"===i&&(u||Xh("Access path missing open bracket: "+t),u>0&&e(),u=0,n=r+1):r>n?e():n=r+1}return u&&Xh("Access path missing closing bracket: "+t),o&&Xh("Access path missing closing quote: "+t),r>n&&(r++,e()),a},Zh=Array.isArray,Qh=function(t){return t===Object(t)},Kh=function(t){return"string"==typeof t},td=function(t,e){var n=Jh(t),i="return _["+n.map(r).join("][")+"];";return Vh(Function("_",i),[t=1===n.length?n[0]:t],e||t)},ed=[],nd=td("id"),rd=Vh(function(t){return t},ed,"identity"),id=Vh(function(){return 0},ed,"zero"),ad=Vh(function(){return 1},ed,"one"),od=Vh(function(){return!0},ed,"true"),ud=Vh(function(){return!1},ed,"false"),sd=1,fd=3,cd=4,ld=function(t){var e=t||0;return{level:function(t){return arguments.length?(e=+t,this):e},error:function(){return e>=sd&&i("error","ERROR",arguments),this},warn:function(){return e>=2&&i("warn","WARN",arguments),this},info:function(){return e>=fd&&i("log","INFO",arguments),this},debug:function(){return e>=cd&&i("log","DEBUG",arguments),this}}},hd=function(t){return t[t.length-1]},dd=function(t){return null==t||""===t?null:+t},pd=function(t){return null!=t?Zh(t)?t:[t]:[]},gd=function(t){return"function"==typeof t},vd=function(t,e){var i,a,o,u,s,f,c,l,h,d=[],p=(t=pd(t)).map(function(t,e){return null==t?null:(d.push(e),gd(t)?t:Jh(t).map(r).join("]["))}),g=d.length-1,v=pd(e),m="var u,v;return ";if(g<0)return null;for(a=0;a<=g;++a)o=p[i=d[a]],gd(o)?(u="(u=this."+(f="f"+i)+"(a))",s="(v=this."+f+"(b))",(c=c||{})[f]=o):(u="(u=a["+o+"])",s="(v=b["+o+"])"),f="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==v[i]?(h=1,l=-1):(h=-1,l=1),m+="("+u+"<"+s+"||u==null)&&v!=null?"+l+":(u>v||v==null)&&u!=null?"+h+":"+f+"!==u&&v===v?"+l+":v!==v&&u===u?"+h+(i<g?":":":0");return o=Function("a","b",m+";"),c&&(o=o.bind(c)),t=t.reduce(function(t,e){return gd(e)?(n(e)||[]).forEach(function(e){t[e]=1}):null!=e&&(t[e+""]=1),t},{}),Vh(o,Object.keys(t))},md=function(t){return gd(t)?t:function(){return t}},yd=function(t,e){function n(){e(i),r=i=null}var r,i;return function(e){i=e,r&&clearTimeout(r),r=setTimeout(n,t)}},bd=function(t){for(var e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t},_d=function(t,e){var n,r,i,a,o,u=-1,s=t.length;if(null==e){for(;++u<s;)if(null!=(r=t[u])&&r>=r){n=i=r;break}for(a=o=u;++u<s;)null!=(r=t[u])&&(n>r&&(n=r,a=u),i<r&&(i=r,o=u))}else{for(;++u<s;)if(null!=(r=e(t[u],u,t))&&r>=r){n=i=r;break}for(a=o=u;++u<s;)null!=(r=e(t[u],u,t))&&(n>r&&(n=r,a=u),i<r&&(i=r,o=u))}return[a,o]},xd={},wd=function(t){function e(t){return i.hasOwnProperty(t)&&i[t]!==xd}var n,r,i={};return n={size:0,empty:0,object:i,has:e,get:function(t){return e(t)?i[t]:void 0},set:function(t,r){return e(t)||(++n.size,i[t]===xd&&--n.empty),i[t]=r,this},delete:function(t){return e(t)&&(--n.size,++n.empty,i[t]=xd),this},clear:function(){n.size=n.empty=0,n.object=i={}},test:function(t){return arguments.length?(r=t,n):r},clean:function(){var t,e,a={},o=0;for(t in i)(e=i[t])===xd||r&&r(e)||(a[t]=e,++o);n.size=o,n.empty=0,n.object=i=a}},t&&Object.keys(t).forEach(function(e){n.set(e,t[e])}),n},Md=function(t,e){var n=t.prototype=Object.create(e.prototype);return n.constructor=t,n},kd=function(t){return"boolean"==typeof t},Ed=function(t){return"[object Date]"===Object.prototype.toString.call(t)},Sd=function(t){return"number"==typeof t},Ad=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},Cd=function(t,e){t&&(t=e?pd(t).map(function(t){return t.replace(/\\(.)/g,"$1")}):pd(t));var n=t&&t.length?Function("_","return ''+"+t.map(function(t){return"_["+(e?r(t):Jh(t).map(r).join("]["))+"]"}).join("+'|'+")+";"):function(){return""};return Vh(n,t,"key")},Dd=function(t,e,n,r){var i=e.length,a=n.length;if(!a)return e;if(!i)return n;for(var o=r||new e.constructor(i+a),u=0,s=0,f=0;u<i&&s<a;++f)o[f]=t(e[u],n[s])>0?n[s++]:e[u++];for(;u<i;++u,++f)o[f]=e[u];for(;s<a;++s,++f)o[f]=n[s];return o},zd=function(t,e){for(var n="";--e>=0;)n+=t;return n},Od=function(t,e,n,r){var i=n||" ",a=t+"",o=e-a.length;return o<=0?a:"left"===r?zd(i,o)+a:"center"===r?zd(i,~~(o/2))+a+zd(i,Math.ceil(o/2)):a+zd(i,o)},Nd=function(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t},Td=function(t,e){return e=e||function(t){return Sd(t)?t:Ed(t)?t:Date.parse(t)},null==t||""===t?null:e(t)},Rd=function(t){return null==t||""===t?null:t+""},Pd=function(t){for(var e={},n=0,r=t.length;n<r;++n)e[t[n]]=1;return e},Ld=function(t,e,n,r){var i=null!=r?r:"…",a=t+"",o=a.length,u=Math.max(0,e-i.length);return o<=e?a:"left"===n?i+a.slice(o-u):"center"===n?a.slice(0,Math.ceil(u/2))+i+a.slice(o-~~(u/2)):a.slice(0,u)+i},qd=function(t,e,n){if(t){var r,i=0,a=t.length;if(e)for(;i<a;++i)(r=e(t[i]))&&n(r,i,t);else t.forEach(n)}},Ud=Symbol("vega_id"),Fd=1,jd="_:mod:_",Id=S.prototype;Id.set=function(t,e,n,r){var i=this[t],a=this[jd];return null!=e&&e>=0?(i[e]!==n||r)&&(i[e]=n,a[e+":"+t]=-1,a[t]=-1):(i!==n||r)&&(this[t]=n,a[t]=Zh(n)?1+n.length:-1),this},Id.modified=function(t,e){var n,r=this[jd];if(!arguments.length){for(n in r)if(r[n])return!0;return!1}if(Zh(t)){for(n=0;n<t.length;++n)if(r[t[n]])return!0;return!1}return null!=e&&e>=0?e+1<r[t]||!!r[e+":"+t]:!!r[t]},Id.clear=function(){return this[jd]={},this};var $d=0,Bd=new S,Wd=A.prototype;Wd.targets=function(){return this._targets||(this._targets=v(nd))},Wd.set=function(t){return this.value!==t?(this.value=t,1):0},Wd.skip=C(1),Wd.modified=C(2),Wd.parameters=function(t,e){function n(t,n,r){r instanceof A?(r!==u&&(e&&r.targets().add(u),c.push(r)),f.push({op:r,name:t,index:n})):s.set(t,n,r)}e=!1!==e;var r,i,a,o,u=this,s=u._argval=u._argval||new S,f=u._argops=u._argops||[],c=[];for(r in t)if(i=t[r],"pulse"===r)pd(i).forEach(function(t){t instanceof A?t!==u&&(t.targets().add(u),c.push(t)):Xh("Pulse parameters must be operator instances.")}),u.source=i;else if(Zh(i))for(s.set(r,-1,Array(a=i.length)),o=0;o<a;++o)n(r,o,i[o]);else n(r,-1,i);return this.marshall().clear(),c},Wd.marshall=function(t){var e,n,r,i,a,o=this._argval||Bd,u=this._argops;if(u&&(r=u.length))for(n=0;n<r;++n)a=(i=(e=u[n]).op).modified()&&i.stamp===t,o.set(e.name,e.index,i.value,a);return o},Wd.evaluate=function(t){if(this._update){var e=this.marshall(t.stamp),n=this._update(e,t);if(e.clear(),n!==this.value)this.value=n;else if(!this.modified())return t.StopPropagation}},Wd.run=function(t){if(t.stamp<=this.stamp)return t.StopPropagation;var e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.stamp=t.stamp,this.pulse=e,e||t};var Yd=0,Hd=D.prototype;Hd._filter=od,Hd._apply=rd,Hd.targets=function(){return this._targets||(this._targets=v(nd))},Hd.consume=function(t){return arguments.length?(this._consume=!!t,this):!!this._consume},Hd.receive=function(t){if(this._filter(t)){for(var e=this.value=this._apply(t),n=this._targets,r=n?n.length:0,i=0;i<r;++i)n[i].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},Hd.filter=function(t){var e=z(t);return this.targets().add(e),e},Hd.apply=function(t){var e=z(null,t);return this.targets().add(e),e},Hd.merge=function(){var t=z();this.targets().add(t);for(var e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},Hd.throttle=function(t){var e=-1;return this.filter(function(){var n=Date.now();return n-e>t?(e=n,1):0})},Hd.debounce=function(t){var e=z();return this.targets().add(z(null,null,yd(t,function(t){var n=t.dataflow;e.receive(t),n&&n.run&&n.run()}))),e},Hd.between=function(t,e){var n=!1;return t.targets().add(z(null,null,function(){n=!0})),e.targets().add(z(null,null,function(){n=!1})),this.filter(function(){return n})};O.prototype=N.prototype={constructor:O,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var Gd=N.prototype;q.prototype=function(t,e){var n=new q;if(t instanceof q)t.each(function(t){n.add(t)});else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}.prototype={constructor:q,has:Gd.has,add:function(t){return t+="",this["$"+t]=t,this},remove:Gd.remove,clear:Gd.clear,values:Gd.keys,size:Gd.size,empty:Gd.empty,each:Gd.each};var Vd={value:function(){}};F.prototype=U.prototype={constructor:F,on:function(t,e){var n,r=this._,i=function(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}(t+"",r),a=-1,o=i.length;{if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<o;)if(n=(t=i[a]).type)r[n]=j(r[n],t.name,e);else if(null==e)for(n in r)r[n]=j(r[n],t.name,null);return this}for(;++a<o;)if((n=(t=i[a]).type)&&(n=function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(r[n],t.name)))return n}},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new F(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var Xd=function(t,e){function n(t){var e,n=f.status;if(!n&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(f)||n>=200&&n<300||304===n){if(a)try{e=a.call(r,f)}catch(t){return void u.call("error",r,t)}else e=f;u.call("load",r,e)}else u.call("error",r,t)}var r,i,a,o,u=U("beforesend","progress","load","error"),s=N(),f=new XMLHttpRequest,c=null,l=null,h=0;if("undefined"==typeof XDomainRequest||"withCredentials"in f||!/^(http(s)?:)?\/\//.test(t)||(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=f.ontimeout=n:f.onreadystatechange=function(t){f.readyState>3&&n(t)},f.onprogress=function(t){u.call("progress",r,t)},r={header:function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s.get(t):(null==e?s.remove(t):s.set(t,e+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(o=t,r):o},timeout:function(t){return arguments.length?(h=+t,r):h},user:function(t){return arguments.length<1?c:(c=null==t?null:t+"",r)},password:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},response:function(t){return a=t,r},get:function(t,e){return r.send("GET",t,e)},post:function(t,e){return r.send("POST",t,e)},send:function(e,n,a){return f.open(e,t,!0,c,l),null==i||s.has("accept")||s.set("accept",i+",*/*"),f.setRequestHeader&&s.each(function(t,e){f.setRequestHeader(e,t)}),null!=i&&f.overrideMimeType&&f.overrideMimeType(i),null!=o&&(f.responseType=o),h>0&&(f.timeout=h),null==a&&"function"==typeof n&&(a=n,n=null),null!=a&&1===a.length&&(a=function(t){return function(e,n){t(null==e?n:null)}}(a)),null!=a&&r.on("error",a).on("load",function(t){a(null,t)}),u.call("beforesend",r,f),f.send(null==n?null:n),r},abort:function(){return f.abort(),r},on:function(){var t=u.on.apply(u,arguments);return t===u?r:t}},null!=e){if("function"!=typeof e)throw new Error("invalid callback: "+e);return r.get(e)}return r},Jd={},Zd={},Qd=34,Kd=10,tp=13,ep=function(t){function e(t,e){function n(){if(f)return Zd;if(c)return c=!1,Jd;var e,n,r=u;if(t.charCodeAt(r)===Qd){for(;u++<o&&t.charCodeAt(u)!==Qd||t.charCodeAt(++u)===Qd;);return(e=u)>=o?f=!0:(n=t.charCodeAt(u++))===Kd?c=!0:n===tp&&(c=!0,t.charCodeAt(u)===Kd&&++u),t.slice(r+1,e-1).replace(/""/g,'"')}for(;u<o;){if((n=t.charCodeAt(e=u++))===Kd)c=!0;else if(n===tp)c=!0,t.charCodeAt(u)===Kd&&++u;else if(n!==a)continue;return t.slice(r,e)}return f=!0,t.slice(r,o)}var r,i=[],o=t.length,u=0,s=0,f=o<=0,c=!1;for(t.charCodeAt(o-1)===Kd&&--o,t.charCodeAt(o-1)===tp&&--o;(r=n())!==Zd;){for(var l=[];r!==Jd&&r!==Zd;)l.push(r),r=n();e&&null==(l=e(l,s++))||i.push(l)}return i}function n(e){return e.map(r).join(t)}function r(t){return null==t?"":i.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}var i=new RegExp('["'+t+"\n\r]"),a=t.charCodeAt(0);return{parse:function(t,n){var r,i,a=e(t,function(t,e){if(r)return r(t,e-1);i=t,r=n?function(t,e){var n=I(t);return function(r,i){return e(n(r),i,t)}}(t,n):I(t)});return a.columns=i||[],a},parseRows:e,format:function(e,n){return null==n&&(n=function(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var r in t)r in e||n.push(e[r]=r)}),n}(e)),[n.map(r).join(t)].concat(e.map(function(e){return n.map(function(t){return r(e[t])}).join(t)})).join("\n")},formatRows:function(t){return t.map(n).join("\n")}}},np=(ep(","),ep("\t"),/^([A-Za-z]+:)?\/\//),rp="file://",ip=["mimeType","responseType","user","password"],ap=function(t){return{options:t||{},sanitize:W,load:B,file:H,http:Y}},op={boolean:Nd,integer:dd,number:dd,date:Td,string:Rd,unknown:rd},up=[function(t){return"true"===t||"false"===t||!0===t||!1===t},function(t){return Z(t)&&(t=+t)==~~t},Z,function(t){return!isNaN(Date.parse(t))}],sp=["boolean","integer","number","date"],fp=function(t,e){var n=e&&e.property?td(e.property):rd;return Qh(t)&&!function(t){return!("function"!=typeof Buffer||!gd(Buffer.isBuffer))&&Buffer.isBuffer(t)}(t)?function(t,e){return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t)):n(JSON.parse(t))},cp=function(t){return t},lp=function(t){if(null==t)return cp;var e,n,r=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,u){u||(e=n=0);var s=2,f=t.length,c=new Array(f);for(c[0]=(e+=t[0])*r+a,c[1]=(n+=t[1])*i+o;s<f;)c[s]=t[s],++s;return c}},hp=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},dp=function(t,e){function n(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){r[t<0?~t:t]=1}),o.push(i)}}var r={},i={},a={},o=[],u=-1;return e.forEach(function(n,r){var i,a=t.arcs[n<0?~n:n];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++u],e[u]=n,e[r]=i)}),e.forEach(function(e){var n,r,o=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1],e<0?[n,i]:[i,n]}(e),u=o[0],s=o[1];if(n=a[u])if(delete a[n.end],n.push(e),n.end=s,r=i[s]){delete i[r.start];var f=r===n?n:n.concat(r);i[f.start=n.start]=a[f.end=r.end]=f}else i[n.start]=a[n.end]=n;else if(n=i[s])if(delete i[n.start],n.unshift(e),n.start=u,r=a[u]){delete a[r.end];var c=r===n?n:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[n.start]=a[n.end]=n;else i[(n=[e]).start=u]=a[n.end=s]=n}),n(a,i),n(i,a),e.forEach(function(t){r[t<0?~t:t]||o.push([t])}),o},pp=function(t){return et(t,function(t,e,n){var r,i,a;if(arguments.length>1)r=function(t,n,r){function i(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function u(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"LineString":a(t.arcs);break;case"MultiLineString":case"Polygon":o(t.arcs);break;case"MultiPolygon":t.arcs.forEach(o)}}var s,f=[],c=[];return u(e),c.forEach(null==r?function(t){f.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&f.push(t[0].i)}),f}(0,0,n);else for(i=0,r=new Array(a=t.arcs.length);i<a;++i)r[i]=i;return{type:"MultiLineString",arcs:dp(t,r)}}.apply(this,arguments))},gp={dsv:K,csv:Q(","),tsv:Q("\t"),json:fp,topojson:function(t,e){var n,r;return t=fp(t,e),e&&(r=e.feature)?(n=t.objects[r])?function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return tt(t,e)})}:tt(t,e)}(t,n).features:Xh("Invalid TopoJSON object: "+r):e&&(r=e.mesh)?(n=t.objects[r])?[pp(t,n)]:Xh("Invalid TopoJSON object: "+r):void Xh("Missing TopoJSON feature or mesh parameter.")}},vp=function(t,e){return arguments.length>1?(gp[t]=e,this):gp.hasOwnProperty(t)?gp[t]:null},mp=new Date,yp=new Date,bp=nt(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});bp.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?nt(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):bp:null};var _p=6e4,xp=6048e5,wp=nt(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3},function(t){return t.getUTCSeconds()}),Mp=nt(function(t){t.setTime(Math.floor(t/_p)*_p)},function(t,e){t.setTime(+t+e*_p)},function(t,e){return(e-t)/_p},function(t){return t.getMinutes()}),kp=nt(function(t){var e=t.getTimezoneOffset()*_p%36e5;e<0&&(e+=36e5),t.setTime(36e5*Math.floor((+t-e)/36e5)+e)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getHours()}),Ep=nt(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*_p)/864e5},function(t){return t.getDate()-1}),Sp=rt(0),Ap=rt(1),Cp=(rt(2),rt(3),rt(4)),Dp=(rt(5),rt(6),nt(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()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})),zp=nt(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()});zp.every=function(t){return isFinite(t=Math.floor(t))&&t>0?nt(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)}):null};var Op=nt(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*_p)},function(t,e){return(e-t)/_p},function(t){return t.getUTCMinutes()}),Np=nt(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getUTCHours()}),Tp=nt(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5},function(t){return t.getUTCDate()-1}),Rp=it(0),Pp=it(1),Lp=(it(2),it(3),it(4)),qp=(it(5),it(6),nt(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()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})),Up=nt(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()});Up.every=function(t){return isFinite(t=Math.floor(t))&&t>0?nt(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)}):null};var Fp,jp,Ip,$p,Bp,Wp={"-":"",_:" ",0:"0"},Yp=/^\s*\d+/,Hp=/^%/,Gp=/[\\^$*+?|[\]().{}]/g;pe({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"]});var Vp="%Y-%m-%dT%H:%M:%S.%LZ",Xp=(Date.prototype.toISOString||$p(Vp),+new Date("2000-01-01T00:00:00.000Z")||Bp(Vp),function(t,e,n){var r=vp((e=e||{}).type||"json");return r||Xh("Unknown data format type: "+e.type),t=r(t,e),e.parse&&function(t,e,n){if(t.length){n=n||Ip;var r,i,a,o,u,s,f,c=t.columns||Object.keys(t[0]);for("auto"===e&&(e=J(t,c)),r=(c=Object.keys(e)).map(function(t){var r,i,a=e[t];if(a&&(0===a.indexOf("date:")||0===a.indexOf("utc:")))return r=a.split(/:(.+)?/,2),("'"===(i=r[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===r[0]?Bp(i):n(i);if(!op[a])throw Error("Illegal format pattern: "+t+":"+a);return op[a]}),o=0,s=t.length,f=c.length;o<s;++o)for(i=t[o],u=0;u<f;++u)i[a=c[u]]=r[u](i[a])}}(t,e.parse,n),t.hasOwnProperty("columns")&&delete t.columns,t}),Jp={skip:!0},Zp={},Qp=ge.prototype;Qp.StopPropagation=Zp,Qp.ADD=1,Qp.REM=2,Qp.MOD=4,Qp.ADD_REM=3,Qp.ADD_MOD=5,Qp.ALL=7,Qp.REFLOW=8,Qp.SOURCE=16,Qp.NO_SOURCE=32,Qp.NO_FIELDS=64,Qp.fork=function(t){return new ge(this.dataflow).init(this,t)},Qp.addAll=function(){var t=this;return this.source&&this.source.length!==this.add.length?(t=new ge(this.dataflow).init(this),t.add=t.source,t):t},Qp.init=function(t,e){return this.stamp=t.stamp,this.encode=t.encode,!t.fields||64&e||(this.fields=t.fields),1&e?(this.addF=t.addF,this.add=t.add):(this.addF=null,this.add=[]),2&e?(this.remF=t.remF,this.rem=t.rem):(this.remF=null,this.rem=[]),4&e?(this.modF=t.modF,this.mod=t.mod):(this.modF=null,this.mod=[]),32&e?(this.srcF=null,this.source=null):(this.srcF=t.srcF,this.source=t.source),this},Qp.runAfter=function(t){this.dataflow.runAfter(t)},Qp.changed=function(t){var e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},Qp.reflow=function(t){if(t)return this.fork(7).reflow();var e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,ye(this,1))),this},Qp.modifies=function(t){var e=pd(t),n=this.fields||(this.fields={});return e.forEach(function(t){n[t]=!0}),this},Qp.modified=function(t){var e=this.fields;return!(!this.mod.length||!e)&&(arguments.length?Zh(t)?t.some(function(t){return e[t]}):e[t]:!!e)},Qp.filter=function(t,e){return 1&t&&(this.addF=ve(this.addF,e)),2&t&&(this.remF=ve(this.remF,e)),4&t&&(this.modF=ve(this.modF,e)),16&t&&(this.srcF=ve(this.srcF,e)),this},Qp.materialize=function(t){return 1&(t=t||7)&&this.addF&&(this.add=me(this.add,this.addF),this.addF=null),2&t&&this.remF&&(this.rem=me(this.rem,this.remF),this.remF=null),4&t&&this.modF&&(this.mod=me(this.mod,this.modF),this.modF=null),16&t&&this.srcF&&(this.source=this.source.filter(this.srcF),this.srcF=null),this},Qp.visit=function(t,e){var n,r,i=e;return 16&t?(qd(this.source,this.srcF,i),this):(1&t&&qd(this.add,this.addF,i),2&t&&qd(this.rem,this.remF,i),4&t&&qd(this.mod,this.modF,i),8&t&&(n=this.source)&&((r=this.add.length+this.mod.length)===n.length||(r?qd(n,ye(this,5),i):qd(n,this.srcF,i))),this)};var Kp=Md(be,ge);Kp.fork=function(t){var e=new ge(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,function(t){return e.add.push(t)}),t&e.REM&&this.visit(e.REM,function(t){return e.rem.push(t)}),t&e.MOD&&this.visit(e.MOD,function(t){return e.mod.push(t)})),e},Kp.changed=function(t){return this.changes&t},Kp.modified=function(t){var e=this.fields;return e&&this.changes&this.MOD?Zh(t)?t.some(function(t){return e[t]}):e[t]:0},Kp.filter=function(){Xh("MultiPulse does not support filtering.")},Kp.materialize=function(){Xh("MultiPulse does not support materialization.")},Kp.visit=function(t,e){var n=this.pulses,r=n.length,i=0;if(t&this.SOURCE)for(;i<r;++i)n[i].visit(t,e);else for(;i<r;++i)n[i].stamp===this.stamp&&n[i].visit(t,e);return this};var tg={skip:!1,force:!1},eg=_e.prototype;eg.size=function(){return this.nodes.length},eg.clear=function(){return this.nodes=[],this},eg.peek=function(){return this.nodes[0]},eg.push=function(t){var e=this.nodes;return e.push(t),xe(e,0,e.length-1,this.cmp)},eg.pop=function(){var t,e=this.nodes,n=e.pop();return e.length?(t=e[0],e[0]=n,we(e,0,this.cmp)):t=n,t},eg.replace=function(t){var e=this.nodes,n=e[0];return e[0]=t,we(e,0,this.cmp),n},eg.pushpop=function(t){var e=this.nodes,n=e[0];return e.length&&this.cmp(n,t)<0&&(e[0]=t,t=n,we(e,0,this.cmp)),t};var ng=Me.prototype;ng.stamp=function(){return this._clock},ng.loader=function(t){return arguments.length?(this._loader=t,this):this._loader},ng.cleanThreshold=1e4,ng.add=function(t,e,n,r){var i,a=1;return t instanceof A?i=t:t&&t.prototype instanceof A?i=new t:gd(t)?i=new A(null,t):(a=0,i=new A(t,e)),this.rank(i),a&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},ng.connect=function(t,e){var n,r,i=t.rank;for(n=0,r=e.length;n<r;++n)if(i<e[n].rank)return void this.rerank(t)},ng.rank=function(t){t.rank=++this._rank},ng.rerank=function(t){for(var e,n,r,i=[t];i.length;)if(this.rank(e=i.pop()),n=e._targets)for(r=n.length;--r>=0;)i.push(e=n[r]),e===t&&Xh("Cycle detected in dataflow graph.")},ng.pulse=function(t,e,n){this.touch(t,n||tg);var r=new ge(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._pulses[t.id]=e.pulse(r,i),this},ng.touch=function(t,e){var n=e||tg;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},ng.update=function(t,e,n){var r=n||tg;return(t.set(e)||r.force)&&this.touch(t,r),this},ng.changeset=E,ng.ingest=function(t,e,n){return this.pulse(t,this.changeset().insert(Xp(e,n)))},ng.request=function(t,e,n){var r=this,i=r._pending||function(t){var e,n,r=new Promise(function(t,r){e=t,n=r});return r.requests=0,r.done=function(){0==--r.requests&&t.runAfter(function(){t._pending=null;try{t.run(),e(t)}catch(t){n(t)}})},t._pending=r}(r);i.requests+=1,r.loader().load(e,{context:"dataflow"}).then(function(e){r.ingest(t,e,n)},function(t){r.error("Loading failed",e,t)}).catch(function(t){r.error("Data ingestion failed",e,t)}).then(i.done,i.done)},ng.events=function(t,e,n,r){for(var i,a=this,o=z(n,r),u=function(t){t.dataflow=a;try{o.receive(t)}catch(t){a.error(t)}finally{a.run()}},s=0,f=(i="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):pd(t)).length;s<f;++s)i[s].addEventListener(e,u);return o},ng.on=function(t,e,n,r,i){return(t instanceof A?function(t,e,n,r,i,a){var o,u;void 0===r?u=n:(o=gd(r)?r:md(r),(u=new A(null,r=n?function(t,e){var r=o(t,e);return n.skip()?r:n.skip(!0).value=r}:o,i,!1)).modified(a&&a.force),u.rank=0,n&&(u.skip(!0),u.value=n.value,u.targets().add(n))),e.targets().add(u)}:function(t,e,n,r,i,a){var o,u,s=bd({},a,Jp);gd(n)||(n=md(n)),void 0===r?o=function(e){t.touch(n(e))}:gd(r)?(u=new A(null,r,i,!1),o=function(e){var r,i=n(e);u.evaluate(e),k(r=u.value)?t.pulse(i,r,a):t.update(i,r,s)}):o=function(e){t.update(n(e),r,s)},e.apply(o)})(this,t,e,n,r,i),this},ng.run=function(t){var e,n,r,i,a=this,o=0,u=a.logLevel();if(a._pending)return a.info("Awaiting requests, delaying dataflow run."),0;if(a._pulse)return a.error("Dataflow invoked recursively. Use the runAfter method to queue invocation."),0;if(!a._touched.length)return a.info("Dataflow invoked, but nothing to do."),0;a._pulse=new ge(a,++a._clock,t),u>=fd&&(r=Date.now(),a.debug("-- START PROPAGATION ("+a._clock+") -----")),a._touched.forEach(function(t){a._enqueue(t,!0)}),a._touched=v(nd);try{for(;a._heap.size()>0;)(e=a._heap.pop()).rank===e.qrank?(n=e.run(a._getPulse(e,t)),u>=cd&&a.debug(e.id,n===Zp?"STOP":n,e),n!==Zp&&(a._pulse=n,e._targets&&e._targets.forEach(function(t){a._enqueue(t)})),++o):a._enqueue(e,!0)}catch(t){i=t}if(a._pulses={},a._pulse=null,u>=fd&&(r=Date.now()-r,a.info("> Pulse "+a._clock+": "+o+" operators; "+r+"ms")),i&&(a._postrun=[],a.error(i)),a._onrun)try{a._onrun(a,o,i)}catch(t){a.error(t)}if(a._postrun.length){var s=a._postrun;a._postrun=[],s.forEach(function(t){try{t(a)}catch(t){a.error(t)}})}return o},ng.runAsync=function(){return this._pending||Promise.resolve(this.run())},ng.runAfter=function(t,e){if(this._pulse||e)this._postrun.push(t);else try{t(this)}catch(t){this.error(t)}},ng._enqueue=function(t,e){var n=!this._pulses[t.id];n&&(this._pulses[t.id]=this._pulse),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},ng._getPulse=function(t,e){var n,r=t.source,i=this._clock;return r&&Zh(r)?(n=r.map(function(t){return t.pulse}),new be(this,i,n,e)):(r=r&&r.pulse,n=this._pulses[t.id],r&&r!==Zp&&(r.stamp===i&&n.target!==t?n=r:n.source=r.source),n)},ng.error=ke("error"),ng.warn=ke("warn"),ng.info=ke("info"),ng.debug=ke("debug"),ng.logLevel=ke("level");var rg=Md(Ee,A);rg.run=function(t){if(t.stamp<=this.stamp)return t.StopPropagation;var e;return this.skip()?this.skip(!1):e=this.evaluate(t),(e=e||t)!==t.StopPropagation&&(this.pulse=e),this.stamp=t.stamp,e},rg.evaluate=function(t){var e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},rg.transform=function(){};var ig={},ag={values:Oe({name:"values",init:"cell.store = true;",set:"cell.data.values()",idx:-1}),count:Oe({name:"count",set:"cell.num"}),missing:Oe({name:"missing",set:"this.missing"}),valid:Oe({name:"valid",set:"this.valid"}),sum:Oe({name:"sum",init:"this.sum = 0;",add:"this.sum += v;",rem:"this.sum -= v;",set:"this.sum"}),mean:Oe({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.mean"}),average:Oe({name:"average",set:"this.mean",req:["mean"],idx:1}),variance:Oe({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : 0",req:["mean"],idx:1}),variancep:Oe({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : 0",req:["variance"],idx:2}),stdev:Oe({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : 0",req:["variance"],idx:2}),stdevp:Oe({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : 0",req:["variance"],idx:2}),stderr:Oe({name:"stderr",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid * (this.valid-1))) : 0",req:["variance"],idx:2}),distinct:Oe({name:"distinct",set:"cell.data.distinct(this.get)",req:["values"],idx:3}),ci0:Oe({name:"ci0",set:"cell.data.ci0(this.get)",req:["values"],idx:3}),ci1:Oe({name:"ci1",set:"cell.data.ci1(this.get)",req:["values"],idx:3}),median:Oe({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:Oe({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:Oe({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),argmin:Oe({name:"argmin",init:"this.argmin = null;",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = null;",set:"this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:Oe({name:"argmax",init:"this.argmax = null;",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = null;",set:"this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:Oe({name:"min",init:"this.min = null;",add:"if (v < this.min || this.min === null) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:Oe({name:"max",init:"this.max = null;",add:"if (v > this.max || this.max === null) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4})},og=Object.keys(ag),ug=function(t){var e,n,r,i,a,o,u,s,f=t.maxbins||20,c=t.base||10,l=Math.log(c),h=t.divide||[5,2],d=t.extent[0],p=t.extent[1],g=p-d;if(t.step)e=t.step;else if(t.steps){for(a=g/f,o=0,u=t.steps.length;o<u&&t.steps[o]<a;++o);e=t.steps[Math.max(0,o-1)]}else{for(n=Math.ceil(Math.log(f)/l),r=t.minstep||0,e=Math.max(r,Math.pow(c,Math.round(Math.log(g)/l)-n));Math.ceil(g/e)>f;)e*=c;for(o=0,u=h.length;o<u;++o)(a=e/h[o])>=r&&g/a<=f&&(e=a)}return a=Math.log(e),i=a>=0?0:1+~~(-a/l),s=Math.pow(c,-i-1),(t.nice||void 0===t.nice)&&(d=d<(a=Math.floor(d/e+s)*e)?a-e:a,p=Math.ceil(p/e)*e),{start:d,stop:p,step:e}},sg=function(t,e){var n,r=[],i=t.length,a=-1;if(null==e)for(;++a<i;)isNaN(n=Re(t[a]))||r.push(n);else for(;++a<i;)isNaN(n=Re(e(t[a],a,t)))||r.push(n);return r};t.random=Math.random;var fg=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},cg=function(t){return 1===t.length&&(t=function(t){return function(e,n){return fg(t(e),n)}}(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}},lg=cg(fg),hg=lg.right,dg=lg.left,pg=function(t){return null===t?NaN:+t},gg=function(t,e){var n,r,i=t.length,a=0,o=-1,u=0,s=0;if(null==e)for(;++o<i;)isNaN(n=pg(t[o]))||(s+=(r=n-u)*(n-(u+=r/++a)));else for(;++o<i;)isNaN(n=pg(e(t[o],o,t)))||(s+=(r=n-u)*(n-(u+=r/++a)));if(a>1)return s/(a-1)},vg=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(n=t[o])&&n>=n)for(r=i=n;++o<a;)null!=(n=t[o])&&(r>n&&(r=n),i<n&&(i=n))}else for(;++o<a;)if(null!=(n=e(t[o],o,t))&&n>=n)for(r=i=n;++o<a;)null!=(n=e(t[o],o,t))&&(r>n&&(r=n),i<n&&(i=n));return[r,i]},mg=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a},yg=Math.sqrt(50),bg=Math.sqrt(10),_g=Math.sqrt(2),xg=function(t,e,n){var r,i,a,o,u=-1;if(e=+e,t=+t,n=+n,t===e&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(o=Pe(t,e,n))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++u<i;)a[u]=(t+u)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++u<i;)a[u]=(t-u)/o;return r&&a.reverse(),a},wg=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},Mg=function(t,e,n){if(null==n&&(n=pg),r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(i-a)}},kg=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(n=t[a])&&n>=n)for(r=n;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else for(;++a<i;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=n;++a<i;)null!=(n=e(t[a],a,t))&&n>r&&(r=n);return r},Eg=function(t){for(var e,n,r,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(n=new Array(o);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n},Sg=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},Ag=function(e,n,r,i){var a,o,u,s,f=sg(e,i),c=f.length,l=n;for(u=0,s=Array(l);u<l;++u){for(a=0,o=0;o<c;++o)a+=f[~~(t.random()*c)];s[u]=a/c}return[Mg(s.sort(fg),r/2),Mg(s,1-r/2)]},Cg=function(t,e){var n=sg(t,e);return[Mg(n.sort(fg),.25),Mg(n,.5),Mg(n,.75)]},Dg=function(e,n){var r,i,a=NaN,o={};return o.mean=function(t){return arguments.length?(r=t||0,a=NaN,o):r},o.stdev=function(t){return arguments.length?(i=null==t?1:t,a=NaN,o):i},o.sample=function(){var e,n,o=0,u=0;if(a==a)return o=a,a=NaN,o;do{e=(o=2*t.random()-1)*o+(u=2*t.random()-1)*u}while(0===e||e>1);return n=Math.sqrt(-2*Math.log(e)/e),a=r+u*n*i,r+o*n*i},o.pdf=function(t){var e=Math.exp(Math.pow(t-r,2)/(-2*Math.pow(i,2)));return 1/(i*Math.sqrt(2*Math.PI))*e},o.cdf=function(t){var e,n=(t-r)/i,a=Math.abs(n);if(a>37)e=0;else{var o=Math.exp(-a*a/2);a<7.07106781186547?(e=o*((((((.0352624965998911*a+.700383064443688)*a+6.37396220353165)*a+33.912866078383)*a+112.079291497871)*a+221.213596169931)*a+220.206867912376),e/=((((((.0883883476483184*a+1.75566716318264)*a+16.064177579207)*a+86.7807322029461)*a+296.564248779674)*a+637.333633378831)*a+793.826512519948)*a+440.413735824752):e=o/(a+1/(a+2/(a+3/(a+4/(a+.65)))))/2.506628274631}return n>0?1-e:e},o.icdf=function(t){if(t<=0||t>=1)return NaN;var e=2*t-1,n=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),a=2/(Math.PI*n)+Math.log(1-Math.pow(e,2))/2,o=Math.log(1-e*e)/n,u=(e>0?1:-1)*Math.sqrt(Math.sqrt(a*a-o)-a);return r+i*Math.SQRT2*u},o.mean(e).stdev(n)},zg=function(e,n){var r=Dg(),i={},a=0;return i.data=function(t){return arguments.length?(e=t,a=t?t.length:0,i.bandwidth(n)):e},i.bandwidth=function(t){return arguments.length?(!(n=t)&&e&&(n=function(t){var e=t.length,n=Cg(t),r=(n[2]-n[0])/1.34;return 1.06*Math.min(Math.sqrt(gg(t)),r)*Math.pow(e,-.2)}(e)),i):n},i.sample=function(){return e[~~(t.random()*a)]+n*r.sample()},i.pdf=function(t){for(var i=0,o=0;o<a;++o)i+=r.pdf((t-e[o])/n);return i/n/a},i.cdf=function(t){for(var i=0,o=0;o<a;++o)i+=r.cdf((t-e[o])/n);return i/a},i.icdf=function(){throw Error("KDE icdf not supported.")},i.data(e)},Og=function(e,n){var r,i={},a=0;return i.weights=function(t){return arguments.length?(r=function(t){var e,n=[],r=0;for(e=0;e<a;++e)r+=n[e]=null==t[e]?1:+t[e];for(e=0;e<a;++e)n[e]/=r;return n}(n=t||[]),i):n},i.distributions=function(t){return arguments.length?(t?(a=t.length,e=t):(a=0,e=[]),i.weights(n)):e},i.sample=function(){for(var n=t.random(),i=e[a-1],o=r[0],u=0;u<a-1;o+=r[++u])if(n<o){i=e[u];break}return i.sample()},i.pdf=function(t){for(var n=0,i=0;i<a;++i)n+=r[i]*e[i].pdf(t);return n},i.cdf=function(t){for(var n=0,i=0;i<a;++i)n+=r[i]*e[i].cdf(t);return n},i.icdf=function(){throw Error("Mixture icdf not supported.")},i.distributions(e).weights(n)},Ng=function(e,n){null==n&&(n=null==e?1:e,e=0);var r,i,a,o={};return o.min=function(t){return arguments.length?(r=t||0,a=i-r,o):r},o.max=function(t){return arguments.length?(i=t||0,a=i-r,o):i},o.sample=function(){return r+a*t.random()},o.pdf=function(t){return t>=r&&t<=i?1/a:0},o.cdf=function(t){return t<r?0:t>i?1:(t-r)/a},o.icdf=function(t){return t>=0&&t<=1?r+t*a:NaN},o.min(e).max(n)},Tg=qe.prototype;Tg.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},Tg.add=function(t){this._add.push(t)},Tg.rem=function(t){this._rem.push(t)},Tg.values=function(){if(this._get=null,0===this._rem.length)return this._add;var t,e,n,r=this._add,i=this._rem,a=this._key,o=r.length,u=i.length,s=Array(o-u),f={};for(t=0;t<u;++t)f[a(i[t])]=1;for(t=0,e=0;t<o;++t)f[a(n=r[t])]?f[a(n)]=0:s[e++]=n;return this._rem=[],this._add=s},Tg.distinct=function(t){for(var e,n=this.values(),r=n.length,i={},a=0;--r>=0;)e=t(n[r])+"",i.hasOwnProperty(e)||(i[e]=1,++a);return a},Tg.extent=function(t){if(this._get!==t||!this._ext){var e=this.values(),n=_d(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},Tg.argmin=function(t){return this.extent(t)[0]||{}},Tg.argmax=function(t){return this.extent(t)[1]||{}},Tg.min=function(t){var e=this.extent(t)[0];return null!=e?t(e):1/0},Tg.max=function(t){var e=this.extent(t)[1];return null!=e?t(e):-1/0},Tg.quartile=function(t){return this._get===t&&this._q||(this._q=Cg(this.values(),t),this._get=t),this._q},Tg.q1=function(t){return this.quartile(t)[0]},Tg.q2=function(t){return this.quartile(t)[1]},Tg.q3=function(t){return this.quartile(t)[2]},Tg.ci=function(t){return this._get===t&&this._ci||(this._ci=Ag(this.values(),1e3,.05,t),this._get=t),this._ci},Tg.ci0=function(t){return this.ci(t)[0]},Tg.ci1=function(t){return this.ci(t)[1]},Ue.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:og},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};var Rg=Md(Ue,Ee);Rg.transform=function(t,e){var n,r=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS);return this.stamp=i.stamp,this.value&&((n=t.modified())||e.modified(this._inputs))?(this._prev=this.value,this.value=n?this.init(t):{},e.visit(e.SOURCE,function(t){r.add(t)})):(this.value=this.value||this.init(t),e.visit(e.REM,function(t){r.rem(t)}),e.visit(e.ADD,function(t){r.add(t)})),i.modifies(this._outputs),r._drop=!1!==t.drop,t.cross&&r._dims.length>1&&(r._drop=!1,this.cross()),r.changes(i)},Rg.cross=function(){function t(t){var e,n,r,u;for(e in t)for(r=t[e].tuple,n=0;n<o;++n)a[n][u=r[i[n]]]=u}function e(t,u,s){var f,c,l=i[s],h=a[s++];for(f in h)u[l]=h[f],c=t?t+"|"+f:f,s<o?e(c,u,s):r[c]||n.cell(c,u)}var n=this,r=n.value,i=n._dnames,a=i.map(function(){return{}}),o=i.length;t(n._prev),t(r),e("",{},0)},Rg.init=function(t){function r(t){for(var e,r=pd(n(t)),a=0,u=r.length;a<u;++a)o[e=r[a]]||(o[e]=1,i.push(e))}var i=this._inputs=[],a=this._outputs=[],o={};this._dims=pd(t.groupby),this._dnames=this._dims.map(function(t){var n=e(t);return r(t),a.push(n),n}),this.cellkey=t.key?t.key:Ce(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];var u,s,f,c,l,h,d=t.fields||[null],p=t.ops||["count"],g=t.as||[],v=d.length,m={};for(v!==p.length&&Xh("Unmatched number of fields and aggregate ops."),h=0;h<v;++h)s=p[h],null==(u=d[h])&&"count"!==s&&Xh("Null aggregate field specified."),l=De(s,c=e(u),g[h]),a.push(l),"count"!==s?((f=m[c])||(r(u),(f=m[c]=[]).field=u,this._measures.push(f)),"count"!==s&&(this._countOnly=!1),f.push(ze(s,l))):this._counts.push(l);return this._measures=this._measures.map(function(t){return Te(t,t.field)}),{}},Rg.cellkey=Ce(),Rg.cell=function(t,e){var n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},Rg.newcell=function(t,e){var n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){var r,i=this._measures,a=i.length;for(n.agg=Array(a),r=0;r<a;++r)n.agg[r]=new i[r](n)}return n.store&&(n.data=new qe),n},Rg.newtuple=function(t,e){var n,r,i=this._dnames,a=this._dims,o={};for(n=0,r=a.length;n<r;++n)o[i[n]]=a[n](t);return e?M(e.tuple,o):_(o)},Rg.add=function(t){var e,n,r,i=this.cellkey(t),a=this.cell(i,t);if(a.num+=1,!this._countOnly)for(a.store&&a.data.add(t),n=0,r=(e=a.agg).length;n<r;++n)e[n].add(e[n].get(t),t)},Rg.rem=function(t){var e,n,r,i=this.cellkey(t),a=this.cell(i,t);if(a.num-=1,!this._countOnly)for(a.store&&a.data.rem(t),n=0,r=(e=a.agg).length;n<r;++n)e[n].rem(e[n].get(t),t)},Rg.celltuple=function(t){var e,n,r,i=t.tuple,a=this._counts;for(t.store&&t.data.values(),n=0,r=a.length;n<r;++n)i[a[n]]=t.num;if(!this._countOnly)for(n=0,r=(e=t.agg).length;n<r;++n)e[n].set(i);return i},Rg.changes=function(t){var e,n,r,i,a=this._adds,o=this._mods,u=this._prev,s=this._drop,f=t.add,c=t.rem,l=t.mod;if(u)for(n in u)e=u[n],s&&!e.num||c.push(e.tuple);for(r=0,i=this._alen;r<i;++r)f.push(this.celltuple(a[r])),a[r]=null;for(r=0,i=this._mlen;r<i;++r)(0===(e=o[r]).num&&s?c:l).push(this.celltuple(e)),o[r]=null;return this._alen=this._mlen=0,this._prev=null,t},Fe.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};var Pg=Md(Fe,Ee);Pg.transform=function(t,e){var r,i=this._bins(t),a=i.start,o=i.step,u=t.as||["bin0","bin1"],s=u[0],f=u[1];return r=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(n(t.field))?e.ADD_MOD:e.ADD,e.visit(r,function(t){var e=i(t);t[s]=e,t[f]=null==e?null:a+o*(1+(e-a)/o)}),e.modifies(u)},Pg._bins=function(t){if(this.value&&!t.modified())return this.value;var r,i,a=t.field,o=ug(t),u=o.start,s=o.stop,f=o.step;null!=(r=t.anchor)&&(i=r-(u+f*Math.floor((r-u)/f)),u+=i,s+=i);var c=function(t){var e=a(t);return null==e?null:(e=Math.max(u,Math.min(+e,s-f)),u+f*Math.floor((e-u)/f))};return c.start=u,c.stop=s,c.step=f,this.value=Vh(c,n(a),t.name||"bin_"+e(a))};var Lg=function(t,e,n){var r=t,i=e||[],a=n||[],o={},u=0;return{add:function(t){a.push(t)},remove:function(t){o[r(t)]=++u},size:function(){return i.length},data:function(t,e){return u&&(i=i.filter(function(t){return!o[r(t)]}),o={},u=0),e&&t&&i.sort(t),a.length&&(i=t?Dd(t,i,a.sort(t)):i.concat(a),a=[]),i}}};je.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};Md(je,Ee).transform=function(t,e){var n=e.fork(e.ALL),r=Lg(y,this.value,n.materialize(n.ADD).add),i=t.sort,a=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(a),this.value=n.source=r.data(i,a),n},Md(Ie,A),Be.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};var qg=Md(Be,Ee);qg.transform=function(t,e){function n(e){return function(n){for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(u(n),t.case,a)||[],s=0,f=i.length;s<f;++s)o.test(r=i[s])||e(r)}}var r=this._parameterCheck(t,e),i=this._counts,a=this._match,o=this._stop,u=t.field,s=t.as||["text","count"],f=n(function(t){i[t]=1+(i[t]||0)}),c=n(function(t){i[t]-=1});return r?e.visit(e.SOURCE,f):(e.visit(e.ADD,f),e.visit(e.REM,c)),this._finish(e,s)},qg._parameterCheck=function(t,e){var n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},qg._finish=function(t,e){var n,r,i,a=this._counts,o=this._tuples||(this._tuples={}),u=e[0],s=e[1],f=t.fork();for(n in a)r=o[n],i=a[n]||0,!r&&i?(o[n]=r=_({}),r[u]=n,r[s]=i,f.add.push(r)):0===i?(r&&f.rem.push(r),a[n]=null,o[n]=null):r[s]!==i&&(r[s]=i,f.mod.push(r));return f.modifies(e)},We.Definition={type:"Cross",metadata:{source:!0,generates:!0,changes:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};Md(We,Ee).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=this.value,i=t.as||["a","b"],a=i[0],o=i[1];return!r||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter")?(r&&(n.rem=r),n.add=this.value=function(t,e,n,r){for(var i,a,o=[],u={},s=t.length,f=0;f<s;++f)for(u[e]=a=t[f],i=0;i<s;++i)u[n]=t[i],r(u)&&(o.push(_(u)),(u={})[e]=a);return o}(e.source,a,o,t.filter||od)):n.mod=r,n.source=this.value,n.modifies(i)};var Ug={kde:zg,mixture:Og,normal:Dg,uniform:Ng},Fg="distributions",jg="function",Ig="field",$g=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Bg={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:$g},{name:"weights",type:"number",array:!0}]};He.Definition={type:"Density",metadata:{generates:!0,source:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number",default:100},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:$g.concat(Bg)},{name:"as",type:"string",array:!0,default:["value","density"]}]};Md(He,Ee).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=Ye(t.distribution,function(t){return function(){return t.materialize(t.SOURCE).source}}(e)),i=t.method||"pdf";"pdf"!==i&&"cdf"!==i&&Xh("Invalid density method: "+i),t.extent||r.data||Xh("Missing density extent parameter."),i=r[i];var a=t.as||["value","density"],o=t.extent||vg(r.data()),u=(o[1]-o[0])/(t.steps||100),s=mg(o[0],o[1]+u/2,u).map(function(t){var e={};return e[a[0]]=t,e[a[1]]=i(t),_(e)});this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n},Ge.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};Md(Ge,Ee).transform=function(t,e){var n=this.value,r=t.field,i=n[0],a=n[1],o=e.ADD;(e.changed()||e.modified(r.fields)||t.modified("field"))&&(o=e.SOURCE,i=1/0,a=-1/0),e.visit(o,function(t){var e=r(t);null!=e&&(e<i&&(i=e),e>a&&(a=e))}),this.value=[i,a]};var Wg=Md(Ve,A);Wg.connect=function(t){return this.targets().add(t),t.source=this},Wg.add=function(t){this.value.add.push(t)},Wg.rem=function(t){this.value.rem.push(t)},Wg.mod=function(t){this.value.mod.push(t)},Wg.init=function(t){this.value.init(t,t.NO_SOURCE)},Wg.evaluate=function(){return this.value};var Yg=Md(Xe,Ee);Yg.activate=function(t){this._targets[this._targets.active++]=t},Yg.subflow=function(t,e,n,r){var i,a,o=this.value,u=o.hasOwnProperty(t)&&o[t];return u?u.value.stamp<n.stamp&&(u.init(n),this.activate(u)):(a=r||(a=this._group[t])&&a.tuple,u=(i=n.dataflow).add(new Ve(n.fork(n.NO_SOURCE),this)).connect(e(i,t,a)),o[t]=u,this.activate(u)),u},Yg.transform=function(t,e){function n(t){return i.subflow(t,o,e)}var r=e.dataflow,i=this,a=t.key,o=t.subflow,u=this._keys,s=t.modified("key");return this._group=t.group||{},this._targets.active=0,e.visit(e.REM,function(t){var e=y(t),r=u.get(e);void 0!==r&&(u.delete(e),n(r).rem(t))}),e.visit(e.ADD,function(t){var e=a(t);u.set(y(t),e),n(e).add(t)}),s||e.modified(a.fields)?e.visit(e.MOD,function(t){var e=y(t),r=u.get(e),i=a(t);r===i?n(i).mod(t):(u.set(e,i),n(r).rem(t),n(i).add(t))}):e.changed(e.MOD)&&e.visit(e.MOD,function(t){n(u.get(y(t))).mod(t)}),s&&e.visit(e.REFLOW,function(t){var e=y(t),r=u.get(e),i=a(t);r!==i&&(u.set(e,i),n(r).rem(t),n(i).add(t))}),u.empty>r.cleanThreshold&&r.runAfter(u.clean),e},Md(Je,A),Qe.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};Md(Qe,Ee).transform=function(t,e){function n(e){var n=y(e),r=f(e,t),a=i.get(n);r&&a?(i.delete(n),o.push(e)):r||a?c&&r&&!a&&s.push(e):(i.set(n,1),u.push(e))}var r=e.dataflow,i=this.value,a=e.fork(),o=a.add,u=a.rem,s=a.mod,f=t.expr,c=!0;return e.visit(e.REM,function(t){var e=y(t);i.has(e)?i.delete(e):u.push(t)}),e.visit(e.ADD,function(e){f(e,t)?o.push(e):i.set(y(e),1)}),e.visit(e.MOD,n),t.modified()&&(c=!1,e.visit(e.REFLOW,n)),i.empty>r.cleanThreshold&&r.runAfter(i.clean),a},Ke.Definition={type:"Fold",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};Md(Ke,Ee).transform=function(t,e){function n(t){for(var e,n=i[y(t)]=Array(l),r=0;r<l;++r)(e=n[r]=x(t))[s]=c[r],e[f]=o[r](t),h.add.push(e)}var r,i=this.value,a=t.modified("fields"),o=t.fields,u=t.as||["key","value"],s=u[0],f=u[1],c=o.map(tn),l=o.length,h=(e.stamp,e.fork(e.NO_SOURCE)),d=0,p=0;if(a){for(r in i)h.rem.push.apply(h.rem,i[r]);i=this.value={},e.visit(e.SOURCE,n)}else{for(e.visit(e.ADD,n);d<l;++d)e.modified(o[d].fields)&&(p|=1<<d);p&&e.visit(e.MOD,function(t){for(var e,n=i[y(t)],r=0;r<l;++r)p&1<<r&&((e=w(t,n[r]))[s]=c[r],e[f]=o[r](t),h.mod.push(e))}),e.visit(e.REM,function(t){var e=y(t);h.rem.push.apply(h.rem,i[e]),i[e]=null})}return h.modifies(u)},en.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};Md(en,Ee).transform=function(t,e){var n=t.expr,r=t.as,i=t.modified(),a=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(a,function(e){e[r]=n(e,t)})};Md(nn,Ee).transform=function(t,e){var n,r,i,a=this.value,o=e.fork(e.ALL),u=t.size-a.length,s=t.generator;if(u>0){for(n=[];--u>=0;)n.push(i=_(s(t))),a.push(i);o.add=o.add.length?o.materialize(o.ADD).add.concat(n):n}else r=a.slice(0,-u),o.rem=o.rem.length?o.materialize(o.REM).rem.concat(r):r,a=a.slice(-u);return o.source=this.value=a,o};var Hg={value:"value",median:function(t,e){var n,r=t.length,i=-1,a=[];if(null==e)for(;++i<r;)isNaN(n=pg(t[i]))||a.push(n);else for(;++i<r;)isNaN(n=pg(e(t[i],i,t)))||a.push(n);return Mg(a.sort(fg),.5)},mean:function(t,e){var n,r=t.length,i=r,a=-1,o=0;if(null==e)for(;++a<r;)isNaN(n=pg(t[a]))?--i:o+=n;else for(;++a<r;)isNaN(n=pg(e(t[a],a,t)))?--i:o+=n;if(i)return o/i},min:function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(n=t[a])&&n>=n)for(r=n;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else for(;++a<i;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=n;++a<i;)null!=(n=e(t[a],a,t))&&r>n&&(r=n);return r},max:kg},Gg=[];rn.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};Md(rn,Ee).transform=function(t,n){var r,i,a,o,u,s,f,c,l,h,d=n.fork(n.ALL),p=function(t){var e,n=t.method||Hg.value;if(null!=Hg[n])return n===Hg.value?(e=void 0!==t.value?t.value:0,function(){return e}):Hg[n];Xh("Unrecognized imputation method: "+n)}(t),g=function(t){var e=t.field;return function(t){return t?e(t):NaN}}(t),v=e(t.field),m=e(t.key),y=(t.groupby||[]).map(e),b=function(t,e,n,r){var i,a,o,u,s,f,c,l,h=function(t){return t(l)},d=[],p=r?r.slice():[],g={},v={};for(p.forEach(function(t,e){g[t]=e+1}),u=0,c=t.length;u<c;++u)f=n(l=t[u]),s=g[f]||(g[f]=p.push(f)),(o=v[a=(i=e?e.map(h):Gg)+""])||(o=v[a]=[],d.push(o),o.values=i),o[s-1]=l;return d.domain=p,d}(n.source,t.groupby,t.key,t.keyvals),x=[],w=this.value,M=b.domain.length;for(u=0,c=b.length;u<c;++u)for(a=(r=b[u]).values,i=NaN,f=0;f<M;++f)if(null==r[f]){for(o=b.domain[f],h={_impute:!0},s=0,l=a.length;s<l;++s)h[y[s]]=a[s];h[m]=o,h[v]=isNaN(i)?i=p(r,g):i,x.push(_(h))}return x.length&&(d.add=d.materialize(d.ADD).add.concat(x)),w.length&&(d.rem=d.materialize(d.REM).rem.concat(w)),this.value=x,d},an.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:og},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};var Vg=Md(an,Ue);Vg.transform=function(t,e){var n,r=this,i=t.modified();return r.value&&(i||e.modified(r._inputs))?(n=r.value=i?r.init(t):{},e.visit(e.SOURCE,function(t){r.add(t)})):(n=r.value=r.value||this.init(t),e.visit(e.REM,function(t){r.rem(t)}),e.visit(e.ADD,function(t){r.add(t)})),r.changes(),e.visit(e.SOURCE,function(t){bd(t,n[r.cellkey(t)].tuple)}),e.reflow(i).modifies(this._outputs)},Vg.changes=function(){var t,e,n=this._adds,r=this._mods;for(t=0,e=this._alen;t<e;++t)this.celltuple(n[t]),n[t]=null;for(t=0,e=this._mlen;t<e;++t)this.celltuple(r[t]),r[t]=null;this._alen=this._mlen=0},Md(on,A),sn.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};Md(sn,Ee).transform=function(t,n){var r,i,a=n,o=t.as,u=t.fields,s=t.index,f=t.values,c=null==t.default?null:t.default,l=t.modified(),h=l?n.SOURCE:n.ADD,d=u.length;return f?(i=f.length,d>1&&!o&&Xh('Multi-field lookup requires explicit "as" parameter.'),o&&o.length!==d*i&&Xh('The "as" parameter has too few output field names.'),o=o||f.map(e),r=function(t){for(var e,n,r=0,a=0;r<d;++r)if(null==(n=s.get(u[r](t))))for(e=0;e<i;++e,++a)t[o[a]]=c;else for(e=0;e<i;++e,++a)t[o[a]]=f[e](n)}):(o||Xh("Missing output field names."),r=function(t){for(var e,n=0;n<d;++n)e=s.get(u[n](t)),t[o[n]]=null==e?c:e}),l?a=n.reflow(!0):h|=u.some(function(t){return n.modified(t.fields)})?n.MOD:0,n.visit(h,r),a.modifies(o)},Md(fn,A),Md(ln,A),Md(dn,Ee),dn.prototype.transform=function(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)};Md(pn,Xe).transform=function(t,e){var r=this,i=t.subflow,a=t.field;return(t.modified("field")||a&&e.modified(n(a)))&&Xh("PreFacet does not support field modification."),this._targets.active=0,e.visit(e.MOD,function(t){var n=r.subflow(y(t),i,e,t);a?a(t).forEach(function(t){n.mod(t)}):n.mod(t)}),e.visit(e.ADD,function(t){var n=r.subflow(y(t),i,e,t);a?a(t).forEach(function(t){n.add(_(t))}):n.add(t)}),e.visit(e.REM,function(t){var n=r.subflow(y(t),i,e,t);a?a(t).forEach(function(t){n.rem(t)}):n.rem(t)}),e},gn.Definition={type:"Project",metadata:{generates:!0,changes:!0,modifies:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};Md(gn,Ee).transform=function(t,n){var r,i,a=t.fields,o=function(t,n){return t?t.map(function(t,r){return n[r]||e(t)}):null}(t.fields,t.as||[]),u=a?function(t,e){return function(t,e,n,r){for(var i=0,a=n.length;i<a;++i)e[r[i]]=n[i](t);return e}(t,e,a,o)}:w;return this.value?i=this.value:(n=n.addAll(),i=this.value={}),r=n.fork(),n.visit(n.REM,function(t){var e=y(t);r.rem.push(i[e]),i[e]=null}),n.visit(n.ADD,function(t){var e=u(t,_({}));i[y(t)]=e,r.add.push(e)}),n.visit(n.MOD,function(t){r.mod.push(u(t,i[y(t)]))}),r};Md(vn,Ee).transform=function(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation};Md(mn,Ee).transform=function(t,e){var n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(),e.visit(e.REM,function(t){var e=y(t);n.rem.push(r[e]),r[e]=null}),e.visit(e.ADD,function(t){var e=x(t);r[y(t)]=e,n.add.push(e)}),e.visit(e.MOD,function(t){n.mod.push(w(t,r[y(t)]))})),n},yn.Definition={type:"Sample",metadata:{source:!0,changes:!0},params:[{name:"size",type:"number",default:1e3}]};Md(yn,Ee).transform=function(e,n){function r(e){var n,r;u.length<o?u.push(e):(r=~~((s+1)*t.random()))<u.length&&r>=f&&(n=u[r],c[y(n)]&&i.rem.push(n),u[r]=e),++s}var i=n.fork(),a=e.modified("size"),o=e.size,u=this.value,s=this.count,f=0,c=u.reduce(function(t,e){return t[y(e)]=1,t},{});if(n.rem.length&&(n.visit(n.REM,function(t){var e=y(t);c[e]&&(c[e]=-1,i.rem.push(t)),--s}),u=u.filter(function(t){return-1!==c[y(t)]})),(n.rem.length||a)&&u.length<o&&n.source&&(f=s=u.length,n.visit(n.SOURCE,function(t){c[y(t)]||r(t)}),f=-1),a&&u.length>o){for(var l=0,h=u.length-o;l<h;++l)c[y(u[l])]=-1,i.rem.push(u[l]);u=u.slice(h)}return n.mod.length&&n.visit(n.MOD,function(t){c[y(t)]&&i.mod.push(t)}),n.add.length&&n.visit(n.ADD,r),(n.add.length||f<0)&&(i.add=u.filter(function(t){return!c[y(t)]})),this.count=s,this.value=i.source=u,i},bn.Definition={type:"Sequence",metadata:{generates:!0,source:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1}],output:["value"]};Md(bn,Ee).transform=function(t,e){if(!this.value||t.modified()){var n=e.materialize().fork(e.MOD);return n.rem=this.value?e.rem.concat(this.value):e.rem,n.source=this.value=mg(t.start,t.stop,t.step||1).map(_),n.add=e.add.concat(this.value),n}};Md(_n,Ee).transform=function(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation};Md(xn,Ee).transform=function(t,e){function n(t){a.set(i(t),t)}var r=e.dataflow,i=t.field,a=this.value,o=!0;return t.modified("field")||e.modified(i.fields)?(a.clear(),e.visit(e.SOURCE,n)):e.changed()?(e.visit(e.REM,function(t){a.delete(i(t))}),e.visit(e.ADD,n)):o=!1,this.modified(o),a.empty>r.cleanThreshold&&r.runAfter(a.clean),e.fork()};Md(wn,Ee).transform=function(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(t.sort):e.source).map(t.field))};var Xg={row_number:function(){return{next:function(t){return t.index+1}}},rank:function(){var t;return{init:function(){t=1},next:function(e){var n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){var t;return{init:function(){t=1},next:function(e){var n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){var t=Xg.rank(),e=t.next;return{init:t.init,next:function(t){return(e(t)-1)/(t.data.length-1)}}},cume_dist:function(){var t;return{init:function(){t=0},next:function(e){var n=e.index,r=e.data,i=e.compare;if(t<n){for(;n+1<r.length&&!i(r[n],r[n+1]);)++n;t=n}return(1+t)/r.length}}},ntile:function(t,e){(e=+e)>0||Xh("ntile num must be greater than zero.");var n=Xg.cume_dist(),r=n.next;return{init:n.init,next:function(t){return Math.ceil(e*r(t))}}},lag:function(t,e){return e=+e||1,{next:function(n){var r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:function(n){var r=n.index+e,i=n.data;return r<i.length?t(i[r]):null}}},first_value:function(t){return{next:function(e){return t(e.data[e.i0])}}},last_value:function(t){return{next:function(e){return t(e.data[e.i1-1])}}},nth_value:function(t,e){return(e=+e)>0||Xh("nth_value nth must be greater than zero."),{next:function(n){var r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}}},Jg=Object.keys(Xg),Zg=Mn.prototype;Zg.init=function(){this.windows.forEach(function(t){t.init()}),this.cell&&this.cell.init()},Zg.update=function(t,e){var n,r=this.cell,i=this.windows,a=t.data,o=i&&i.length;if(r){for(n=t.p0;n<t.i0;++n)r.rem(a[n]);for(n=t.p1;n<t.i1;++n)r.add(a[n]);r.set(e)}for(n=0;n<o;++n)i[n].update(t,e)},kn.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Jg.concat(og)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};var Qg=Md(kn,Ee);Qg.transform=function(t,e){function n(t){return a.group(s(t))}var r,i,a=this,o=a.state,u=t.modified();this.stamp=e.stamp,o&&!u||(o=a.state=new Mn(t));var s=Ce(t.groupby);for(u||e.modified(o.inputs)?(a.value={},e.visit(e.SOURCE,function(t){n(t).add(t)})):(e.visit(e.REM,function(t){n(t).remove(t)}),e.visit(e.ADD,function(t){n(t).add(t)})),r=0,i=a._mlen;r<i;++r)En(a._mods[r],o,t);return a._mlen=0,a._mods=[],e.reflow(u).modifies(o.outputs)},Qg.group=function(t){var e=this.value[t];return e||((e=this.value[t]=Lg(y)).stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e};var Kg=Object.freeze({aggregate:Ue,bin:Fe,collect:je,compare:Ie,countpattern:Be,cross:We,density:He,extent:Ge,facet:Xe,field:Je,filter:Qe,fold:Ke,formula:en,generate:nn,impute:rn,joinaggregate:an,key:on,lookup:sn,multiextent:fn,multivalues:ln,params:dn,prefacet:pn,project:gn,proxy:vn,relay:mn,sample:yn,sequence:bn,sieve:_n,subflow:Ve,tupleindex:xn,values:wn,window:kn}),tv=Sn.prototype;tv.clone=function(){return new Sn(this)},tv.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},tv.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},tv.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},tv.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},tv.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},tv.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},tv.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},tv.rotate=function(t,e,n){var r=Math.cos(t),i=Math.sin(t),a=e-e*r+n*i,o=n-e*i-n*r,u=this.x1,s=this.x2,f=this.y1,c=this.y2;return this.clear().add(r*u-i*f+a,i*u+r*f+o).add(r*u-i*c+a,i*u+r*c+o).add(r*s-i*f+a,i*s+r*f+o).add(r*s-i*c+a,i*s+r*c+o)},tv.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},tv.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},tv.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},tv.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},tv.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},tv.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},tv.width=function(){return this.x2-this.x1},tv.height=function(){return this.y2-this.y1};var ev=0,nv=function(t,e){var n,r=[];return n={id:"gradient_"+ev++,x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}};Md(Cn,An);var rv;try{rv=require("canvas")}catch(t){try{rv=require("canvas-prebuilt")}catch(t){rv=null}}var iv=function(t,e){var n=Dn(null,"canvas");if(n&&n.getContext)n.width=t,n.height=e;else if(rv)try{n=new rv(t,e)}catch(t){n=null}return n},av="undefined"!=typeof Image?Image:rv&&rv.Image||null,ov=Rn.prototype;ov.pending=function(){return this._pending},ov.sanitizeURL=function(t){var e=this;return Pn(e),e._loader.sanitize(t,{context:"href"}).then(function(t){return Ln(e),t}).catch(function(){return Ln(e),null})},ov.loadImage=function(t){var e=this;return Pn(e),e._loader.sanitize(t,{context:"image"}).then(function(t){var n=t.href;if(!n||!av)throw{url:n};var r=new av;return r.onload=function(){Ln(e),r.loaded=!0},r.onerror=function(){Ln(e),r.loaded=!1},r.src=n,r}).catch(function(t){return Ln(e),{loaded:!1,width:0,height:0,src:t&&t.url||""}})},ov.ready=function(){var t=this;return new Promise(function(e){function n(r){t.pending()?setTimeout(function(){n(!0)},10):e(r)}n(!1)})};var uv=Math.PI,sv=2*uv,fv=sv-1e-6;qn.prototype=Un.prototype={constructor:qn,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(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,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,u=n-t,s=r-e,f=a-t,c=o-e,l=f*f+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(l>1e-6)if(Math.abs(c*u-s*f)>1e-6&&i){var h=n-a,d=r-o,p=u*u+s*s,g=h*h+d*d,v=Math.sqrt(p),m=Math.sqrt(l),y=i*Math.tan((uv-Math.acos((p+l-g)/(2*v*m)))/2),b=y/m,_=y/v;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*f)+","+(e+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>f*d)+","+(this._x1=t+_*u)+","+(this._y1=e+_*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,a){t=+t,e=+e;var o=(n=+n)*Math.cos(r),u=n*Math.sin(r),s=t+o,f=e+u,c=1^a,l=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+f:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+s+","+f),n&&(l<0&&(l=l%sv+sv),l>fv?this._+="A"+n+","+n+",0,1,"+c+","+(t-o)+","+(e-u)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=f):l>1e-6&&(this._+="A"+n+","+n+",0,"+ +(l>=uv)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var cv=function(t){return function(){return t}},lv=Math.abs,hv=Math.atan2,dv=Math.cos,pv=Math.max,gv=Math.min,vv=Math.sin,mv=Math.sqrt,yv=1e-12,bv=Math.PI,_v=bv/2,xv=2*bv;Hn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var wv=function(t){return new Hn(t)},Mv=function(){function t(t){var u,s,f,c=t.length,l=!1;for(null==i&&(o=a(f=Un())),u=0;u<=c;++u)!(u<c&&r(s=t[u],u,t))===l&&((l=!l)?o.lineStart():o.lineEnd()),l&&o.point(+e(s,u,t),+n(s,u,t));if(f)return o=null,f+""||null}var e=Gn,n=Vn,r=cv(!0),i=null,a=wv,o=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:cv(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:cv(+e),t):n},t.defined=function(e){return arguments.length?(r="function"==typeof e?e:cv(!!e),t):r},t.curve=function(e){return arguments.length?(a=e,null!=i&&(o=a(i)),t):a},t.context=function(e){return arguments.length?(null==e?i=o=null:o=a(i=e),t):i},t},kv=function(){function t(t){var e,c,l,h,d,p=t.length,g=!1,v=new Array(p),m=new Array(p);for(null==u&&(f=s(d=Un())),e=0;e<=p;++e){if(!(e<p&&o(h=t[e],e,t))===g)if(g=!g)c=e,f.areaStart(),f.lineStart();else{for(f.lineEnd(),f.lineStart(),l=e-1;l>=c;--l)f.point(v[l],m[l]);f.lineEnd(),f.areaEnd()}g&&(v[e]=+n(h,e,t),m[e]=+i(h,e,t),f.point(r?+r(h,e,t):v[e],a?+a(h,e,t):m[e]))}if(d)return f=null,d+""||null}function e(){return Mv().defined(o).curve(s).context(u)}var n=Gn,r=null,i=cv(0),a=Vn,o=cv(!0),u=null,s=wv,f=null;return t.x=function(e){return arguments.length?(n="function"==typeof e?e:cv(+e),r=null,t):n},t.x0=function(e){return arguments.length?(n="function"==typeof e?e:cv(+e),t):n},t.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:cv(+e),t):r},t.y=function(e){return arguments.length?(i="function"==typeof e?e:cv(+e),a=null,t):i},t.y0=function(e){return arguments.length?(i="function"==typeof e?e:cv(+e),t):i},t.y1=function(e){return arguments.length?(a=null==e?null:"function"==typeof e?e:cv(+e),t):a},t.lineX0=t.lineY0=function(){return e().x(n).y(i)},t.lineY1=function(){return e().x(n).y(a)},t.lineX1=function(){return e().x(r).y(i)},t.defined=function(e){return arguments.length?(o="function"==typeof e?e:cv(!!e),t):o},t.curve=function(e){return arguments.length?(s=e,null!=u&&(f=s(u)),t):s},t.context=function(e){return arguments.length?(null==e?u=f=null:f=s(u=e),t):u},t},Ev={draw:function(t,e){var n=Math.sqrt(e/bv);t.moveTo(n,0),t.arc(0,0,n,0,xv)}},Sv=function(){};Jn.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:Xn(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Xn(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};Zn.prototype={areaStart:Sv,areaEnd:Sv,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Xn(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};Qn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Xn(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};Kn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,u=e[n]-a,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*o),this._beta*e[s]+(1-this._beta)*(a+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Av=function t(e){function n(t){return 1===e?new Jn(t):new Kn(t,e)}return n.beta=function(e){return t(+e)},n}(.85);er.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:tr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:tr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Cv=function t(e){function n(t){return new er(t,e)}return n.tension=function(e){return t(+e)},n}(0);nr.prototype={areaStart:Sv,areaEnd:Sv,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:tr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Dv=function t(e){function n(t){return new nr(t,e)}return n.tension=function(e){return t(+e)},n}(0);rr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:tr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var zv=function t(e){function n(t){return new rr(t,e)}return n.tension=function(e){return t(+e)},n}(0);ar.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)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ir(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ov=function t(e){function n(t){return e?new ar(t,e):new er(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);or.prototype={areaStart:Sv,areaEnd:Sv,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)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ir(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Nv=function t(e){function n(t){return e?new or(t,e):new nr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);ur.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ir(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tv=function t(e){function n(t){return e?new ur(t,e):new rr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);sr.prototype={areaStart:Sv,areaEnd:Sv,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};dr.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:hr(this,this._t0,lr(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,t!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,hr(this,lr(this,n=cr(this,t,e)),n);break;default:hr(this,this._t0,n=cr(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(pr.prototype=Object.create(dr.prototype)).point=function(t,e){dr.prototype.point.call(this,e,t)},gr.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}},vr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=mr(t),i=mr(e),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[o],e[o]);(this._line||0!==this._line&&1===n)&&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)}};yr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Rv,Pv={basis:{curve:function(t){return new Jn(t)}},"basis-closed":{curve:function(t){return new Zn(t)}},"basis-open":{curve:function(t){return new Qn(t)}},bundle:{curve:Av,tension:"beta",value:.85},cardinal:{curve:Cv,tension:"tension",value:0},"cardinal-open":{curve:zv,tension:"tension",value:0},"cardinal-closed":{curve:Dv,tension:"tension",value:0},"catmull-rom":{curve:Ov,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Nv,tension:"alpha",value:.5},"catmull-rom-open":{curve:Tv,tension:"alpha",value:.5},linear:{curve:wv},"linear-closed":{curve:function(t){return new sr(t)}},monotone:{horizontal:function(t){return new pr(t)},vertical:function(t){return new dr(t)}},natural:{curve:function(t){return new vr(t)}},step:{curve:function(t){return new yr(t,.5)}},"step-after":{curve:function(t){return new yr(t,1)}},"step-before":{curve:function(t){return new yr(t,0)}}},Lv={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},qv=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],Uv=function(t){var e,n,r,i,a,o,u,s,f,c,l,h=[];for(s=0,c=(e=t.slice().replace(qv[0],"###$1").split(qv[1]).slice(1)).length;s<c;++s){for(r=(n=e[s]).slice(1).trim().replace(qv[2],"$1###$2").split(qv[3]),i=[o=n.charAt(0)],f=0,l=r.length;f<l;++f)(a=+r[f])===a&&i.push(a);if(u=Lv[o.toLowerCase()],i.length-1>u)for(f=1,l=i.length;f<l;f+=u)h.push([o].concat(i.slice(f,f+u)));else h.push(i)}return h},Fv={},jv={},Iv=[].join,$v=["l",0,0,0,0,0,0,0],Bv=function(t,e,n,r,i){var a,o,u,s,f,c=null,l=0,h=0,d=0,p=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),t.beginPath&&t.beginPath();for(var g=0,v=e.length;g<v;++g){switch(a=e[g],1!==i&&(a=xr(a,i)),a[0]){case"l":l+=a[1],h+=a[2],t.lineTo(l+n,h+r);break;case"L":l=a[1],h=a[2],t.lineTo(l+n,h+r);break;case"h":l+=a[1],t.lineTo(l+n,h+r);break;case"H":l=a[1],t.lineTo(l+n,h+r);break;case"v":h+=a[1],t.lineTo(l+n,h+r);break;case"V":h=a[1],t.lineTo(l+n,h+r);break;case"m":l+=a[1],h+=a[2],t.moveTo(l+n,h+r);break;case"M":l=a[1],h=a[2],t.moveTo(l+n,h+r);break;case"c":o=l+a[5],u=h+a[6],d=l+a[3],p=h+a[4],t.bezierCurveTo(l+a[1]+n,h+a[2]+r,d+n,p+r,o+n,u+r),l=o,h=u;break;case"C":l=a[5],h=a[6],d=a[3],p=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,d+n,p+r,l+n,h+r);break;case"s":o=l+a[3],u=h+a[4],d=2*l-d,p=2*h-p,t.bezierCurveTo(d+n,p+r,l+a[1]+n,h+a[2]+r,o+n,u+r),d=l+a[1],p=h+a[2],l=o,h=u;break;case"S":o=a[3],u=a[4],d=2*l-d,p=2*h-p,t.bezierCurveTo(d+n,p+r,a[1]+n,a[2]+r,o+n,u+r),l=o,h=u,d=a[1],p=a[2];break;case"q":o=l+a[3],u=h+a[4],d=l+a[1],p=h+a[2],t.quadraticCurveTo(d+n,p+r,o+n,u+r),l=o,h=u;break;case"Q":o=a[3],u=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,o+n,u+r),l=o,h=u,d=a[1],p=a[2];break;case"t":o=l+a[1],u=h+a[2],null===c[0].match(/[QqTt]/)?(d=l,p=h):"t"===c[0]?(d=2*l-s,p=2*h-f):"q"===c[0]&&(d=2*l-d,p=2*h-p),s=d,f=p,t.quadraticCurveTo(d+n,p+r,o+n,u+r),h=u,d=(l=o)+a[1],p=h+a[2];break;case"T":o=a[1],u=a[2],d=2*l-d,p=2*h-p,t.quadraticCurveTo(d+n,p+r,o+n,u+r),l=o,h=u;break;case"a":wr(t,l+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+l+n,a[7]+h+r]),l+=a[6],h+=a[7];break;case"A":wr(t,l+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),l=a[6],h=a[7];break;case"z":case"Z":t.closePath()}c=a}},Wv=2*Math.PI,Yv=Math.sqrt(3)/2,Hv={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,Wv)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,e){var 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),r=-n/2;t.rect(r,r,n,n)}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Yv*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Yv*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Yv*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=Yv*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}}},Gv={},Vv=function(){function t(t,u,s){var f,c=null!=u?u:+e.call(this,t),l=null!=s?s:+n.call(this,t),h=+r.call(this,t),d=+i.call(this,t),p=+a.call(this,t);if(o||(o=f=Un()),p<=0)o.rect(c,l,h,d);else{var g=c+h,v=l+d;o.moveTo(c+p,l),o.lineTo(g-p,l),o.quadraticCurveTo(g,l,g,l+p),o.lineTo(g,v-p),o.quadraticCurveTo(g,v,g-p,v),o.lineTo(c+p,v),o.quadraticCurveTo(c,v,c,v-p),o.lineTo(c,l+p),o.quadraticCurveTo(c,l,c+p,l),o.closePath()}if(f)return o=null,f+""||null}var e=kr,n=Er,r=Sr,i=Ar,a=Cr(0),o=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:Cr(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:Cr(+e),t):n},t.width=function(e){return arguments.length?(r="function"==typeof e?e:Cr(+e),t):r},t.height=function(e){return arguments.length?(i="function"==typeof e?e:Cr(+e),t):i},t.cornerRadius=function(e){return arguments.length?(a="function"==typeof e?e:Cr(+e),t):a},t.context=function(e){return arguments.length?(o=null==e?null:e,t):o},t},Xv=Math.PI,Jv=function(){function t(t,e,n){var r=n/2;if(o){var i=s-e,a=t-u;if(i||a){var l=Math.sqrt(i*i+a*a),h=(i/=l)*f,d=(a/=l)*f,p=Math.atan2(a,i);c.moveTo(u-h,s-d),c.lineTo(t-i*r,e-a*r),c.arc(t,e,r,p-Xv,p),c.lineTo(u+h,s+d),c.arc(u,s,f,p,p+Xv)}else c.arc(t,e,r,0,2*Xv);c.closePath()}else o=1;u=t,s=e,f=r}function e(e){var u,s,f,l=e.length,h=!1;for(null==c&&(c=f=Un()),u=0;u<=l;++u)!(u<l&&a(s=e[u],u,e))===h&&(h=!h)&&(o=0),h&&t(+n(s,u,e),+r(s,u,e),+i(s,u,e));if(f)return c=null,f+""||null}var n,r,i,a,o,u,s,f,c=null;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e.size=function(t){return arguments.length?(i=t,e):i},e.defined=function(t){return arguments.length?(a=t,e):a},e.context=function(t){return arguments.length?(c=null==t?null:t,e):c},e},Zv=function(){function t(){var t,f,c=+e.apply(this,arguments),l=+n.apply(this,arguments),h=a.apply(this,arguments)-_v,d=o.apply(this,arguments)-_v,p=lv(d-h),g=d>h;if(s||(s=t=Un()),l<c&&(f=l,l=c,c=f),l>yv)if(p>xv-yv)s.moveTo(l*dv(h),l*vv(h)),s.arc(0,0,l,h,d,!g),c>yv&&(s.moveTo(c*dv(d),c*vv(d)),s.arc(0,0,c,d,h,g));else{var v,m,y=h,b=d,_=h,x=d,w=p,M=p,k=u.apply(this,arguments)/2,E=k>yv&&(i?+i.apply(this,arguments):mv(c*c+l*l)),S=gv(lv(l-c)/2,+r.apply(this,arguments)),A=S,C=S;if(E>yv){var D=Fn(E/c*vv(k)),z=Fn(E/l*vv(k));(w-=2*D)>yv?(D*=g?1:-1,_+=D,x-=D):(w=0,_=x=(h+d)/2),(M-=2*z)>yv?(z*=g?1:-1,y+=z,b-=z):(M=0,y=b=(h+d)/2)}var O=l*dv(y),N=l*vv(y),T=c*dv(x),R=c*vv(x);if(S>yv){var P=l*dv(b),L=l*vv(b),q=c*dv(_),U=c*vv(_);if(p<bv){var F=w>yv?function(t,e,n,r,i,a,o,u){var s=q-O,f=U-N,c=T-P,l=R-L,h=(c*(N-L)-l*(O-P))/(l*s-c*f);return[O+h*s,N+h*f]}():[T,R],j=O-F[0],I=N-F[1],$=P-F[0],B=L-F[1],W=1/vv(function(t){return t>1?0:t<-1?bv:Math.acos(t)}((j*$+I*B)/(mv(j*j+I*I)*mv($*$+B*B)))/2),Y=mv(F[0]*F[0]+F[1]*F[1]);A=gv(S,(c-Y)/(W-1)),C=gv(S,(l-Y)/(W+1))}}M>yv?C>yv?(v=Yn(q,U,O,N,l,C,g),m=Yn(P,L,T,R,l,C,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),C<S?s.arc(v.cx,v.cy,C,hv(v.y01,v.x01),hv(m.y01,m.x01),!g):(s.arc(v.cx,v.cy,C,hv(v.y01,v.x01),hv(v.y11,v.x11),!g),s.arc(0,0,l,hv(v.cy+v.y11,v.cx+v.x11),hv(m.cy+m.y11,m.cx+m.x11),!g),s.arc(m.cx,m.cy,C,hv(m.y11,m.x11),hv(m.y01,m.x01),!g))):(s.moveTo(O,N),s.arc(0,0,l,y,b,!g)):s.moveTo(O,N),c>yv&&w>yv?A>yv?(v=Yn(T,R,P,L,c,-A,g),m=Yn(O,N,q,U,c,-A,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),A<S?s.arc(v.cx,v.cy,A,hv(v.y01,v.x01),hv(m.y01,m.x01),!g):(s.arc(v.cx,v.cy,A,hv(v.y01,v.x01),hv(v.y11,v.x11),!g),s.arc(0,0,c,hv(v.cy+v.y11,v.cx+v.x11),hv(m.cy+m.y11,m.cx+m.x11),g),s.arc(m.cx,m.cy,A,hv(m.y11,m.x11),hv(m.y01,m.x01),!g))):s.arc(0,0,c,x,_,g):s.lineTo(T,R)}else s.moveTo(0,0);if(s.closePath(),t)return s=null,t+""||null}var e=jn,n=In,r=cv(0),i=null,a=$n,o=Bn,u=Wn,s=null;return t.centroid=function(){var t=(+e.apply(this,arguments)+ +n.apply(this,arguments))/2,r=(+a.apply(this,arguments)+ +o.apply(this,arguments))/2-bv/2;return[dv(r)*t,vv(r)*t]},t.innerRadius=function(n){return arguments.length?(e="function"==typeof n?n:cv(+n),t):e},t.outerRadius=function(e){return arguments.length?(n="function"==typeof e?e:cv(+e),t):n},t.cornerRadius=function(e){return arguments.length?(r="function"==typeof e?e:cv(+e),t):r},t.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:cv(+e),t):i},t.startAngle=function(e){return arguments.length?(a="function"==typeof e?e:cv(+e),t):a},t.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:cv(+e),t):o},t.padAngle=function(e){return arguments.length?(u="function"==typeof e?e:cv(+e),t):u},t.context=function(e){return arguments.length?(s=null==e?null:e,t):s},t}().startAngle(function(t){return t.startAngle||0}).endAngle(function(t){return t.endAngle||0}).padAngle(function(t){return t.padAngle||0}).innerRadius(function(t){return t.innerRadius||0}).outerRadius(function(t){return t.outerRadius||0}).cornerRadius(Or),Qv=kv().x(Dr).y1(zr).y0(function(t){return(t.y||0)+(t.height||0)}).defined(Nr),Kv=kv().y(zr).x1(Dr).x0(function(t){return(t.x||0)+(t.width||0)}).defined(Nr),tm=Mv().x(Dr).y(zr).defined(Nr),em=Vv().x(Dr).y(zr).width(function(t){return t.width||0}).height(function(t){return t.height||0}).cornerRadius(Or),nm=function(){function t(){var t;if(r||(r=t=Un()),e.apply(this,arguments).draw(r,+n.apply(this,arguments)),t)return r=null,t+""||null}var e=cv(Ev),n=cv(64),r=null;return t.type=function(n){return arguments.length?(e="function"==typeof n?n:cv(n),t):e},t.size=function(e){return arguments.length?(n="function"==typeof e?e:cv(+e),t):n},t.context=function(e){return arguments.length?(r=null==e?null:e,t):r},t}().type(function(t){return Mr(t.shape||"circle")}).size(function(t){return null==t.size?64:t.size}),rm=Jv().x(Dr).y(zr).defined(Nr).size(function(t){return t.size||1}),im=function(t,e){return e.stroke&&0!==e.opacity&&0!==e.strokeOpacity&&t.expand(null!=e.strokeWidth?+e.strokeWidth:1),t},am=2*Math.PI,om=am/4,um=am-1e-8;Rr.beginPath=Pr,Rr.closePath=Pr,Rr.moveTo=Lr,Rr.lineTo=Lr,Rr.rect=function(t,e,n,r){Lr(t,e),Lr(t+n,e+r)},Rr.quadraticCurveTo=function(t,e,n,r){Lr(t,e),Lr(n,r)},Rr.bezierCurveTo=function(t,e,n,r,i,a){Lr(t,e),Lr(n,r),Lr(i,a)},Rr.arc=function(t,e,n,r,i,a){function o(t){f=n*Math.cos(t),c=n*Math.sin(t),f<l&&(l=f),f>h&&(h=f),c<d&&(d=c),c>p&&(p=c)}if(Math.abs(i-r)>um)return Lr(t-n,e-n),void Lr(t+n,e+n);var u,s,f,c,l=1/0,h=-1/0,d=1/0,p=-1/0;if(o(r),o(i),i!==r)if((r%=am)<0&&(r+=am),(i%=am)<0&&(i+=am),i<r&&(a=!a,u=r,r=i,i=u),a)for(i-=am,u=r-r%om,s=0;s<3&&u>i;++s,u-=om)o(u);else for(u=r-r%om+om,s=0;s<3&&u<i;++s,u+=om)o(u);Lr(t+l,e+d),Lr(t+h,e+p)};var sm,fm,cm=function(t,e,n){return n.id?function(t,e,n){for(var r=n.width(),i=n.height(),a=n.x1+e.x1*r,o=n.y1+e.y1*i,u=n.x1+e.x2*r,s=n.y1+e.y2*i,f=e.stops,c=0,l=f.length,h=t.createLinearGradient(a,o,u,s);c<l;++c)h.addColorStop(f[c].offset,f[c].color);return h}(t,n,e.bounds):n},lm=function(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=cm(t,e,e.fill),!0)},hm=[],dm=function(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=cm(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||hm),t.lineDashOffset=e.strokeDashOffset||0),!0))},pm=function(){return!0},gm=function(t,e){return"translate("+t+","+e+")"},vm=function(t){return gm(t.x||0,t.y||0)},mm=function(t,e){function n(t,n){var r=n.x||0,i=n.y||0;t.translate(r,i),t.beginPath(),e(t,n),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",vm(n)),t("d",e(null,n))},bound:function(t,n){return e(Rr(t),n),im(t,n).translate(n.x||0,n.y||0)},draw:Ir(n),pick:Yr(n)}},ym=mm("arc",function(t,e){return Zv.context(t)(e)}),bm=function(t,e){function n(t,n){t.beginPath(),e(t,n)}var r=Wr(n);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(Rr(t),r),im(t,r[0]))},draw:function(t){return function(e,n,r){!n.items.length||r&&!r.intersects(n.bounds)||$r(t,e,n.items[0],n.items)}}(n),pick:function(t,e,n,i,a,o){var u=e.items,s=e.bounds;return!u||!u.length||s&&!s.contains(a,o)?null:(t.pixelRatio>1&&(n*=t.pixelRatio,i*=t.pixelRatio),r(t,u,n,i)?u[0]:null)}}},_m=bm("area",function(t,e){var n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Kv:Qv).curve(br(r,n.orient,n.tension)).context(t)(e)}),xm=1,wm=function(t,e,n){var r=t._defs,i=e.clip_id||(e.clip_id="clip"+xm++),a=r.clipping[i]||(r.clipping[i]={id:i});return a.width=n.width||0,a.height=n.height||0,"url(#"+i+")"},Mm=.5,km={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",vm(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,r=0,i=n.length;r<i;++r)t.union(n[r].bounds);return(e.clip||e.width||e.height)&&im(t.add(0,0).add(e.width||0,e.height||0),e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var r=this;Fr(e,function(e){var i,a,o=e.x||0,u=e.y||0,s=e.width||0,f=e.height||0;t.save(),t.translate(o,u),(e.stroke||e.fill)&&(a=null==e.opacity?1:e.opacity)>0&&(t.beginPath(),i=e.stroke?Mm:0,Tr(t,e,i,i),e.fill&&lm(t,e,a)&&t.fill(),e.stroke&&dm(t,e,a)&&t.stroke()),e.clip&&(t.beginPath(),t.rect(0,0,s,f),t.clip()),n&&n.translate(-o,-u),Fr(e,function(e){r.draw(t,e,n)}),n&&n.translate(o,u),t.restore()})},pick:function(t,e,n,r,i,a){if(e.bounds&&!e.bounds.contains(i,a)||!e.items)return null;var o=this;return jr(e,function(u){var s,f,c,l;if(!(l=u.bounds)||l.contains(i,a))return f=u.x||0,c=u.y||0,t.save(),t.translate(f,c),f=i-f,c=a-c,s=jr(u,function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,f,c)?o.pick(t,n,r,f,c):null}),t.restore(),s||((s=!1!==e.interactive&&(u.fill||u.stroke)&&f>=0&&f<=u.width&&c>=0&&c<=u.height)?u:null)})},background:function(t,e){var n=e.stroke?Mm:0;t("class","background"),t("d",Tr(null,e,n,n))},foreground:function(t,e,n){t("clip-path",e.clip?wm(n,e,e):null)}},Em={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var r=Hr(e,n),i=e.x||0,a=e.y||0,o=(null!=e.width?e.width:r.width)||0,u=(null!=e.height?e.height:r.height)||0,s=!1===e.aspect?"none":"xMidYMid";i-=Gr(e.align,o),a-=Vr(e.baseline,u),t("href",r.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",gm(i,a)),t("width",o),t("height",u),t("preserveAspectRatio",s)},bound:function(t,e){var n=e.image,r=e.x||0,i=e.y||0,a=(null!=e.width?e.width:n&&n.width)||0,o=(null!=e.height?e.height:n&&n.height)||0;return r-=Gr(e.align,a),i-=Vr(e.baseline,o),t.set(r,i,r+a,i+o)},draw:function(t,e,n){var r=this;Fr(e,function(e){if(!n||n.intersects(e.bounds)){var i,a,o,u,s=Hr(e,r),f=e.x||0,c=e.y||0,l=(null!=e.width?e.width:s.width)||0,h=(null!=e.height?e.height:s.height)||0;f-=Gr(e.align,l),c-=Vr(e.baseline,h),!1!==e.aspect&&(a=s.width/s.height,o=e.width/e.height,a==a&&o==o&&a!==o&&(o<a?(c+=(h-(u=l/a))/2,h=u):(f+=(l-(u=h*a))/2,l=u))),s.loaded&&(t.globalAlpha=null!=(i=e.opacity)?i:1,t.drawImage(s,f,c,l,h))}})},pick:Br(),get:Hr,xOffset:Gr,yOffset:Vr},Sm=bm("line",function(t,e){var n=e[0],r=n.interpolate||"linear";return tm.curve(br(r,n.orient,n.tension)).context(t)(e)}),Am={type:"path",tag:"path",nested:!1,attr:function(t,e){t("transform",vm(e)),t("d",e.path)},bound:function(t,e){return Xr(Rr(t),e)?t.set(0,0,0,0):im(t,e)},draw:Ir(Xr),pick:Yr(Xr)},Cm={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Tr(null,e))},bound:function(t,e){var n,r;return im(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:Ir(Jr),pick:Yr(Jr)},Dm={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",vm(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,r;return im(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){Fr(e,function(e){if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Zr(t,e,r)&&t.stroke()}})},pick:Br(function(t,e,n,r){return!!t.isPointInStroke&&Zr(t,e,1)&&t.isPointInStroke(n,r)})},zm=mm("shape",function(t,e){return(e.mark.shape||e.shape).context(t)(e)}),Om=mm("symbol",function(t,e){return nm.context(t)(e)}),Nm={height:ni,measureWidth:ti,estimateWidth:Qr,width:Qr,canvas:ri};ri(!0);var Tm={left:"start",center:"middle",right:"end"},Rm=new Sn,Pm={arc:ym,area:_m,group:km,image:Em,line:Sm,path:Am,rect:Cm,rule:Dm,shape:zm,symbol:Om,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+oi(e),a=e.x||0,o=e.y||0,u=e.angle||0,s=e.radius||0;s&&(n=(e.theta||0)-Math.PI/2,a+=s*Math.cos(n),o+=s*Math.sin(n)),t("text-anchor",Tm[e.align]||"start"),u?(n=gm(a,o)+" rotate("+u+")",(r||i)&&(n+=" "+gm(r,i))):n=gm(a+r,o+i),t("transform",n)},bound:ui,draw:function(t,e,n){Fr(e,function(e){var r,i,a,o,u,s;n&&!n.intersects(e.bounds)||(s=ii(e))&&0!==(r=null==e.opacity?1:e.opacity)&&(t.font=ai(e),t.textAlign=e.align||"left",i=e.x||0,a=e.y||0,(o=e.radius)&&(u=(e.theta||0)-Math.PI/2,i+=o*Math.cos(u),a+=o*Math.sin(u)),e.angle&&(t.save(),t.translate(i,a),t.rotate(e.angle*Math.PI/180),i=a=0),i+=e.dx||0,a+=(e.dy||0)+oi(e),e.fill&&lm(t,e,r)&&t.fillText(s,i,a),e.stroke&&dm(t,e,r)&&t.strokeText(s,i,a),e.angle&&t.restore())})},pick:Br(function(t,e,n,r,i,a){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var o=ui(Rm,e,!0),u=-e.angle*Math.PI/180,s=Math.cos(u),f=Math.sin(u),c=e.x,l=e.y,h=s*i-f*a+(c-c*s+l*f),d=f*i+s*a+(l-c*f-l*s);return o.contains(h,d)})},trail:bm("trail",function(t,e){return rm.context(t)(e)})},Lm=function(t,e,n){var r=Pm[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new Sn),t,n)},qm={mark:null},Um=function(t,e,n){var r,i,a,o,u=Pm[t.marktype],s=u.bound,f=t.items,c=f&&f.length;if(u.nested)return c?a=f[0]:(qm.mark=t,a=qm),o=Lm(a,s,n),e=e&&e.union(o)||o;if(e=e||t.bounds&&t.bounds.clear()||new Sn,c)for(r=0,i=f.length;r<i;++r)e.union(Lm(f[r],s,n));return t.bounds=e},Fm=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","interpolate","tension","orient","defined","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"],jm=li.prototype;jm.toJSON=function(t){return si(this.root,t||0)},jm.mark=function(t,e,n){var r=hi(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r};var Im=di.prototype;Im.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},Im.element=function(){return this._el},Im.origin=function(t){return this._origin=t||[0,0],this},Im.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},Im.on=function(){},Im.off=function(){},Im.handlers=function(){var t,e=this._handlers,n=[];for(t in e)n.push.apply(n,e[t]);return n},Im.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},Im.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then(function(e){var n=new MouseEvent(t.type,t),r=Dn(null,"a");for(var i in e)r.setAttribute(i,e[i]);r.dispatchEvent(n)}).catch(function(){})},Im.handleTooltip=function(t,e,n){this._el.setAttribute("title",n||"")};var $m=pi.prototype;$m.initialize=function(t,e,n,r){return this._el=t,this.resize(e,n,r)},$m.element=function(){return this._el},$m.scene=function(){return this._el&&this._el.firstChild},$m.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},$m.resize=function(t,e,n){return this._width=t,this._height=e,this._origin=n||[0,0],this},$m.dirty=function(){},$m.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},$m._render=function(){},$m.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then(function(){return e}):Promise.resolve(e)},$m._load=function(t,e){var n=this,r=n._loader[t](e);if(!n._ready){var i=n._call;n._ready=n._loader.ready().then(function(t){t&&i(),n._ready=null})}return r},$m.sanitizeURL=function(t){return this._load("sanitizeURL",t)},$m.loadImage=function(t){return this._load("loadImage",t)};var Bm=function(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]},Wm=Md(gi,di);Wm.initialize=function(t,e,n){var r=this._canvas=t&&zn(t,"canvas");if(r){var i=this;this.events.forEach(function(t){r.addEventListener(t,function(e){Wm[t]?Wm[t].call(i,e):i.fire(t,e)})})}return di.prototype.initialize.call(this,t,e,n)},Wm.canvas=function(){return this._canvas},Wm.context=function(){return this._canvas.getContext("2d")},Wm.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],Wm.DOMMouseScroll=function(t){this.fire("mousewheel",t)},Wm.mousemove=vi("mousemove","mouseover","mouseout"),Wm.dragover=vi("dragover","dragenter","dragleave"),Wm.mouseout=mi("mouseout"),Wm.dragleave=mi("dragleave"),Wm.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},Wm.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},Wm.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},Wm.touchmove=function(t){this.fire("touchmove",t,!0)},Wm.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},Wm.fire=function(t,e,n){var r,i,a=n?this._touch:this._active,o=this._handlers[t];if("click"===t&&a&&a.href?this.handleHref(e,a,a.href):("mouseover"===t||"mouseout"===t)&&a&&a.tooltip&&this.handleTooltip(e,a,"mouseover"===t?a.tooltip:null),o)for(e.vegaType=t,r=0,i=o.length;r<i;++r)o[r].handler.call(this._obj,e,a)},Wm.on=function(t,e){var n=this.eventName(t),r=this._handlers;return(r[n]||(r[n]=[])).push({type:t,handler:e}),this},Wm.off=function(t,e){var n,r=this.eventName(t),i=this._handlers[r];if(i){for(n=i.length;--n>=0;)i[n].type===t&&(e&&i[n].handler!==e||i.splice(n,1));return this}},Wm.pickEvent=function(t){var e=Bm(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},Wm.pick=function(t,e,n,r,i){var a=this.context();return Pm[t.marktype].pick.call(this,a,t,e,n,r,i)};var Ym="undefined"!=typeof window?window.devicePixelRatio||1:1,Hm=Md(yi,pi),Gm=pi.prototype,Vm=new Sn;Hm.initialize=function(t,e,n,r){return this._canvas=iv(1,1),t&&(Nn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Gm.initialize.call(this,t,e,n,r)},Hm.resize=function(t,e,n){return Gm.resize.call(this,t,e,n),function(t,e,n,r){var i="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),o=i?Ym:1;t.width=e*o,t.height=n*o,1!==o&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=o,a.setTransform(o,0,0,o,o*r[0],o*r[1])}(this._canvas,this._width,this._height,this._origin),this._redraw=!0,this},Hm.canvas=function(){return this._canvas},Hm.context=function(){return this._canvas?this._canvas.getContext("2d"):null},Hm.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=Vm.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}(t.bounds,t.mark.group);this._dirty.union(e)},Hm._render=function(t){var e=this.context(),n=this._origin,r=this._width,i=this._height,a=this._dirty;return e.save(),this._redraw||a.empty()?(this._redraw=!1,a=null):a=function(t,e,n){return e.expand(1).round(),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a,n),this.clear(-n[0],-n[1],r,i),this.draw(e,t,a),e.restore(),this._dirty.clear(),this},Hm.draw=function(t,e,n){var r=Pm[e.marktype];e.clip&&function(t,e){var n=e.group;t.save(),t.beginPath(),t.rect(0,0,n.width||0,n.height||0),t.clip()}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},Hm.clear=function(t,e,n,r){var i=this.context();i.clearRect(t,e,n,r),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(t,e,n,r))};var Xm=Md(bi,di);Xm.initialize=function(t,e,n){var r=this._svg;return r&&(r.removeEventListener("click",this._hrefHandler),r.removeEventListener("mouseover",this._tooltipHandler),r.removeEventListener("mouseout",this._tooltipHandler)),this._svg=r=t&&zn(t,"svg"),r&&(r.addEventListener("click",this._hrefHandler),r.addEventListener("mouseover",this._tooltipHandler),r.addEventListener("mouseout",this._tooltipHandler)),di.prototype.initialize.call(this,t,e,n)},Xm.svg=function(){return this._svg},Xm.on=function(t,e){var n=this.eventName(t),r=this._handlers,i={type:t,handler:e,listener:_i(this,e)};return(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener),this},Xm.off=function(t,e){var n,r=this.eventName(t),i=this._svg,a=this._handlers[r];if(a){for(n=a.length;--n>=0;)(a[n].type===t&&!e||a[n].handler===e)&&(this._svg&&i.removeEventListener(r,a[n].listener),a.splice(n,1));return this}};var Jm={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Zm={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},Qm=Object.keys(Zm),Km=Jm.xmlns,ty=Md(Mi,pi),ey=pi.prototype;ty.initialize=function(t,e,n,r){return t&&(this._svg=On(t,0,"svg",Km),this._svg.setAttribute("class","marks"),Nn(t,1),this._root=On(this._svg,0,"g",Km),Nn(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),ey.initialize.call(this,t,e,n,r)},ty.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),ey.background.apply(this,arguments)},ty.resize=function(t,e,n){return ey.resize.call(this,t,e,n),this._svg&&(this._svg.setAttribute("width",this._width),this._svg.setAttribute("height",this._height),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},ty.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width,height:this._height,viewBox:"0 0 "+this._width+" "+this._height};for(var e in Jm)t[e]=Jm[e];var n=this._bgcolor?xi("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+wi("rect"):"";return xi("svg",t)+n+this._svg.innerHTML+wi("svg")},ty._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),Nn(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},ty.updateDefs=function(){var t,e=this._svg,n=this._defs,r=n.el,i=0;for(t in n.gradient)r||(n.el=r=On(e,0,"defs",Km)),function(t,e,n){var r,i,a;for((t=On(t,n,"linearGradient",Km)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2),r=0,i=e.stops.length;r<i;++r)(a=On(t,r,"stop",Km)).setAttribute("offset",e.stops[r].offset),a.setAttribute("stop-color",e.stops[r].color);Nn(t,r)}(r,n.gradient[t],i++);for(t in n.clipping)r||(n.el=r=On(e,0,"defs",Km)),function(t,e,n){var r;(t=On(t,n,"clipPath",Km)).setAttribute("id",e.id),(r=On(t,0,"rect",Km)).setAttribute("x",0),r.setAttribute("y",0),r.setAttribute("width",e.width),r.setAttribute("height",e.height)}(r,n.clipping[t],i++);r&&(0===i?(e.removeChild(r),n.el=null):Nn(r,i))},ty._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},ty.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},ty.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},ty._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length)return!0;var e,n,r,i,a,o,u,s=++this._dirtyID;for(a=0,o=t.length;a<o;++a)(n=(e=t[a]).mark).marktype!==r&&(r=n.marktype,i=Pm[r]),n.zdirty&&n.dirty!==s&&(this._dirtyAll=!1,n.dirty=s,ki(n.group,s)),e.exit?(i.nested&&n.items.length?(u=n.items[0])._svg&&this._update(i,u._svg,u):e._svg&&(u=e._svg.parentNode)&&u.removeChild(e._svg),e._svg=null):(e=i.nested?n.items[0]:e)._update!==s&&(e._svg&&e._svg.ownerSVGElement?this._update(i,e._svg,e):(this._dirtyAll=!1,ki(e,s)),e._update=s);return!this._dirtyAll},ty.draw=function(t,e,n){function r(t){var e=a.isDirty(t),n=Ei(t,i,f,o.tag);e&&(a._update(o,n,t),s&&function(t,e,n){e=e.lastChild;var r,i=0;Fr(n,function(n){r=t.draw(e,n,r),++i}),Nn(e,1+i)}(a,n,t)),f=n,++c}if(!this.isDirty(e))return e._svg;var i,a=this,o=Pm[e.marktype],u=!1===e.interactive?"none":null,s="g"===o.tag,f=null,c=0;return(i=Ei(e,t,n,"g")).setAttribute("class",Tn(e)),!s&&u&&i.style.setProperty("pointer-events",u),e.clip&&i.setAttribute("clip-path",wm(a,e,e.group)),o.nested?e.items.length&&r(e.items[0]):Fr(e,r),Nn(i,c),i};var ny=null,ry=null,iy={group:function(t,e,n){ry=e.__values__,ny=e.childNodes[1],t.foreground(Si,n,this),ny=e.childNodes[0],t.background(Si,n,this);var r=!1===n.mark.interactive?"none":null;r!==ry.events&&(ny.style.setProperty("pointer-events",r),ry.events=r)},text:function(t,e,n){var r=ii(n);r!==ry.text&&(e.textContent=r,ry.text=r),(r=ai(n))!==ry.font&&(e.style.setProperty("font",r),ry.font=r)}};ty._update=function(t,e,n){ny=e,ry=e.__values__,t.attr(Si,n,this);var r=iy[t.type];r&&r.call(this,t,e,n),this.style(ny,n)},ty.style=function(t,e){if(null!=e){var n,r,i,a,o;for(n=0,r=Qm.length;n<r;++n)(o=e[i=Qm[n]])!==ry[i]&&(a=Zm[i],null==o?"fill"===a?t.style.setProperty(a,"none"):t.style.removeProperty(a):(o.id&&(this._defs.gradient[o.id]=o,o="url("+function(){var t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}()+"#"+o.id+")"),t.style.setProperty(a,o+"")),ry[i]=o)}};var ay=Md(Ai,pi),oy=pi.prototype;ay.resize=function(t,e,n){oy.resize.call(this,t,e,n);var r=this._origin,i=this._text,a={class:"marks",width:this._width,height:this._height,viewBox:"0 0 "+this._width+" "+this._height};for(var o in Jm)a[o]=Jm[o];return i.head=xi("svg",a),this._bgcolor?i.bg=xi("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+wi("rect"):i.bg="",i.root=xi("g",{transform:"translate("+r+")"}),i.foot=wi("g")+wi("svg"),this},ay.background=function(){var t=oy.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin),t},ay.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},ay._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},ay.buildDefs=function(){var t,e,n,r,i=this._defs,a="";for(e in i.gradient){for(r=(n=i.gradient[e]).stops,a+=xi("linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<r.length;++t)a+=xi("stop",{offset:r[t].offset,"stop-color":r[t].color})+wi("stop");a+=wi("linearGradient")}for(e in i.clipping)n=i.clipping[e],a+=xi("clipPath",{id:e}),a+=xi("rect",{x:0,y:0,width:n.width,height:n.height})+wi("rect"),a+=wi("clipPath");return a.length>0?xi("defs")+a+wi("defs"):""};var uy;ay.attributes=function(t,e){return uy={},t(Ci,e,this),uy},ay.href=function(t){var e,n=this,r=t.href;if(r){if(e=n._hrefs&&n._hrefs[r])return e;n.sanitizeURL(r).then(function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[r]=t})}return null},ay.mark=function(t){function e(e){var s=r.href(e);s&&(u+=xi("a",s)),n="g"!==a?Di(e,t,a,o):null,u+=xi(a,r.attributes(i.attr,e),n),"text"===a?u+=function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(ii(e)):"g"===a&&(u+=xi("path",r.attributes(i.background,e),Di(e,t,"bgrect",o))+wi("path"),u+=xi("g",r.attributes(i.foreground,e))+r.markGroup(e)+wi("g")),u+=wi(a),s&&(u+=wi("a"))}var n,r=this,i=Pm[t.marktype],a=i.tag,o=this._defs,u="";return"g"!==a&&!1===t.interactive&&(n='style="pointer-events: none;"'),u+=xi("g",{class:Tn(t),"clip-path":t.clip?wm(r,t,t.group):null},n),i.nested?t.items&&t.items.length&&e(t.items[0]):Fr(t,e),u+wi("g")},ay.markGroup=function(t){var e=this,n="";return Fr(t,function(t){n+=e.mark(t)}),n};var sy={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},fy={};fy.canvas=fy.png={renderer:yi,headless:yi,handler:gi},fy.svg={renderer:Mi,headless:Ai,handler:bi},fy.none={};var cy=1e-9,ly=Md(Ti,Ee),hy=new Sn;ly.transform=function(t,e){var n,r=e.dataflow,i=t.mark,a=i.marktype,o=Pm[a],u=o.bound,s=i.clip,f=i.bounds;return o.nested?(i.items.length&&r.dirty(i.items[0]),f=Ri(i,u),i.items.forEach(function(t){t.bounds.clear().union(f)})):"group"===a||t.modified()?(e.visit(e.MOD,function(t){r.dirty(t)}),f.clear(),i.items.forEach(function(t){f.union(Ri(t,u))})):(n=e.changed(e.REM),e.visit(e.ADD,function(t){f.union(Ri(t,u))}),e.visit(e.MOD,function(t){n=n||f.alignsWith(t.bounds),r.dirty(t),f.union(Ri(t,u))}),n&&!s&&(f.clear(),i.items.forEach(function(t){f.union(t.bounds)}))),s&&f.intersect(hy.set(0,0,i.group.width,i.group.height)),e.modifies("bounds")};var dy=":vega_identifier:";Pi.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};Md(Pi,Ee).transform=function(t,e){var n=function(t){var e=t._signals[dy];return e||(t._signals[dy]=e=t.add(0)),e}(e.dataflow),r=n.value,i=t.as;return e.visit(e.ADD,function(t){t[i]||(t[i]=++r)}),n.set(this.value=r),e};Md(Li,Ee).transform=function(t,e){var n=this.value;n||((n=e.dataflow.scenegraph().mark(t.markdef,function(t){var e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index)).group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this,this.value=n);var r="group"===n.marktype?Cn:An;return e.visit(e.ADD,function(t){r.call(t,n)}),n.items=e.source,e};var py="top",gy="left",vy="right",my="bottom",yy={parity:function(t){return t.filter(function(t,e){return e%2?t.opacity=0:1})},greedy:function(t){var e;return t.filter(function(t,n){return n&&Ui(e.bounds,t.bounds)?t.opacity=0:(e=t,1)})}};Md(qi,Ee).transform=function(t,e){var n=yy[t.method]||yy.parity,r=e.materialize(e.SOURCE).source;if(r){t.sort&&(r=r.slice().sort(t.sort)),"greedy"===t.method&&(r=r.filter(ji)),r.forEach(function(t){t.opacity=1});var i=r;if(i.length>=3&&Fi(i)){e=e.reflow(t.modified()).modifies("opacity");do{i=n(i)}while(i.length>=3&&Fi(i));i.length<3&&!hd(r).opacity&&(i.length>1&&(hd(i).opacity=0),hd(r).opacity=1)}if(t.boundScale){var a=function(t,e,n){var r=t.range(),i=new Sn;return e===py||e===my?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),function(t){return i.encloses(t.bounds)}}(t.boundScale,t.boundOrient,t.boundTolerance);r.forEach(function(t){a(t)||(t.opacity=0)})}return e}};Md(Ii,Ee).transform=function(t,e){var n=e.dataflow;if(e.visit(e.ALL,function(t){n.dirty(t)}),e.fields&&e.fields.zindex){var r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}};var by="axis",_y="legend",xy="row-header",wy="row-footer",My="row-title",ky="column-header",Ey="column-footer",Sy="column-title",Ay="fit",Cy="pad",Dy="none",zy="padding",Oy="axis",Ny="title",Ty="frame",Ry="legend",Py="scope",Ly="row-header",qy="row-footer",Uy="column-header",Fy="column-footer",jy=.5,Iy=new Sn;Md(Vi,Ee).transform=function(t,e){var n=e.dataflow;return t.mark.items.forEach(function(e){t.layout&&Yi(n,e,t.layout),Xi(n,e,t)}),e};var $y=Object.freeze({bound:Ti,identifier:Pi,mark:Li,overlap:qi,render:Ii,viewlayout:Vi}),By="log",Wy="pow",Yy="sqrt",Hy="band",Gy="point",Vy="ordinal",Xy="quantile",Jy="quantize",Zy="threshold",Qy="bin-ordinal",Ky="sequential",tb=function(t){return function(e){var n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}},eb=function(t){return function(e){var n,r,i,a,o=t.range(),u=e[0],s=e[1],f=-1;for(s<u&&(r=u,u=s,s=r),i=0,a=o.length;i<a;++i)o[i]>=u&&o[i]<=s&&(f<0&&(f=i),n=i);if(!(f<0))return u=t.invertExtent(o[f]),s=t.invertExtent(o[n]),[void 0===u[0]?u[1]:u[0],void 0===s[1]?s[0]:s[1]]}},nb=function(t,e,n){var r=t-e+2*n;return t?r>0?r:1:0},rb=Array.prototype,ib=rb.map,ab=rb.slice,ob={name:"implicit"},ub=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t},sb="\\s*([+-]?\\d+)\\s*",fb="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",cb="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lb=/^#([0-9a-f]{3})$/,hb=/^#([0-9a-f]{6})$/,db=new RegExp("^rgb\\("+[sb,sb,sb]+"\\)$"),pb=new RegExp("^rgb\\("+[cb,cb,cb]+"\\)$"),gb=new RegExp("^rgba\\("+[sb,sb,sb,fb]+"\\)$"),vb=new RegExp("^rgba\\("+[cb,cb,cb,fb]+"\\)$"),mb=new RegExp("^hsl\\("+[fb,cb,cb]+"\\)$"),yb=new RegExp("^hsla\\("+[fb,cb,cb,fb]+"\\)$"),bb={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};ub(ta,ea,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),ub(oa,aa,Ki(ta,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new oa(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new oa(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"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))+(1===t?")":", "+t+")")}})),ub(fa,sa,Ki(ta,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new fa(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new fa(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new oa(ca(t>=240?t-240:t+120,i,r),ca(t,i,r),ca(t<120?t+240:t-120,i,r),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}}));var _b=Math.PI/180,xb=180/Math.PI,wb=.95047,Mb=1,kb=1.08883,Eb=4/29,Sb=6/29,Ab=3*Sb*Sb,Cb=Sb*Sb*Sb;ub(da,ha,Ki(ta,{brighter:function(t){return new da(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new da(this.l-18*(null==t?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;return t=Mb*ga(t),e=wb*ga(e),n=kb*ga(n),new oa(va(3.2404542*e-1.5371385*t-.4985314*n),va(-.969266*e+1.8760108*t+.041556*n),va(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),ub(ba,ya,Ki(ta,{brighter:function(t){return new ba(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ba(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return la(this).rgb()}}));var Db=-.29227,zb=-.90649,Ob=1.97294,Nb=Ob*zb,Tb=1.78277*Ob,Rb=1.78277*Db- -.14861*zb;ub(xa,_a,Ki(ta,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new xa(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new xa(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*_b,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new oa(255*(e+n*(-.14861*r+1.78277*i)),255*(e+n*(Db*r+zb*i)),255*(e+n*(Ob*r)),this.opacity)}}));var Pb,Lb,qb,Ub,Fb,jb=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,u=r<e-1?t[r+2]:2*a-i;return wa((n-r/e)*e,o,i,a,u)}},Ib=function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],o=t[(r+1)%e],u=t[(r+2)%e];return wa((n-r/e)*e,i,a,o,u)}},$b=function(t){return function(){return t}},Bb=function t(e){function n(t,e){var n=r((t=aa(t)).r,(e=aa(e)).r),i=r(t.g,e.g),a=r(t.b,e.b),o=Sa(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}var r=Ea(e);return n.gamma=t,n}(1),Wb=Aa(jb),Yb=Aa(Ib),Hb=function(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(n=0;n<i;++n)a[n]=Kb(t[n],e[n]);for(;n<r;++n)o[n]=e[n];return function(t){for(n=0;n<i;++n)o[n]=a[n](t);return o}},Gb=function(t,e){var n=new Date;return t=+t,e-=t,function(r){return n.setTime(t+e*r),n}},Vb=function(t,e){return t=+t,e-=t,function(n){return t+e*n}},Xb=function(t,e){var n,r={},i={};null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={});for(n in e)n in t?r[n]=Kb(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Jb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zb=new RegExp(Jb.source,"g"),Qb=function(t,e){var n,r,i,a=Jb.lastIndex=Zb.lastIndex=0,o=-1,u=[],s=[];for(t+="",e+="";(n=Jb.exec(t))&&(r=Zb.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(n=n[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,s.push({i:o,x:Vb(n,r)})),a=Zb.lastIndex;return a<e.length&&(i=e.slice(a),u[o]?u[o]+=i:u[++o]=i),u.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})},Kb=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?$b(e):("number"===r?Vb:"string"===r?(n=ea(e))?(e=n,Bb):Qb:e instanceof ea?Bb:e instanceof Date?Gb:Array.isArray(e)?Hb:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Xb:Vb)(t,e)},t_=function(t,e){return t=+t,e-=t,function(n){return Math.round(t+e*n)}},e_=180/Math.PI,n_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},r_=function(t,e,n,r,i,a){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*e_,skewX:Math.atan(s)*e_,scaleX:o,scaleY:u}},i_=Ca(function(t){return"none"===t?n_:(Pb||(Pb=document.createElement("DIV"),Lb=document.documentElement,qb=document.defaultView),Pb.style.transform=t,t=qb.getComputedStyle(Lb.appendChild(Pb),null).getPropertyValue("transform"),Lb.removeChild(Pb),t=t.slice(7,-1).split(","),r_(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),a_=Ca(function(t){return null==t?n_:(Ub||(Ub=document.createElementNS("http://www.w3.org/2000/svg","g")),Ub.setAttribute("transform",t),(t=Ub.transform.baseVal.consolidate())?(t=t.matrix,r_(t.a,t.b,t.c,t.d,t.e,t.f)):n_)},", ",")",")"),o_=Math.SQRT2,u_=za(ka),s_=za(Sa),f_=Oa(ka),c_=Oa(Sa),l_=Na(ka),h_=Na(Sa),d_=Object.freeze({interpolate:Kb,interpolateArray:Hb,interpolateBasis:jb,interpolateBasisClosed:Ib,interpolateDate:Gb,interpolateNumber:Vb,interpolateObject:Xb,interpolateRound:t_,interpolateString:Qb,interpolateTransformCss:i_,interpolateTransformSvg:a_,interpolateZoom:function(t,e){var n,r,i=t[0],a=t[1],o=t[2],u=e[0],s=e[1],f=e[2],c=u-i,l=s-a,h=c*c+l*l;if(h<1e-12)r=Math.log(f/o)/o_,n=function(t){return[i+t*c,a+t*l,o*Math.exp(o_*t*r)]};else{var d=Math.sqrt(h),p=(f*f-o*o+4*h)/(2*o*2*d),g=(f*f-o*o-4*h)/(2*f*2*d),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);r=(m-v)/o_,n=function(t){var e=t*r,n=Da(v),u=o/(2*d)*(n*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(o_*e+v)-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+u*c,a+u*l,o*n/Da(o_*e+v)]}}return n.duration=1e3*r,n},interpolateRgb:Bb,interpolateRgbBasis:Wb,interpolateRgbBasisClosed:Yb,interpolateHsl:u_,interpolateHslLong:s_,interpolateLab:function(t,e){var n=Sa((t=ha(t)).l,(e=ha(e)).l),r=Sa(t.a,e.a),i=Sa(t.b,e.b),a=Sa(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=a(e),t+""}},interpolateHcl:f_,interpolateHclLong:c_,interpolateCubehelix:l_,interpolateCubehelixLong:h_,quantize:function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}}),p_=function(t){return function(){return t}},g_=function(t){return+t},v_=[0,1],m_=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]},y_=function(t){return(t=m_(Math.abs(t)))?t[1]:NaN},b_=function(t,e){var n=m_(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},__={"":function(t,e){t:for(var n,r=(t=t.toPrecision(e)).length,i=1,a=-1;i<r;++i)switch(t[i]){case".":a=n=i;break;case"0":0===a&&(a=i),n=i;break;case"e":break t;default:a>0&&(a=0)}return a>0?t.slice(0,a)+t.slice(n+1):t},"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return b_(100*t,e)},r:b_,s:function(t,e){var n=m_(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Fb=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+m_(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},x_=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;La.prototype=qa.prototype,qa.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var w_,M_,k_,E_=function(t){return t},S_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],A_=function(t){function e(t){function e(t){var e,r,o,c=v,_=m;if("c"===g)_=y(t)+_,t="";else{var x=(t=+t)<0;if(t=y(Math.abs(t),p),x&&0==+t&&(x=!1),c=(x?"("===f?f:"-":"-"===f||"("===f?"":f)+c,_=_+("s"===g?S_[8+Fb/3]:"")+(x&&"("===f?")":""),b)for(e=-1,r=t.length;++e<r;)if(48>(o=t.charCodeAt(e))||o>57){_=(46===o?i+t.slice(e+1):t.slice(e))+_,t=t.slice(0,e);break}}d&&!l&&(t=n(t,1/0));var w=c.length+t.length+_.length,M=w<h?new Array(h-w+1).join(u):"";switch(d&&l&&(t=n(M+t,M.length?h-_.length:1/0),M=""),s){case"<":t=c+t+_+M;break;case"=":t=c+M+t+_;break;case"^":t=M.slice(0,w=M.length>>1)+c+t+_+M.slice(w);break;default:t=M+c+t+_}return a(t)}var u=(t=La(t)).fill,s=t.align,f=t.sign,c=t.symbol,l=t.zero,h=t.width,d=t.comma,p=t.precision,g=t.type,v="$"===c?r[0]:"#"===c&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",m="$"===c?r[1]:/[%p]/.test(g)?o:"",y=__[g],b=!g||/[defgprs%]/.test(g);return p=null==p?g?6:12:/[gprs]/.test(g)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),e.toString=function(){return t+""},e}var n=t.grouping&&t.thousands?function(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}(t.grouping,t.thousands):E_,r=t.currency,i=t.decimal,a=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(t.numerals):E_,o=t.percent||"%";return{format:e,formatPrefix:function(t,n){var r=e((t=La(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(y_(n)/3))),a=Math.pow(10,-i),o=S_[8+i/3];return function(t){return r(a*t)+o}}}};Ua({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var C_=function(t,e,n){var r,i=t[0],a=t[t.length-1],o=Le(i,a,null==e?10:e);switch((n=La(null==n?",f":n)).type){case"s":var u=Math.max(Math.abs(i),Math.abs(a));return null!=n.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(y_(e)/3)))-y_(Math.abs(t)))}(o,u))||(n.precision=r),k_(n,u);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,y_(e)-y_(t))+1}(o,Math.max(Math.abs(i),Math.abs(a))))||(n.precision=r-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(r=function(t){return Math.max(0,-y_(Math.abs(t)))}(o))||(n.precision=r-2*("%"===n.type))}return M_(n)},D_=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o<a&&(n=r,r=i,i=n,n=a,a=o,o=n),t[r]=e.floor(a),t[i]=e.ceil(o),t},z_=1e3,O_=60*z_,N_=60*O_,T_=24*N_,R_=7*T_,P_=30*T_,L_=365*T_,q_=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})},U_=q_("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),F_=q_("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),j_=q_("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),I_=q_("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5");h_(_a(300,.5,0),_a(-240,.5,1));h_(_a(-100,.75,.35),_a(80,1.5,.8)),h_(_a(260,.75,.35),_a(80,1.5,.8)),_a();var $_=no(q_("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),B_=no(q_("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),W_=no(q_("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Y_=no(q_("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),H_=Array.prototype.map,G_=Array.prototype.slice,V_={identity:Ia,linear:ja,log:Ga,ordinal:Qi,pow:Xa,sqrt:function(){return Xa().exponent(.5)},quantile:Ja,quantize:Za,threshold:Qa,time:function(){return eo(zp,Dp,Sp,Ep,kp,Mp,wp,bp,jp).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},utc:function(){return eo(Up,qp,Rp,Tp,Np,Op,wp,bp,$p).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},band:ro,point:function(){return io(ro().paddingInner(1))},sequential:so,"bin-linear":oo,"bin-ordinal":uo};for(var X_ in V_)fo(X_,V_[X_]);var J_=co("4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac"),Z_=co("4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"),Q_=new Array(3).concat("67a9cff7f7f7f1a340","0571b092c5defdb863e66101","0571b092c5def7f7f7fdb863e66101","2166ac67a9cfd1e5f0fee0b6f1a340b35806","2166ac67a9cfd1e5f0f7f7f7fee0b6f1a340b35806","2166ac4393c392c5ded1e5f0fee0b6fdb863e08214b35806","2166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b35806","0530612166ac4393c392c5ded1e5f0fee0b6fdb863e08214b358067f3b08","0530612166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b358067f3b08").map(co),K_=function(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n},tx=K_("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),ex=K_("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),nx=K_("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),rx=K_("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),ix=K_("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ax=K_("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),ox=K_("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),ux=K_("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),sx=function(t){return Wb(t[t.length-1])},fx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(K_),cx=sx(fx),lx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(K_),hx=sx(lx),dx=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(K_),px=sx(dx),gx=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(K_),vx=sx(gx),mx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(K_),yx=sx(mx),bx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(K_),_x=sx(bx),xx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(K_),wx=sx(xx),Mx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(K_),kx=sx(Mx),Ex=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(K_),Sx=sx(Ex),Ax=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(K_),Cx=sx(Ax),Dx=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(K_),zx=sx(Dx),Ox=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(K_),Nx=sx(Ox),Tx=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(K_),Rx=sx(Tx),Px=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(K_),Lx=sx(Px),qx=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(K_),Ux=sx(qx),Fx=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(K_),jx=sx(Fx),Ix=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(K_),$x=sx(Ix),Bx=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(K_),Wx=sx(Bx),Yx=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(K_),Hx=sx(Yx),Gx=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(K_),Vx=sx(Gx),Xx=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(K_),Jx=sx(Xx),Zx=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(K_),Qx=sx(Zx),Kx=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(K_),tw=sx(Kx),ew=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(K_),nw=sx(ew),rw=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(K_),iw=sx(rw),aw=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(K_),ow=sx(aw),uw=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(K_),sw=sx(uw),fw=Object.freeze({schemeAccent:tx,schemeDark2:ex,schemePaired:nx,schemePastel1:rx,schemePastel2:ix,schemeSet1:ax,schemeSet2:ox,schemeSet3:ux,interpolateBrBG:cx,schemeBrBG:fx,interpolatePRGn:hx,schemePRGn:lx,interpolatePiYG:px,schemePiYG:dx,interpolatePuOr:vx,schemePuOr:gx,interpolateRdBu:yx,schemeRdBu:mx,interpolateRdGy:_x,schemeRdGy:bx,interpolateRdYlBu:wx,schemeRdYlBu:xx,interpolateRdYlGn:kx,schemeRdYlGn:Mx,interpolateSpectral:Sx,schemeSpectral:Ex,interpolateBuGn:Cx,schemeBuGn:Ax,interpolateBuPu:zx,schemeBuPu:Dx,interpolateGnBu:Nx,schemeGnBu:Ox,interpolateOrRd:Rx,schemeOrRd:Tx,interpolatePuBuGn:Lx,schemePuBuGn:Px,interpolatePuBu:Ux,schemePuBu:qx,interpolatePuRd:jx,schemePuRd:Fx,interpolateRdPu:$x,schemeRdPu:Ix,interpolateYlGnBu:Wx,schemeYlGnBu:Bx,interpolateYlGn:Hx,schemeYlGn:Yx,interpolateYlOrBr:Vx,schemeYlOrBr:Gx,interpolateYlOrRd:Jx,schemeYlOrRd:Xx,interpolateBlues:Qx,schemeBlues:Zx,interpolateGreens:tw,schemeGreens:Kx,interpolateGreys:nw,schemeGreys:ew,interpolatePurples:iw,schemePurples:rw,interpolateReds:ow,schemeReds:aw,interpolateOranges:sw,schemeOranges:uw}),cw={blueorange:Q_},lw={category10:U_,category20:I_,category20b:F_,category20c:j_,accent:tx,dark2:ex,paired:nx,pastel1:rx,pastel2:ix,set1:ax,set2:ox,set3:ux,tableau10:J_,tableau20:Z_,viridis:$_,magma:B_,inferno:W_,plasma:Y_,blueorange:Wb(hd(Q_))};lo("blues","Blues"),lo("greens","Greens"),lo("greys","Greys"),lo("purples","Purples"),lo("reds","Reds"),lo("oranges","Oranges"),lo("brownbluegreen","BrBG"),lo("purplegreen","PRGn"),lo("pinkyellowgreen","PiYG"),lo("purpleorange","PuOr"),lo("redblue","RdBu"),lo("redgrey","RdGy"),lo("redyellowblue","RdYlBu"),lo("redyellowgreen","RdYlGn"),lo("spectral","Spectral"),lo("bluegreen","BuGn"),lo("bluepurple","BuPu"),lo("greenblue","GnBu"),lo("orangered","OrRd"),lo("purplebluegreen","PuBuGn"),lo("purpleblue","PuBu"),lo("purplered","PuRd"),lo("redpurple","RdPu"),lo("yellowgreenblue","YlGnBu"),lo("yellowgreen","YlGn"),lo("yelloworangebrown","YlOrBr"),lo("yelloworangered","YlOrRd");var hw=function(t,e){if(arguments.length>1)return lw[t]=e,this;var n=t.split("-");return t=n[0],(n=+n[1]+1)&&cw.hasOwnProperty(t)?cw[t][n-1]:!n&&lw.hasOwnProperty(t)?lw[t]:void 0},dw={millisecond:bp,second:wp,minute:Mp,hour:kp,day:Ep,week:Sp,month:Dp,year:zp},pw={millisecond:bp,second:wp,minute:Op,hour:Np,day:Tp,week:Rp,month:qp,year:Up};Md(Mo,Ee).transform=function(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,i=t.scale,a=null==t.count?t.values?t.values.length:10:bo(i,t.count),o=t.format||wo(i,a,t.formatSpecifier),u=t.values?_o(i,t.values,a):xo(i,a);return r&&(n.rem=r),r=u.map(function(t,e){return _({index:e/(u.length-1),value:t,label:o(t)})}),t.extra&&r.push(_({index:-1,extra:{value:r[0].value},label:""})),n.source=r,n.add=r,this.value=r,n};Md(ko,Ee).transform=function(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||function(){return _({})},a=t.key||y,o=this.value;return Zh(r.encode)&&(r.encode=null),o&&(t.modified("key")||e.modified(a))&&Xh("DataJoin does not support modified key function or fields."),o||(e=e.addAll(),this.value=o=wd().test(Eo),o.lookup=function(t){return o.get(a(t))}),e.visit(e.ADD,function(t){var e=a(t),n=o.get(e);n?n.exit?(o.empty--,r.add.push(n)):r.mod.push(n):(o.set(e,n=i(t)),r.add.push(n)),n.datum=t,n.exit=!1}),e.visit(e.MOD,function(t){var e=a(t),n=o.get(e);n&&(n.datum=t,r.mod.push(n))}),e.visit(e.REM,function(t){var e=a(t),n=o.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++o.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),t.clean&&o.empty>n.cleanThreshold&&n.runAfter(o.clean),r};Md(So,Ee).transform=function(t,e){var n=e.fork(e.ADD_REM),r=t.encoders,i=e.encode;if(Zh(i)){if(!n.changed()&&!i.every(function(t){return r[t]}))return e.StopPropagation;i=i[0]}var a="enter"===i,o=r.update||ud,u=r.enter||ud,s=r.exit||ud,f=(i&&!a?r[i]:o)||ud;if(e.changed(e.ADD)&&(e.visit(e.ADD,function(e){u(e,t),o(e,t),f!==ud&&f!==o&&f(e,t)}),n.modifies(u.output),n.modifies(o.output),f!==ud&&f!==o&&n.modifies(f.output)),e.changed(e.REM)&&s!==ud&&(e.visit(e.REM,function(e){s(e,t)}),n.modifies(s.output)),a||f!==ud){var c=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(c,function(e){var r=u(e,t);(f(e,t)||r)&&n.mod.push(e)}),n.mod.length&&n.modifies(u.output)):e.visit(c,function(e){f(e,t)&&n.mod.push(e)}),n.mod.length&&n.modifies(f.output)}return n.changed()?n:e.StopPropagation};var gw={};gw[Xy]=function(t){var e=[-1/0].concat(t.quantiles());return e.max=1/0,e},gw[Jy]=function(t){var e=t.domain(),n=e[0],r=hd(e),i=t.range().length,a=new Array(i),o=0;for(a[0]=-1/0;++o<i;)a[o]=(o*r-(o-i)*n)/i;return a.max=1/0,a},gw[Zy]=function(t){var e=[-1/0].concat(t.domain());return e.max=1/0,e},gw["bin-linear"]=Ao,gw[Qy]=Ao;Md(zo,Ee).transform=function(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=0,i=this.value,a="gradient"===t.type,o=t.scale,u=null==t.count?5:bo(o,t.count),s=t.format||wo(o,u,t.formatSpecifier),f=t.values||function(t,e,n){if(n)return t.domain();var r=gw[t.type];return r?r(t):xo(t,e)}(o,u,a);if(s=Co(o,s),i&&(n.rem=i),a)var c=t.values?o.domain():f,l=po(o,c[0],hd(c));else{var h,d=t.size;gd(d)?(t.values||0!==o(f[0])||(f=f.slice(1)),h=f.reduce(function(e,n){return Math.max(e,d(n,t))},0)):d=md(h=d||8)}return i=f.map(function(e,n){var i=_({index:n,label:s(e,n,f),value:e});return a?i.perc=l(e):(i.offset=h,i.size=d(e,t),i.total=Math.round(r),r+=i.size),i}),n.source=i,n.add=i,this.value=i,n};var vw=wd({line:No,"line-radial":function(t,e,n,r){return No(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},arc:To,"arc-radial":function(t,e,n,r){return To(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},curve:Ro,"curve-radial":function(t,e,n,r){return Ro(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},"orthogonal-horizontal":function(t,e,n,r){return"M"+t+","+e+"V"+r+"H"+n},"orthogonal-vertical":function(t,e,n,r){return"M"+t+","+e+"H"+n+"V"+r},"orthogonal-radial":function(t,e,n,r){var i=Math.cos(t),a=Math.sin(t),o=Math.cos(n),u=Math.sin(n);return"M"+e*i+","+e*a+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*o+","+e*u+"L"+r*o+","+r*u},"diagonal-horizontal":function(t,e,n,r){var i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":function(t,e,n,r){var i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":function(t,e,n,r){var i=Math.cos(t),a=Math.sin(t),o=Math.cos(n),u=Math.sin(n),s=(e+r)/2;return"M"+e*i+","+e*a+"C"+s*i+","+s*a+" "+s*o+","+s*u+" "+r*o+","+r*u}});Oo.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"as",type:"string",default:"path"}]};Md(Oo,Ee).transform=function(t,e){var n=t.sourceX||function(t){return t.source.x},r=t.sourceY||function(t){return t.source.y},i=t.targetX||function(t){return t.target.x},a=t.targetY||function(t){return t.target.y},o=t.as||"path",u=t.orient||"vertical",s=t.shape||"line",f=vw.get(s+"-"+u)||vw.get(s);return f||Xh("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,function(t){t[o]=f(n(t),r(t),i(t),a(t))}),e.reflow(t.modified()).modifies(o)},Po.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};Md(Po,Ee).transform=function(t,e){var n,r,i,a=t.as||["startAngle","endAngle"],o=a[0],u=a[1],s=t.field||ad,f=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,l=e.source,h=l.map(s),d=h.length,p=f,g=(c-f)/function(t,e){var n,r=t.length,i=-1,a=0;if(null==e)for(;++i<r;)(n=+t[i])&&(a+=n);else for(;++i<r;)(n=+e(t[i],i,t))&&(a+=n);return a}(h),v=mg(d);for(t.sort&&v.sort(function(t,e){return h[t]-h[e]}),n=0;n<d;++n)i=h[v[n]],(r=l[v[n]])[o]=p,r[u]=p+=i*g;return this.value=h,e.reflow(t.modified()).modifies(a)};var mw=5,yw=Pd(["linear",Wy,Yy]),bw=Pd(["linear",By,Wy,Yy,"time","utc"]),_w=Pd(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","nice","zero","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);Md(Lo,Ee).transform=function(t,e){var n,r=e.dataflow,i=this.value;i&&!t.modified("type")||(this.value=i=fo((t.type||"linear").toLowerCase())());for(n in t)if(!_w[n]){if("padding"===n&&bw[i.type])continue;gd(i[n])?i[n](t[n]):r.warn("Unsupported scale property: "+n)}return Uo(i,t,qo(i,t,r)),e.fork(e.NO_SOURCE|e.NO_FIELDS)};Md(Io,Ee).transform=function(t,e){var n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(t.sort),this.modified(n),e};$o.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:["y0","y1"]}]};Md($o,Ee).transform=function(t,e){var n,r,i,a,o=t.as||["y0","y1"],u=o[0],s=o[1],f=t.field||ad,c="center"===t.offset?function(t,e,n,r,i){for(var a,o=(e-t.sum)/2,u=t.length,s=0;s<u;++s)(a=t[s])[r]=o,a[i]=o+=Math.abs(n(a))}:"normalize"===t.offset?function(t,e,n,r,i){for(var a,o=1/t.sum,u=0,s=t.length,f=0,c=0;f<s;++f)(a=t[f])[r]=u,a[i]=u=o*(c+=Math.abs(n(a)))}:function(t,e,n,r,i){for(var a,o,u=0,s=0,f=t.length,c=0;c<f;++c)(a=n(o=t[c]))<0?(o[r]=s,o[i]=s+=a):(o[r]=u,o[i]=u+=a)};for(r=0,i=(n=function(t,e,n,r){var i,a,o,u,s,f,c,l,h,d=[],p=function(t){return t(s)};if(null==e)d.push(t.slice());else for(i={},a=0,o=t.length;a<o;++a)s=t[a],(c=i[f=e.map(p)])||(i[f]=c=[],d.push(c)),c.push(s);for(f=0,h=0,u=d.length;f<u;++f){for(a=0,l=0,o=(c=d[f]).length;a<o;++a)l+=Math.abs(r(c[a]));c.sum=l,l>h&&(h=l),n&&c.sort(n)}return d.max=h,d}(e.source,t.groupby,t.sort,f)).length,a=n.max;r<i;++r)c(n[r],a,f,u,s);return e.reflow(t.modified()).modifies(o)};var xw=Object.freeze({axisticks:Mo,datajoin:ko,encode:So,legendentries:zo,linkpath:Oo,pie:Po,scale:Lo,sortitems:Io,stack:$o,validTicks:_o}),ww=Array.prototype.slice,Mw=function(t,e){return t-e},kw=function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r},Ew=function(t){return function(){return t}},Sw=function(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=Bo(t,e[r]))return n;return 0},Aw=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,.5],[.5,1]],[[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,1.5]],[[1.5,1],[1,.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],Cw=function(){function t(t){var n=a(t);if(Array.isArray(n))n=n.slice().sort(Mw);else{var u=vg(t),s=u[0],f=u[1];n=Le(s,f,n),n=mg(Math.floor(s/n)*n,Math.floor(f/n)*n,n)}return n.map(function(n){var a=[],u=[];return function(t,n,a){function o(t){var n,r,i=[t[0][0]+u,t[0][1]+s],o=[t[1][0]+u,t[1][1]+s],f=e(i),c=e(o);(n=p[f])?(r=d[c])?(delete p[n.end],delete d[r.start],n===r?(n.ring.push(o),a(n.ring)):d[n.start]=p[r.end]={start:n.start,end:r.end,ring:n.ring.concat(r.ring)}):(delete p[n.end],n.ring.push(o),p[n.end=c]=n):(n=d[c])?(r=p[f])?(delete d[n.start],delete p[r.end],n===r?(n.ring.push(o),a(n.ring)):d[r.start]=p[n.end]={start:r.start,end:n.end,ring:r.ring.concat(n.ring)}):(delete d[n.start],n.ring.unshift(i),d[n.start=f]=n):d[f]=p[c]={start:f,end:c,ring:[i,o]}}var u,s,f,c,l,h,d=new Array,p=new Array;u=s=-1,c=t[0]>=n,Aw[c<<1].forEach(o);for(;++u<r-1;)f=c,c=t[u+1]>=n,Aw[f|c<<1].forEach(o);Aw[c<<0].forEach(o);for(;++s<i-1;){for(u=-1,c=t[s*r+r]>=n,l=t[s*r]>=n,Aw[c<<1|l<<2].forEach(o);++u<r-1;)f=c,c=t[s*r+r+u+1]>=n,h=l,l=t[s*r+u+1]>=n,Aw[f|c<<1|l<<2|h<<3].forEach(o);Aw[c|l<<3].forEach(o)}u=-1,l=t[s*r]>=n,Aw[l<<2].forEach(o);for(;++u<r-1;)h=l,l=t[s*r+u+1]>=n,Aw[l<<2|h<<3].forEach(o);Aw[l<<3].forEach(o)}(t,n,function(e){o(e,t,n),kw(e)>0?a.push([e]):u.push(e)}),u.forEach(function(t){for(var e,n=0,r=a.length;n<r;++n)if(-1!==Sw((e=a[n])[0],t))return void e.push(t)}),a}).map(function(t,e){return{type:"MultiPolygon",value:n[e],coordinates:t}})}function e(t){return 2*t[0]+t[1]*(r+1)*4}function n(t,e,n){t.forEach(function(t){var a,o=t[0],u=t[1],s=0|o,f=0|u,c=e[f*r+s];o>0&&o<r&&s===o&&(a=e[f*r+s-1],t[0]=o+(n-a)/(c-a)-.5),u>0&&u<i&&f===u&&(a=e[(f-1)*r+s],t[1]=u+(n-a)/(c-a)-.5)})}var r=1,i=1,a=wg,o=n;return t.size=function(e){if(!arguments.length)return[r,i];var n=Math.ceil(e[0]),a=Math.ceil(e[1]);if(!(n>0&&a>0))throw new Error("invalid size");return r=n,i=a,t},t.thresholds=function(e){return arguments.length?(a="function"==typeof e?e:Ew(Array.isArray(e)?ww.call(e):e),t):a},t.smooth=function(e){return arguments.length?(o=e?n:function(){},t):o===n},t},Dw=["values","size"],zw=["x","y","size","cellSize","bandwidth"];Vo.Definition={type:"Contour",metadata:{generates:!0,source:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"number",default:!1},{name:"thresholds",type:"number",array:!0}]};Md(Vo,Ee).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i,a=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=t.count||10;return t.values?(n=Cw(),r=Dw,i=t.values):(n=function(){function t(t){var n=new Float32Array(d*p),r=new Float32Array(d*p);t.forEach(function(t,e,r){var i=o(t,e,r)+h>>l,a=u(t,e,r)+h>>l;i>=0&&i<d&&a>=0&&a<p&&++n[i+a*d]}),Wo({width:d,height:p,data:n},{width:d,height:p,data:r},c>>l),Yo({width:d,height:p,data:r},{width:d,height:p,data:n},c>>l),Wo({width:d,height:p,data:n},{width:d,height:p,data:r},c>>l),Yo({width:d,height:p,data:r},{width:d,height:p,data:n},c>>l),Wo({width:d,height:p,data:n},{width:d,height:p,data:r},c>>l),Yo({width:d,height:p,data:r},{width:d,height:p,data:n},c>>l);var i=g(n);if(!Array.isArray(i)){var a=kg(n);i=Le(0,a,i),(i=mg(0,Math.floor(a/i)*i,i)).shift()}return Cw().thresholds(i).size([d,p])(n).map(e)}function e(t){return t.value*=Math.pow(2,-2*l),t.coordinates.forEach(n),t}function n(t){t.forEach(r)}function r(t){t.forEach(i)}function i(t){t[0]=t[0]*Math.pow(2,l)-h,t[1]=t[1]*Math.pow(2,l)-h}function a(){return h=3*c,d=s+2*h>>l,p=f+2*h>>l,t}var o=Ho,u=Go,s=960,f=500,c=20,l=2,h=3*c,d=s+2*h>>l,p=f+2*h>>l,g=Ew(20);return t.x=function(e){return arguments.length?(o="function"==typeof e?e:Ew(+e),t):o},t.y=function(e){return arguments.length?(u="function"==typeof e?e:Ew(+e),t):u},t.size=function(t){if(!arguments.length)return[s,f];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return s=e,f=n,a()},t.cellSize=function(t){if(!arguments.length)return 1<<l;if(!((t=+t)>=1))throw new Error("invalid cell size");return l=Math.floor(Math.log(t)/Math.LN2),a()},t.thresholds=function(e){return arguments.length?(g="function"==typeof e?e:Ew(Array.isArray(e)?ww.call(e):e),t):g},t.bandwidth=function(t){if(!arguments.length)return Math.sqrt(c*(c+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return c=Math.round((Math.sqrt(4*t*t+1)-1)/2),a()},t}(),r=zw,i=e.materialize(e.SOURCE).source),n.thresholds(t.thresholds||(t.nice?o:function(t){return function(e){for(var n=vg(e),r=n[0],i=n[1]-r,a=[],o=1;o<=t;++o)a.push(r+i*o/(t+1));return a}}(o))),r.forEach(function(e){null!=t[e]&&n[e](t[e])}),this.value&&(a.rem=this.value),this.value=a.source=a.add=n(i).map(_),a};var Ow="FeatureCollection";Xo.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};Md(Xo,Ee).transform=function(t,e){var r,i=this._features,a=this._points,o=t.fields,u=o&&o[0],s=o&&o[1],f=t.geojson,c=e.ADD;r=t.modified()||e.changed(e.REM)||e.modified(n(f))||u&&e.modified(n(u))||s&&e.modified(n(s)),this.value&&!r||(c=e.SOURCE,this._features=i=[],this._points=a=[]),f&&e.visit(c,function(t){i.push(f(t))}),u&&s&&(e.visit(c,function(t){var e=u(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&a.push([e,n])}),i=i.concat({type:"Feature",geometry:{type:"MultiPoint",coordinates:a}})),this.value={type:Ow,features:i}};var Nw=function(){return new Jo};Jo.prototype={constructor:Jo,reset:function(){this.s=this.t=0},add:function(t){Zo(Tw,t,this.t),Zo(this,Tw.s,this.s),this.s?this.t+=Tw.t:this.s=Tw.t},valueOf:function(){return this.s}};var Tw=new Jo,Rw=1e-6,Pw=Math.PI,Lw=Pw/2,qw=Pw/4,Uw=2*Pw,Fw=180/Pw,jw=Pw/180,Iw=Math.abs,$w=Math.atan,Bw=Math.atan2,Ww=Math.cos,Yw=Math.ceil,Hw=Math.exp,Gw=Math.log,Vw=Math.pow,Xw=Math.sin,Jw=Math.sign||function(t){return t>0?1:t<0?-1:0},Zw=Math.sqrt,Qw=Math.tan,Kw={Feature:function(t,e){eu(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)eu(n[r].geometry,e)}},tM={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){nu(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)nu(n[r],e,0)},Polygon:function(t,e){ru(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ru(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)eu(n[r],e)}},eM=function(t,e){t&&Kw.hasOwnProperty(t.type)?Kw[t.type](t,e):eu(t,e)},nM=(Nw(),Nw(),Nw(),function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n});lu.invert=lu;var rM,iM,aM,oM,uM,sM,fM,cM,lM=function(t){function e(e){return e=t(e[0]*jw,e[1]*jw),e[0]*=Fw,e[1]*=Fw,e}return t=hu(t[0]*jw,t[1]*jw,t.length>2?t[2]*jw:0),e.invert=function(e){return e=t.invert(e[0]*jw,e[1]*jw),e[0]*=Fw,e[1]*=Fw,e},e},hM=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:tu,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},dM=function(t,e){return Iw(t[0]-e[0])<Rw&&Iw(t[1]-e[1])<Rw},pM=function(t,e,n,r,i){var a,o,u=[],s=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(dM(r,o)){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);i.lineEnd()}else u.push(n=new mu(r,t,null,!0)),s.push(n.o=new mu(r,null,n,!1)),u.push(n=new mu(o,t,null,!1)),s.push(n.o=new mu(o,null,n,!0))}}),u.length){for(s.sort(e),yu(u),yu(s),a=0,o=s.length;a<o;++a)s[a].e=n=!n;for(var f,c,l=u[0];;){for(var h=l,d=!0;h.v;)if((h=h.n)===l)return;f=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,o=f.length;a<o;++a)i.point((c=f[a])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(f=h.p.z,a=f.length-1;a>=0;--a)i.point((c=f[a])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}},gM=Nw(),vM=function(t,e){var n=e[0],r=e[1],i=[Xw(n),-Ww(n),0],a=0,o=0;gM.reset();for(var u=0,s=t.length;u<s;++u)if(c=(f=t[u]).length)for(var f,c,l=f[c-1],h=l[0],d=l[1]/2+qw,p=Xw(d),g=Ww(d),v=0;v<c;++v,h=y,p=_,g=x,l=m){var m=f[v],y=m[0],b=m[1]/2+qw,_=Xw(b),x=Ww(b),w=y-h,M=w>=0?1:-1,k=M*w,E=k>Pw,S=p*_;if(gM.add(Bw(S*M*Xw(k),g*x+S*Ww(k))),a+=E?w+M*Uw:w,E^h>=n^y>=n){var A=uu(au(l),au(m));cu(A);var C=uu(i,A);cu(C);var D=(E^w>=0?-1:1)*Ko(C[2]);(r>D||r===D&&(A[0]||A[1]))&&(o+=E^w>=0?1:-1)}}return(a<-Rw||a<Rw&&gM<-Rw)^1&o},mM=function(t,e,n,r){return function(i){function a(e,n){t(e,n)&&i.point(e,n)}function o(t,e){g.point(t,e)}function u(){b.point=o,g.lineStart()}function s(){b.point=a,g.lineEnd()}function f(t,e){p.push([t,e]),m.point(t,e)}function c(){m.lineStart(),p=[]}function l(){f(p[0][0],p[0][1]),m.lineEnd();var t,e,n,r,a=m.clean(),o=v.result(),u=o.length;if(p.pop(),h.push(p),p=null,u)if(1&a){if(n=o[0],(e=n.length-1)>0){for(y||(i.polygonStart(),y=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else u>1&&2&a&&o.push(o.pop().concat(o.shift())),d.push(o.filter(bu))}var h,d,p,g=e(i),v=hM(),m=e(v),y=!1,b={point:a,lineStart:u,lineEnd:s,polygonStart:function(){b.point=f,b.lineStart=c,b.lineEnd=l,d=[],h=[]},polygonEnd:function(){b.point=a,b.lineStart=u,b.lineEnd=s,d=Eg(d);var t=vM(h,r);d.length?(y||(i.polygonStart(),y=!0),pM(d,_u,t,n,i)):t&&(y||(i.polygonStart(),y=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),y&&(i.polygonEnd(),y=!1),d=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};return b}},yM=mM(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var u=a>0?Pw:-Pw,s=Iw(a-n);Iw(s-Pw)<Rw?(t.point(n,r=(r+o)/2>0?Lw:-Lw),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(a,r),e=0):i!==u&&s>=Pw&&(Iw(n-i)<Rw&&(n-=i*Rw),Iw(a-u)<Rw&&(a-=u*Rw),r=function(t,e,n,r){var i,a,o=Xw(t-n);return Iw(o)>Rw?$w((Xw(e)*(a=Ww(r))*Xw(n)-Xw(r)*(i=Ww(e))*Xw(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=a,r=o),i=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Lw,r.point(-Pw,i),r.point(0,i),r.point(Pw,i),r.point(Pw,0),r.point(Pw,-i),r.point(0,-i),r.point(-Pw,-i),r.point(-Pw,0),r.point(-Pw,i);else if(Iw(t[0]-e[0])>Rw){var a=t[0]<e[0]?Pw:-Pw;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])},[-Pw,-Lw]),bM=function(t){function e(t,e){return Ww(t)*Ww(e)>i}function n(t,e,n){var r=[1,0,0],a=uu(au(t),au(e)),o=ou(a,a),u=a[0],s=o-u*u;if(!s)return!n&&t;var f=i*o/s,c=-i*u/s,l=uu(r,a),h=fu(r,f);su(h,fu(a,c));var d=l,p=ou(h,d),g=ou(d,d),v=p*p-g*(ou(h,h)-1);if(!(v<0)){var m=Zw(v),y=fu(d,(-p-m)/g);if(su(y,h),y=iu(y),!n)return y;var b,_=t[0],x=e[0],w=t[1],M=e[1];x<_&&(b=_,_=x,x=b);var k=x-_,E=Iw(k-Pw)<Rw;if(!E&&M<w&&(b=w,w=M,M=b),E||k<Rw?E?w+M>0^y[1]<(Iw(y[0]-_)<Rw?w:M):w<=y[1]&&y[1]<=M:k>Pw^(_<=y[0]&&y[0]<=x)){var S=fu(d,(-p+m)/g);return su(S,h),[y,iu(S)]}}}function r(e,n){var r=o?t:Pw-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var i=Ww(t),a=6*jw,o=i>0,u=Iw(i)>Rw;return mM(e,function(t){var i,a,s,f,c;return{lineStart:function(){f=s=!1,c=1},point:function(l,h){var d,p=[l,h],g=e(l,h),v=o?g?0:r(l,h):g?r(l+(l<0?Pw:-Pw),h):0;if(!i&&(f=s=g)&&t.lineStart(),g!==s&&(!(d=n(i,p))||dM(i,d)||dM(p,d))&&(p[0]+=Rw,p[1]+=Rw,g=e(p[0],p[1])),g!==s)c=0,g?(t.lineStart(),d=n(p,i),t.point(d[0],d[1])):(d=n(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(u&&i&&o^g){var m;v&a||!(m=n(p,i,!0))||(c=0,o?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||i&&dM(i,p)||t.point(p[0],p[1]),i=p,s=g,a=v},lineEnd:function(){s&&t.lineEnd(),i=null},clean:function(){return c|(f&&s)<<1}}},function(e,n,r,i){!function(t,e,n,r,i,a){if(n){var o=Ww(e),u=Xw(e),s=r*n;null==i?(i=e+r*Uw,a=e-s/2):(i=vu(o,i),a=vu(o,a),(r>0?i<a:i>a)&&(i+=r*Uw));for(var f,c=i;r>0?c>a:c<a;c-=s)f=iu([o,-u*Ww(c),-u*Xw(c)]),t.point(f[0],f[1])}}(i,t,a,r,e,n)},o?[0,-t]:[-Pw,t-Pw])},_M=function(t,e,n,r,i,a){var o,u=t[0],s=t[1],f=0,c=1,l=e[0]-u,h=e[1]-s;if(o=n-u,l||!(o>0)){if(o/=l,l<0){if(o<f)return;o<c&&(c=o)}else if(l>0){if(o>c)return;o>f&&(f=o)}if(o=i-u,l||!(o<0)){if(o/=l,l<0){if(o>c)return;o>f&&(f=o)}else if(l>0){if(o<f)return;o<c&&(c=o)}if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o<f)return;o<c&&(c=o)}else if(h>0){if(o>c)return;o>f&&(f=o)}if(o=a-s,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>f&&(f=o)}else if(h>0){if(o<f)return;o<c&&(c=o)}return f>0&&(t[0]=u+f*l,t[1]=s+f*h),c<1&&(e[0]=u+c*l,e[1]=s+c*h),!0}}}}},xM=1e9,wM=-xM,MM=(Nw(),function(t){return t}),kM=Nw(),EM=Nw(),SM={point:tu,lineStart:tu,lineEnd:tu,polygonStart:function(){SM.lineStart=ku,SM.lineEnd=Au},polygonEnd:function(){SM.lineStart=SM.lineEnd=SM.point=tu,kM.add(Iw(EM)),EM.reset()},result:function(){var t=kM/2;return kM.reset(),t}},AM=1/0,CM=AM,DM=-AM,zM=DM,OM={point:function(t,e){t<AM&&(AM=t),t>DM&&(DM=t),e<CM&&(CM=e),e>zM&&(zM=e)},lineStart:tu,lineEnd:tu,polygonStart:tu,polygonEnd:tu,result:function(){var t=[[AM,CM],[DM,zM]];return DM=zM=-(CM=AM=1/0),t}},NM=0,TM=0,RM=0,PM=0,LM=0,qM=0,UM=0,FM=0,jM=0,IM={point:Cu,lineStart:Du,lineEnd:Nu,polygonStart:function(){IM.lineStart=Tu,IM.lineEnd=Ru},polygonEnd:function(){IM.point=Cu,IM.lineStart=Du,IM.lineEnd=Nu},result:function(){var t=jM?[UM/jM,FM/jM]:qM?[PM/qM,LM/qM]:RM?[NM/RM,TM/RM]:[NaN,NaN];return NM=TM=RM=PM=LM=qM=UM=FM=jM=0,t}};qu.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(){0===this._line&&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,Uw)}},result:tu};var $M,BM,WM,YM,HM,GM=Nw(),VM={point:tu,lineStart:function(){VM.point=Uu},lineEnd:function(){$M&&Fu(BM,WM),VM.point=tu},polygonStart:function(){$M=!0},polygonEnd:function(){$M=null},result:function(){var t=+GM;return GM.reset(),t}};ju.prototype={_radius:4.5,_circle:Iu(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&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:null==this._circle&&(this._circle=Iu(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var XM=function(t,e){function n(t){return t&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),eM(t,r(i))),i.result()}var r,i,a=4.5;return n.area=function(t){return eM(t,r(SM)),SM.result()},n.measure=function(t){return eM(t,r(VM)),VM.result()},n.bounds=function(t){return eM(t,r(OM)),OM.result()},n.centroid=function(t){return eM(t,r(IM)),IM.result()},n.projection=function(e){return arguments.length?(r=null==e?(t=null,MM):(t=e).stream,n):t},n.context=function(t){return arguments.length?(i=null==t?(e=null,new ju):new qu(e=t),"function"!=typeof a&&i.pointRadius(a),n):e},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(t).context(e)};Bu.prototype={constructor:Bu,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()}};var JM=16,ZM=Ww(30*jw),QM=function(t,e){return+e?function(t,e){function n(r,i,a,o,u,s,f,c,l,h,d,p,g,v){var m=f-r,y=c-i,b=m*m+y*y;if(b>4*e&&g--){var _=o+h,x=u+d,w=s+p,M=Zw(_*_+x*x+w*w),k=Ko(w/=M),E=Iw(Iw(w)-1)<Rw||Iw(a-l)<Rw?(a+l)/2:Bw(x,_),S=t(E,k),A=S[0],C=S[1],D=A-r,z=C-i,O=y*D-m*z;(O*O/b>e||Iw((m*D+y*z)/b-.5)>.3||o*h+u*d+s*p<ZM)&&(n(r,i,a,o,u,s,A,C,E,_/=M,x/=M,w,g,v),v.point(A,C),n(A,C,E,_,x,w,f,c,l,h,d,p,g,v))}}return function(e){function r(n,r){n=t(n,r),e.point(n[0],n[1])}function i(){m=NaN,w.point=a,e.lineStart()}function a(r,i){var a=au([r,i]),o=t(r,i);n(m,y,v,b,_,x,m=o[0],y=o[1],v=r,b=a[0],_=a[1],x=a[2],JM,e),e.point(m,y)}function o(){w.point=r,e.lineEnd()}function u(){i(),w.point=s,w.lineEnd=f}function s(t,e){a(c=t,e),l=m,h=y,d=b,p=_,g=x,w.point=a}function f(){n(m,y,v,b,_,x,l,h,c,d,p,g,JM,e),w.lineEnd=o,o()}var c,l,h,d,p,g,v,m,y,b,_,x,w={point:r,lineStart:i,lineEnd:o,polygonStart:function(){e.polygonStart(),w.lineStart=u},polygonEnd:function(){e.polygonEnd(),w.lineStart=i}};return w}}(t,e):function(t){return $u({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)},KM=$u({point:function(t,e){this.stream.point(t*jw,e*jw)}}),tk=function(){return Zu(Qu).scale(155.424).center([0,33.6442])},ek=function(){return tk().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},nk=Ku(function(t){return Zw(2/(1+t))});nk.invert=ts(function(t){return 2*Ko(t/2)});var rk=Ku(function(t){return(t=Qo(t))&&t/Xw(t)});rk.invert=ts(function(t){return t});es.invert=function(t,e){return[t,2*$w(Hw(e))-Lw]};as.invert=as;us.invert=ts($w);ss.invert=ts(Ko);fs.invert=ts(function(t){return 2*$w(t)});cs.invert=function(t,e){return[-e,2*$w(Hw(t))-Lw]};var ik=XM(),ak=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"],ok={albers:ek,albersusa:function(){function t(t){var e=t[0],n=t[1];return u=null,i.point(e,n),u||(a.point(e,n),u)||(o.point(e,n),u)}function e(){return n=r=null,t}var n,r,i,a,o,u,s=ek(),f=tk().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=tk().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){u=[t,e]}};return t.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?f:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:s).invert(t)},t.stream=function(t){return n&&r===t?n:n=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([s.stream(r=t),f.stream(t),c.stream(t)])},t.precision=function(t){return arguments.length?(s.precision(t),f.precision(t),c.precision(t),e()):s.precision()},t.scale=function(e){return arguments.length?(s.scale(e),f.scale(.35*e),c.scale(e),t.translate(s.translate())):s.scale()},t.translate=function(t){if(!arguments.length)return s.translate();var n=s.scale(),r=+t[0],u=+t[1];return i=s.translate(t).clipExtent([[r-.455*n,u-.238*n],[r+.455*n,u+.238*n]]).stream(l),a=f.translate([r-.307*n,u+.201*n]).clipExtent([[r-.425*n+Rw,u+.12*n+Rw],[r-.214*n-Rw,u+.234*n-Rw]]).stream(l),o=c.translate([r-.205*n,u+.212*n]).clipExtent([[r-.214*n+Rw,u+.166*n+Rw],[r-.115*n-Rw,u+.234*n-Rw]]).stream(l),e()},t.fitExtent=function(e,n){return Yu(t,e,n)},t.fitSize=function(e,n){return Hu(t,e,n)},t.fitWidth=function(e,n){return Gu(t,e,n)},t.fitHeight=function(e,n){return Vu(t,e,n)},t.scale(1070)},azimuthalequalarea:function(){return Xu(nk).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return Xu(rk).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return Zu(is).scale(109.5).parallels([30,30])},conicequalarea:tk,conicequidistant:function(){return Zu(os).scale(131.154).center([0,13.9389])},equirectangular:function(){return Xu(as).scale(152.63)},gnomonic:function(){return Xu(us).scale(144.049).clipAngle(60)},mercator:function(){return ns(es).scale(961/Uw)},orthographic:function(){return Xu(ss).scale(249.5).clipAngle(90+Rw)},stereographic:function(){return Xu(fs).scale(250).clipAngle(142)},transversemercator:function(){var t=ns(cs),e=t.center,n=t.rotate;return 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])},n([0,0,90]).scale(159.155)}};for(var uk in ok)ls(uk,ok[uk]);ds.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"as",type:"string",default:"path"}]};Md(ds,Ee).transform=function(t,e){function n(t){t[u]=a(o(t))}var r,i=e.fork(e.ALL),a=this.value,o=t.field||rd,u=t.as||"path";return!a||t.modified()?(this.value=a=hs(t.projection).context(null),i.materialize().reflow().visit(i.SOURCE,n)):(a.context(null),r=o===rd||e.modified(o.fields),i.visit(r?i.ADD_MOD:i.ADD,n)),i.modifies(u)},ps.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};Md(ps,Ee).transform=function(t,e){function n(t){var e=i([a(t),o(t)]);e?(t[s]=e[0],t[f]=e[1]):(t[s]=void 0,t[f]=void 0)}var r,i=t.projection,a=t.fields[0],o=t.fields[1],u=t.as||["x","y"],s=u[0],f=u[1];return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,n):(r=e.modified(a.fields)||e.modified(o.fields),e.visit(r?e.ADD_MOD:e.ADD,n)),e.modifies(u)},gs.Definition={type:"GeoShape",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"as",type:"string",default:"shape"}]};Md(gs,Ee).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||td("datum"),a=t.as||"shape",o=n.ADD_MOD;return r&&!t.modified()||(this.value=r=function(t,e){var n=function(n){return t(e(n))};return n.context=function(e){return t.context(e),n},n}(hs(t.projection),i),n.materialize().reflow(),o=n.SOURCE),n.visit(o,function(t){t[a]=r}),n.modifies(a)},vs.Definition={type:"Graticule",metadata:{source:!0,generates:!0,changes:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};Md(vs,Ee).transform=function(t,e){var n,r=e.fork(),i=this.value,a=this.generator;if(!i.length||t.modified())for(var o in t)gd(a[o])&&a[o](t[o]);return n=a(),i.length?r.mod.push(M(i[0],n)):r.add.push(_(n)),i[0]=n,r.source=i,r};Md(ms,Ee).transform=function(t,e){var n=this.value;return!n||t.modified("type")?(this.value=n=function(t){var e=ls((t||"mercator").toLowerCase());return e||Xh("Unrecognized projection type: "+t),e()}(t.type),ak.forEach(function(e){null!=t[e]&&bs(n,e,t[e])})):ak.forEach(function(e){t.modified(e)&&bs(n,e,t[e])}),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&ys(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)};var sk=Object.freeze({contour:Vo,geojson:Xo,geopath:ds,geopoint:ps,geoshape:gs,graticule:vs,projection:ms}),fk=function(t){return function(){return t}},ck=function(){return 1e-6*(Math.random()-.5)},lk=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i},hk=xs.prototype=ws.prototype;hk.copy=function(){var t,e,n=new ws(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Ms(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Ms(e));return n},hk.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return _s(this.cover(e,n),e,n,t)},hk.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),u=new Array(a),s=1/0,f=1/0,c=-1/0,l=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,u[n]=i,r<s&&(s=r),r>c&&(c=r),i<f&&(f=i),i>l&&(l=i));for(c<s&&(s=this._x0,c=this._x1),l<f&&(f=this._y0,l=this._y1),this.cover(s,f).cover(c,l),n=0;n<a;++n)_s(this,o[n],u[n],t[n]);return this},hk.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{if(!(n>t||t>i||r>e||e>a))return this;var o,u,s=i-n,f=this._root;switch(u=(e<(r+a)/2)<<1|t<(n+i)/2){case 0:do{o=new Array(4),o[u]=f,f=o}while(s*=2,i=n+s,a=r+s,t>i||e>a);break;case 1:do{o=new Array(4),o[u]=f,f=o}while(s*=2,n=i-s,a=r+s,n>t||e>a);break;case 2:do{o=new Array(4),o[u]=f,f=o}while(s*=2,i=n+s,r=a-s,t>i||r>e);break;case 3:do{o=new Array(4),o[u]=f,f=o}while(s*=2,n=i-s,r=a-s,n>t||r>e)}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this},hk.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},hk.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},hk.find=function(t,e,n){var r,i,a,o,u,s,f,c=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new lk(g,c,l,h,d)),null==n?n=1/0:(c=t-n,l=e-n,h=t+n,d=e+n,n*=n);s=p.pop();)if(!(!(g=s.node)||(i=s.x0)>h||(a=s.y0)>d||(o=s.x1)<c||(u=s.y1)<l))if(g.length){var v=(i+o)/2,m=(a+u)/2;p.push(new lk(g[3],v,m,o,u),new lk(g[2],i,m,v,u),new lk(g[1],v,a,o,m),new lk(g[0],i,a,v,m)),(f=(e>=m)<<1|t>=v)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=s)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=y*y+b*b;if(_<n){var x=Math.sqrt(n=_);c=t-x,l=e-x,h=t+x,d=e+x,r=g.data}}return r},hk.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,r,i,a,o,u,s,f,c,l,h,d=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((f=a>=(u=(p+v)/2))?p=u:v=u,(c=o>=(s=(g+m)/2))?g=s:m=s,e=d,!(d=d[l=c<<1|f]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},hk.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},hk.root=function(){return this._root},hk.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},hk.visit=function(t){var e,n,r,i,a,o,u=[],s=this._root;for(s&&u.push(new lk(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,a=e.x1,o=e.y1)&&s.length){var f=(r+a)/2,c=(i+o)/2;(n=s[3])&&u.push(new lk(n,f,c,a,o)),(n=s[2])&&u.push(new lk(n,r,c,f,o)),(n=s[1])&&u.push(new lk(n,f,i,a,c)),(n=s[0])&&u.push(new lk(n,r,i,f,c))}return this},hk.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new lk(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,o=e.x0,u=e.y0,s=e.x1,f=e.y1,c=(o+s)/2,l=(u+f)/2;(a=i[0])&&n.push(new lk(a,o,u,c,l)),(a=i[1])&&n.push(new lk(a,c,u,s,l)),(a=i[2])&&n.push(new lk(a,o,l,c,f)),(a=i[3])&&n.push(new lk(a,c,l,s,f))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},hk.x=function(t){return arguments.length?(this._x=t,this):this._x},hk.y=function(t){return arguments.length?(this._y=t,this):this._y};var dk,pk,gk=0,vk=0,mk=0,yk=1e3,bk=0,_k=0,xk=0,wk="object"==typeof performance&&performance.now?performance:Date,Mk="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};zs.prototype=Os.prototype={constructor:zs,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Cs():+n)+(null==e?0:+e),this._next||pk===this||(pk?pk._next=this:dk=this,pk=this),this._call=t,this._time=n,Rs()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rs())}};var kk=10,Ek=Math.PI*(3-Math.sqrt(5)),Sk=function(t){function e(){n(),d.call("tick",a),o<u&&(h.stop(),d.call("end",a))}function n(){var e,n,r=t.length;for(o+=(f-o)*s,l.each(function(t){t(o)}),e=0;e<r;++e)null==(n=t[e]).fx?n.x+=n.vx*=c:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=c:(n.y=n.fy,n.vy=0)}function r(){for(var e,n=0,r=t.length;n<r;++n){if(e=t[n],e.index=n,isNaN(e.x)||isNaN(e.y)){var i=kk*Math.sqrt(n),a=n*Ek;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function i(e){return e.initialize&&e.initialize(t),e}var a,o=1,u=.001,s=1-Math.pow(u,1/300),f=0,c=.6,l=N(),h=Os(e),d=U("tick","end");return null==t&&(t=[]),r(),a={tick:n,restart:function(){return h.restart(e),a},stop:function(){return h.stop(),a},nodes:function(e){return arguments.length?(t=e,r(),l.each(i),a):t},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(u=+t,a):u},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(f=+t,a):f},velocityDecay:function(t){return arguments.length?(c=1-t,a):1-c},force:function(t,e){return arguments.length>1?(null==e?l.remove(t):l.set(t,i(e)),a):l.get(t)},find:function(e,n,r){var i,a,o,u,s,f=0,c=t.length;for(null==r?r=1/0:r*=r,f=0;f<c;++f)(o=(i=e-(u=t[f]).x)*i+(a=n-u.y)*a)<r&&(s=u,r=o);return s},on:function(t,e){return arguments.length>1?(d.on(t,e),a):d.on(t)}}},Ak={center:function(t,e){function n(){var n,i,a=r.length,o=0,u=0;for(n=0;n<a;++n)o+=(i=r[n]).x,u+=i.y;for(o=o/a-t,u=u/a-e,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=u}var r;return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},collide:function(t){function e(){for(var t,e,r,s,f,c,l,h=i.length,d=0;d<u;++d)for(e=xs(i,ks,Es).visitAfter(n),t=0;t<h;++t)r=i[t],c=a[r.index],l=c*c,s=r.x+r.vx,f=r.y+r.vy,e.visit(function(t,e,n,i,a){var u=t.data,h=t.r,d=c+h;if(!u)return e>s+d||i<s-d||n>f+d||a<f-d;if(u.index>r.index){var p=s-u.x-u.vx,g=f-u.y-u.vy,v=p*p+g*g;v<d*d&&(0===p&&(p=ck(),v+=p*p),0===g&&(g=ck(),v+=g*g),v=(d-(v=Math.sqrt(v)))/v*o,r.vx+=(p*=v)*(d=(h*=h)/(l+h)),r.vy+=(g*=v)*d,u.vx-=p*(d=1-d),u.vy-=g*d)}})}function n(t){if(t.data)return t.r=a[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function r(){if(i){var e,n,r=i.length;for(a=new Array(r),e=0;e<r;++e)n=i[e],a[n.index]=+t(n,e,i)}}var i,a,o=1,u=1;return"function"!=typeof t&&(t=fk(null==t?1:+t)),e.initialize=function(t){i=t,r()},e.iterations=function(t){return arguments.length?(u=+t,e):u},e.strength=function(t){return arguments.length?(o=+t,e):o},e.radius=function(n){return arguments.length?(t="function"==typeof n?n:fk(+n),r(),e):t},e},nbody:function(){function t(t){var e,u=i.length,s=xs(i,Ps,Ls).visitAfter(n);for(o=t,e=0;e<u;++e)a=i[e],s.visit(r)}function e(){if(i){var t,e,n=i.length;for(u=new Array(n),t=0;t<n;++t)e=i[t],u[e.index]=+s(e,t,i)}}function n(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{o+=u[e.data.index]}while(e=e.next)}t.value=o}function r(t,e,n,r){if(!t.value)return!0;var i=t.x-a.x,s=t.y-a.y,h=r-e,d=i*i+s*s;if(h*h/l<d)return d<c&&(0===i&&(i=ck(),d+=i*i),0===s&&(s=ck(),d+=s*s),d<f&&(d=Math.sqrt(f*d)),a.vx+=i*t.value*o/d,a.vy+=s*t.value*o/d),!0;if(!(t.length||d>=c)){(t.data!==a||t.next)&&(0===i&&(i=ck(),d+=i*i),0===s&&(s=ck(),d+=s*s),d<f&&(d=Math.sqrt(f*d)));do{t.data!==a&&(h=u[t.data.index]*o/d,a.vx+=i*h,a.vy+=s*h)}while(t=t.next)}}var i,a,o,u,s=fk(-30),f=1,c=1/0,l=.81;return t.initialize=function(t){i=t,e()},t.strength=function(n){return arguments.length?(s="function"==typeof n?n:fk(+n),e(),t):s},t.distanceMin=function(e){return arguments.length?(f=e*e,t):Math.sqrt(f)},t.distanceMax=function(e){return arguments.length?(c=e*e,t):Math.sqrt(c)},t.theta=function(e){return arguments.length?(l=e*e,t):Math.sqrt(l)},t},link:function(t){function e(e){for(var n=0,r=t.length;n<d;++n)for(var i,u,s,c,l,h,p,g=0;g<r;++g)u=(i=t[g]).source,c=(s=i.target).x+s.vx-u.x-u.vx||ck(),l=s.y+s.vy-u.y-u.vy||ck(),c*=h=((h=Math.sqrt(c*c+l*l))-o[g])/h*e*a[g],l*=h,s.vx-=c*(p=f[g]),s.vy-=l*p,u.vx+=c*(p=1-p),u.vy+=l*p}function n(){if(u){var e,n,l=u.length,h=t.length,d=N(u,c);for(e=0,s=new Array(l);e<h;++e)(n=t[e]).index=e,"object"!=typeof n.source&&(n.source=As(d,n.source)),"object"!=typeof n.target&&(n.target=As(d,n.target)),s[n.source.index]=(s[n.source.index]||0)+1,s[n.target.index]=(s[n.target.index]||0)+1;for(e=0,f=new Array(h);e<h;++e)n=t[e],f[e]=s[n.source.index]/(s[n.source.index]+s[n.target.index]);a=new Array(h),r(),o=new Array(h),i()}}function r(){if(u)for(var e=0,n=t.length;e<n;++e)a[e]=+l(t[e],e,t)}function i(){if(u)for(var e=0,n=t.length;e<n;++e)o[e]=+h(t[e],e,t)}var a,o,u,s,f,c=Ss,l=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},h=fk(30),d=1;return null==t&&(t=[]),e.initialize=function(t){u=t,n()},e.links=function(r){return arguments.length?(t=r,n(),e):t},e.id=function(t){return arguments.length?(c=t,e):c},e.iterations=function(t){return arguments.length?(d=+t,e):d},e.strength=function(t){return arguments.length?(l="function"==typeof t?t:fk(+t),r(),e):l},e.distance=function(t){return arguments.length?(h="function"==typeof t?t:fk(+t),i(),e):h},e},x:function(t){function e(t){for(var e,n=0,o=r.length;n<o;++n)(e=r[n]).vx+=(a[n]-e.x)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),a=new Array(n),e=0;e<n;++e)i[e]=isNaN(a[e]=+t(r[e],e,r))?0:+o(r[e],e,r)}}var r,i,a,o=fk(.1);return"function"!=typeof t&&(t=fk(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(o="function"==typeof t?t:fk(+t),n(),e):o},e.x=function(r){return arguments.length?(t="function"==typeof r?r:fk(+r),n(),e):t},e},y:function(t){function e(t){for(var e,n=0,o=r.length;n<o;++n)(e=r[n]).vy+=(a[n]-e.y)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),a=new Array(n),e=0;e<n;++e)i[e]=isNaN(a[e]=+t(r[e],e,r))?0:+o(r[e],e,r)}}var r,i,a,o=fk(.1);return"function"!=typeof t&&(t=fk(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(o="function"==typeof t?t:fk(+t),n(),e):o},e.y=function(r){return arguments.length?(t="function"==typeof r?r:fk(+r),n(),e):t},e}},Ck="forces",Dk=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],zk=["static","iterations"],Ok=["x","y","vx","vy"];qs.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:Ok}]};var Nk=Md(qs,Ee);Nk.transform=function(t,e){var n=this.value,r=e.changed(e.ADD_REM),i=t.modified(Dk),a=t.iterations||300;if(n?(r&&(e.modifies("index"),n.nodes(e.source)),(i||e.changed(e.MOD))&&Us(n,t,0,e)):(this.value=n=function(t,e){var n=Sk(t),r=!1,i=n.stop,a=n.restart;return n.stopped=function(){return r},n.restart=function(){return r=!1,a()},n.stop=function(){return r=!0,i()},Us(n,e,!0).on("end",function(){r=!0})}(e.source,t),n.on("tick",function(t,e){return function(){t.touch(e).run()}}(e.dataflow,this)),t.static||(r=!0,n.tick()),e.modifies("index")),i||r||t.modified(zk)||e.changed()&&t.restart)if(n.alpha(Math.max(n.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/a)),t.static)for(n.stop();--a>=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return e.StopPropagation;return this.finish(t,e)},Nk.finish=function(t,e){for(var n,r=e.dataflow,i=this._argops,a=0,o=i.length;a<o;++a)if((n=i[a]).name===Ck&&"link"===n.op._argval.force)for(var u,s=n.op._argops,f=0,c=s.length;f<c;++f)if("links"===s[f].name&&(u=s[f].op.source)){r.pulse(u,r.changeset().reflow());break}return e.reflow(t.modified()).modifies(Ok)};var Tk=Object.freeze({force:qs});Gs.prototype=Bs.prototype={constructor:Gs,count:function(){return this.eachAfter($s)},each:function(t){var e,n,r,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r])}while(o.length);return this},eachAfter:function(t){for(var e,n,r,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n]);for(;i=o.pop();)t(i);return this},eachBefore:function(t){for(var e,n,r=this,i=[r];r=i.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return Bs(this).eachBefore(Ys)}};var Rk=Array.prototype.slice,Pk=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(Rk.call(t))).length,a=[];r<i;)e=t[r],n&&Xs(n,e)?++r:(n=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return Zs(t[0],t[1]);case 3:return Qs(t[0],t[1],t[2])}}(a=function(t,e){var n,r;if(Js(e,t))return[e];for(n=0;n<t.length;++n)if(Vs(e,t[n])&&Js(Zs(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(Vs(Zs(t[n],t[r]),e)&&Vs(Zs(t[n],e),t[r])&&Vs(Zs(t[r],e),t[n])&&Js(Qs(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(a,e)),r=0);return n},Lk=function(t){return function(){return t}},qk=function(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)},Uk=function(t,e,n,r,i){for(var a,o=t.children,u=-1,s=o.length,f=t.value&&(r-e)/t.value;++u<s;)(a=o[u]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*f},Fk="$",jk={depth:-1},Ik={};mf.prototype=Object.create(Gs.prototype);var $k=function(t,e,n,r,i){for(var a,o=t.children,u=-1,s=o.length,f=t.value&&(i-n)/t.value;++u<s;)(a=o[u]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*f},Bk=(1+Math.sqrt(5))/2,Wk=function t(e){function n(t,n,r,i,a){yf(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Bk),Yk=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,u,s,f,c,l=-1,h=o.length,d=t.value;++l<h;){for(s=(u=o[l]).children,f=u.value=0,c=s.length;f<c;++f)u.value+=s[f].value;u.dice?Uk(u,n,r,i,r+=(a-r)*u.value/d):$k(u,n,r,n+=(i-n)*u.value/d,a),d-=u.value}else t._squarify=o=yf(e,t,n,r,i,a),o.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Bk);bf.Definition={type:"Nest",metadata:{treesource:!0,source:!0,generates:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"key",type:"field"},{name:"generate",type:"boolean"}]};Md(bf,Ee).transform=function(t,e){e.source||Xh("Nest transform requires an upstream data source.");var n,r,i,a=t.key||y,o=t.generate,u=t.modified(),s=o||u?e.fork(e.ALL):e;return(!this.value||u||e.changed())&&(o&&this.value&&(s.materialize(s.REM),this.value.each(function(t){t.children&&s.rem.push(t)})),n=pd(t.keys).reduce(function(t,e){return t.key(e),t},function(){function t(e,i,o,u){if(i>=a.length)return null!=n&&e.sort(n),null!=r?r(e):e;for(var s,f,c,l=-1,h=e.length,d=a[i++],p=N(),g=o();++l<h;)(c=p.get(s=d(f=e[l])+""))?c.push(f):p.set(s,[f]);return p.each(function(e,n){u(g,n,t(e,i,o,u))}),g}function e(t,n){if(++n>a.length)return t;var i,u=o[n-1];return null!=r&&n>=a.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:e(t,n)})})),null!=u?i.sort(function(t,e){return u(t.key,e.key)}):i}var n,r,i,a=[],o=[];return i={object:function(e){return t(e,0,T,R)},map:function(e){return t(e,0,P,L)},entries:function(n){return e(t(n,0,P,L),0)},key:function(t){return a.push(t),i},sortKeys:function(t){return o[a.length-1]=t,i},sortValues:function(t){return n=t,i},rollup:function(t){return r=t,i}}}()).entries(e.source),this.value=r=Bs({values:n},_f),o&&(s.materialize(s.ADD),s.source=s.source.slice(),r.each(function(t){t.children&&(t=_(t.data),s.add.push(t),s.source.push(t))})),i=r.lookup={},r.each(function(t){null!=y(t.data)&&(i[a(t.data)]=t)})),s.source.root=this.value,s};Md(xf,Ee).transform=function(t,e){e.source&&e.source.root||Xh(this.constructor.name+" transform requires a backing tree data source.");var n=this.layout(t.method),r=this.fields,i=e.source.root,a=t.as||r;t.field&&i.sum(t.field),t.sort&&i.sort(t.sort),function(t,e,n){for(var r,i=0,a=e.length;i<a;++i)(r=e[i])in n&&t[r](n[r])}(n,this.params,t);try{this.value=n(i)}catch(t){Xh(t)}return i.each(function(t){!function(t,e,n){for(var r=t.data,i=0,a=e.length-1;i<a;++i)r[n[i]]=t[e[i]];r[n[a]]=t.children?t.children.length:0}(t,r,a)}),e.reflow(t.modified()).modifies(a).modifies("leaf")};var Hk=["x","y","r","depth","children"];wf.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:3,default:Hk}]};var Gk=Md(wf,xf);Gk.layout=function(){function t(t){return t.x=n/2,t.y=r/2,e?t.eachBefore(uf(e)).eachAfter(sf(i,.5)).eachBefore(ff(1)):t.eachBefore(uf(of)).eachAfter(sf(af,1)).eachAfter(sf(i,t.r/Math.min(n,r))).eachBefore(ff(Math.min(n,r)/(2*t.r))),t}var e=null,n=1,r=1,i=af;return t.radius=function(n){return arguments.length?(e=null==n?null:rf(n),t):e},t.size=function(e){return arguments.length?(n=+e[0],r=+e[1],t):[n,r]},t.padding=function(e){return arguments.length?(i="function"==typeof e?e:Lk(+e),t):i},t},Gk.params=["size","padding"],Gk.fields=Hk;var Vk=["x0","y0","x1","y1","depth","children"];Mf.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,default:Vk}]};var Xk=Md(Mf,xf);Xk.layout=function(){function t(t){var a=t.height+1;return t.x0=t.y0=r,t.x1=e,t.y1=n/a,t.eachBefore(function(t,e){return function(n){n.children&&Uk(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,u=n.y1-r;o<i&&(i=o=(i+o)/2),u<a&&(a=u=(a+u)/2),n.x0=i,n.y0=a,n.x1=o,n.y1=u}}(n,a)),i&&t.eachBefore(qk),t}var e=1,n=1,r=0,i=!1;return t.round=function(e){return arguments.length?(i=!!e,t):i},t.size=function(r){return arguments.length?(e=+r[0],n=+r[1],t):[e,n]},t.padding=function(e){return arguments.length?(r=+e,t):r},t},Xk.params=["size","round","padding"],Xk.fields=Vk,kf.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};Md(kf,Ee).transform=function(t,e){e.source||Xh("Stratify transform requires an upstream data source.");var n,r,i=t.modified();return(!this.value||i||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields))&&(n=function(){function t(t){var r,i,a,o,u,s,f,c=t.length,l=new Array(c),h={};for(i=0;i<c;++i)r=t[i],u=l[i]=new Gs(r),null!=(s=e(r,i,t))&&(s+="")&&(h[f=Fk+(u.id=s)]=f in h?Ik:u);for(i=0;i<c;++i)if(u=l[i],null!=(s=n(t[i],i,t))&&(s+="")){if(!(o=h[Fk+s]))throw new Error("missing: "+s);if(o===Ik)throw new Error("ambiguous: "+s);o.children?o.children.push(u):o.children=[u],u.parent=o}else{if(a)throw new Error("multiple roots");a=u}if(!a)throw new Error("no root");if(a.parent=jk,a.eachBefore(function(t){t.depth=t.parent.depth+1,--c}).eachBefore(Hs),a.parent=null,c>0)throw new Error("cycle");return a}var e=cf,n=lf;return t.id=function(n){return arguments.length?(e=rf(n),t):e},t.parentId=function(e){return arguments.length?(n=rf(e),t):n},t}().id(t.key).parentId(t.parentKey)(e.source),r=n.lookup={},n.each(function(e){r[t.key(e.data)]=e}),this.value=n),e.source.root=this.value,i?e.fork(e.ALL):e};var Jk={tidy:function(){function t(t){var s=function(e){for(var n,r,i,a,o,u=new mf(t,0),s=[u];n=s.pop();)if(i=n._.children)for(n.children=new Array(o=i.length),a=o-1;a>=0;--a)s.push(r=n.children[a]=new mf(i[a],a)),r.parent=n;return(u.parent=new mf(null,0)).children=[u],u}();if(s.eachAfter(e),s.parent.m=-s.z,s.eachBefore(n),u)t.eachBefore(r);else{var f=t,c=t,l=t;t.eachBefore(function(t){t.x<f.x&&(f=t),t.x>c.x&&(c=t),t.depth>l.depth&&(l=t)});var h=f===c?1:i(f,c)/2,d=h-f.x,p=a/(c.x+h+d),g=o/(l.depth||1);t.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*g})}return t}function e(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){!function(e){for(var n,r=0,i=0,a=t.children,o=a.length;--o>=0;)(n=a[o]).z+=r,n.m+=r,r+=n.s+(i+=n.c)}();var a=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+i(t._,r._),t.m=t.z-a):t.z=a}else r&&(t.z=r.z+i(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,a=t,o=t,u=e,s=a.parent.children[0],f=a.m,c=o.m,l=u.m,h=s.m;u=pf(u),a=df(a),u&&a;)s=df(s),(o=pf(o)).a=t,(r=u.z+l-a.z-f+i(u._,a._))>0&&(gf(vf(u,t,n),t,r),f+=r,c+=r),l+=u.m,f+=a.m,h+=s.m,c+=o.m;u&&!pf(o)&&(o.t=u,o.m+=l-c),a&&!df(s)&&(s.t=a,s.m+=f-h,n=t)}return n}(t,r,t.parent.A||n[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function r(t){t.x*=a,t.y=t.depth*o}var i=hf,a=1,o=1,u=null;return t.separation=function(e){return arguments.length?(i=e,t):i},t.size=function(e){return arguments.length?(u=!1,a=+e[0],o=+e[1],t):u?null:[a,o]},t.nodeSize=function(e){return arguments.length?(u=!0,a=+e[0],o=+e[1],t):u?[a,o]:null},t},cluster:function(){function t(t){var a,o=0;t.eachAfter(function(t){var n=t.children;n?(t.x=function(t){return t.reduce(js,0)/t.length}(n),t.y=1+n.reduce(Is,0)):(t.x=a?o+=e(t,a):0,t.y=0,a=t)});var u=function(t){for(var e;e=t.children;)t=e[0];return t}(t),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(t),f=u.x-e(u,s)/2,c=s.x+e(s,u)/2;return t.eachAfter(i?function(e){e.x=(e.x-t.x)*n,e.y=(t.y-e.y)*r}:function(e){e.x=(e.x-f)/(c-f)*n,e.y=(1-(t.y?e.y/t.y:1))*r})}var e=Fs,n=1,r=1,i=!1;return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(e){return arguments.length?(i=!1,n=+e[0],r=+e[1],t):i?null:[n,r]},t.nodeSize=function(e){return arguments.length?(i=!0,n=+e[0],r=+e[1],t):i?[n,r]:null},t}},Zk=["x","y","depth","children"];Ef.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,default:Zk}]};var Qk=Md(Ef,xf);Qk.layout=function(t){var e=t||"tidy";if(Jk.hasOwnProperty(e))return Jk[e]();Xh("Unrecognized Tree layout method: "+e)},Qk.params=["size","nodeSize","separation"],Qk.fields=Zk,Sf.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[{name:"key",type:"field"}]};Md(Sf,Ee).transform=function(t,e){function n(t){var e=i[t];e&&(o[t]=1,u.mod.push(e))}e.source&&e.source.root||Xh("TreeLinks transform requires a backing tree data source.");var r=e.source.root.lookup,i=this.value,a=t.key||y,o={},u=e.fork();return e.visit(e.REM,function(t){var e=a(t),n=i[e];n&&(delete i[e],u.rem.push(n))}),e.visit(e.ADD,function(t){var e,n=a(t);(e=function(t){var e;return t.parent&&(e=t.parent.data)&&null!=y(e)&&e}(r[n]))&&(u.add.push(i[n]=_({source:e,target:t})),o[n]=1)}),e.visit(e.MOD,function(t){var e=a(t),i=r[e].children;if(n(e),i)for(var u=0,s=i.length;u<s;++u)o[e=a(i[u].data)]||n(e)}),u};var Kk={binary:function(t,e,n,r,i){function a(t,e,n,r,i,o,u){if(t>=e-1){var f=s[t];return f.x0=r,f.y0=i,f.x1=o,void(f.y1=u)}for(var l=c[t],h=n/2+l,d=t+1,p=e-1;d<p;){var g=d+p>>>1;c[g]<h?d=g+1:p=g}h-c[d-1]<c[d]-h&&t+1<d&&--d;var v=c[d]-l,m=n-v;if(o-r>u-i){var y=(r*m+o*v)/n;a(t,d,v,r,i,y,u),a(d,e,m,y,i,o,u)}else{var b=(i*m+u*v)/n;a(t,d,v,r,i,o,b),a(d,e,m,r,b,o,u)}}var o,u,s=t.children,f=s.length,c=new Array(f+1);for(c[0]=u=o=0;o<f;++o)c[o+1]=u+=s[o].value;a(0,f,t.value,e,n,r,i)},dice:Uk,slice:$k,slicedice:function(t,e,n,r,i){(1&t.depth?$k:Uk)(t,e,n,r,i)},squarify:Wk,resquarify:Yk},tE=["x0","y0","x1","y1","depth","children"];Af.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,default:tE}]};var eE=Md(Af,xf);eE.layout=function(){var t=function(){function t(t){return t.x0=t.y0=0,t.x1=i,t.y1=a,t.eachBefore(e),o=[0],r&&t.eachBefore(qk),t}function e(t){var e=o[t.depth],r=t.x0+e,i=t.y0+e,a=t.x1-e,h=t.y1-e;a<r&&(r=a=(r+a)/2),h<i&&(i=h=(i+h)/2),t.x0=r,t.y0=i,t.x1=a,t.y1=h,t.children&&(e=o[t.depth+1]=u(t)/2,r+=l(t)-e,i+=s(t)-e,a-=f(t)-e,h-=c(t)-e,a<r&&(r=a=(r+a)/2),h<i&&(i=h=(i+h)/2),n(t,r,i,a,h))}var n=Wk,r=!1,i=1,a=1,o=[0],u=af,s=af,f=af,c=af,l=af;return t.round=function(e){return arguments.length?(r=!!e,t):r},t.size=function(e){return arguments.length?(i=+e[0],a=+e[1],t):[i,a]},t.tile=function(e){return arguments.length?(n=rf(e),t):n},t.padding=function(e){return arguments.length?t.paddingInner(e).paddingOuter(e):t.paddingInner()},t.paddingInner=function(e){return arguments.length?(u="function"==typeof e?e:Lk(+e),t):u},t.paddingOuter=function(e){return arguments.length?t.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):t.paddingTop()},t.paddingTop=function(e){return arguments.length?(s="function"==typeof e?e:Lk(+e),t):s},t.paddingRight=function(e){return arguments.length?(f="function"==typeof e?e:Lk(+e),t):f},t.paddingBottom=function(e){return arguments.length?(c="function"==typeof e?e:Lk(+e),t):c},t.paddingLeft=function(e){return arguments.length?(l="function"==typeof e?e:Lk(+e),t):l},t}();return t.ratio=function(e){var n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=function(e){Kk.hasOwnProperty(e)?t.tile(Kk[e]):Xh("Unrecognized Treemap layout method: "+e)},t},eE.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],eE.fields=tE;var nE=Object.freeze({nest:bf,pack:wf,partition:Mf,stratify:kf,tree:Ef,treelinks:Sf,treemap:Af}),rE=function(t){return function(){return t}};zf.prototype={constructor:zf,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Rf(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Nf(this,n),n=(t=n).U),n.C=!1,r.C=!0,Tf(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Tf(this,n),n=(t=n).U),n.C=!1,r.C=!0,Nf(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,a=t.L,o=t.R;if(n=a?o?Rf(o):a:o,i?i.L===t?i.L=n:i.R=n:this._=n,a&&o?(r=n.C,n.C=t.C,n.L=a,a.U=n,n!==o?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=o,o.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Nf(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Tf(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Nf(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Tf(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Nf(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Tf(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var iE,aE,oE,uE,sE,fE=[],cE=[],lE=1e-6,hE=1e-12;Qf.prototype={constructor:Qf,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return If(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,r){if(a=(i=n.halfedges).length)for(var i,a,o,u=n.site,s=-1,f=e[i[a-1]],c=f.left===u?f.right:f.left;++s<a;)o=c,c=(f=e[i[s]]).left===u?f.right:f.left,o&&c&&r<o.index&&r<c.index&&Jf(u,o,c)<0&&t.push([u.data,o.data,c.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var r,i,a=this,o=a._found||0,u=a.cells.length;!(i=a.cells[o]);)if(++o>=u)return null;var s=t-i.site[0],f=e-i.site[1],c=s*s+f*f;do{i=a.cells[r=o],o=null,i.halfedges.forEach(function(n){var r=a.edges[n],u=r.left;if(u!==i.site&&u||(u=r.right)){var s=t-u[0],f=e-u[1],l=s*s+f*f;l<c&&(c=l,o=u.index)}})}while(null!==o);return a._found=r,null==n||c<=n*n?i.site:null}};Kf.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};var dE=[[-1e5,-1e5],[1e5,1e5]];Md(Kf,Ee).transform=function(t,e){var n,r,i,a,o=t.as||"path",u=e.source;for(n=function(){function t(t){return new Qf(t.map(function(r,i){var a=[Math.round(e(r,i,t)/lE)*lE,Math.round(n(r,i,t)/lE)*lE];return a.index=i,a.data=r,a}),r)}var e=Cf,n=Df,r=null;return t.polygons=function(e){return t(e).polygons()},t.links=function(e){return t(e).links()},t.triangles=function(e){return t(e).triangles()},t.x=function(n){return arguments.length?(e="function"==typeof n?n:rE(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:rE(+e),t):n},t.extent=function(e){return arguments.length?(r=null==e?null:[[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]],t):r&&[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},t.size=function(e){return arguments.length?(r=null==e?null:[[0,0],[+e[0],+e[1]]],t):r&&[r[1][0]-r[0][0],r[1][1]-r[0][1]]},t}().x(t.x).y(t.y),t.size?n.size(t.size):n.extent(t.extent||dE),this.value=n=n(u),r=n.polygons(),i=0,a=u.length;i<a;++i)u[i][o]=r[i]?"M"+r[i].join("L")+"Z":null;return e.reflow(t.modified()).modifies(o)};var pE=Object.freeze({voronoi:Kf}),gE=Math.PI/180,vE=64,mE=2048,yE=function(){var t,e,n,r,i,a,o,u=[256,256],s=tc,f=[],c=Math.random,l={},h=ec;return l.layout=function(){for(var l=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(vE<<5)/e,t.height=mE/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(h()),d=function(t){for(var e=[],n=-1;++n<t;)e[n]=0;return e}((u[0]>>5)*u[1]),p=null,g=f.length,v=-1,m=[],y=f.map(function(u){return{text:t(u),font:e(u),style:r(u),weight:i(u),rotate:a(u),size:~~n(u),padding:o(u),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:u}}).sort(function(t,e){return e.size-t.size});++v<g;){var b=y[v];b.x=u[0]*(c()+.5)>>1,b.y=u[1]*(c()+.5)>>1,function(t,e,n,r){if(!e.sprite){var i=t.context,a=t.ratio;i.clearRect(0,0,(vE<<5)/a,mE/a);var o,u,s,f,c,l=0,h=0,d=0,p=n.length;for(--r;++r<p;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font,o=i.measureText(e.text+"m").width*a,s=e.size<<1,e.rotate){var g=Math.sin(e.rotate*gE),v=Math.cos(e.rotate*gE),m=o*v,y=o*g,b=s*v,_=s*g;o=Math.max(Math.abs(m+_),Math.abs(m-_))+31>>5<<5,s=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else o=o+31>>5<<5;if(s>d&&(d=s),l+o>=vE<<5&&(l=0,h+=d,d=0),h+s>=mE)break;i.translate((l+(o>>1))/a,(h+(s>>1))/a),e.rotate&&i.rotate(e.rotate*gE),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=o,e.height=s,e.xoff=l,e.yoff=h,e.x1=o>>1,e.y1=s>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,l+=o}for(var x=i.getImageData(0,0,(vE<<5)/a,mE/a).data,w=[];--r>=0;)if((e=n[r]).hasText){for(u=(o=e.width)>>5,s=e.y1-e.y0,f=0;f<s*u;f++)w[f]=0;if(null==(l=e.xoff))return;h=e.yoff;var M=0,k=-1;for(c=0;c<s;c++){for(f=0;f<o;f++){var E=u*c+(f>>5),S=x[(h+c)*(vE<<5)+(l+f)<<2]?1<<31-f%32:0;w[E]|=S,M|=S}M?k=c:(e.y0++,s--,c--,h++)}e.y1=e.y0+k,e.sprite=w.slice(0,(e.y1-e.y0)*u)}}}(l,b,y,v),b.hasText&&function(t,e,n){for(var r,i,a,o=e.x,f=e.y,l=Math.sqrt(u[0]*u[0]+u[1]*u[1]),h=s(u),d=c()<.5?1:-1,p=-d;(r=h(p+=d))&&(i=~~r[0],a=~~r[1],!(Math.min(Math.abs(i),Math.abs(a))>=l));)if(e.x=o+i,e.y=f+a,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>u[0]||e.y+e.y1>u[1])&&(!n||!function(t,e,n){n>>=5;for(var r,i=t.sprite,a=t.width>>5,o=t.x-(a<<4),u=127&o,s=32-u,f=t.y1-t.y0,c=(t.y+t.y0)*n+(o>>5),l=0;l<f;l++){r=0;for(var h=0;h<=a;h++)if((r<<s|(h<a?(r=i[l*a+h])>>>u:0))&e[c+h])return!0;c+=n}return!1}(e,t,u[0]))&&(!n||function(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}(e,n))){for(var g,v=e.sprite,m=e.width>>5,y=u[0]>>5,b=e.x-(m<<4),_=127&b,x=32-_,w=e.y1-e.y0,M=(e.y+e.y0)*y+(b>>5),k=0;k<w;k++){g=0;for(var E=0;E<=m;E++)t[M+E]|=g<<x|(E<m?(g=v[k*m+E])>>>_:0);M+=y}return e.sprite=null,!0}return!1}(d,b,p)&&(m.push(b),p?function(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}(p,b):p=[{x:b.x+b.x0,y:b.y+b.y0},{x:b.x+b.x1,y:b.y+b.y1}],b.x-=u[0]>>1,b.y-=u[1]>>1)}return m},l.words=function(t){return arguments.length?(f=t,l):f},l.size=function(t){return arguments.length?(u=[+t[0],+t[1]],l):u},l.font=function(t){return arguments.length?(e=nc(t),l):e},l.fontStyle=function(t){return arguments.length?(r=nc(t),l):r},l.fontWeight=function(t){return arguments.length?(i=nc(t),l):i},l.rotate=function(t){return arguments.length?(a=nc(t),l):a},l.text=function(e){return arguments.length?(t=nc(e),l):t},l.spiral=function(t){return arguments.length?(s=bE[t]||t,l):s},l.fontSize=function(t){return arguments.length?(n=nc(t),l):n},l.padding=function(t){return arguments.length?(o=nc(t),l):o},l.random=function(t){return arguments.length?(c=t,l):c},l},bE={archimedean:tc,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}},_E=["x","y","font","fontSize","fontStyle","fontWeight","angle"],xE=["text","font","rotate","fontSize","fontStyle","fontWeight"];rc.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:_E}]};Md(rc,Ee).transform=function(e,n){var r=e.modified();if(r||n.changed(n.ADD_REM)||xE.some(function(t){var r=e[t];return gd(r)&&n.modified(r.fields)})){var i,a=n.materialize(n.SOURCE).source,o=this.value,u=e.as||_E,s=e.fontSize||14;if(gd(s)?i=e.fontSizeRange:s=md(s),i){var f=s,c=fo("sqrt")().domain(function(t,e){for(var n,r=1/0,i=-1/0,a=0,o=e.length;a<o;++a)(n=t(e[a]))<r&&(r=n),n>i&&(i=n);return[r,i]}(f,a)).range(i);s=function(t){return c(f(t))}}a.forEach(function(t){t[u[0]]=NaN,t[u[1]]=NaN,t[u[3]]=0});for(var l,h,d=o.words(a).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(t.random).layout(),p=o.size(),g=p[0]>>1,v=p[1]>>1,m=0,y=d.length;m<y;++m)(h=(l=d[m]).datum)[u[0]]=l.x+g,h[u[1]]=l.y+v,h[u[2]]=l.font,h[u[3]]=l.size,h[u[4]]=l.style,h[u[5]]=l.weight,h[u[6]]=l.rotate;return n.reflow(r).modifies(u)}};var wE=Object.freeze({wordcloud:rc}),ME=function(t,e,n){var r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd:function(t,e){var n,i=this.bisect(this.range,t.value),a=t.index,o=i[0],u=i[1],s=a.length;for(n=0;n<o;++n)e[a[n]]|=r;for(n=u;n<s;++n)e[a[n]]|=r;return this}}};uc.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};var kE=Md(uc,Ee);kE.transform=function(t,e){if(this._dims){return t.modified("fields")||t.fields.some(function(t){return e.modified(t.fields)})?this.reinit(t,e):this.eval(t,e)}return this.init(t,e)},kE.init=function(t,e){for(var n,r,i=t.fields,a=t.query,o=this._indices={},u=this._dims=[],s=a.length,f=0;f<s;++f)r=o[n=i[f].fname]||(o[n]=oc()),u.push(ME(r,f,a[f]));return this.eval(t,e)},kE.reinit=function(t,e){var n,r,i,a,o,u,s,f,c,l=e.materialize().fork(),h=t.fields,d=t.query,p=this._indices,g=this._dims,v=this.value,m=v.curr(),y=v.prev(),b=v.all(),_=l.rem=l.add,x=l.mod,w=d.length,M={};if(y.set(m),e.rem.length&&(o=this.remove(t,e,l)),e.add.length&&v.add(e.add),e.mod.length)for(u={},s=0,f=(a=e.mod).length;s<f;++s)u[a[s]._index]=1;for(s=0;s<w;++s)c=h[s],(!g[s]||t.modified("fields",s)||e.modified(c.fields))&&((n=M[i=c.fname])||(p[i]=r=oc(),M[i]=n=r.insert(c,e.source,0)),g[s]=ME(r,s,d[s]).onAdd(n,m));for(s=0,f=v.data().length;s<f;++s)o[s]||(y[s]!==m[s]?_.push(s):u[s]&&m[s]!==b&&x.push(s));return v.mask=(1<<w)-1,l},kE.eval=function(t,e){var n=e.materialize().fork(),r=this._dims.length,i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},kE.insert=function(t,e,n){var r,i,a,o=e.add,u=this.value,s=this._dims,f=this._indices,c=t.fields,l={},h=n.add,d=u.size(),p=d+o.length,g=s.length;u.resize(p,g),u.add(o);var v=u.curr(),m=u.prev(),y=u.all();for(r=0;r<g;++r)a=l[i=c[r].fname]||(l[i]=f[i].insert(c[r],o,d)),s[r].onAdd(a,v);for(;d<p;++d)m[d]=y,v[d]!==y&&h.push(d)},kE.modify=function(t,e){var n,r,i,a=e.mod,o=this.value,u=o.curr(),s=o.all(),f=t.mod;for(n=0,r=f.length;n<r;++n)u[i=f[n]._index]!==s&&a.push(i)},kE.remove=function(t,e,n){var r,i,a,o,u=this._indices,s=this.value,f=s.curr(),c=s.prev(),l=s.all(),h={},d=n.rem,p=e.rem;for(r=0,i=p.length;r<i;++r)h[a=p[r]._index]=1,c[a]=o=f[a],f[a]=l,o!==l&&d.push(a);for(a in u)u[a].remove(i,h);return this.reindex(e,i,h),h},kE.reindex=function(t,e,n){var r=this._indices,i=this.value;t.runAfter(function(){var t=i.remove(e,n);for(var a in r)r[a].reindex(t)})},kE.update=function(t,e,n){var r,i,a=this._dims,o=t.query,u=e.stamp,s=a.length,f=0;for(n.filters=0,i=0;i<s;++i)t.modified("query",i)&&(r=i,++f);if(1===f)f=a[r].one,this.incrementOne(a[r],o[r],n.add,n.rem);else for(i=0,f=0;i<s;++i)t.modified("query",i)&&(f|=a[i].one,this.incrementAll(a[i],o[i],u,n.add),n.rem=n.add);return f},kE.incrementAll=function(t,e,n,r){var i,a,o,u=this.value,s=u.seen(),f=u.curr(),c=u.prev(),l=t.index(),h=t.bisect(t.range),d=t.bisect(e),p=d[0],g=d[1],v=h[0],m=h[1],y=t.one;if(p<v)for(i=p,a=Math.min(v,g);i<a;++i)s[o=l[i]]!==n&&(c[o]=f[o],s[o]=n,r.push(o)),f[o]^=y;else if(p>v)for(i=v,a=Math.min(p,m);i<a;++i)s[o=l[i]]!==n&&(c[o]=f[o],s[o]=n,r.push(o)),f[o]^=y;if(g>m)for(i=Math.max(p,m),a=g;i<a;++i)s[o=l[i]]!==n&&(c[o]=f[o],s[o]=n,r.push(o)),f[o]^=y;else if(g<m)for(i=Math.max(v,g),a=m;i<a;++i)s[o=l[i]]!==n&&(c[o]=f[o],s[o]=n,r.push(o)),f[o]^=y;t.range=e.slice()},kE.incrementOne=function(t,e,n,r){var i,a,o,u=this.value.curr(),s=t.index(),f=t.bisect(t.range),c=t.bisect(e),l=c[0],h=c[1],d=f[0],p=f[1],g=t.one;if(l<d)for(i=l,a=Math.min(d,h);i<a;++i)u[o=s[i]]^=g,n.push(o);else if(l>d)for(i=d,a=Math.min(l,p);i<a;++i)u[o=s[i]]^=g,r.push(o);if(h>p)for(i=Math.max(l,p),a=h;i<a;++i)u[o=s[i]]^=g,n.push(o);else if(h<p)for(i=Math.max(d,h),a=p;i<a;++i)u[o=s[i]]^=g,r.push(o);t.range=e.slice()},sc.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};Md(sc,Ee).transform=function(t,e){var n=~(t.ignore||0),r=t.filter,i=r.mask;if(0==(i&n))return e.StopPropagation;var a=e.fork(e.ALL),o=r.data(),u=r.curr(),s=r.prev(),f=function(t){return u[t]&n?null:o[t]};return a.filter(a.MOD,f),i&i-1?(a.filter(a.ADD,function(t){var e=u[t]&n;return!e&&e^s[t]&n?o[t]:null}),a.filter(a.REM,function(t){var e=u[t]&n;return e&&!(e^e^s[t]&n)?o[t]:null})):(a.filter(a.ADD,f),a.filter(a.REM,function(t){return(u[t]&n)===i?o[t]:null})),a.filter(a.SOURCE,function(t){return f(t._index)})};var EE=Object.freeze({crossfilter:uc,resolvefilter:sc}),SE=function(t){var e=t._signals.cursor;e||(t._signals.cursor=e=t.add({user:"default",item:null})),t.on(t.events("view","mousemove"),e,function(t,n){var r=e.value,i=r?Kh(r)?r:r.user:"default",a=n.item&&n.item.cursor||null;return r&&i===r.user&&a==r.item?r:{user:i,item:a}}),t.add(null,function(t){var e=t.cursor,n=this.value;return Kh(e)||(n=e.item,e=e.user),function(t){"undefined"!=typeof document&&document.body&&(document.body.style.cursor=t)}(e&&"default"!==e?e:n||e),n},{cursor:e})},AE=function(t,e,n){var r,i,a,o=t._renderer.scene();return o&&(a=dc(t),i=e.changedTouches?e.changedTouches[0]:e,(r=Bm(i,o))[0]-=a[0],r[1]-=a[1]),e.dataflow=t,e.vega=function(t,e,n){function r(t){var n,r=a;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){r=n;break}return r&&r.mark&&r.mark.interactive?r:{}}function i(t){if(!t)return n;Kh(t)&&(t=r(t));for(var e=n.slice();t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}var a=e?"group"===e.mark.marktype?e:e.mark.group:null;return{view:md(t),item:md(e||{}),group:r,xy:i,x:function(t){return i(t)[0]},y:function(t){return i(t)[1]}}}(t,n,r),e.item=n,e},CE="view",DE="window",zE=function(t,e,n){var r=document.createElement(t);for(var i in e)r.setAttribute(i,e[i]);return null!=n&&(r.textContent=n),r},OE="vega-bind",NE="vega-bind-name",TE="vega-bind-radio",RE="vega-option-",PE=function(t,e,n){if(e){var r=n.param,i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:function(e){i.source=!0,t.signal(r.signal,e).run()}},r.debounce&&(i.update=yd(r.debounce,i.update))),function(t,e,n,r){var i=zE("div",{class:OE});i.appendChild(zE("span",{class:NE},n.name||n.signal)),e.appendChild(i);var a=mc;switch(n.input){case"checkbox":a=yc;break;case"select":a=bc;break;case"radio":a=_c;break;case"range":a=xc}a(t,i,n,r)}(i,e,r,t.signal(r.signal)),i.active||(t.on(t._signals[r.signal],null,function(){i.source?i.source=!1:i.set(t.signal(r.signal))}),i.active=!0),i}},LE=function(t,e,n,r){return(e=e||new r(t.loader())).initialize(n,lc(t),hc(t),dc(t)).background(t._background)},qE=function(t,e){var n=zi(e);return n&&n.headless?t.runAsync().then(function(){return LE(t,null,null,n.headless).renderAsync(t._scenegraph.root)}):Promise.reject("Unrecognized renderer type: "+e)},UE=function(t,e){return t=t||e.autosize,Qh(t)?t:(t=t||"pad",{type:t})},FE=function(t,e){return t=t||e.padding,Qh(t)?{top:kc(t.top),bottom:kc(t.bottom),left:kc(t.left),right:kc(t.right)}:function(t){return{top:t,bottom:t,left:t,right:t}}(kc(t))},jE=["value","update","react","bind"],IE=function(t,e){var n=t.name;if("outer"===t.push)e.signals[n]||Ec("No prior signal definition",n),jE.forEach(function(e){void 0!==t[e]&&Ec("Invalid property ",e)});else{var r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}};Sc.prototype.visit=function(t){var e,n,r;if(t(this))return 1;for(n=0,r=(e=function(t){switch(t.type){case"ArrayExpression":return t.elements;case"BinaryExpression":case"LogicalExpression":return[t.left,t.right];case"CallExpression":var e=t.arguments.slice();return e.unshift(t.callee),e;case"ConditionalExpression":return[t.test,t.consequent,t.alternate];case"MemberExpression":return[t.object,t.property];case"ObjectExpression":return t.properties;case"Property":return[t.key,t.value];case"UnaryExpression":return[t.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}(this)).length;n<r;++n)if(e[n].visit(t))return 1};var $E,BE,WE,YE,HE=1,GE=2,VE=3,XE=4,JE=5,ZE=6,QE=7,KE=8,tS="ArrayExpression",eS="BinaryExpression",nS="CallExpression",rS="ConditionalExpression",iS="Identifier",aS="Literal",oS="LogicalExpression",uS="MemberExpression",sS="ObjectExpression",fS="Property",cS="UnaryExpression",lS="Unexpected token %0",hS="Unexpected number",dS="Unexpected string",pS="Unexpected identifier",gS="Unexpected reserved word",vS="Unexpected end of input",mS="Invalid regular expression",yS="Invalid regular expression: missing /",bS="Octal literals are not allowed in strict mode.",_S="Duplicate data property in object literal not allowed in strict mode",xS="ILLEGAL",wS="Disabled.",MS=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ]"),kS=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ０-９Ａ-Ｚ＿ａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ]"),ES={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},SS={if:1,this:1},AS={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"},CS=function(t){function e(e,n,r){return function(i){return function(e,n,r,i){var a=t(n[0]);return r&&(a=r+"("+a+")",0===r.lastIndexOf("new ",0)&&(a="("+a+")")),a+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}}var n="new Date";return{isNaN:"isNaN",isFinite:"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){e.length<3&&Xh("Missing arguments to clamp function."),e.length>3&&Xh("Too many arguments to clamp function.");var n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase","String",0),lower:e("toLowerCase","String",0),substring:e("substring","String"),replace:e("replace","String"),regexp:"RegExp",test:e("test","RegExp"),if:function(e){e.length<3&&Xh("Missing arguments to if function."),e.length>3&&Xh("Too many arguments to if function.");var n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}},DS={},zS=new Date(2e3,0,1),OS="undefined"!=typeof window&&window||null,NS="Literal",TS="Identifier",RS="@",PS="%",LS=":",qS=kl("area"),US=kl("bounds"),FS=kl("centroid"),jS={},IS=function(t,e,n,r){var i,a=e[0],o=e[e.length-1];return a>o&&(i=a,a=o,o=i),n=void 0===n||n,r=void 0===r||r,(n?a<=t:a<t)&&(r?t<=o:t<o)},$S="bin_",BS="intersect",WS="union",YS="index:unit",HS={random:function(){return t.random()},isArray:Zh,isBoolean:kd,isDate:Ed,isNumber:Sd,isObject:Qh,isRegExp:Ad,isString:Kh,isTuple:m,toBoolean:Nd,toDate:Td,toNumber:dd,toString:Rd,pad:Od,peek:hd,truncate:Ld,rgb:aa,lab:ha,hcl:ya,hsl:sa,sequence:mg,format:function(t,e){return ml("format",M_,e)(t)},utcFormat:function(t,e){return ml("utcFormat",$p,e)(t)},utcParse:function(t,e){return ml("utcParse",Bp,e)(t)},timeFormat:yl,timeParse:function(t,e){return ml("timeParse",Ip,e)(t)},monthFormat:function(t){return bl(t,1,"%B")},monthAbbrevFormat:function(t){return bl(t,1,"%b")},dayFormat:function(t){return bl(0,2+t,"%A")},dayAbbrevFormat:function(t){return bl(0,2+t,"%a")},quarter:function(t){return 1+~~(new Date(t).getMonth()/3)},utcquarter:function(t){return 1+~~(new Date(t).getUTCMonth()/3)},warn:function(){return _l(this.context.dataflow,"warn",arguments)},info:function(){return _l(this.context.dataflow,"info",arguments)},debug:function(){return _l(this.context.dataflow,"debug",arguments)},inScope:function(t){var e=this.context.group,n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},clampRange:function(t,e,n){var r,i=t[0],a=t[1];return a<i&&(r=a,a=i,i=r),(r=a-i)>=n-e?[e,n]:[Math.min(Math.max(i,e),n-r),Math.min(Math.max(a,r),n)]},pinchDistance:function(t){var e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){var e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){return OS?OS.screen:{}},containerSize:function(){var t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){return OS?[OS.innerWidth,OS.innerHeight]:[void 0,void 0]},span:function(t){return t[t.length-1]-t[0]||0},flush:function(t,e,n,r,i,a){var o=Math.abs(e-t[0]),u=Math.abs(hd(t)-e);return o<u&&o<=n?r:u<=n?i:a},bandspace:function(t,e,n){return nb(t||0,e||0,n||0)},inrange:IS,setdata:function(t,e){var n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(od).insert(e)),1},panLinear:f,panLog:c,panPow:l,zoomLinear:d,zoomLog:p,zoomPow:g,encode:function(t,e,n){if(t){var r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,a){var o,u,s=this.context.dataflow,f=this.context.data[t],c=f.input,l=f.changes,h=s.stamp();if(!1===s._trigger||!(c.value.length||e||r))return 0;if((!l||l.stamp<h)&&(f.changes=l=s.changeset(),l.stamp=h,s.runAfter(function(){f.modified=!0,s.pulse(c,l).run()},!0)),n&&(o=!0===n?od:Zh(n)||m(n)?n:zl(n),l.remove(o)),e&&l.insert(e),r&&(o=zl(r),c.value.some(o)?l.remove(o):l.insert(r)),i)for(u in a)l.modify(i,u,a[u]);return 1}},GS=["view","item","group","xy","x","y"],VS="event.vega.",XS="this.",JS={};Fl("bandwidth",function(t,e){var n=xl(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0},Ml),Fl("copy",function(t,e){var n=xl(t,(e||this).context);return n?n.copy():void 0},Ml),Fl("domain",function(t,e){var n=xl(t,(e||this).context);return n?n.domain():[]},Ml),Fl("range",function(t,e){var n=xl(t,(e||this).context);return n&&n.range?n.range():[]},Ml),Fl("invert",function(t,e,n){var r=xl(t,(n||this).context);return r?Zh(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0},Ml),Fl("scale",function(t,e,n){var r=xl(t,(n||this).context);return r?r(e):void 0},Ml),Fl("gradient",function(t,e,n,r){var i=nv(e,n),a=t.domain(),o=a[0],u=a[a.length-1],s=po(t,o,u);t.ticks&&(o!==(a=t.ticks(+r||15))[0]&&a.unshift(o),u!==a[a.length-1]&&a.push(u));for(var f=0,c=a.length;f<c;++f)i.stop(s(a[f]),t(a[f]));return i},Ml),Fl("geoArea",qS,Ml),Fl("geoBounds",US,Ml),Fl("geoCentroid",FS,Ml),Fl("indata",function(t,e,n){var r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i},function(t,e,n,r){e[0].type!==NS&&Xh("First argument to indata must be a string literal."),e[1].type!==NS&&Xh("Second argument to indata must be a string literal.");var i=e[0].value,a=e[1].value,o=RS+a;r.hasOwnProperty(o)||(r[o]=n.getData(i).indataRef(n,a))}),Fl("data",El,Sl),Fl("vlSingle",Rl,Sl),Fl("vlSingleDomain",Ll,Sl),Fl("vlMulti",Rl,Pl),Fl("vlMultiDomain",Ll,Pl),Fl("vlInterval",function(t,e,n){return Tl.call(this,t,e,n,Nl)},Sl),Fl("vlIntervalDomain",function(t,e,n,r){var i,a,o,u,s,f=this.context.data[t],c=f?f.values.value:[],l=c[0],h=0;if(l){for(i=l.intervals.length;h<i;++h)if(a=l.intervals[h],e&&a.encoding===e||n&&a.field===n){if(!a.extent)return;o=h,s=a.extent.length>2;break}return u=c.reduce(function(t,e){var n=e.intervals[o].extent,r=s?n.map(function(t){return{unit:e.unit,value:t}}):{unit:e.unit,value:n};return s?t.push.apply(t,r):t.push(r),t},[]),s?ql(u,r):Ul(u,r)}},Sl),Fl("treePath",function(t,e,n){var r=Cl(t,this),i=r[e],a=r[n];return i&&a?i.path(a).map(Al):void 0},Sl),Fl("treeAncestors",function(t,e){var n=Cl(t,this)[e];return n?n.ancestors().map(Al):void 0},Sl);var ZS,QS,KS={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function(t){return"_["+r("$"+t)+"]"},functions:function(t){var e=CS(t);GS.forEach(function(t){e[t]=VS+t});for(var n in HS)e[n]=XS+n;return e},constants:AS,visitors:JS},tA=function(t){function e(t){if(Kh(t))return t;var e=d[t.type];return null==e&&Xh("Unsupported type: "+t.type),e(t)}function n(t){var n={code:e(t),globals:Object.keys(f),fields:Object.keys(c)};return f={},c={},n}var r=(t=t||{}).whitelist?Pd(t.whitelist):{},i=t.blacklist?Pd(t.blacklist):{},a=t.constants||AS,o=(t.functions||CS)(e),u=t.globalvar,s=t.fieldvar,f={},c={},l=0,h=gd(u)?u:function(t){return u+'["'+t+'"]'},d={Literal:function(t){return t.raw},Identifier:function(t){var e=t.name;return l>0?e:i.hasOwnProperty(e)?Xh("Illegal identifier: "+e):a.hasOwnProperty(e)?a[e]:r.hasOwnProperty(e)?e:(f[e]=1,h(e))},MemberExpression:function(t){var n=!t.computed,r=e(t.object);n&&(l+=1);var i=e(t.property);return r===s&&(c[i]=1),n&&(l-=1),r+(n?"."+i:"["+i+"]")},CallExpression:function(t){"Identifier"!==t.callee.type&&Xh("Illegal callee type: "+t.callee.type);var n=t.callee.name,r=t.arguments,i=o.hasOwnProperty(n)&&o[n];return i||Xh("Unrecognized function: "+n),gd(i)?i(r):i+"("+r.map(e).join(",")+")"},ArrayExpression:function(t){return"["+t.elements.map(e).join(",")+"]"},BinaryExpression:function(t){return"("+e(t.left)+t.operator+e(t.right)+")"},UnaryExpression:function(t){return"("+t.operator+e(t.argument)+")"},ConditionalExpression:function(t){return"("+e(t.test)+"?"+e(t.consequent)+":"+e(t.alternate)+")"},LogicalExpression:function(t){return"("+e(t.left)+t.operator+e(t.right)+")"},ObjectExpression:function(t){return"{"+t.properties.map(e).join(",")+"}"},Property:function(t){l+=1;var n=e(t.key);return l-=1,n+":"+e(t.value)}};return n.functions=o,n.constants=a,n}(KS),eA=function(t,e,n){var i,a,o={};try{i=function(t){BE=0,WE=($E=t).length,YE=null,Yc();var e=vl();if(YE.type!==GE)throw new Error("Unexpect token after expression.");return e}(t)}catch(e){Xh("Expression parse error: "+r(t))}return i.visit(function(t){if("CallExpression"===t.type){var n=t.callee.name,r=KS.visitors[n];r&&r(n,t.arguments,e,o)}}),(a=tA(i)).globals.forEach(function(t){var n="$"+t;!o.hasOwnProperty(n)&&e.getSignal(t)&&(o[n]=e.signalRef(t))}),{$expr:n?n+"return("+a.code+");":a.code,$fields:a.fields,$params:o}},nA="view",rA="scope",iA="view",aA="[",oA="]",uA="{",sA="}",fA=":",cA=",",lA="@",hA=">",dA=/[[\]{}]/,pA={"*":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},gA="var datum=event.item&&event.item.datum;",vA=function(t,e,n){var i,a=t.events,o=t.update,u=t.encode,s=[],f="";a||Xh("Signal update missing events specification."),Kh(a)&&(a=function(t,e,n){return ZS=e||iA,QS=n||pA,Bl(t.trim()).map(Wl)}(a)),(a=pd(a).filter(function(t){return t.signal||t.scale?(s.push(t),0):1})).length&&s.push(a.length>1?{merge:a}:a[0]),null!=u&&(o&&Xh("Signal encode and update are mutually exclusive."),o="encode(item(),"+r(u)+")"),f=Kh(o)?eA(o,e,gA):null!=o.expr?eA(o.expr,e,gA):null!=o.value?o.value:null!=o.signal?{$expr:"_.value",$params:{value:e.signalRef(o.signal)}}:Xh("Invalid signal update specification."),i={target:n,update:f},t.force&&(i.options={force:!0}),s.forEach(function(t){t={source:function(t,e){return t.signal?e.getSignal(t.signal).id:t.scale?e.getScale(t.scale).id:jl(t,e)}(t,e)},e.addUpdate(bd(t,i))})},mA={$tupleid:1,toString:function(){return":_tupleid_:"}},yA=Xl("key"),bA="descending",_A=th("aggregate"),xA=th("axisticks"),wA=th("bound"),MA=th("collect"),kA=th("compare"),EA=th("datajoin"),SA=th("encode"),AA=th("facet"),CA=th("field"),DA=th("key"),zA=th("legendentries"),OA=th("mark"),NA=th("multiextent"),TA=th("multivalues"),RA=th("overlap"),PA=th("params"),LA=th("prefacet"),qA=th("projection"),UA=th("proxy"),FA=th("relay"),jA=th("render"),IA=th("scale"),$A=th("sieve"),BA=th("sortitems"),WA=th("viewlayout"),YA=th("values"),HA=0,GA=["identity","ordinal","band","point","bin-linear","bin-ordinal","linear","pow","sqrt","log","sequential","time","utc","quantize","quantile","threshold"],VA=Pd(GA),XA=Pd(GA.slice(1,6)),JA="top",ZA="left",QA="bottom",KA="guide-label",tC="group-title",eC=["shape","size","fill","stroke","strokeDash","opacity"],nC={name:1,interactive:1},rC=Pd(["rule"]),iC=Pd(["group","image","rect"]),aC=function(t,e){var n="";return rC[e]?n:(t.x2&&(t.x?(iC[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(iC[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;"),n)},oC=function(t,e,n,r){var i=eA(t,e);return i.$fields.forEach(function(t){r[t]=1}),bd(n,i.$params),i.$expr},uC=function(t,e,n,r){return ch(Qh(t)?t:{datum:t},e,n,r)},sC=function(t,e,n,r,i){var a,o,u,s=lh(t.scale,n,r,i);return null!=t.range?(o=s+".range()",e=0===(a=+t.range)?o+"[0]":"($="+o+","+(1===a?"$[$.length-1]":"$[0]+"+a+"*($[$.length-1]-$[0])")+")"):(void 0!==e&&(e=s+"("+e+")"),t.band&&(u=function(t,e){if(!Kh(t))return-1;var n=e.scaleType(t);return"band"===n||"point"===n?1:0}(t.scale,n))&&(a=(o=s+".bandwidth")+"()"+(1===(a=+t.band)?"":"*"+a),u<0&&(a="("+o+"?"+a+":0)"),e=(e?e+"+":"")+a,t.extra&&(e="(datum.extra?"+s+"(datum.extra.value):"+e+")")),null==e&&(e="0")),e},fC=function(t,e,n,r){return Qh(t)?"("+cC(null,t,e,n,r)+")":t},cC=function(t,e,n,i,a){if(null!=e.gradient)return function(t,e,n,i){return"this.gradient("+lh(t.gradient,e,n,i)+","+r(t.start)+","+r(t.stop)+","+r(t.count)+")"}(e,n,i,a);var o=e.signal?oC(e.signal,n,i,a):e.color?function(t,e,n,r){function i(t,i,a,o){return"this."+t+"("+[cC(null,i,e,n,r),cC(null,a,e,n,r),cC(null,o,e,n,r)].join(",")+").toString()"}return t.c?i("hcl",t.h,t.c,t.l):t.h||t.s?i("hsl",t.h,t.s,t.l):t.l||t.a?i("lab",t.l,t.a,t.b):t.r||t.g||t.b?i("rgb",t.r,t.g,t.b):null}(e.color,n,i,a):null!=e.field?uC(e.field,n,i,a):void 0!==e.value?r(e.value):void 0;return null!=e.scale&&(o=sC(e,o,n,i,a)),void 0===o&&(o=null),null!=e.exponent&&(o="Math.pow("+o+","+fC(e.exponent,n,i,a)+")"),null!=e.mult&&(o+="*"+fC(e.mult,n,i,a)),null!=e.offset&&(o+="+"+fC(e.offset,n,i,a)),e.round&&(o="Math.round("+o+")"),o},lC=function(t,e,n){return t+"["+r(e)+"]="+n+";"},hC=function(t,e,n,r,i){var a="";return e.forEach(function(e){var o=cC(t,e,n,r,i);a+=e.test?oC(e.test,n,r,i)+"?"+o+":":o}),lC("o",t,a)},dC="mark",pC="frame",gC="title",vC=function(t,e,n,r,i,a,o){return{type:t,name:o?o.name:void 0,role:e,style:o&&o.style||n,key:r,from:i,interactive:!(!o||!o.interactive),encode:gh(a,o,nC)}},mC="group",yC="text",bC=function(t,e,n,r,i,a,o){return{type:mC,name:n,role:t,style:e,from:r,interactive:i,encode:a,marks:o}},_C=function(t){var e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")?t.type===mC?"scope":e||dC:e},xC=function(t,e){var n=Se(t.type);n||Xh("Unrecognized transform type: "+r(t.type));var i=Hl(n.type.toLowerCase(),null,yh(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(i)),i.metadata=n.metadata||{},i};kh.fromEntries=function(t,e){var n=e.length,r=1,i=e[0],a=e[n-1],o=e[n-2],u=null;for(t.add(e[0]);r<n;++r)e[r].params.pulse=Vl(e[r-1]),t.add(e[r]),"aggregate"===e[r].type&&(u=e[r]);return new kh(t,i,o,a,u)};var wC=kh.prototype;wC.countsRef=function(t,e,n){var r,i,a,o=this.counts||(this.counts={}),u=Eh(e);return null!=u&&(t=this.scope,r=o[u]),r?n&&n.field&&Sh(t,r.agg.params,n):(a={groupby:t.fieldRef(e,"key"),pulse:Vl(this.output)},n&&n.field&&Sh(t,a,n),r={agg:i=t.add(_A(a)),ref:Vl(r=t.add(MA({pulse:Vl(i)})))},null!=u&&(o[u]=r)),r.ref},wC.tuplesRef=function(){return Vl(this.values)},wC.extentRef=function(t,e){return Ah(t,this,"extent","extent",e,!1)},wC.domainRef=function(t,e){return Ah(t,this,"domain","values",e,!1)},wC.valuesRef=function(t,e,n){return Ah(t,this,"vals","values",e,n||!0)},wC.lookupRef=function(t,e){return Ah(t,this,"lookup","tupleindex",e,!1)},wC.indataRef=function(t,e){return Ah(t,this,"indata","tupleindex",e,!0,!0)};var MC=function(t,e,n){var r,i,a=t.remove,o=t.insert,u=t.toggle,s=t.modify,f=t.values,c=e.add(Gl());r="if("+t.trigger+',modify("'+n+'",'+[o,a,u,s,f].map(function(t){return null==t?"null":t}).join(",")+"),0)",i=eA(r,e),c.update=i.$expr,c.params=i.$params},kC=function(t,e){var n,i,a,o,u,s,f,c,l,h,d,p,g,v=_C(t),m=t.type===mC,y=t.from&&t.from.facet,b=t.layout||"scope"===v||v===pC,_=v===dC||b||y,x=t.overlap;a=function(t,e,n){var r,i,a,o,u;return t?(r=t.facet)&&(e||Xh("Only group marks can be faceted."),null!=r.field?o=u=Vl(n.getData(r.data).output):(t.data?u=Vl(n.getData(t.data).aggregate):((a=xC(bd({type:"aggregate",groupby:pd(r.groupby)},r.aggregate),n)).params.key=n.keyRef(r.groupby),a.params.pulse=Vl(n.getData(r.data).output),o=u=Vl(n.add(a))),i=n.keyRef(r.groupby,!0))):o=Vl(n.add(MA(null,[{}]))),o||(o=t.$ref?t:Vl(n.getData(t.data).output)),{key:i,pulse:o,parent:u}}(t.from,m,e),l=Vl(i=e.add(EA({key:a.key||(t.key?Xl(t.key):void 0),pulse:a.pulse,clean:!m}))),i=o=e.add(MA({pulse:l})),h=Vl(i=e.add(OA({markdef:function(t){return{clip:t.clip||!1,interactive:!1!==t.interactive,marktype:t.type,name:t.name||void 0,role:t.role||_C(t),zindex:+t.zindex||void 0}}(t),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:Vl(i)}))),(i=e.add(SA(vh(t.encode,t.type,v,t.style,e,{pulse:h})))).params.parent=e.encode(),t.transform&&t.transform.forEach(function(t){var n=xC(t,e);(n.metadata.generates||n.metadata.changes)&&Xh("Mark transforms should not generate new data."),n.params.pulse=Vl(i),e.add(i=n)}),t.sort&&(i=e.add(BA({sort:e.compareRef(t.sort),pulse:Vl(i)}))),d=Vl(i),(y||b)&&(p=Vl(b=e.add(WA({layout:e.objectProperty(t.layout),legendMargin:e.config.legendMargin,mark:h,pulse:d})))),g=Vl(u=e.add(wA({mark:h,pulse:p||d}))),m&&(_&&((n=e.operators).pop(),b&&n.pop()),e.pushState(d,p||g,l),y?function(t,e,n){var i,a,o,u,s=t.from.facet,f=s.name,c=Vl(e.getData(s.data).output);s.name||Xh("Facet must have a name: "+r(s)),s.data||Xh("Facet must reference a data set: "+r(s)),s.field?u=e.add(LA({field:e.fieldRef(s.field),pulse:c})):s.groupby?u=e.add(AA({key:e.keyRef(s.groupby),group:Vl(e.proxy(n.parent)),pulse:c})):Xh("Facet must specify groupby or field: "+r(s)),a=(i=e.fork()).add(MA()),o=i.add($A({pulse:Vl(a)})),i.addData(f,new kh(i,a,a,o)),i.addSignal("parent",null),u.params.subflow={$subflow:CC(t,i).toRuntime()}}(t,e,a):_?function(t,e,n){var r=e.add(LA({pulse:n.pulse})),i=e.fork();i.add($A()),i.addSignal("parent",null),r.params.subflow={$subflow:CC(t,i).toRuntime()}}(t,e,a):CC(t,e),e.popState(),_&&(b&&n.push(b),n.push(u))),x&&(i={method:!0===x.method?"parity":x.method,pulse:g},x.order&&(i.sort=e.compareRef({field:x.order})),x.bound&&(i.boundScale=e.scaleRef(x.bound.scale),i.boundOrient=x.bound.orient,i.boundTolerance=x.bound.tolerance),g=Vl(e.add(RA(i)))),s=e.add(jA({pulse:g})),f=e.add($A({pulse:Vl(s)},void 0,e.parent())),null!=t.name&&(c=t.name,e.addData(c,new kh(e,o,s,f)),t.on&&t.on.forEach(function(t){(t.insert||t.remove||t.toggle)&&Xh("Marks only support modify triggers."),MC(t,e,c)}))},EC=function(t,e){var n,r,i,a,o,u,s,f,c=t.type||"symbol",l=e.config.legend,h=t.encode||{},d=h.legend||{},p=d.name||void 0,g=!!d.interactive,v=d.style,m=t.size||t.shape||t.fill||t.stroke||t.strokeDash||t.opacity;return m||Xh("Missing valid scale for legend."),n={orient:Kl(t.orient,l.orient),title:null!=t.title},r=Vl(e.add(MA(null,[n]))),d=gh({enter:function(t){var e={};return ph(e,"fill",t.fillColor)+ph(e,"stroke",t.strokeColor)+ph(e,"strokeWidth",t.strokeWidth)+ph(e,"strokeDash",t.strokeDash)+ph(e,"cornerRadius",t.cornerRadius)?e:void 0}(l),update:{offset:dh(Kl(t.offset,l.offset)),padding:dh(Kl(t.padding,l.padding)),titlePadding:dh(Kl(t.titlePadding,l.titlePadding))}},d,nC),u={update:{x:{field:{group:"padding"}},y:{field:{group:"padding"}},entryPadding:dh(Kl(t.entryPadding,l.entryPadding))}},"gradient"===c?(i=Vl(e.add(zA({type:"gradient",scale:e.scaleRef(m),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),formatSpecifier:e.property(t.format)}))),f=[function(t,e,n,r){var i,a,o={value:0},u={};return u.enter=i={opacity:o,x:o,y:o},ph(i,"width",n.gradientWidth),ph(i,"height",n.gradientHeight),ph(i,"stroke",n.gradientStrokeColor),ph(i,"strokeWidth",n.gradientStrokeWidth),u.exit={opacity:o},u.update=a={x:o,y:o,fill:{gradient:e},opacity:{value:1}},ph(a,"width",n.gradientWidth),ph(a,"height",n.gradientHeight),vC("rect","legend-gradient",null,void 0,void 0,u,r)}(0,m,l,h.gradient),function(t,e,n,r){var i,a,o={value:0},u={};return u.enter=i={opacity:o},ph(i,"fill",e.labelColor),ph(i,"font",e.labelFont),ph(i,"fontSize",e.labelFontSize),ph(i,"baseline",e.gradientLabelBaseline),ph(i,"limit",e.gradientLabelLimit),u.exit={opacity:o},u.update=a={opacity:{value:1},text:{field:"label"}},i.x=a.x={field:"perc",mult:e.gradientWidth},i.y=a.y={value:e.gradientHeight,offset:e.gradientLabelOffset},i.align=a.align={signal:'datum.perc<=0?"left":datum.perc>=1?"right":"center"'},vC(yC,"legend-label",KA,"perc",r,u,n)}(0,l,h.labels,i)]):(i=Vl(e.add(zA(s={scale:e.scaleRef(m),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),formatSpecifier:e.property(t.format)}))),f=[function(t,e,n,r){var i,a,o={value:0},u={};return u.enter=i={opacity:o},ph(i,"shape",e.symbolType),ph(i,"size",e.symbolSize),ph(i,"strokeWidth",e.symbolStrokeWidth),t.fill||(ph(i,"fill",e.symbolFillColor),ph(i,"stroke",e.symbolStrokeColor)),u.exit={opacity:o},u.update=a={opacity:{value:1}},i.x=a.x={field:"offset",mult:.5},i.y=a.y={field:"size",mult:.5,offset:{field:"total",offset:{field:{group:"entryPadding"},mult:{field:"index"}}}},eC.forEach(function(e){t[e]&&(a[e]=i[e]={scale:t[e],field:"value"})}),vC("symbol","legend-symbol",null,"value",r,u,n)}(t,l,h.symbols,i),function(t,e,n,r){var i,a,o={value:0},u={};return u.enter=i={opacity:o},ph(i,"align",e.labelAlign),ph(i,"baseline",e.labelBaseline),ph(i,"fill",e.labelColor),ph(i,"font",e.labelFont),ph(i,"fontSize",e.labelFontSize),ph(i,"limit",e.labelLimit),u.exit={opacity:o},u.update=a={opacity:{value:1},text:{field:"label"}},i.x=a.x={field:"offset",offset:e.labelOffset},i.y=a.y={field:"size",mult:.5,offset:{field:"total",offset:{field:{group:"entryPadding"},mult:{field:"index"}}}},vC(yC,"legend-label",KA,"value",r,u,n)}(0,l,h.labels,i)],s.size=function(t,e,n){var r=Ch(e,n[1].encode,"fontSize",KA);if(t.size)return{$expr:"Math.max(Math.ceil(Math.sqrt(_.scale(datum))),"+r+")"};var i=Ch(e,n[0].encode,"size");return Math.max(Math.ceil(Math.sqrt(i)),r)}(t,e,f)),f=[bC("legend-entry",null,null,r,g,u,f)],n.title&&(o=function(t,e,n,r){var i,a={value:0},o=t.title,u={};return u.enter=i={x:{field:{group:"padding"}},y:{field:{group:"padding"}},opacity:a},ph(i,"align",e.titleAlign),ph(i,"baseline",e.titleBaseline),ph(i,"fill",e.titleColor),ph(i,"font",e.titleFont),ph(i,"fontSize",e.titleFontSize),ph(i,"fontWeight",e.titleFontWeight),ph(i,"limit",e.titleLimit),u.exit={opacity:a},u.update={opacity:{value:1},text:o&&o.signal?{signal:o.signal}:{value:o+""}},vC(yC,"legend-title","guide-title",null,r,u,n)}(t,l,h.title,r),u.update.y.offset={field:{group:"titlePadding"},offset:Ch(e,o.encode,"fontSize","guide-title")},f.push(o)),a=bC("legend",v,p,r,g,d,f),t.zindex&&(a.zindex=t.zindex),kC(a,e)},SC=function(t,e){t=Kh(t)?{text:t}:t;var n,r,i,a=e.config.title,o=bd({},t.encode);return n={orient:null!=t.orient?t.orient:a.orient},r=Vl(e.add(MA(null,[n]))),o.name=t.name,o.interactive=t.interactive,i=function(t,e,n,r){var i,a,o,u,s,f,c=t.text,l=t.orient||e.orient,h=t.anchor||e.anchor,d=l===ZA||l===JA?-1:1,p=l===JA||l===QA,g={group:p?"width":"height"},v={};return v.enter=i={opacity:{value:0}},ph(i,"fill",e.color),ph(i,"font",e.font),ph(i,"fontSize",e.fontSize),ph(i,"fontWeight",e.fontWeight),v.exit={opacity:{value:0}},v.update=a={opacity:{value:1},text:Qh(c)?c:{value:c+""},offset:dh((null!=t.offset?t.offset:e.offset)||0)},"start"===h?(s=0,f="left"):"end"===h?(s=1,f="right"):(s=.5,f="center"),o={field:g,mult:s},u=d<0?{value:0}:p?{field:{group:"height"}}:{field:{group:"width"}},p?(a.x=o,a.y=u,a.angle={value:0},a.baseline={value:l===JA?"bottom":"top"}):(a.x=u,a.y=o,a.angle={value:90*d},a.baseline={value:"bottom"}),a.align={value:f},a.limit={field:g},ph(a,"angle",e.angle),ph(a,"baseline",e.baseline),ph(a,"limit",e.limit),vC(yC,gC,t.style||tC,null,r,v,n)}(t,a,o,r),t.zindex&&(i.zindex=t.zindex),kC(i,e)},AC=function(t,e){var n,r,i,a,o,u,s=function(t,e){var n=e.config,r=t.orient,i=r===JA||r===QA?n.axisX:n.axisY,a=n["axis"+r[0].toUpperCase()+r.slice(1)],o="band"===e.scaleType(t.scale)&&n.axisBand;return i||a||o?bd({},n.axis,i,a,o):n.axis}(t,e),f=t.encode||{},c=f.axis||{},l=c.name||void 0,h=!!c.interactive,d=c.style;return n={orient:t.orient,ticks:!!Kl(t.ticks,s.ticks),labels:!!Kl(t.labels,s.labels),grid:!!Kl(t.grid,s.grid),domain:!!Kl(t.domain,s.domain),title:!!Kl(t.title,!1)},r=Vl(e.add(MA({},[n]))),c=gh({update:{range:{signal:'abs(span(range("'+t.scale+'")))'},offset:dh(Kl(t.offset,0)),position:dh(Kl(t.position,0)),titlePadding:dh(Kl(t.titlePadding,s.titlePadding)),minExtent:dh(Kl(t.minExtent,s.minExtent)),maxExtent:dh(Kl(t.maxExtent,s.maxExtent))}},f.axis,nC),i=Vl(e.add(xA({scale:e.scaleRef(t.scale),extra:s.tickExtra,count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),formatSpecifier:e.property(t.format)}))),u=[],n.grid&&u.push(function(t,e,n,r){var i,a,o,u,s,f,c,l,h=t.orient,d=t.gridScale,p=h===ZA||h===JA?1:-1,g=p*t.offset||0,v={value:0},m={};return m.enter=i={opacity:v},ph(i,"stroke",e.gridColor),ph(i,"strokeWidth",e.gridWidth),ph(i,"strokeDash",e.gridDash),m.exit=a={opacity:v},m.update=o={},ph(o,"opacity",e.gridOpacity),u={scale:t.scale,field:"value",band:e.bandPosition,round:e.tickRound,extra:e.tickExtra,offset:e.tickOffset},h===JA||h===QA?(s="x",f="y",l="height"):(s="y",f="x",l="width"),c=f+"2",o[s]=i[s]=a[s]=u,d?(i[f]={scale:d,range:0,mult:p,offset:g},o[c]=i[c]={scale:d,range:1,mult:p,offset:g}):(i[f]={value:g},o[c]=i[c]={signal:l,mult:p,offset:g}),vC("rule","axis-grid",null,"value",r,m,n)}(t,s,f.grid,i)),n.ticks&&(a=Kl(t.tickSize,s.tickSize),u.push(function(t,e,n,r,i){var a,o,u,s,f,c=t.orient,l=c===ZA||c===JA?-1:1,h={value:0},d={};return d.enter=a={opacity:h},ph(a,"stroke",e.tickColor),ph(a,"strokeWidth",e.tickWidth),d.exit=o={opacity:h},d.update=u={opacity:{value:1}},s=dh(i),s.mult=l,f={scale:t.scale,field:"value",band:e.bandPosition,round:e.tickRound,extra:e.tickExtra,offset:e.tickOffset},c===JA||c===QA?(u.y=a.y=h,u.y2=a.y2=s,u.x=a.x=o.x=f):(u.x=a.x=h,u.x2=a.x2=s,u.y=a.y=o.y=f),vC("rule","axis-tick",null,"value",r,d,n)}(t,s,f.ticks,i,a))),n.labels&&(a=n.ticks?a:0,u.push(function(t,e,n,r,i){var a,o,u,s,f,c=t.orient,l=c===ZA||c===JA?-1:1,h=t.scale,d=Kl(t.labelPadding,e.labelPadding),p=Kl(t.labelBound,e.labelBound),g=Kl(t.labelFlush,e.labelFlush),v=null!=g&&!1!==g&&(g=+g)===g,m=+Kl(t.labelFlushOffset,e.labelFlushOffset),y=Kl(t.labelOverlap,e.labelOverlap),b={value:0},_={};return _.enter=a={opacity:b},ph(a,"angle",e.labelAngle),ph(a,"fill",e.labelColor),ph(a,"font",e.labelFont),ph(a,"fontSize",e.labelFontSize),ph(a,"limit",e.labelLimit),_.exit=o={opacity:b},_.update=u={opacity:{value:1},text:{field:"label"}},s=dh(i),s.mult=l,s.offset=dh(d),s.offset.mult=l,f={scale:h,field:"value",band:.5,offset:e.tickOffset},c===JA||c===QA?(u.y=a.y=s,u.x=a.x=o.x=f,ph(u,"align",v?Nh(h,g,'"left"','"right"','"center"'):"center"),v&&m&&ph(u,"dx",Nh(h,g,-m,m,0)),ph(u,"baseline",c===JA?"bottom":"top")):(u.x=a.x=s,u.y=a.y=o.y=f,ph(u,"align","right"===c?"left":"right"),ph(u,"baseline",v?Nh(h,g,'"bottom"','"top"','"middle"'):"middle"),v&&m&&ph(u,"dy",Nh(h,g,m,-m,0))),t=vC(yC,"axis-label",KA,"value",r,_,n),(y||p)&&(t.overlap={method:y,order:"datum.index",bound:p?{scale:h,orient:c,tolerance:+p}:null}),t}(t,s,f.labels,i,a))),n.domain&&u.push(function(t,e,n,r){var i,a,o,u,s,f=t.orient,c={value:0},l={};return l.enter=i={opacity:c},ph(i,"stroke",e.domainColor),ph(i,"strokeWidth",e.domainWidth),l.exit={opacity:c},l.update=a={opacity:{value:1}},f===JA||f===QA?(o="x",s="y"):(o="y",s="x"),u=o+"2",i[s]=c,a[o]=i[o]=Oh(t,0),a[u]=i[u]=Oh(t,1),vC("rule","axis-domain",null,null,r,l,n)}(t,s,f.domain,r)),n.title&&u.push(function(t,e,n,r){var i,a,o,u=t.orient,s=t.title,f=u===ZA||u===JA?-1:1,c=u===JA||u===QA,l={};return l.enter=i={opacity:{value:0}},ph(i,"align",e.titleAlign),ph(i,"fill",e.titleColor),ph(i,"font",e.titleFont),ph(i,"fontSize",e.titleFontSize),ph(i,"fontWeight",e.titleFontWeight),ph(i,"limit",e.titleLimit),l.exit={opacity:{value:0}},l.update=a={opacity:{value:1},text:s&&s.signal?{signal:s.signal}:{value:s+""}},o={scale:t.scale,range:.5},c?(a.x=o,a.angle={value:0},a.baseline={value:u===JA?"bottom":"top"}):(a.y=o,a.angle={value:90*f},a.baseline={value:"bottom"}),ph(a,"angle",e.titleAngle),ph(a,"baseline",e.titleBaseline),!ph(a,"x",e.titleX)&&c&&!mh("x",n)&&(l.enter.auto={value:!0}),!ph(a,"y",e.titleY)&&!c&&!mh("y",n)&&(l.enter.auto={value:!0}),vC(yC,"axis-title","guide-title",null,r,l,n)}(t,s,f.title,r)),o=bC("axis",d,l,r,h,c,u),t.zindex&&(o.zindex=t.zindex),kC(o,e)},CC=function(t,e,n){var i=pd(t.signals),a=pd(t.scales);return n||i.forEach(function(t){IE(t,e)}),pd(t.projections).forEach(function(t){!function(t,e){var n={};for(var r in t)"name"!==r&&(n[r]=fh(t[r],e));e.addProjection(t.name,n)}(t,e)}),a.forEach(function(t){!function(t,e){var n=t.type||"linear";VA.hasOwnProperty(n)||Xh("Unrecognized scale type: "+r(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e)}),pd(t.data).forEach(function(t){Dh(t,e)}),a.forEach(function(t){rh(t,e)}),i.forEach(function(t){!function(t,e){var n=e.getSignal(t.name);if(t.update){var r=eA(t.update,e);n.update=r.$expr,n.params=r.$params}t.on&&t.on.forEach(function(t){vA(t,e,n.id)})}(t,e)}),pd(t.axes).forEach(function(t){AC(t,e)}),pd(t.marks).forEach(function(t){kC(t,e)}),pd(t.legends).forEach(function(t){EC(t,e)}),t.title&&SC(t.title,e),e.parseLambdas(),e},DC=Pd(["width","height","padding","autosize"]),zC=Th.prototype=Rh.prototype;zC.fork=function(){return new Rh(this)},zC.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},zC.id=function(){return(this._subid?this._subid+":":0)+this._id++},zC.add=function(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(function(e){e.$ref=t.id}),t.refs=null),t},zC.proxy=function(t){var e=t instanceof Yl?Vl(t):t;return this.add(UA({value:e}))},zC.addStream=function(t){return this.streams.push(t),t.id=this.id(),t},zC.addUpdate=function(t){return this.updates.push(t),t},zC.finish=function(){function t(t,e,n){var r;t&&((r=t.data||(t.data={}))[e]||(r[e]=[])).push(n)}var e,n;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;for(e in this.data){t((n=this.data[e]).input,e,"input"),t(n.output,e,"output"),t(n.values,e,"values");for(var r in n.index)t(n.index[r],e,"index:"+r)}return this},zC.pushState=function(t,e,n){this._encode.push(Vl(this.add($A({pulse:t})))),this._parent.push(e),this._lookup.push(n?Vl(this.proxy(n)):null),this._markpath.push(-1)},zC.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},zC.parent=function(){return hd(this._parent)},zC.encode=function(){return hd(this._encode)},zC.lookup=function(){return hd(this._lookup)},zC.markpath=function(){var t=this._markpath;return++t[t.length-1]},zC.fieldRef=function(t,e){if(Kh(t))return Xl(t,e);t.signal||Xh("Unsupported field reference: "+r(t));var n,i=t.signal,a=this.field[i];return a||(n={name:this.signalRef(i)},e&&(n.as=e),this.field[i]=a=Vl(this.add(CA(n)))),a},zC.compareRef=function(t){function e(t){return Ql(t)?(r=!0,Vl(n[t.signal])):t}var n=this.signals,r=!1,i=pd(t.field).map(e),a=pd(t.order).map(e);return r?Vl(this.add(kA({fields:i,orders:a}))):Jl(i,a)},zC.keyRef=function(t,e){var n=this.signals,r=!1;return t=pd(t).map(function(t){return Ql(t)?(r=!0,Vl(n[t.signal])):t}),r?Vl(this.add(DA({fields:t,flat:e}))):function(t,e){var n={$key:t};return e&&(n.$flat=!0),n}(t,e)},zC.sortRef=function(t){if(!t)return t;var e=[Zl(t.op,t.field),mA],n=t.order||"ascending";return n.signal?Vl(this.add(kA({fields:e,orders:[n=this.signalRef(n.signal),n]}))):Jl(e,[n,n])},zC.event=function(t,e){var n=t+":"+e;if(!this.events[n]){var r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},zC.addSignal=function(t,e){this.signals.hasOwnProperty(t)&&Xh("Duplicate signal name: "+r(t));var n=e instanceof Yl?e:this.add(Gl(e));return this.signals[t]=n},zC.getSignal=function(t){return this.signals[t]||Xh("Unrecognized signal name: "+r(t)),this.signals[t]},zC.signalRef=function(t){return this.signals[t]?Vl(this.signals[t]):(this.lambdas.hasOwnProperty(t)||(this.lambdas[t]=this.add(Gl(null))),Vl(this.lambdas[t]))},zC.parseLambdas=function(){for(var t=Object.keys(this.lambdas),e=0,n=t.length;e<n;++e){var r=t[e],i=eA(r,this),a=this.lambdas[r];a.params=i.$params,a.update=i.$expr}},zC.property=function(t){return t&&t.signal?this.signalRef(t.signal):t},zC.objectProperty=function(t){return t&&Qh(t)?this.signalRef(t.signal||Ph(t)):t},zC.addBinding=function(t,e){this.bindings||Xh("Nested signals do not support binding: "+r(t)),this.bindings.push(bd({signal:t},e))},zC.addScaleProj=function(t,e){this.scales.hasOwnProperty(t)&&Xh("Duplicate scale or projection name: "+r(t)),this.scales[t]=this.add(e)},zC.addScale=function(t,e){this.addScaleProj(t,IA(e))},zC.addProjection=function(t,e){this.addScaleProj(t,qA(e))},zC.getScale=function(t){return this.scales[t]||Xh("Unrecognized scale name: "+r(t)),this.scales[t]},zC.projectionRef=zC.scaleRef=function(t){return Vl(this.getScale(t))},zC.projectionType=zC.scaleType=function(t){return this.getScale(t).params.type},zC.addData=function(t,e){return this.data.hasOwnProperty(t)&&Xh("Duplicate data set name: "+r(t)),this.data[t]=e},zC.getData=function(t){return this.data[t]||Xh("Undefined data set name: "+r(t)),this.data[t]},zC.addDataPipeline=function(t,e){return this.data.hasOwnProperty(t)&&Xh("Duplicate data set name: "+r(t)),this.addData(t,kh.fromEntries(this,e))};var OC=function(t){var e={padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:PC},area:{fill:PC},image:null,line:{stroke:PC,strokeWidth:RC},path:{stroke:PC},rect:{fill:PC},rule:{stroke:LC},shape:{stroke:PC},symbol:{fill:PC,size:64},text:{fill:LC,font:NC,fontSize:11},style:{"guide-label":{fill:LC,font:NC,fontSize:10},"guide-title":{fill:LC,font:NC,fontSize:11,fontWeight:"bold"},"group-title":{fill:LC,font:NC,fontSize:13,fontWeight:"bold"},point:{size:TC,strokeWidth:RC,shape:"circle"},circle:{size:TC,strokeWidth:RC},square:{size:TC,strokeWidth:RC,shape:"square"},cell:{fill:"transparent",stroke:UC}},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:qC,grid:!1,gridWidth:1,gridColor:UC,gridDash:[],gridOpacity:1,labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:qC,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titleAlign:"center",titlePadding:4},axisBand:{tickOffset:-1},legend:{orient:"right",offset:18,padding:0,entryPadding:5,titlePadding:5,gradientWidth:100,gradientHeight:20,gradientStrokeColor:UC,gradientStrokeWidth:0,gradientLabelBaseline:"top",gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelOffset:8,labelLimit:160,symbolType:"circle",symbolSize:100,symbolFillColor:"transparent",symbolStrokeColor:qC,symbolStrokeWidth:1.5,titleAlign:"left",titleBaseline:"top",titleLimit:180},title:{orient:"top",anchor:"middle",offset:4},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues",extent:[.2,1]},heatmap:{scheme:"viridis"},ramp:{scheme:"blues",extent:[.2,1]},diverging:{scheme:"blueorange"},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}};return(t||[]).forEach(function(t){var n,r;if(t)for(n in t)if("style"===n){r=e.style||(e.style={});for(n in t.style)r[n]=bd(r[n]||{},t.style[n])}else e[n]=Qh(t[n])?bd(e[n]||{},t[n]):t[n]}),e},NC="sans-serif",TC=30,RC=2,PC="#4c78a8",LC="#000",qC="#888",UC="#ddd",FC=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||Xh("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){var n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=Cd(t.$key,t.$flat))}},{key:"$expr",parse:function(t,e){var n="e:"+t.$expr;return e.fn[n]||(e.fn[n]=Vh(Lh(["datum","_"],t.$expr,e),t.$fields,t.$name))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;var n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=td(t.$field,t.$name))}},{key:"$encode",parse:function(t,e){var n,r,i=t.$encode,a={};for(n in i)r=i[n],a[n]=Vh(Uh(r.$expr,e),r.$fields),a[n].output=r.$output;return a}},{key:"$compare",parse:function(t,e){var n="c:"+t.$compare+"_"+t.$order,r=pd(t.$compare).map(function(t){return t&&t.$tupleid?y:t});return e.fn[n]||(e.fn[n]=vd(r,t.$order))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){var n=t.$subflow;return function(t,r,i){var a=$C(n,e.fork()),o=a.get(n.operators[0].id),u=a.signals.parent;return u&&u.set(i),o}}},{key:"$tupleid",parse:function(){return y}}],jC=function(t,e){!function(t){return"operator"===Ih(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?function(t,e){return Lh(["_"],t,e)}(t.update,e):null)},IC=function(t,e){var n=e.get(t.source),r=null,i=t.update,a=void 0;n||Xh("Source not defined: "+t.source),r=t.target&&t.target.$expr?qh(t.target.$expr,e):e.get(t.target),i&&i.$expr&&(i.$params&&(a=Fh(i.$params,e)),i=function(t,e){return Lh(["_","event"],t,e)}(i.$expr,e)),e.update(t,n,r,i,a)},$C=function(t,e){var n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),n.forEach(function(t){jC(t,e)}),n.forEach(function(t){!function(t,e){var n,r;t.params&&((n=e.get(t.id))||Xh("Invalid operator id: "+t.id),r=Fh(t.params,e),e.dataflow.connect(n,n.parameters(r)))}(t,e)}),(t.streams||[]).forEach(function(t){!function(t,e){var n,r=null!=t.filter?qh(t.filter,e):void 0,i=null!=t.stream?e.get(t.stream):void 0;t.source?i=e.events(t.source,t.type,r):t.merge&&(i=(n=t.merge.map(e.get.bind(e)))[0].merge.apply(n[0],n.slice(1))),t.between&&(n=t.between.map(e.get.bind(e)),i=i.between(n[0],n[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&Xh("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),e.stream(t,i)}(t,e)}),(t.updates||[]).forEach(function(t){IC(t,e)}),e.resolve()},BC={skip:!0},WC=function(t,e,n){return new $h(t,e,n)};$h.prototype=Bh.prototype={fork:function(){var t=new Bh(this);return(this.subcontext||(this.subcontext=[])).push(t),t},get:function(t){return this.nodes[t]},set:function(t,e){return this.nodes[t]=e},add:function(t,e){var n,r=this,i=r.dataflow;if(r.set(t.id,e),function(t){return"collect"===Ih(t)}(t.type)&&(n=t.value)&&(n.$ingest?i.ingest(e,n.$ingest,n.$format):n.$request?i.request(e,n.$request,n.$format):i.pulse(e,i.changeset().insert(n))),t.root&&(r.root=e),t.parent){var a=r.get(t.parent.$ref);a?(i.connect(a,[e]),e.targets().add(a)):(r.unresolved=r.unresolved||[]).push(function(){a=r.get(t.parent.$ref),i.connect(a,[e]),e.targets().add(a)})}if(t.signal&&(r.signals[t.signal]=e),t.scale&&(r.scales[t.scale]=e),t.data)for(var o in t.data)n=r.data[o]||(r.data[o]={}),t.data[o].forEach(function(t){n[t]=e})},resolve:function(){return(this.unresolved||[]).forEach(function(t){t()}),delete this.unresolved,this},operator:function(t,e,n){this.add(t,this.dataflow.add(t.value,e,n,t.react))},transform:function(t,e,n){this.add(t,this.dataflow.add(this.transforms[Ih(e)],n))},stream:function(t,e){this.set(t.id,e)},update:function(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(function(n){var i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)})}if(t.data){var i=n.data={};Object.keys(e.data).forEach(function(n){var r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)})}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map(function(e){return e.getState(t)})),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach(function(t){n.update(e.signals[t],i[t],BC)}),Object.keys(r||{}).forEach(function(t){n.pulse(e.data[t].input,n.changeset().remove(od).insert(r[t]))}),(t.subcontext||[]).forEach(function(t,n){var r=e.subcontext[n];r&&r.setState(t)})}};var YC=function(t,e,n){return $C(e,WC(t,ig,n||HS))},HC="padding",GC=Md(Hh,Me);GC.run=function(t){if(Me.prototype.run.call(this,t),this._redraw||this._resize)try{this.render()}catch(t){this.error(t)}return this},GC.render=function(){return this._renderer&&(this._resize&&(this._resize=0,function(t){var e=dc(t);t._renderer.background(t._background),t._renderer.resize(lc(t),hc(t),e),t._handler.origin(e)}(this)),this._renderer.render(this._scenegraph.root)),this._redraw=!1,this},GC.dirty=function(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},GC.container=function(){return this._el},GC.scenegraph=function(){return this._scenegraph},GC.signal=function(t,e,n){var r=Gh(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},GC.background=function(t){return arguments.length?(this._background=t,this._resize=1,this):this._background},GC.width=function(t){return arguments.length?this.signal("width",t):this.signal("width")},GC.height=function(t){return arguments.length?this.signal("height",t):this.signal("height")},GC.padding=function(t){return arguments.length?this.signal("padding",t):this.signal("padding")},GC.autosize=function(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},GC.renderer=function(t){return arguments.length?(zi(t)||Xh("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._renderer&&(this._renderer=null,this.initialize(this._el))),this):this._renderType},GC.loader=function(t){return arguments.length?(t!==this._loader&&(Me.prototype.loader.call(this,t),this._renderer&&(this._renderer=null,this.initialize(this._el))),this):this._loader},GC.resize=function(){return this._autosize=1,this},GC._resizeView=function(t,e,n,r,i,a){this.runAfter(function(o){var u=0;o._autosize=0,o.width()!==n&&(u=1,o.width(n),o._resizeWidth.skip(!0)),o.height()!==r&&(u=1,o.height(r),o._resizeHeight.skip(!0)),o._viewWidth!==t&&(o._resize=1,o._viewWidth=t),o._viewHeight!==e&&(o._resize=1,o._viewHeight=e),o._origin[0]===i[0]&&o._origin[1]===i[1]||(o._resize=1,o._origin=i),u&&o.run("enter"),a&&o.runAfter(function(){o.resize()})})},GC.addEventListener=function(t,e){return this._handler.on(t,e),this},GC.removeEventListener=function(t,e){return this._handler.off(t,e),this},GC.addSignalListener=function(t,e){var n=Gh(this,t),r=function(){e(t,n.value)};return r.handler=e,this.on(n,null,r),this},GC.removeSignalListener=function(t,e){var n=Gh(this,t)._targets||[],r=n.filter(function(t){var n=t._update;return n&&n.handler===e});return r.length&&n.remove(r[0]),this},GC.preventDefault=function(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},GC.tooltipHandler=function(t){var e=this._handler;return arguments.length?(e.handleTooltip=t||di.prototype.handleTooltip,this):e.handleTooltip},GC.events=function(t,e,n){var r,i=this,a=new D(n),o=function(n,r){t===CE&&function(t,e){var n=t._eventConfig.defaults,r=n&&n.prevent,i=n&&n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault();try{a.receive(AE(i,n,r))}catch(t){i.error(t)}finally{i.run()}};if(t===CE)return i.addEventListener(e,o),a;if(t===DE?"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&(r=document.querySelectorAll(t)),!r)return i.warn("Can not resolve event source: "+t),a;for(var u=0,s=r.length;u<s;++u)r[u].addEventListener(e,o);return i._eventListeners.push({type:e,sources:r,handler:o}),a},GC.finalize=function(){for(var t,e,n=this._eventListeners,r=n.length;--r>=0;)for(t=(e=n[r]).sources.length;--t>=0;)e.sources[t].removeEventListener(e.type,e.handler)},GC.hover=function(t,e){return t=[t||"hover"],e=[e||"update",t],this.on(this.events("view","mouseover",pc),gc,vc(t)),this.on(this.events("view","mouseout",pc),gc,vc(e)),this},GC.data=function(t){return fc(this,t).values.value},GC.change=cc,GC.insert=function(t,e){return cc.call(this,t,E().insert(e))},GC.remove=function(t,e){return cc.call(this,t,E().remove(e))},GC.initialize=function(t,e){var n,r,i=this,a=i._renderType,o=zi(a);return t=i._el=t?Mc(i,t):null,o||i.error("Unrecognized renderer type: "+a),n=o.handler||gi,r=t?o.renderer:o.headless,i._renderer=r?LE(i,i._renderer,t,r):null,i._handler=function(t,e,r,i){var a=(new n).scene(t.scenegraph().root).initialize(r,dc(t),t);return e&&(a.handleTooltip=e.handleTooltip,e.handlers().forEach(function(t){a.on(t.type,t.handler)})),a}(i,i._handler,t),i._redraw=!0,t&&(e=e?Mc(i,e):t.appendChild(zE("div",{class:"vega-bindings"})),i._bind.forEach(function(t){t.param.element&&(t.element=Mc(i,t.param.element))}),i._bind.forEach(function(t){PE(i,t.element||e,t)})),i},GC.toImageURL=function(t){return t!==sy.Canvas&&t!==sy.SVG&&t!==sy.PNG?Promise.reject("Unrecognized image type: "+t):qE(this,t).then(function(e){return t===sy.SVG?function(t,e){var n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(e.svg(),"image/svg+xml"):e.canvas().toDataURL("image/png")})},GC.toCanvas=function(){return qE(this,sy.Canvas).then(function(t){return t.canvas()})},GC.toSVG=function(){return qE(this,sy.SVG).then(function(t){return t.svg()})},GC.getState=function(t){return this._runtime.getState(t||{data:function(t,e){return e.modified&&Zh(e.input.value)&&t.indexOf("_:vega:_")},signals:function(t,e){return!("parent"===t||e instanceof ig.proxy)},recurse:!0})},GC.setState=function(t){var e=this;return e._trigger=!1,e._runtime.setState(t),e.run().runAfter(function(){e._trigger=!0}),this},bd(ig,Kg,$y,xw,sk,Tk,nE,pE,wE,EE),t.version="3.0.8",t.Dataflow=Me,t.EventStream=D,t.Parameters=S,t.Pulse=ge,t.MultiPulse=be,t.Operator=A,t.Transform=Ee,t.changeset=E,t.ingest=_,t.isTuple=m,t.definition=Se,t.transform=Ae,t.transforms=ig,t.tupleid=y,t.scale=fo,t.scheme=hw,t.interpolate=vo,t.interpolateRange=ho,t.timeInterval=mo,t.utcInterval=yo,t.projection=ls,t.View=Hh,t.parse=function(t,e){return Qh(t)||Xh("Input Vega specification must be an object."),function(t,e){var n,r,i,a,o,u=e.config;return e.background=t.background||u.background,e.eventConfig=u.events,o=Vl(e.root=e.add(Gl())),e.addSignal("width",t.width||0),e.addSignal("height",t.height||0),e.addSignal("padding",FE(t.padding,u)),e.addSignal("autosize",UE(t.autosize,u)),pd(t.signals).forEach(function(t){DC[t.name]||IE(t,e)}),r=e.add(MA()),i=gh({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t.encode),i=e.add(SA(vh(i,mC,pC,t.style,e,{pulse:Vl(r)}))),a=e.add(WA({layout:e.objectProperty(t.layout),legendMargin:u.legendMargin,autosize:e.signalRef("autosize"),mark:o,pulse:Vl(i)})),e.operators.pop(),e.pushState(Vl(i),Vl(a),null),CC(t,e,!0),e.operators.push(a),n=e.add(wA({mark:o,pulse:Vl(a)})),n=e.add(jA({pulse:Vl(n)})),n=e.add($A({pulse:Vl(n)})),e.addData("root",new kh(e,r,r,n)),e}(t,new Th(OC([e,t.config]))).toRuntime()},t.expressionFunction=Fl,t.formatLocale=Ua,t.timeFormatLocale=pe,t.runtime=$C,t.runtimeContext=WC,t.bin=ug,t.bootstrapCI=Ag,t.quartiles=Cg,t.setRandom=function(e){t.random=e},t.randomInteger=function(e,n){null==n&&(n=e,e=0);var r,i,a,o={};return o.min=function(t){return arguments.length?(r=t||0,a=i-r,o):r},o.max=function(t){return arguments.length?(i=t||0,a=i-r,o):i},o.sample=function(){return r+Math.floor(a*t.random())},o.pdf=function(t){return t===Math.floor(t)&&t>=r&&t<i?1/a:0},o.cdf=function(t){var e=Math.floor(t);return e<r?0:e>=i?1:(e-r+1)/a},o.icdf=function(t){return t>=0&&t<=1?r-1+Math.floor(t*a):NaN},o.min(e).max(n)},t.randomKDE=zg,t.randomMixture=Og,t.randomNormal=Dg,t.randomUniform=Ng,t.accessor=Vh,t.accessorName=e,t.accessorFields=n,t.id=nd,t.identity=rd,t.zero=id,t.one=ad,t.truthy=od,t.falsy=ud,t.logger=ld,t.None=0,t.Error=sd,t.Warn=2,t.Info=fd,t.Debug=cd,t.panLinear=f,t.panLog=c,t.panPow=l,t.zoomLinear=d,t.zoomLog=p,t.zoomPow=g,t.array=pd,t.compare=vd,t.constant=md,t.debounce=yd,t.error=Xh,t.extend=bd,t.extentIndex=_d,t.fastmap=wd,t.field=td,t.inherits=Md,t.isArray=Zh,t.isBoolean=kd,t.isDate=Ed,t.isFunction=gd,t.isNumber=Sd,t.isObject=Qh,t.isRegExp=Ad,t.isString=Kh,t.key=Cd,t.merge=Dd,t.pad=Od,t.peek=hd,t.repeat=zd,t.splitAccessPath=Jh,t.stringValue=r,t.toBoolean=Nd,t.toDate=Td,t.toNumber=dd,t.toString=Rd,t.toSet=Pd,t.truncate=Ld,t.visitArray=qd,t.loader=ap,t.read=Xp,t.inferType=X,t.inferTypes=J,t.typeParsers=op,t.formats=vp,t.Bounds=Sn,t.Gradient=nv,t.GroupItem=Cn,t.ResourceLoader=Rn,t.Item=An,t.Scenegraph=li,t.Handler=di,t.Renderer=pi,t.CanvasHandler=gi,t.CanvasRenderer=yi,t.SVGHandler=bi,t.SVGRenderer=Mi,t.SVGStringRenderer=Ai,t.RenderType=sy,t.renderModule=zi,t.Marks=Pm,t.boundContext=Rr,t.boundStroke=im,t.boundItem=Lm,t.boundMark=Um,t.pathCurves=br,t.pathSymbols=Mr,t.pathRectangle=Vv,t.pathTrail=Jv,t.pathParse=Uv,t.pathRender=Bv,t.point=Bm,t.canvas=iv,t.domCreate=Dn,t.domFind=zn,t.domChild=On,t.domClear=Nn,t.openTag=xi,t.closeTag=wi,t.font=ai,t.textMetrics=Nm,t.resetSVGClipId=function(){xm=1},t.sceneEqual=Oi,t.pathEqual=Ni,t.sceneToJSON=si,t.sceneFromJSON=fi,t.sceneZOrder=Ur,t.sceneVisit=Fr,t.scenePickVisit=jr,Object.defineProperty(t,"__esModule",{value:!0})});