cat/resources/public/js/vendor/vega-4.4.0.js
Midgard d94880b725 Eliminate CDNs
Make noctua and myself happy
2019-02-14 19:54:17 +01:00

1 line
No EOL
429 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.vega={})}(this,function(t){"use strict";function e(t,e,n){return t.fields=e||[],t.fname=n,t}function n(t){return null==t?null:t.fname}function r(t){return null==t?null:t.fields}function i(t){throw Error(t)}function a(t){var e,n,r,a=[],o=null,u=0,s=t.length,f="";function c(){a.push(f+t.substring(e,n)),f="",e=n+1}for(t+="",e=n=0;n<s;++n)if("\\"===(r=t[n]))f+=t.substring(e,n),e=++n;else if(r===o)c(),o=null,u=-1;else{if(o)continue;e===u&&'"'===r?(e=n+1,o=r):e===u&&"'"===r?(e=n+1,o=r):"."!==r||u?"["===r?(n>e&&c(),u=e=n+1):"]"===r&&(u||i("Access path missing open bracket: "+t),u>0&&c(),u=0,e=n+1):n>e?c():e=n+1}return u&&i("Access path missing closing bracket: "+t),o&&i("Access path missing closing quote: "+t),n>e&&(n++,c()),a}var o=Array.isArray;function u(t){return t===Object(t)}function s(t){return"string"==typeof t}function f(t){return o(t)?"["+t.map(f)+"]":u(t)||s(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function c(t,n){var r=a(t),i="return _["+r.map(f).join("][")+"];";return e(Function("_",i),[t=1===r.length?r[0]:t],n||t)}var l=[],h=c("id"),d=e(function(t){return t},l,"identity"),p=e(function(){return 0},l,"zero"),v=e(function(){return 1},l,"one"),g=e(function(){return!0},l,"true"),m=e(function(){return!1},l,"false");function y(t,e,n){var r=[e].concat([].slice.call(n));console[t].apply(console,r)}var b=0,_=1,x=2,w=3,M=4;function k(t){var e=t||b;return{level:function(t){return arguments.length?(e=+t,this):e},error:function(){return e>=_&&y("error","ERROR",arguments),this},warn:function(){return e>=x&&y("warn","WARN",arguments),this},info:function(){return e>=w&&y("log","INFO",arguments),this},debug:function(){return e>=M&&y("log","DEBUG",arguments),this}}}function E(t){return t[t.length-1]}function S(t){return null==t||""===t?null:+t}function A(t){return function(e){return t*Math.exp(e)}}function C(t){return function(e){return Math.log(t*e)}}function O(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function z(t,e,n,r){var i=n(t[0]),a=n(E(t)),o=(a-i)*e;return[r(i-o),r(a-o)]}function D(t,e){return z(t,e,S,d)}function N(t,e){var n=Math.sign(t[0]);return z(t,e,C(n),A(n))}function R(t,e,n){return z(t,e,O(n),O(1/n))}function T(t,e,n,r,i){var a=r(t[0]),o=r(E(t)),u=null!=e?r(e):(a+o)/2;return[i(u+(a-u)*n),i(u+(o-u)*n)]}function P(t,e,n){return T(t,e,n,S,d)}function L(t,e,n){var r=Math.sign(t[0]);return T(t,e,n,C(r),A(r))}function q(t,e,n,r){return T(t,e,n,O(r),O(1/r))}function U(t){return null!=t?o(t)?t:[t]:[]}function F(t){return"function"==typeof t}function j(t,n){var i,o,u,s,c,l,h,d,p,v=[],g=(t=U(t)).map(function(t,e){return null==t?null:(v.push(e),F(t)?t:a(t).map(f).join("]["))}),m=v.length-1,y=U(n),b="var u,v;return ";if(m<0)return null;for(o=0;o<=m;++o)F(u=g[i=v[o]])?(s="(u=this."+(l="f"+i)+"(a))",c="(v=this."+l+"(b))",(h=h||{})[l]=u):(s="(u=a["+u+"])",c="(v=b["+u+"])"),l="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[i]?(p=1,d=-1):(p=-1,d=1),b+="("+s+"<"+c+"||u==null)&&v!=null?"+d+":(u>v||v==null)&&u!=null?"+p+":"+l+"!==u&&v===v?"+d+":v!==v&&u===u?"+p+(i<m?":":":0");return u=Function("a","b",b+";"),h&&(u=u.bind(h)),t=t.reduce(function(t,e){return F(e)?(r(e)||[]).forEach(function(e){t[e]=1}):null!=e&&(t[e+""]=1),t},{}),e(u,Object.keys(t))}function I(t){return F(t)?t:function(){return t}}function $(t,e){var n,r;function i(){e(r),n=r=null}return function(e){r=e,n&&clearTimeout(n),n=setTimeout(i,t)}}function B(t){for(var e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r])t[n]=e[n];return t}function W(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]}var Y={};function G(t){var e,n,r={};function i(t){return r.hasOwnProperty(t)&&r[t]!==Y}return e={size:0,empty:0,object:r,has:i,get:function(t){return i(t)?r[t]:void 0},set:function(t,n){return i(t)||(++e.size,r[t]===Y&&--e.empty),r[t]=n,this},delete:function(t){return i(t)&&(--e.size,++e.empty,r[t]=Y),this},clear:function(){e.size=e.empty=0,e.object=r={}},test:function(t){return arguments.length?(n=t,e):n},clean:function(){var t,i,a={},o=0;for(t in r)(i=r[t])===Y||n&&n(i)||(a[t]=i,++o);e.size=o,e.empty=0,e.object=r=a}},t&&Object.keys(t).forEach(function(n){e.set(n,t[n])}),e}function H(t,e){var n=t.prototype=Object.create(e.prototype);return n.constructor=t,n}function V(t){return"boolean"==typeof t}function X(t){return"[object Date]"===Object.prototype.toString.call(t)}function J(t){return"number"==typeof t}function Z(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function Q(t,n){return t&&(t=n?U(t).map(function(t){return t.replace(/\\(.)/g,"$1")}):U(t)),e(t&&t.length?Function("_","return ''+"+t.map(function(t){return"_["+(n?f(t):a(t).map(f).join("]["))+"]"}).join("+'|'+")+";"):function(){return""},t,"key")}function K(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}function tt(t,e){for(var n="";--e>=0;)n+=t;return n}function et(t,e,n,r){var i=n||" ",a=t+"",o=e-a.length;return o<=0?a:"left"===r?tt(i,o)+a:"center"===r?tt(i,~~(o/2))+a+tt(i,Math.ceil(o/2)):a+tt(i,o)}function nt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}function rt(t){return J(t)?t:X(t)?t:Date.parse(t)}function it(t,e){return e=e||rt,null==t||""===t?null:e(t)}function at(t){return null==t||""===t?null:t+""}function ot(t){for(var e={},n=0,r=t.length;n<r;++n)e[t[n]]=!0;return e}function ut(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}function st(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)}}function ft(t){var e=t||d,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}var ct=Symbol("vega_id"),lt=1;function ht(t){return!(!t||!dt(t))}function dt(t){return t[ct]}function pt(t,e){return t[ct]=e,t}function vt(t){var e=t===Object(t)?t:{data:t};return dt(e)?e:pt(e,lt++)}function gt(t){return mt(t,vt({}))}function mt(t,e){for(var n in t)e[n]=t[n];return e}function yt(t,e){return pt(e,dt(t))}function bt(t){return t&&t.constructor===_t}function _t(){var t=[],e=[],n=[],r=[],i=[],a=!1;return{constructor:_t,insert:function(e){for(var n=U(e),r=0,i=n.length;r<i;++r)t.push(n[r]);return this},remove:function(t){for(var n=F(t)?r:e,i=U(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:I(r)};return F(t)?(a.filter=t,i.push(a)):(a.tuple=t,n.push(a)),this},encode:function(t,e){return F(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},reflow:function(){return a=!0,this},pulse:function(o,u){var s,f,c,l,h,d,p={},v={};for(s=0,f=u.length;s<f;++s)p[dt(u[s])]=1;for(s=0,f=e.length;s<f;++s)p[dt(h=e[s])]=-1;for(s=0,f=r.length;s<f;++s)l=r[s],u.forEach(function(t){l(t)&&(p[dt(t)]=-1)});for(s=0,f=t.length;s<f;++s)d=dt(h=t[s]),p[d]?p[d]=1:o.add.push(vt(t[s]));for(s=0,f=u.length;s<f;++s)h=u[s],p[dt(h)]<0&&o.rem.push(h);function g(t,e,n){n?t[e]=n(t):o.encode=e,a||(v[dt(t)]=t)}for(s=0,f=n.length;s<f;++s)h=(c=n[s]).tuple,l=c.field,(d=p[dt(h)])>0&&(g(h,l,c.value),o.modifies(l));for(s=0,f=i.length;s<f;++s)c=i[s],l=c.filter,u.forEach(function(t){l(t)&&p[dt(t)]>0&&g(t,c.field,c.value)}),o.modifies(c.field);if(a)o.mod=e.length||r.length?u.filter(function(t){return p[dt(t)]>0}):u.slice();else for(d in v)o.mod.push(v[d]);return o}}}var xt="_:mod:_";function wt(){Object.defineProperty(this,xt,{writable:!0,value:{}})}var Mt=wt.prototype;Mt.set=function(t,e,n,r){var i=this,a=i[t],u=i[xt];return null!=e&&e>=0?(a[e]!==n||r)&&(a[e]=n,u[e+":"+t]=-1,u[t]=-1):(a!==n||r)&&(i[t]=n,u[t]=o(n)?1+n.length:-1),i},Mt.modified=function(t,e){var n,r=this[xt];if(!arguments.length){for(n in r)if(r[n])return!0;return!1}if(o(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]},Mt.clear=function(){return this[xt]={},this};var kt=0,Et=new wt;function St(t,e,n,r){this.id=++kt,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}var At=St.prototype;function Ct(t){return function(e){var n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}At.targets=function(){return this._targets||(this._targets=ft(h))},At.set=function(t){return this.value!==t?(this.value=t,1):0},At.skip=Ct(1),At.modified=Ct(2),At.parameters=function(t,e,n){e=!1!==e;var r,a,u,s,f=this,c=f._argval=f._argval||new wt,l=f._argops=f._argops||[],h=[];function d(t,n,r){r instanceof St?(r!==f&&(e&&r.targets().add(f),h.push(r)),l.push({op:r,name:t,index:n})):c.set(t,n,r)}for(r in t)if(a=t[r],"pulse"===r)U(a).forEach(function(t){t instanceof St?t!==f&&(t.targets().add(f),h.push(t)):i("Pulse parameters must be operator instances.")}),f.source=a;else if(o(a))for(c.set(r,-1,Array(u=a.length)),s=0;s<u;++s)d(r,s,a[s]);else d(r,-1,a);return this.marshall().clear(),n&&(l.initonly=!0),h},At.marshall=function(t){var e,n,r,i,a,o=this._argval||Et,u=this._argops;if(u){for(n=0,r=u.length;n<r;++n)a=(i=(e=u[n]).op).modified()&&i.stamp===t,o.set(e.name,e.index,i.value,a);if(u.initonly){for(n=0;n<r;++n)(e=u[n]).op.targets().remove(this);this._argops=null,this._update=null}}return o},At.evaluate=function(t){var e=this._update;if(e){var n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},At.run=function(t){return t.stamp<=this.stamp?t.StopPropagation:(this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.stamp=t.stamp,this.pulse=e||t);var e};var Ot=0;function zt(t,e,n){this.id=++Ot,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Dt(t,e,n){return new zt(t,e,n)}var Nt=zt.prototype;Nt._filter=g,Nt._apply=d,Nt.targets=function(){return this._targets||(this._targets=ft(h))},Nt.consume=function(t){return arguments.length?(this._consume=!!t,this):!!this._consume},Nt.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())}},Nt.filter=function(t){var e=Dt(t);return this.targets().add(e),e},Nt.apply=function(t){var e=Dt(null,t);return this.targets().add(e),e},Nt.merge=function(){var t=Dt();this.targets().add(t);for(var e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},Nt.throttle=function(t){var e=-1;return this.filter(function(){var n=Date.now();return n-e>t?(e=n,1):0})},Nt.debounce=function(t){var e=Dt();return this.targets().add(Dt(null,null,$(t,function(t){var n=t.dataflow;e.receive(t),n&&n.run&&n.run()}))),e},Nt.between=function(t,e){var n=!1;return t.targets().add(Dt(null,null,function(){n=!0})),e.targets().add(Dt(null,null,function(){n=!1})),this.filter(function(){return n})};var Rt=/^([A-Za-z]+:)?\/\//,Tt="file://";function Pt(t){return{options:t||{},sanitize:qt,load:Lt,file:Ft,http:Ut}}function Lt(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 qt(t,e){return e=B({},this.options,e),new Promise(function(n,r){var i,a,o,u,s={href:null};null!=t&&"string"==typeof t?(a=Rt.test(t),(u=e.baseURL)&&!a&&(It(t,"/")||"/"===u[u.length-1]||(t="/"+t),t=u+t),o=(i=It(t,Tt))||"file"===e.mode||"http"!==e.mode&&!a&&jt(),i?t=t.slice(Tt.length):It(t,"//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(s,"localFile",{value:!!o}),s.href=t,e.target&&(s.target=e.target+""),n(s)):r("Sanitize failure, invalid URI: "+f(t))})}function Ut(t,e){return function(t,e){var n="function"==typeof fetch?fetch:require("node-fetch");return n?n(t,e):Promise.reject("No fetch method available.")}(t,B({},this.options.http,e)).then(function(t){if(!t.ok)throw t.status+""+t.statusText;return t.text()})}function Ft(t){return new Promise(function(e,n){var r=jt();r?r.readFile(t,function(t,r){t?n(t):e(r)}):n("No file system access for "+t)})}function jt(){var t="function"==typeof require&&require("fs");return t&&F(t.readFile)?t:null}function It(t,e){return null!=t&&0===t.lastIndexOf(e,0)}var $t={boolean:nt,integer:S,number:S,date:it,string:at,unknown:d},Bt=[function(t){return"true"===t||"false"===t||!0===t||!1===t},function(t){return Ht(t)&&(t=+t)==~~t},Ht,function(t){return!isNaN(Date.parse(t))}],Wt=["boolean","integer","number","date"];function Yt(t,e){if(!t||!t.length)return"unknown";var n,r,i,a,o=0,u=t.length,s=Bt.length,f=Bt.map(function(t,e){return e+1});for(r=0,u=t.length;r<u;++r)for(n=e?t[r][e]:t[r],i=0;i<s;++i)if(f[i]&&(null!=(a=n)&&a==a)&&!Bt[i](n)&&(f[i]=0,++o===Bt.length))return"string";return o=f.reduce(function(t,e){return 0===t?e:t},0)-1,Wt[o]}function Gt(t,e){return e.reduce(function(e,n){return e[n]=Yt(t,n),e},{})}function Ht(t){return!(isNaN(+t)||t instanceof Date)}var Vt={},Xt={},Jt=34,Zt=10,Qt=13;function Kt(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}")}function te(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,u=0,s=a<=0,f=!1;function c(){if(s)return Xt;if(f)return f=!1,Vt;var e,r,i=o;if(t.charCodeAt(i)===Jt){for(;o++<a&&t.charCodeAt(o)!==Jt||t.charCodeAt(++o)===Jt;);return(e=o)>=a?s=!0:(r=t.charCodeAt(o++))===Zt?f=!0:r===Qt&&(f=!0,t.charCodeAt(o)===Zt&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if((r=t.charCodeAt(e=o++))===Zt)f=!0;else if(r===Qt)f=!0,t.charCodeAt(o)===Zt&&++o;else if(r!==n)continue;return t.slice(i,e)}return s=!0,t.slice(i,a)}for(t.charCodeAt(a-1)===Zt&&--a,t.charCodeAt(a-1)===Qt&&--a;(r=c())!==Xt;){for(var l=[];r!==Vt&&r!==Xt;)l.push(r),r=c();e&&null==(l=e(l,u++))||i.push(l)}return i}function i(e){return e.map(a).join(t)}function a(t){return null==t?"":e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=Kt(t);return function(r,i){return e(n(r),i,t)}}(t,e):Kt(t)});return a.columns=i||[],a},parseRows:r,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(a).join(t)].concat(e.map(function(e){return n.map(function(t){return a(e[t])}).join(t)})).join("\n")},formatRows:function(t){return t.map(i).join("\n")}}}te(","),te("\t");function ee(t){return function(e,n){var r={delimiter:t};return ne(e,n?B(n,r):r)}}function ne(t,e){return e.header&&(t=e.header.map(f).join(e.delimiter)+"\n"+t),te(e.delimiter).parse(t+"")}function re(t,e){var n,r=e&&e.property?c(e.property):d;return!u(t)||(n=t,"function"==typeof Buffer&&F(Buffer.isBuffer)&&Buffer.isBuffer(n))?r(JSON.parse(t)):function(t,e){return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(r(t))}function ie(t){return t}function ae(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return oe(t,e)})}:oe(t,e)}function oe(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,a=ue(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 ue(t,e){var n=function(t){if(null==t)return ie;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}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],a=0,o=i.length;a<o;++a)e.push(n(i[a],a));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,o)}function a(t){return n(t)}function o(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function u(t){for(var e=o(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(u)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=a(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(a);break;case"LineString":n=o(e.arcs);break;case"MultiLineString":n=e.arcs.map(o);break;case"Polygon":n=s(e.arcs);break;case"MultiPolygon":n=e.arcs.map(s);break;default:return null}return{type:r,coordinates:n}}(e)}function se(t,e){var n={},r={},i={},a=[],o=-1;function u(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),a.push(i)}}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[++o],e[o]=n,e[r]=i)}),e.forEach(function(e){var n,a,o=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),u=o[0],s=o[1];if(n=i[u])if(delete i[n.end],n.push(e),n.end=s,a=r[s]){delete r[a.start];var f=a===n?n:n.concat(a);r[f.start=n.start]=i[f.end=a.end]=f}else r[n.start]=i[n.end]=n;else if(n=r[s])if(delete r[n.start],n.unshift(e),n.start=u,a=i[u]){delete i[a.end];var c=a===n?n:a.concat(n);r[c.start=a.start]=i[c.end=n.end]=c}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=u]=i[n.end=s]=n}),u(i,r),u(r,i),e.forEach(function(t){n[t<0?~t:t]||a.push([t])}),a}function fe(t){return ue(t,function(t,e,n){var r,i,a;if(arguments.length>1)r=function(t,e,n){var r,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:r})}function u(t){t.forEach(o)}function s(t){t.forEach(u)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":u(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":e.arcs.forEach(s)}}(e),a.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,n);else for(i=0,r=new Array(a=t.arcs.length);i<a;++i)r[i]=i;return{type:"MultiLineString",arcs:se(t,r)}}.apply(this,arguments))}var ce={dsv:ne,csv:ee(","),tsv:ee("\t"),json:re,topojson:function(t,e){var n,r,a;return t=re(t,e),n=e&&(a=e.feature)?ae:e&&(a=e.mesh)?fe:i("Missing TopoJSON feature or mesh parameter."),(r=(r=t.objects[a])?n(t,r):i("Invalid TopoJSON object: "+a))&&r.features||[r]}};function le(t,e){return arguments.length>1?(ce[t]=e,this):ce.hasOwnProperty(t)?ce[t]:null}var he=new Date,de=new Date;function pe(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 pe(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 he.setTime(+e),de.setTime(+r),t(he),t(de),Math.floor(n(he,de))},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}var ve=pe(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});ve.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?pe(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):ve:null};ve.range;var ge=6e4,me=6048e5,ye=pe(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()}),be=(ye.range,pe(function(t){t.setTime(Math.floor(t/ge)*ge)},function(t,e){t.setTime(+t+e*ge)},function(t,e){return(e-t)/ge},function(t){return t.getMinutes()})),_e=(be.range,pe(function(t){var e=t.getTimezoneOffset()*ge%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()})),xe=(_e.range,pe(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())*ge)/864e5},function(t){return t.getDate()-1}));xe.range;function we(t){return pe(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())*ge)/me})}var Me=we(0),ke=we(1),Ee=(we(2),we(3),we(4)),Se=(we(5),we(6),Me.range,ke.range,Ee.range,pe(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()})),Ae=(Se.range,pe(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()}));Ae.every=function(t){return isFinite(t=Math.floor(t))&&t>0?pe(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};Ae.range;var Ce=pe(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*ge)},function(t,e){return(e-t)/ge},function(t){return t.getUTCMinutes()}),Oe=(Ce.range,pe(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()})),ze=(Oe.range,pe(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}));ze.range;function De(t){return pe(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)/me})}var Ne=De(0),Re=De(1),Te=(De(2),De(3),De(4)),Pe=(De(5),De(6),Ne.range,Re.range,Te.range,pe(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()})),Le=(Pe.range,pe(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()}));Le.every=function(t){return isFinite(t=Math.floor(t))&&t>0?pe(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};Le.range;function qe(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 Ue(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 Fe(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var je,Ie,$e,Be,We,Ye={"-":"",_:" ",0:"0"},Ge=/^\s*\d+/,He=/^%/,Ve=/[\\^$*+?|[\]().{}]/g;function Xe(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 Je(t){return t.replace(Ve,"\\$&")}function Ze(t){return new RegExp("^(?:"+t.map(Je).join("|")+")","i")}function Qe(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function Ke(t,e,n){var r=Ge.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function tn(t,e,n){var r=Ge.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function en(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function nn(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function rn(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function an(t,e,n){var r=Ge.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function on(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function un(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 sn(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function fn(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function cn(t,e,n){var r=Ge.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function ln(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function hn(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function dn(t,e,n){var r=Ge.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function pn(t,e,n){var r=Ge.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function vn(t,e,n){var r=Ge.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function gn(t,e,n){var r=He.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function mn(t,e,n){var r=Ge.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function yn(t,e,n){var r=Ge.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function bn(t,e){return Xe(t.getDate(),e,2)}function _n(t,e){return Xe(t.getHours(),e,2)}function xn(t,e){return Xe(t.getHours()%12||12,e,2)}function wn(t,e){return Xe(1+xe.count(Ae(t),t),e,3)}function Mn(t,e){return Xe(t.getMilliseconds(),e,3)}function kn(t,e){return Mn(t,e)+"000"}function En(t,e){return Xe(t.getMonth()+1,e,2)}function Sn(t,e){return Xe(t.getMinutes(),e,2)}function An(t,e){return Xe(t.getSeconds(),e,2)}function Cn(t){var e=t.getDay();return 0===e?7:e}function On(t,e){return Xe(Me.count(Ae(t),t),e,2)}function zn(t,e){var n=t.getDay();return t=n>=4||0===n?Ee(t):Ee.ceil(t),Xe(Ee.count(Ae(t),t)+(4===Ae(t).getDay()),e,2)}function Dn(t){return t.getDay()}function Nn(t,e){return Xe(ke.count(Ae(t),t),e,2)}function Rn(t,e){return Xe(t.getFullYear()%100,e,2)}function Tn(t,e){return Xe(t.getFullYear()%1e4,e,4)}function Pn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Xe(e/60|0,"0",2)+Xe(e%60,"0",2)}function Ln(t,e){return Xe(t.getUTCDate(),e,2)}function qn(t,e){return Xe(t.getUTCHours(),e,2)}function Un(t,e){return Xe(t.getUTCHours()%12||12,e,2)}function Fn(t,e){return Xe(1+ze.count(Le(t),t),e,3)}function jn(t,e){return Xe(t.getUTCMilliseconds(),e,3)}function In(t,e){return jn(t,e)+"000"}function $n(t,e){return Xe(t.getUTCMonth()+1,e,2)}function Bn(t,e){return Xe(t.getUTCMinutes(),e,2)}function Wn(t,e){return Xe(t.getUTCSeconds(),e,2)}function Yn(t){var e=t.getUTCDay();return 0===e?7:e}function Gn(t,e){return Xe(Ne.count(Le(t),t),e,2)}function Hn(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Te(t):Te.ceil(t),Xe(Te.count(Le(t),t)+(4===Le(t).getUTCDay()),e,2)}function Vn(t){return t.getUTCDay()}function Xn(t,e){return Xe(Re.count(Le(t),t),e,2)}function Jn(t,e){return Xe(t.getUTCFullYear()%100,e,2)}function Zn(t,e){return Xe(t.getUTCFullYear()%1e4,e,4)}function Qn(){return"+0000"}function Kn(){return"%"}function tr(t){return+t}function er(t){return Math.floor(+t/1e3)}function nr(t){return je=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,u=t.months,s=t.shortMonths,f=Ze(i),c=Qe(i),l=Ze(a),h=Qe(a),d=Ze(o),p=Qe(o),v=Ze(u),g=Qe(u),m=Ze(s),y=Qe(s),b={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:bn,e:bn,f:kn,H:_n,I:xn,j:wn,L:Mn,m:En,M:Sn,p:function(t){return i[+(t.getHours()>=12)]},Q:tr,s:er,S:An,u:Cn,U:On,V:zn,w:Dn,W:Nn,x:null,X:null,y:Rn,Y:Tn,Z:Pn,"%":Kn},_={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Ln,e:Ln,f:In,H:qn,I:Un,j:Fn,L:jn,m:$n,M:Bn,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:tr,s:er,S:Wn,u:Yn,U:Gn,V:Hn,w:Vn,W:Xn,x:null,X:null,y:Jn,Y:Zn,Z:Qn,"%":Kn},x={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return k(t,e,n,r)},d:fn,e:fn,f:vn,H:ln,I:ln,j:cn,L:pn,m:sn,M:hn,p:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.p=c[r[0].toLowerCase()],n+r[0].length):-1},Q:mn,s:yn,S:dn,u:tn,U:en,V:nn,w:Ke,W:rn,x:function(t,e,r){return k(t,n,e,r)},X:function(t,e,n){return k(t,r,e,n)},y:on,Y:an,Z:un,"%":gn};function w(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=Ye[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 M(t,e){return function(n){var r,i,a=Fe(1900);if(k(a,t,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("p"in a&&(a.H=a.H%12+12*a.p),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=Ue(Fe(a.y))).getUTCDay(),r=i>4||0===i?Re.ceil(r):Re(r),r=ze.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=e(Fe(a.y))).getDay(),r=i>4||0===i?ke.ceil(r):ke(r),r=xe.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?Ue(Fe(a.y)).getUTCDay():e(Fe(a.y)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,Ue(a)):e(a)}}function k(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=x[i in Ye?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),_.x=w(n,_),_.X=w(r,_),_.c=w(e,_),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",qe);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t,Ue);return e.toString=function(){return t},e}}}(t),Ie=je.format,$e=je.parse,Be=je.utcFormat,We=je.utcParse,je}nr({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"]});Date.prototype.toISOString||Be("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||We("%Y-%m-%dT%H:%M:%S.%LZ");function rr(t,e,n){var r=le((e=e||{}).type||"json");return r||i("Unknown data format type: "+e.type),t=r(t,e),e.parse&&function(t,e,n){if(!t.length)return;n=n||$e;var r,i,a,o,u,s,f,c=t.columns||Object.keys(t[0]);"auto"===e&&(e=Gt(t,c));for(c=Object.keys(e),r=c.map(function(t){var r,i,a=e[t];if(a&&(0===a.indexOf("date:")||0===a.indexOf("utc:")))return("'"===(i=(r=a.split(/:(.+)?/,2))[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===r[0]?We(i):n(i);if(!$t[a])throw Error("Illegal format pattern: "+t+":"+a);return $t[a]}),o=0,s=t.length,f=c.length;o<s;++o)for(i=t[o],u=0;u<f;++u)a=c[u],i[a]=r[u](i[a])}(t,e.parse,n),t.hasOwnProperty("columns")&&delete t.columns,t}var ir={skip:!0};function ar(t,e,n,r,i,a){var o,u,s=B({},a,ir);F(n)||(n=I(n)),void 0===r?o=function(e){t.touch(n(e))}:F(r)?(u=new St(null,r,i,!1),o=function(e){var r,i=n(e);u.evaluate(e),bt(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)}function or(t,e,n,r,i,a){var o,u;void 0===r?u=n:(o=F(r)?r:I(r),(u=new St(null,r=n?function(t,e){var r=o(t,e);return n.skip()||(n.skip(r!==this.value).value=r),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)}var ur={};function sr(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}var fr=sr.prototype;function cr(t,e){return t?function(n,r){return t(n,r)&&e(n,r)}:e}function lr(t,e){var n=[];return st(t,e,function(t){n.push(t)}),n}function hr(t,e){var n={};return t.visit(e,function(t){n[dt(t)]=1}),function(t){return n[dt(t)]?null:t}}function dr(t,e,n,r){var i,a,o,u,s,f=this,c=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)for(s in a=f.fields||(f.fields={}),i.fields)a[s]=1;i.changed(f.ADD)&&(c|=f.ADD),i.changed(f.REM)&&(c|=f.REM),i.changed(f.MOD)&&(c|=f.MOD)}this.changes=c}fr.StopPropagation=ur,fr.ADD=1,fr.REM=2,fr.MOD=4,fr.ADD_REM=3,fr.ADD_MOD=5,fr.ALL=7,fr.REFLOW=8,fr.SOURCE=16,fr.NO_SOURCE=32,fr.NO_FIELDS=64,fr.fork=function(t){return new sr(this.dataflow).init(this,t)},fr.clone=function(){var t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},fr.addAll=function(){var t=this;return this.source&&this.source.length!==this.add.length?((t=new sr(this.dataflow).init(this)).add=t.source,t):t},fr.init=function(t,e){var n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source),n},fr.runAfter=function(t){this.dataflow.runAfter(t)},fr.changed=function(t){var e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},fr.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,hr(this,1))),this},fr.modifies=function(t){var e=U(t),n=this.fields||(this.fields={});return e.forEach(function(t){n[t]=!0}),this},fr.modified=function(t){var e=this.fields;return!(!this.mod.length||!e)&&(arguments.length?o(t)?t.some(function(t){return e[t]}):e[t]:!!e)},fr.filter=function(t,e){var n=this;return 1&t&&(n.addF=cr(n.addF,e)),2&t&&(n.remF=cr(n.remF,e)),4&t&&(n.modF=cr(n.modF,e)),16&t&&(n.srcF=cr(n.srcF,e)),n},fr.materialize=function(t){var e=this;return 1&(t=t||7)&&e.addF&&(e.add=lr(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=lr(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=lr(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},fr.visit=function(t,e){var n,r,i=this,a=e;return 16&t?(st(i.source,i.srcF,a),i):(1&t&&st(i.add,i.addF,a),2&t&&st(i.rem,i.remF,a),4&t&&st(i.mod,i.modF,a),8&t&&(n=i.source)&&((r=i.add.length+i.mod.length)===n.length||st(n,r?hr(i,5):i.srcF,a)),i)};var pr=H(dr,sr);function vr(t,e){try{e(t)}catch(e){t.error(e)}}pr.fork=function(t){var e=new sr(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},pr.changed=function(t){return this.changes&t},pr.modified=function(t){var e=this,n=e.fields;return n&&e.changes&e.MOD?o(t)?t.some(function(t){return n[t]}):n[t]:0},pr.filter=function(){i("MultiPulse does not support filtering.")},pr.materialize=function(){i("MultiPulse does not support materialization.")},pr.visit=function(t,e){var n=this,r=n.pulses,i=r.length,a=0;if(t&n.SOURCE)for(;a<i;++a)r[a].visit(t,e);else for(;a<i;++a)r[a].stamp===n.stamp&&r[a].visit(t,e);return n};var gr={skip:!1,force:!1};function mr(t){this.cmp=t,this.nodes=[]}var yr=mr.prototype;function br(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 _r(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,br(t,i,e,n)}function xr(){this._log=k(),this.logLevel(_),this._clock=0,this._rank=0;try{this._loader=Pt()}catch(t){}this._touched=ft(h),this._pulses={},this._pulse=null,this._heap=new mr(function(t,e){return t.qrank-e.qrank}),this._postrun=[]}yr.size=function(){return this.nodes.length},yr.clear=function(){return this.nodes=[],this},yr.peek=function(){return this.nodes[0]},yr.push=function(t){var e=this.nodes;return e.push(t),br(e,0,e.length-1,this.cmp)},yr.pop=function(){var t,e=this.nodes,n=e.pop();return e.length?(t=e[0],e[0]=n,_r(e,0,this.cmp)):t=n,t},yr.replace=function(t){var e=this.nodes,n=e[0];return e[0]=t,_r(e,0,this.cmp),n},yr.pushpop=function(t){var e=this.nodes,n=e[0];return e.length&&this.cmp(n,t)<0&&(e[0]=t,t=n,_r(e,0,this.cmp)),t};var wr=xr.prototype;function Mr(t){return function(){return this._log[t].apply(this,arguments)}}function kr(t,e){St.call(this,t,null,e)}wr.stamp=function(){return this._clock},wr.loader=function(t){return arguments.length?(this._loader=t,this):this._loader},wr.cleanThreshold=1e4,wr.add=function(t,e,n,r){var i,a=1;return t instanceof St?i=t:t&&t.prototype instanceof St?i=new t:F(t)?i=new St(null,t):(a=0,i=new St(t,e)),this.rank(i),a&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},wr.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)},wr.rank=function(t){t.rank=++this._rank},wr.rerank=function(t){for(var e,n,r,a=[t];a.length;)if(this.rank(e=a.pop()),n=e._targets)for(r=n.length;--r>=0;)a.push(e=n[r]),e===t&&i("Cycle detected in dataflow graph.")},wr.pulse=function(t,e,n){this.touch(t,n||gr);var r=new sr(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},wr.touch=function(t,e){var n=e||gr;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},wr.update=function(t,e,n){var r=n||gr;return(t.set(e)||r.force)&&this.touch(t,r),this},wr.changeset=_t,wr.ingest=function(t,e,n){return this.pulse(t,this.changeset().insert(rr(e,n)))},wr.request=function(t,e,n){var r=this,i=0,a=r._pending||function(t){var e,n,r=new Promise(function(r,i){e=function(){r(t)},n=i});return r.requests=0,r.done=function(){0==--r.requests&&t.runAfter(function(){t._pending=null;try{t.run(),t._pending?t._pending.then(e):e()}catch(t){n(t)}})},t._pending=r}(r);return a.requests+=1,r.loader().load(e,{context:"dataflow"}).then(function(t){return rr(t,n)},function(t){i=-1,r.error("Loading failed",e,t)}).catch(function(t){i=-2,r.error("Data ingestion failed",e,t)}).then(function(e){return r.pulse(t,r.changeset().remove(g).insert(e||[])),a.done(),i})},wr.events=function(t,e,n,r){for(var i,a=this,o=Dt(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):U(t)).length;s<f;++s)i[s].addEventListener(e,u);return o},wr.on=function(t,e,n,r,i){return(t instanceof St?or:ar)(this,t,e,n,r,i),this},wr.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 sr(a,++a._clock,t),u>=w&&(r=Date.now(),a.debug("-- START PROPAGATION ("+a._clock+") -----")),a._touched.forEach(function(t){a._enqueue(t,!0)}),a._touched=ft(h);try{for(;a._heap.size()>0;)(e=a._heap.pop()).rank===e.qrank?(n=e.run(a._getPulse(e,t)),u>=M&&a.debug(e.id,n===ur?"STOP":n,e),n!==ur&&(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>=w&&(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.sort(function(t,e){return e.priority-t.priority}).forEach(function(t){vr(a,t.callback)})}return this},wr.runAsync=function(){return this._pending||this.run()&&this._pending||Promise.resolve(this)},wr.runAfter=function(t,e,n){this._pulse||e?this._postrun.push({priority:n||0,callback:t}):vr(this,t)},wr._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))},wr._getPulse=function(t,e){var n,r=t.source,i=this._clock;return r&&o(r)?new dr(this,i,n=r.map(function(t){return t.pulse}),e):(n=this._pulses[t.id],r&&((r=r.pulse)&&r!==ur?r.stamp===i&&n.target!==t?n=r:n.source=r.source:n.source=[]),n)},wr.error=Mr("error"),wr.warn=Mr("warn"),wr.info=Mr("info"),wr.debug=Mr("debug"),wr.logLevel=Mr("level");var Er=H(kr,St);Er.run=function(t){return t.stamp<=this.stamp?t.StopPropagation:(this.skip()?this.skip(!1):e=this.evaluate(t),(e=e||t)!==t.StopPropagation&&(this.pulse=e),this.stamp=t.stamp,e);var e},Er.evaluate=function(t){var e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},Er.transform=function(){};var Sr={};function Ar(t){var e=Cr(t);return e&&e.Definition||null}function Cr(t){return t=t&&t.toLowerCase(),Sr.hasOwnProperty(t)?Sr[t]:null}function Or(t){return t&&t.length?1===t.length?t[0]:(e=t,function(t){for(var n=e.length,r=1,i=String(e[0](t));r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function zr(t,e,n){return n||t+(e?"_"+e:"")}var Dr={values:Tr({name:"values",init:"cell.store = true;",set:"cell.data.values()",idx:-1}),count:Tr({name:"count",set:"cell.num"}),__count__:Tr({name:"count",set:"this.missing + this.valid"}),missing:Tr({name:"missing",set:"this.missing"}),valid:Tr({name:"valid",set:"this.valid"}),sum:Tr({name:"sum",init:"this.sum = 0;",add:"this.sum += +v;",rem:"this.sum -= v;",set:"this.sum"}),mean:Tr({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.valid ? this.mean : undefined"}),average:Tr({name:"average",set:"this.valid ? this.mean : undefined",req:["mean"],idx:1}),variance:Tr({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) : undefined",req:["mean"],idx:1}),variancep:Tr({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : undefined",req:["variance"],idx:2}),stdev:Tr({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : undefined",req:["variance"],idx:2}),stdevp:Tr({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : undefined",req:["variance"],idx:2}),stderr:Tr({name:"stderr",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid * (this.valid-1))) : undefined",req:["variance"],idx:2}),distinct:Tr({name:"distinct",set:"cell.data.distinct(this.get)",req:["values"],idx:3}),ci0:Tr({name:"ci0",set:"cell.data.ci0(this.get)",req:["values"],idx:3}),ci1:Tr({name:"ci1",set:"cell.data.ci1(this.get)",req:["values"],idx:3}),median:Tr({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:Tr({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:Tr({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),argmin:Tr({name:"argmin",init:"this.argmin = undefined;",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = undefined;",set:"this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:Tr({name:"argmax",init:"this.argmax = undefined;",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = undefined;",set:"this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:Tr({name:"min",init:"this.min = undefined;",add:"if (v < this.min || this.min === undefined) 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:Tr({name:"max",init:"this.max = undefined;",add:"if (v > this.max || this.max === undefined) 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})},Nr=Object.keys(Dr);function Rr(t,e){return Dr[t](e)}function Tr(t){return function(e){var n=B({init:"",add:"",rem:"",idx:0},t);return n.out=e||t.name,n}}function Pr(t,e){return t.idx-e.idx}function Lr(t,e){var n=e||d,r=function(t,e){var n,r=t.reduce(function t(n,r){function i(e){n[e]||t(n,n[e]=Dr[e]())}return r.req&&r.req.forEach(i),e&&r.str&&r.str.forEach(i),n},t.reduce(function(t,e){return t[e.name]=e,t},{})),i=[];for(n in r)i.push(r[n]);return i.sort(Pr)}(t,!0),i="var cell = this.cell; this.valid = 0; this.missing = 0;",a="this.cell = cell; this.init();",o="if(v==null){++this.missing; return;} if(v!==v) return; ++this.valid;",u="if(v==null){--this.missing; return;} if(v!==v) return; --this.valid;",s="var cell = this.cell;";return r.forEach(function(t){i+=t.init,o+=t.add,u+=t.rem}),t.slice().sort(Pr).forEach(function(t){s+="t['"+t.out+"']="+t.set+";"}),s+="return t;",(a=Function("cell",a)).prototype.init=Function(i),a.prototype.add=Function("v","t",o),a.prototype.rem=Function("v","t",u),a.prototype.set=Function("t",s),a.prototype.get=n,a.fields=t.map(function(t){return t.out}),a}function qr(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],v=p-d;if(t.step)e=t.step;else if(t.steps){for(a=v/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(v)/l)-n));Math.ceil(v/e)>f;)e*=c;for(o=0,u=h.length;o<u;++o)(a=e/h[o])>=r&&v/a<=f&&(e=a)}return i=(a=Math.log(e))>=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}}function Ur(t,e){var n,r=[],i=t.length,a=-1;if(null==e)for(;++a<i;)isNaN(n=Fr(t[a]))||r.push(n);else for(;++a<i;)isNaN(n=Fr(e(t[a],a,t)))||r.push(n);return r}function Fr(t){return null===t?NaN:+t}function jr(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ir(t){var e;return 1===t.length&&(e=t,t=function(t,n){return jr(e(t),n)}),{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}}}t.random=Math.random;var $r=Ir(jr),Br=$r.right,Wr=$r.left;function Yr(t,e){let n,r;if(void 0===e)for(let e of t)null!=e&&e>=e&&(void 0===n?n=r=e:(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&a>=a&&(void 0===n?n=r=a:(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}function Gr(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}var Hr=Math.sqrt(50),Vr=Math.sqrt(10),Xr=Math.sqrt(2);function Jr(t,e,n=function(t){return null===t?NaN:+t}){if(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)}}function Zr(t,e,n=0,r=t.length-1,i=jr){for(;r>n;){if(r-n>600){const a=r-n+1,o=e-n+1,u=Math.log(a),s=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*s*(a-s)/a)*(o-a/2<0?-1:1);Zr(t,e,Math.max(n,Math.floor(e-o*s/a+f)),Math.min(r,Math.floor(e+(a-o)*s/a+f)),i)}const a=t[e];let o=n,u=r;for(Qr(t,n,e),i(t[r],a)>0&&Qr(t,n,r);o<u;){for(Qr(t,o,u),++o,--u;i(t[o],a)<0;)++o;for(;i(t[u],a)>0;)--u}0===i(t[n],a)?Qr(t,n,u):Qr(t,++u,r),u<=e&&(n=u+1),e<=u&&(r=u-1)}return t}function Qr(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Kr(e,n,r,i){if(!e.length)return[void 0,void 0];var a,o,u,s,f=Ur(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[Jr(s.sort(jr),r/2),Jr(s,1-r/2)]}function ti(t,e){var n=Ur(t,e);return[Jr(n.sort(jr),.25),Jr(n,.5),Jr(n,.75)]}function ei(e,n){var r,i,a=NaN,o={mean:function(t){return arguments.length?(r=t||0,a=NaN,o):r},stdev:function(t){return arguments.length?(i=null==t?1:t,a=NaN,o):i},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},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},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},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}};return o.mean(e).stdev(n)}function ni(e,n){var r=ei(),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&&(a=(r=e).length,o=ti(r),u=(o[2]-o[0])/1.34,n=1.06*Math.min(Math.sqrt(function(t,e){let n,r=0,i=0,a=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(a+=(n=e-i)*(e-(i+=n/++r)));else{let o=-1;for(let u of t)null!=(u=e(u,++o,t))&&(u=+u)>=u&&(a+=(n=u-i)*(u-(i+=n/++r)))}if(r>1)return a/(r-1)}(r)),u)*Math.pow(a,-.2)),i):n;var r,a,o,u},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)}function ri(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)}function ii(e,n){null==n&&(n=null==e?1:e,e=0);var r,i,a,o={};return o.min=function(t){return arguments.length?(a=i-(r=t||0),o):r},o.max=function(t){return arguments.length?(a=(i=t||0)-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)}function ai(t){this._key=t?c(t):dt,this.reset()}var oi=ai.prototype;function ui(t){kr.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}oi.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},oi.add=function(t){this._add.push(t)},oi.rem=function(t){this._rem.push(t)},oi.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},oi.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},oi.extent=function(t){if(this._get!==t||!this._ext){var e=this.values(),n=W(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},oi.argmin=function(t){return this.extent(t)[0]||{}},oi.argmax=function(t){return this.extent(t)[1]||{}},oi.min=function(t){var e=this.extent(t)[0];return null!=e?t(e):void 0},oi.max=function(t){var e=this.extent(t)[1];return null!=e?t(e):void 0},oi.quartile=function(t){return this._get===t&&this._q||(this._q=ti(this.values(),t),this._get=t),this._q},oi.q1=function(t){return this.quartile(t)[0]},oi.q2=function(t){return this.quartile(t)[1]},oi.q3=function(t){return this.quartile(t)[2]},oi.ci=function(t){return this._get===t&&this._ci||(this._ci=Kr(this.values(),1e3,.05,t),this._get=t),this._ci},oi.ci0=function(t){return this.ci(t)[0]},oi.ci1=function(t){return this.ci(t)[1]},ui.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Nr},{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 si=H(ui,kr);function fi(t){kr.call(this,null,t)}si.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)},si.cross=function(){var t=this,e=t.value,n=t._dnames,r=n.map(function(){return{}}),i=n.length;function a(t){var e,a,o,u;for(e in t)for(o=t[e].tuple,a=0;a<i;++a)r[a][u=o[n[a]]]=u}a(t._prev),a(e),function a(o,u,s){var f,c,l=n[s],h=r[s++];for(f in h)u[l]=h[f],c=o?o+"|"+f:f,s<i?a(c,u,s):e[c]||t.cell(c,u)}("",{},0)},si.init=function(t){var e=this._inputs=[],a=this._outputs=[],o={};function u(t){for(var n,i=U(r(t)),a=0,u=i.length;a<u;++a)o[n=i[a]]||(o[n]=1,e.push(n))}this._dims=U(t.groupby),this._dnames=this._dims.map(function(t){var e=n(t);return u(t),a.push(e),e}),this.cellkey=t.key?t.key:Or(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];var s,f,c,l,h,d,p=t.fields||[null],v=t.ops||["count"],g=t.as||[],m=p.length,y={};for(m!==v.length&&i("Unmatched number of fields and aggregate ops."),d=0;d<m;++d)s=p[d],f=v[d],null==s&&"count"!==f&&i("Null aggregate field specified."),h=zr(f,l=n(s),g[d]),a.push(h),"count"!==f?((c=y[l])||(u(s),(c=y[l]=[]).field=s,this._measures.push(c)),"count"!==f&&(this._countOnly=!1),c.push(Rr(f,h))):this._counts.push(h);return this._measures=this._measures.map(function(t){return Lr(t,t.field)}),{}},si.cellkey=Or(),si.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},si.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 ai),n},si.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?yt(e.tuple,o):vt(o)},si.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)},si.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)},si.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},si.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},fi.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 ci=H(fi,kr);function li(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?K(t,i,a.sort(t)):i.concat(a),a=[]),i}}}function hi(t){kr.call(this,[],t)}function di(t){St.call(this,null,pi,t)}function pi(t){return this.value&&!t.modified()?this.value:j(t.fields,t.orders)}function vi(t){kr.call(this,null,t)}ci.transform=function(t,e){var n,i=this._bins(t),a=i.start,o=i.step,u=t.as||["bin0","bin1"],s=u[0],f=u[1];return n=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(r(t.field))?e.ADD_MOD:e.ADD,e.visit(n,function(t){var e=i(t);t[s]=e,t[f]=null==e?null:a+o*(1+(e-a)/o)}),e.modifies(u)},ci._bins=function(t){if(this.value&&!t.modified())return this.value;var i,a,o=t.field,u=qr(t),s=u.start,f=u.stop,c=u.step;null!=(i=t.anchor)&&(a=i-(s+c*Math.floor((i-s)/c)),s+=a,f+=a);var l=function(t){var e=o(t);return null==e?null:(e=Math.max(s,Math.min(+e,f-c)),s+c*Math.floor((e-s)/c))};return l.start=s,l.stop=f,l.step=c,this.value=e(l,r(o),t.name||"bin_"+n(o))},hi.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},H(hi,kr).transform=function(t,e){var n=e.fork(e.ALL),r=li(dt,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),e.source&&e.source.root&&(this.value.root=e.source.root),n},H(di,St),vi.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 gi=H(vi,kr);function mi(t){kr.call(this,null,t)}gi.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)},gi._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},gi._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(t.NO_SOURCE|t.NO_FIELDS);for(n in a)r=o[n],i=a[n]||0,!r&&i?(o[n]=r=vt({}),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)},mi.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},H(mi,kr).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),r=e.materialize(e.SOURCE).source,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(vt(u)),(u={})[e]=a);return o}(r,a,o,t.filter||g)):n.mod=r,n.source=this.value,n.modifies(i)};var yi={kde:ni,mixture:ri,normal:ei,uniform:ii},bi="distributions",_i="function",xi="field";function wi(t){kr.call(this,null,t)}var Mi=[{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}]}],ki={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Mi},{name:"weights",type:"number",array:!0}]};function Ei(t){St.call(this,null,Si,t),this.modified(!0)}function Si(t){var i=t.expr;return this.value&&!t.modified("expr")?this.value:e(function(e){return i(e,t)},r(i),n(i))}function Ai(t){kr.call(this,[void 0,void 0],t)}function Ci(t,e){St.call(this,t),this.parent=e}wi.Definition={type:"Density",metadata:{generates:!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:Mi.concat(ki)},{name:"as",type:"string",array:!0,default:["value","density"]}]},H(wi,kr).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=function t(e,n){var r=e[_i];yi.hasOwnProperty(r)||i("Unknown distribution function: "+r);var a=yi[r]();for(var o in e)o===xi?a.data((e.from||n()).map(e[o])):o===bi?a[o](e[o].map(function(e){return t(e,n)})):typeof a[o]===_i&&a[o](e[o]);return a}(t.distribution,function(t){return function(){return t.materialize(t.SOURCE).source}}(e)),a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&i("Invalid density method: "+a),t.extent||r.data||i("Missing density extent parameter."),a=r[a];var o=t.as||["value","density"],u=t.extent||Yr(r.data()),s=(u[1]-u[0])/(t.steps||100),f=Gr(u[0],u[1]+s/2,s).map(function(t){var e={};return e[o[0]]=t,e[o[1]]=a(t),vt(e)});this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n},H(Ei,St),Ai.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},H(Ai,kr).transform=function(t,e){var n,r=this.value,i=t.field,a=r[0],o=r[1];((n=e.changed()||e.modified(i.fields)||t.modified("field"))||null==a)&&(a=1/0,o=-1/0),e.visit(n?e.SOURCE:e.ADD,function(t){var e=i(t);null!=e&&((e=+e)<a&&(a=e),e>o&&(o=e))}),isFinite(a)&&isFinite(o)||(a=o=void 0),this.value=[a,o]};var Oi=H(Ci,St);function zi(t){kr.call(this,{},t),this._keys=G();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)}}Oi.connect=function(t){return this.targets().add(t),t.source=this},Oi.add=function(t){this.value.add.push(t)},Oi.rem=function(t){this.value.rem.push(t)},Oi.mod=function(t){this.value.mod.push(t)},Oi.init=function(t){this.value.init(t,t.NO_SOURCE)},Oi.evaluate=function(){return this.value};var Di=H(zi,kr);function Ni(t){St.call(this,null,Ri,t)}function Ri(t){return this.value&&!t.modified()?this.value:o(t.name)?U(t.name).map(function(t){return c(t)}):c(t.name,t.as)}function Ti(t){kr.call(this,G(),t)}function Pi(t,e){return t?t.map(function(t,r){return e[r]||n(t)}):null}function Li(t){kr.call(this,[],t)}function qi(t){kr.call(this,[],t)}function Ui(t){kr.call(this,null,t)}function Fi(t){kr.call(this,[],t)}Di.activate=function(t){this._targets[this._targets.active++]=t},Di.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 Ci(n.fork(n.NO_SOURCE),this)).connect(e(i,t,a)),o[t]=u,this.activate(u)),u},Di.transform=function(t,e){var n=e.dataflow,r=this,i=t.key,a=t.subflow,o=this._keys,u=t.modified("key");function s(t){return r.subflow(t,a,e)}return this._group=t.group||{},this._targets.active=0,e.visit(e.REM,function(t){var e=dt(t),n=o.get(e);void 0!==n&&(o.delete(e),s(n).rem(t))}),e.visit(e.ADD,function(t){var e=i(t);o.set(dt(t),e),s(e).add(t)}),u||e.modified(i.fields)?e.visit(e.MOD,function(t){var e=dt(t),n=o.get(e),r=i(t);n===r?s(r).mod(t):(o.set(e,r),s(n).rem(t),s(r).add(t))}):e.changed(e.MOD)&&e.visit(e.MOD,function(t){s(o.get(dt(t))).mod(t)}),u&&e.visit(e.REFLOW,function(t){var e=dt(t),n=o.get(e),r=i(t);n!==r&&(o.set(e,r),s(n).rem(t),s(r).add(t))}),o.empty>n.cleanThreshold&&n.runAfter(o.clean),e},H(Ni,St),Ti.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},H(Ti,kr).transform=function(t,e){var n=e.dataflow,r=this.value,i=e.fork(),a=i.add,o=i.rem,u=i.mod,s=t.expr,f=!0;function c(e){var n=dt(e),i=s(e,t),c=r.get(n);i&&c?(r.delete(n),a.push(e)):i||c?f&&i&&!c&&u.push(e):(r.set(n,1),o.push(e))}return e.visit(e.REM,function(t){var e=dt(t);r.has(e)?r.delete(e):o.push(t)}),e.visit(e.ADD,function(e){s(e,t)?a.push(e):r.set(dt(e),1)}),e.visit(e.MOD,c),t.modified()&&(f=!1,e.visit(e.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i},Li.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0}]},H(Li,kr).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.fields,i=Pi(r,t.as||[]),a=i.length;return n.rem=this.value,e.visit(e.SOURCE,function(t){for(var e,o,u,s=r.map(function(e){return e(t)}),f=s.reduce(function(t,e){return Math.max(t,e.length)},0),c=0;c<f;++c){for(o=gt(t),e=0;e<a;++e)o[i[e]]=null==(u=s[e][c])?null:u;n.add.push(o)}}),this.value=n.source=n.add,n.modifies(i)},qi.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},H(qi,kr).transform=function(t,e){var r=e.fork(e.NO_SOURCE),i=t.fields,a=i.map(n),o=t.as||["key","value"],u=o[0],s=o[1],f=i.length;return r.rem=this.value,e.visit(e.SOURCE,function(t){for(var e,n=0;n<f;++n)(e=gt(t))[u]=a[n],e[s]=i[n](t),r.add.push(e)}),this.value=r.source=r.add,r.modifies(o)},Ui.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},H(Ui,kr).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)})},H(Fi,kr).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=vt(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 ji={value:"value",median:function(t,e){if(!(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,e))).length)return;const n=t.length,r=n>>1;return Zr(t,r-1,0),0==(1&n)&&Zr(t,r,r),Jr(t,.5)},mean:function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n},min:function(t,e){let n;if(void 0===e)for(let e of t)null!=e&&e>=e&&(void 0===n||n>e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&i>=i&&(void 0===n||n>i)&&(n=i)}return n},max:function(t,e){let n;if(void 0===e)for(let e of t)null!=e&&e>=e&&(void 0===n||n<e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&i>=i&&(void 0===n||n<i)&&(n=i)}return n}},Ii=[];function $i(t){kr.call(this,[],t)}function Bi(t){ui.call(this,t)}$i.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}]},H($i,kr).transform=function(t,e){var r,a,o,u,s,f,c,l,h,d,p=e.fork(e.ALL),v=function(t){var e,n=t.method||ji.value;if(null!=ji[n])return n===ji.value?(e=void 0!==t.value?t.value:0,function(){return e}):ji[n];i("Unrecognized imputation method: "+n)}(t),g=function(t){var e=t.field;return function(t){return t?e(t):NaN}}(t),m=n(t.field),y=n(t.key),b=(t.groupby||[]).map(n),_=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():[],v={},g={};for(p.forEach(function(t,e){v[t]=e+1}),u=0,c=t.length;u<c;++u)l=t[u],f=n(l),s=v[f]||(v[f]=p.push(f)),a=(i=e?e.map(h):Ii)+"",(o=g[a])||(o=g[a]=[],d.push(o),o.values=i),o[s-1]=l;return d.domain=p,d}(e.source,t.groupby,t.key,t.keyvals),x=[],w=this.value,M=_.domain.length;for(s=0,l=_.length;s<l;++s)for(o=(r=_[s]).values,a=NaN,c=0;c<M;++c)if(null==r[c]){for(u=_.domain[c],d={_impute:!0},f=0,h=o.length;f<h;++f)d[b[f]]=o[f];d[y]=u,d[m]=isNaN(a)?a=v(r,g):a,x.push(vt(d))}return x.length&&(p.add=p.materialize(p.ADD).add.concat(x)),w.length&&(p.rem=p.materialize(p.REM).rem.concat(w)),this.value=x,p},Bi.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:Nr},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};var Wi=H(Bi,ui);function Yi(t){St.call(this,null,Gi,t)}function Gi(t){return this.value&&!t.modified()?this.value:Q(t.fields,t.flat)}function Hi(t){kr.call(this,null,t)}function Vi(t){kr.call(this,{},t)}function Xi(t){St.call(this,null,Ji,t)}function Ji(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 Zi(t){St.call(this,null,Qi,t)}function Qi(t){return this.value&&!t.modified()?this.value:t.values.reduce(function(t,e){return t.concat(e)},[])}function Ki(t){kr.call(this,null,t)}function ta(t){ui.call(this,t)}Wi.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){B(t,n[r.cellkey(t)].tuple)}),e.reflow(i).modifies(this._outputs)},Wi.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},H(Yi,St),H(Hi,kr).transform=function(t,e){e.dataflow.request(this.target,t.url,t.format)},Vi.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}]},H(Vi,kr).transform=function(t,e){var r,a,o=e,u=t.as,s=t.fields,f=t.index,c=t.values,l=null==t.default?null:t.default,h=t.modified(),d=h?e.SOURCE:e.ADD,p=s.length;return c?(a=c.length,p>1&&!u&&i('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==p*a&&i('The "as" parameter has too few output field names.'),u=u||c.map(n),r=function(t){for(var e,n,r=0,i=0;r<p;++r)if(null==(n=f.get(s[r](t))))for(e=0;e<a;++e,++i)t[u[i]]=l;else for(e=0;e<a;++e,++i)t[u[i]]=c[e](n)}):(u||i("Missing output field names."),r=function(t){for(var e,n=0;n<p;++n)e=f.get(s[n](t)),t[u[n]]=null==e?l:e}),h?o=e.reflow(!0):d|=s.some(function(t){return e.modified(t.fields)})?e.MOD:0,e.visit(d,r),o.modifies(u)},H(Xi,St),H(Zi,St),H(Ki,kr),Ki.prototype.transform=function(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)},ta.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Nr,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};var ea=H(ta,ui);function na(t){zi.call(this,t)}function ra(t){kr.call(this,null,t)}function ia(t){kr.call(this,null,t)}function aa(t){kr.call(this,null,t)}function oa(t){kr.call(this,[],t),this.count=0}function ua(t){kr.call(this,null,t)}function sa(t){kr.call(this,null,t),this.modified(!0)}function fa(t){kr.call(this,G(),t)}function ca(t){kr.call(this,null,t)}ea._transform=ea.transform,ea.transform=function(t,n){return this._transform(function(t,n){var i=t.field,a=t.value,o=("count"===t.op?"__count__":t.op)||"sum",u=r(i).concat(r(a)),s=function(t,e,n){var r={},i=[];return n.visit(n.SOURCE,function(e){var n=t(e);r[n]||(r[n]=1,i.push(n))}),i.sort(function(t,e){return(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0)}),e?i.slice(0,e):i}(i,t.limit||0,n);return{key:t.key,groupby:t.groupby,ops:s.map(function(){return o}),fields:s.map(function(t){return function(t,n,r,i){return e(function(e){return n(e)===t?r(e):NaN},i,t+"")}(t,i,a,u)}),as:s.map(function(t){return t+""}),modified:t.modified.bind(t)}}(t,n),n)},H(na,zi).transform=function(t,e){var n=this,a=t.subflow,o=t.field;return(t.modified("field")||o&&e.modified(r(o)))&&i("PreFacet does not support field modification."),this._targets.active=0,e.visit(e.MOD,function(t){var r=n.subflow(dt(t),a,e,t);o?o(t).forEach(function(t){r.mod(t)}):r.mod(t)}),e.visit(e.ADD,function(t){var r=n.subflow(dt(t),a,e,t);o?o(t).forEach(function(t){r.add(vt(t))}):r.add(t)}),e.visit(e.REM,function(t){var r=n.subflow(dt(t),a,e,t);o?o(t).forEach(function(t){r.rem(t)}):r.rem(t)}),e},ra.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},H(ra,kr).transform=function(t,e){var n,r,i=t.fields,a=Pi(t.fields,t.as||[]),o=i?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,i,a)}:mt;return this.value?r=this.value:(e=e.addAll(),r=this.value={}),n=e.fork(e.NO_SOURCE),e.visit(e.REM,function(t){var e=dt(t);n.rem.push(r[e]),r[e]=null}),e.visit(e.ADD,function(t){var e=o(t,vt({}));r[dt(t)]=e,n.add.push(e)}),e.visit(e.MOD,function(t){n.mod.push(o(t,r[dt(t)]))}),n},H(ia,kr).transform=function(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation},H(aa,kr).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.NO_SOURCE),e.visit(e.REM,function(t){var e=dt(t);n.rem.push(r[e]),r[e]=null}),e.visit(e.ADD,function(t){var e=gt(t);r[dt(t)]=e,n.add.push(e)}),e.visit(e.MOD,function(t){n.mod.push(mt(t,r[dt(t)]))})),n},oa.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},H(oa,kr).transform=function(e,n){var r=n.fork(n.NO_SOURCE),i=e.modified("size"),a=e.size,o=this.value,u=this.count,s=0,f=o.reduce(function(t,e){return t[dt(e)]=1,t},{});function c(e){var n,i;o.length<a?o.push(e):(i=~~((u+1)*t.random()))<o.length&&i>=s&&(n=o[i],f[dt(n)]&&r.rem.push(n),o[i]=e),++u}if(n.rem.length&&(n.visit(n.REM,function(t){var e=dt(t);f[e]&&(f[e]=-1,r.rem.push(t)),--u}),o=o.filter(function(t){return-1!==f[dt(t)]})),(n.rem.length||i)&&o.length<a&&n.source&&(s=u=o.length,n.visit(n.SOURCE,function(t){f[dt(t)]||c(t)}),s=-1),i&&o.length>a){for(var l=0,h=o.length-a;l<h;++l)f[dt(o[l])]=-1,r.rem.push(o[l]);o=o.slice(h)}return n.mod.length&&n.visit(n.MOD,function(t){f[dt(t)]&&r.mod.push(t)}),n.add.length&&n.visit(n.ADD,c),(n.add.length||s<0)&&(r.add=o.filter(function(t){return!f[dt(t)]})),this.count=u,this.value=r.source=o,r},ua.Definition={type:"Sequence",metadata:{changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},H(ua,kr).transform=function(t,e){if(!this.value||t.modified()){var n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=Gr(t.start,t.stop,t.step||1).map(function(t){var e={};return e[r]=t,vt(e)}),n.add=e.add.concat(this.value),n}},H(sa,kr).transform=function(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation},H(fa,kr).transform=function(t,e){var n=e.dataflow,r=t.field,i=this.value,a=!0;function o(t){i.set(r(t),t)}return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,function(t){i.delete(r(t))}),e.visit(e.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()},H(ca,kr).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 la={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=la.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||i("ntile num must be greater than zero.");var n=la.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||i("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}}}},ha=Object.keys(la);function da(t){var e=U(t.ops),a=U(t.fields),o=U(t.params),u=U(t.as),s=this.outputs=[],f=this.windows=[],c={},l={},h=!0,d=[],v=[];function g(t){U(r(t)).forEach(function(t){c[t]=1})}g(t.sort),e.forEach(function(t,e){var r=a[e],c=n(r),m=zr(t,c,u[e]);if(g(r),s.push(m),la.hasOwnProperty(t))f.push(function(t,e,n,r){var i=la[t](e,n);return{init:i.init||p,update:function(t,e){e[r]=i.next(t)}}}(t,a[e],o[e],m));else{if(null==r&&"count"!==t&&i("Null aggregate field specified."),"count"===t)return void d.push(m);h=!1;var y=l[c];y||((y=l[c]=[]).field=r,v.push(y)),y.push(Rr(t,m))}}),(d.length||v.length)&&(this.cell=function(t,e,n){t=t.map(function(t){return Lr(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 ai;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}(v,d,h)),this.inputs=Object.keys(c)}var pa=da.prototype;function va(t){kr.call(this,{},t),this._mlen=0,this._mods=[]}pa.init=function(){this.windows.forEach(function(t){t.init()}),this.cell&&this.cell.init()},pa.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)},va.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ha.concat(Nr)},{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 ga=H(va,kr);function ma(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?Ir(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:o,compare:r||I(-1)};for(e.init();s<u;++s)ya(c,a,s,u),i&&ba(c,f),e.update(c,o[s])}function ya(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}function ba(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]))}ga.transform=function(t,e){var n,r,i=this,a=i.state,o=t.modified();this.stamp=e.stamp,a&&!o||(a=i.state=new da(t));var u=Or(t.groupby);function s(t){return i.group(u(t))}for(o||e.modified(a.inputs)?(i.value={},e.visit(e.SOURCE,function(t){s(t).add(t)})):(e.visit(e.REM,function(t){s(t).remove(t)}),e.visit(e.ADD,function(t){s(t).add(t)})),n=0,r=i._mlen;n<r;++n)ma(i._mods[n],a,t);return i._mlen=0,i._mods=[],e.reflow(o).modifies(a.outputs)},ga.group=function(t){var e=this.value[t];return e||((e=this.value[t]=li(dt)).stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e};var _a=Object.freeze({aggregate:ui,bin:fi,collect:hi,compare:di,countpattern:vi,cross:mi,density:wi,expression:Ei,extent:Ai,facet:zi,field:Ni,filter:Ti,flatten:Li,fold:qi,formula:Ui,generate:Fi,impute:$i,joinaggregate:Bi,key:Yi,load:Hi,lookup:Vi,multiextent:Xi,multivalues:Zi,params:Ki,pivot:ta,prefacet:na,project:ra,proxy:ia,relay:aa,sample:oa,sequence:ua,sieve:sa,subflow:Ci,tupleindex:fa,values:ca,window:va}),xa="top",wa="left",Ma="right",ka="bottom",Ea="top-left",Sa="top-right",Aa="bottom-left",Ca="bottom-right",Oa="start",za="end",Da="group",Na="axis",Ra="title",Ta="frame",Pa="scope",La="legend",qa="row-header",Ua="row-footer",Fa="row-title",ja="column-header",Ia="column-footer",$a="column-title",Ba="padding",Wa="symbol",Ya="fit",Ga="fit-x",Ha="fit-y",Va="pad",Xa="none",Ja="all",Za="each",Qa="flush",Ka="column",to="row";function eo(t){this.clear(),t&&this.union(t)}var no=eo.prototype;no.clone=function(){return new eo(this)},no.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},no.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},no.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},no.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},no.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},no.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},no.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},no.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)},no.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},no.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},no.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},no.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},no.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},no.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},no.width=function(){return this.x2-this.x1},no.height=function(){return this.y2-this.y1};var ro,io=0;function ao(t,e){var n,r=[];return n={id:"gradient_"+io++,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}}}function oo(t){this.mark=t,this.bounds=this.bounds||new eo}function uo(t){oo.call(this,t),this.items=this.items||[]}function so(t,e){return function(t,e){if("undefined"!=typeof document&&document.createElement){var n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}(t,e)||function(t,e){if(ro)try{return new ro(t,e)}catch(t){}return null}(t,e)||null}function fo(){return("undefined"!=typeof Image?Image:null)||ro&&ro.Image||null||null}function co(t){this._pending=0,this._loader=t||Pt()}H(uo,oo),["canvas","canvas-prebuilt"].some(function(t){try{"function"!=typeof(ro=require(t))&&(ro=null)}catch(t){ro=null}return ro});var lo=co.prototype;function ho(t){t._pending+=1}function po(t){t._pending-=1}lo.pending=function(){return this._pending},lo.sanitizeURL=function(t){var e=this;return ho(e),e._loader.sanitize(t,{context:"href"}).then(function(t){return po(e),t}).catch(function(){return po(e),null})},lo.loadImage=function(t){var e=this,n=fo();return ho(e),e._loader.sanitize(t,{context:"image"}).then(function(t){var r=t.href;if(!r||!n)throw{url:r};var i=new n;return i.onload=function(){po(e),i.loaded=!0},i.onerror=function(){po(e),i.loaded=!1},i.src=r,i}).catch(function(t){return po(e),{loaded:!1,width:0,height:0,src:t&&t.url||""}})},lo.ready=function(){var t=this;return new Promise(function(e){!function n(r){t.pending()?setTimeout(function(){n(!0)},10):e(r)}(!1)})};var vo=Math.PI,go=2*vo,mo=go-1e-6;function yo(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function bo(){return new yo}function _o(t){return function(){return t}}yo.prototype=bo.prototype={constructor:yo,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,v=h*h+d*d,g=Math.sqrt(p),m=Math.sqrt(l),y=i*Math.tan((vo-Math.acos((p+l-v)/(2*g*m)))/2),b=y/m,_=y/g;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%go+go),l>mo?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>=vo)+","+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 xo=Math.abs,wo=Math.atan2,Mo=Math.cos,ko=Math.max,Eo=Math.min,So=Math.sin,Ao=Math.sqrt,Co=1e-12,Oo=Math.PI,zo=Oo/2,Do=2*Oo;function No(t){return t>=1?zo:t<=-1?-zo:Math.asin(t)}function Ro(t){return t.innerRadius}function To(t){return t.outerRadius}function Po(t){return t.startAngle}function Lo(t){return t.endAngle}function qo(t){return t&&t.padAngle}function Uo(t,e,n,r,i,a,o){var u=t-n,s=e-r,f=(o?a:-a)/Ao(u*u+s*s),c=f*s,l=-f*u,h=t+c,d=e+l,p=n+c,v=r+l,g=(h+p)/2,m=(d+v)/2,y=p-h,b=v-d,_=y*y+b*b,x=i-a,w=h*v-p*d,M=(b<0?-1:1)*Ao(ko(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-g,O=E-m,z=S-g,D=A-m;return C*C+O*O>z*z+D*D&&(k=S,E=A),{cx:k,cy:E,x01:-c,y01:-l,x11:k*(i/x-1),y11:E*(i/x-1)}}function Fo(t){this._context=t}function jo(t){return new Fo(t)}function Io(t){return t[0]}function $o(t){return t[1]}function Bo(){var t=Io,e=$o,n=_o(!0),r=null,i=jo,a=null;function o(o){var u,s,f,c=o.length,l=!1;for(null==r&&(a=i(f=bo())),u=0;u<=c;++u)!(u<c&&n(s=o[u],u,o))===l&&((l=!l)?a.lineStart():a.lineEnd()),l&&a.point(+t(s,u,o),+e(s,u,o));if(f)return a=null,f+""||null}return o.x=function(e){return arguments.length?(t="function"==typeof e?e:_o(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:_o(+t),o):e},o.defined=function(t){return arguments.length?(n="function"==typeof t?t:_o(!!t),o):n},o.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),o):i},o.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),o):r},o}function Wo(){var t=Io,e=null,n=_o(0),r=$o,i=_o(!0),a=null,o=jo,u=null;function s(s){var f,c,l,h,d,p=s.length,v=!1,g=new Array(p),m=new Array(p);for(null==a&&(u=o(d=bo())),f=0;f<=p;++f){if(!(f<p&&i(h=s[f],f,s))===v)if(v=!v)c=f,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),l=f-1;l>=c;--l)u.point(g[l],m[l]);u.lineEnd(),u.areaEnd()}v&&(g[f]=+t(h,f,s),m[f]=+n(h,f,s),u.point(e?+e(h,f,s):g[f],r?+r(h,f,s):m[f]))}if(d)return u=null,d+""||null}function f(){return Bo().defined(i).curve(o).context(a)}return s.x=function(n){return arguments.length?(t="function"==typeof n?n:_o(+n),e=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:_o(+e),s):t},s.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:_o(+t),s):e},s.y=function(t){return arguments.length?(n="function"==typeof t?t:_o(+t),r=null,s):n},s.y0=function(t){return arguments.length?(n="function"==typeof t?t:_o(+t),s):n},s.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:_o(+t),s):r},s.lineX0=s.lineY0=function(){return f().x(t).y(n)},s.lineY1=function(){return f().x(t).y(r)},s.lineX1=function(){return f().x(e).y(n)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:_o(!!t),s):i},s.curve=function(t){return arguments.length?(o=t,null!=a&&(u=o(a)),s):o},s.context=function(t){return arguments.length?(null==t?a=u=null:u=o(a=t),s):a},s}Fo.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 Yo={draw:function(t,e){var n=Math.sqrt(e/Oo);t.moveTo(n,0),t.arc(0,0,n,0,Do)}};function Go(){}function Ho(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 Vo(t){this._context=t}function Xo(t){this._context=t}function Jo(t){this._context=t}function Zo(t,e){this._basis=new Vo(t),this._beta=e}Vo.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:Ho(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:Ho(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Xo.prototype={areaStart:Go,areaEnd:Go,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:Ho(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Jo.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:Ho(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Zo.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 Qo=function t(e){function n(t){return 1===e?new Vo(t):new Zo(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Ko(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 tu(t,e){this._context=t,this._k=(1-e)/6}tu.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:Ko(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:Ko(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 eu=function t(e){function n(t){return new tu(t,e)}return n.tension=function(e){return t(+e)},n}(0);function nu(t,e){this._context=t,this._k=(1-e)/6}nu.prototype={areaStart:Go,areaEnd:Go,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:Ko(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 ru=function t(e){function n(t){return new nu(t,e)}return n.tension=function(e){return t(+e)},n}(0);function iu(t,e){this._context=t,this._k=(1-e)/6}iu.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:Ko(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 au=function t(e){function n(t){return new iu(t,e)}return n.tension=function(e){return t(+e)},n}(0);function ou(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Co){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>Co){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 uu(t,e){this._context=t,this._alpha=e}uu.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:ou(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 su=function t(e){function n(t){return e?new uu(t,e):new tu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function fu(t,e){this._context=t,this._alpha=e}fu.prototype={areaStart:Go,areaEnd:Go,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:ou(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 cu=function t(e){function n(t){return e?new fu(t,e):new nu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function lu(t,e){this._context=t,this._alpha=e}lu.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:ou(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 hu=function t(e){function n(t){return e?new lu(t,e):new iu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function du(t){this._context=t}function pu(t){return t<0?-1:1}function vu(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(pu(a)+pu(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function gu(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function mu(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 yu(t){this._context=t}function bu(t){this._context=new _u(t)}function _u(t){this._context=t}function xu(t){this._context=t}function wu(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 Mu(t,e){this._context=t,this._t=e}du.prototype={areaStart:Go,areaEnd:Go,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))}},yu.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:mu(this,this._t0,gu(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(e=+e,(t=+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,mu(this,gu(this,n=vu(this,t,e)),n);break;default:mu(this,this._t0,n=vu(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(bu.prototype=Object.create(yu.prototype)).point=function(t,e){yu.prototype.point.call(this,e,t)},_u.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)}},xu.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=wu(t),i=wu(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)}},Mu.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 ku={basis:{curve:function(t){return new Vo(t)}},"basis-closed":{curve:function(t){return new Xo(t)}},"basis-open":{curve:function(t){return new Jo(t)}},bundle:{curve:Qo,tension:"beta",value:.85},cardinal:{curve:eu,tension:"tension",value:0},"cardinal-open":{curve:au,tension:"tension",value:0},"cardinal-closed":{curve:ru,tension:"tension",value:0},"catmull-rom":{curve:su,tension:"alpha",value:.5},"catmull-rom-closed":{curve:cu,tension:"alpha",value:.5},"catmull-rom-open":{curve:hu,tension:"alpha",value:.5},linear:{curve:jo},"linear-closed":{curve:function(t){return new du(t)}},monotone:{horizontal:function(t){return new bu(t)},vertical:function(t){return new yu(t)}},natural:{curve:function(t){return new xu(t)}},step:{curve:function(t){return new Mu(t,.5)}},"step-after":{curve:function(t){return new Mu(t,1)}},"step-before":{curve:function(t){return new Mu(t,0)}}};function Eu(t,e,n){var r=ku.hasOwnProperty(t)&&ku[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}var Su={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Au=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];function Cu(t){var e,n,r,i,a,o,u,s,f,c,l,h=[];for(s=0,c=(e=t.slice().replace(Au[0],"###$1").split(Au[1]).slice(1)).length;s<c;++s){for(r=(n=e[s]).slice(1).trim().replace(Au[2],"$1###$2").split(Au[3]),i=[o=n.charAt(0)],f=0,l=r.length;f<l;++f)(a=+r[f])===a&&i.push(a);if(u=Su[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}var Ou={},zu={},Du=[].join;function Nu(t){var e=Du.call(t);if(zu[e])return zu[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),v=Math.sin(i),g=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-_*v,w=r+v+_*p,M=n+g,k=r+m,E=M+_*m,S=k-_*g;return zu[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]}var Ru=["l",0,0,0,0,0,0,0];function Tu(t,e){var n=Ru[0]=t[0];if("a"===n||"A"===n)Ru[1]=e*t[1],Ru[2]=e*t[2],Ru[3]=t[3],Ru[4]=t[4],Ru[5]=t[5],Ru[6]=e*t[6],Ru[7]=e*t[7];else for(var r=1,i=t.length;r<i;++r)Ru[r]=e*t[r];return Ru}function Pu(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 v=0,g=e.length;v<g;++v){switch(a=e[v],1!==i&&(a=Tu(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":Lu(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":Lu(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}}function Lu(t,e,n,r){for(var i=function(t,e,n,r,i,a,o,u,s){var f=Du.call(arguments);if(Ou[f])return Ou[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,v=d*d/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);v>1&&(n*=v=Math.sqrt(v),r*=v);var g=h/n,m=l/n,y=-l/r,b=h/r,_=g*u+m*s,x=y*u+b*s,w=g*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),O=Math.atan2(M-A,w-S)-C;O<0&&1===a?O+=2*Math.PI:O>0&&0===a&&(O-=2*Math.PI);for(var z=Math.ceil(Math.abs(O/(.5*Math.PI+.001))),D=[],N=0;N<z;++N){var R=C+N*O/z,T=C+(N+1)*O/z;D[N]=[S,A,R,T,n,r,l,h]}return Ou[f]=D}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n),a=0;a<i.length;++a){var o=Nu(i[a]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}var qu=2*Math.PI,Uu=Math.sqrt(3)/2,Fu={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,qu)}},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=Uu*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=Uu*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=Uu*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=Uu*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}}};function ju(t){return Fu.hasOwnProperty(t)?Fu[t]:function(t){if(!Iu.hasOwnProperty(t)){var e=Cu(t);Iu[t]={draw:function(t,n){Pu(t,e,0,0,Math.sqrt(n)/2)}}}return Iu[t]}(t)}var Iu={};function $u(t){return t.x}function Bu(t){return t.y}function Wu(t){return t.width}function Yu(t){return t.height}function Gu(t){return function(){return t}}function Hu(){var t=$u,e=Bu,n=Wu,r=Yu,i=Gu(0),a=null;function o(o,u,s){var f,c=null!=u?u:+t.call(this,o),l=null!=s?s:+e.call(this,o),h=+n.call(this,o),d=+r.call(this,o),p=+i.call(this,o);if(a||(a=f=bo()),p<=0)a.rect(c,l,h,d);else{var v=c+h,g=l+d;a.moveTo(c+p,l),a.lineTo(v-p,l),a.quadraticCurveTo(v,l,v,l+p),a.lineTo(v,g-p),a.quadraticCurveTo(v,g,v-p,g),a.lineTo(c+p,g),a.quadraticCurveTo(c,g,c,g-p),a.lineTo(c,l+p),a.quadraticCurveTo(c,l,c+p,l),a.closePath()}if(f)return a=null,f+""||null}return o.x=function(e){return arguments.length?(t="function"==typeof e?e:Gu(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:Gu(+t),o):e},o.width=function(t){return arguments.length?(n="function"==typeof t?t:Gu(+t),o):n},o.height=function(t){return arguments.length?(r="function"==typeof t?t:Gu(+t),o):r},o.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Gu(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}var Vu=Math.PI;function Xu(){var t,e,n,r,i,a,o,u,s=null;function f(t,e,n){var r=n/2;if(i){var f=o-e,c=t-a;if(f||c){var l=Math.sqrt(f*f+c*c),h=(f/=l)*u,d=(c/=l)*u,p=Math.atan2(c,f);s.moveTo(a-h,o-d),s.lineTo(t-f*r,e-c*r),s.arc(t,e,r,p-Vu,p),s.lineTo(a+h,o+d),s.arc(a,o,u,p,p+Vu)}else s.arc(t,e,r,0,2*Vu);s.closePath()}else i=1;a=t,o=e,u=r}function c(a){var o,u,c,l=a.length,h=!1;for(null==s&&(s=c=bo()),o=0;o<=l;++o)!(o<l&&r(u=a[o],o,a))===h&&(h=!h)&&(i=0),h&&f(+t(u,o,a),+e(u,o,a),+n(u,o,a));if(c)return s=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(r=t,c):r},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}function Ju(t){return t.x||0}function Zu(t){return t.y||0}function Qu(t){return t.cornerRadius||0}function Ku(t){return!(!1===t.defined)}var ts=function(){var t=Ro,e=To,n=_o(0),r=null,i=Po,a=Lo,o=qo,u=null;function s(){var s,f,c,l=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-zo,p=a.apply(this,arguments)-zo,v=xo(p-d),g=p>d;if(u||(u=s=bo()),h<l&&(f=h,h=l,l=f),h>Co)if(v>Do-Co)u.moveTo(h*Mo(d),h*So(d)),u.arc(0,0,h,d,p,!g),l>Co&&(u.moveTo(l*Mo(p),l*So(p)),u.arc(0,0,l,p,d,g));else{var m,y,b=d,_=p,x=d,w=p,M=v,k=v,E=o.apply(this,arguments)/2,S=E>Co&&(r?+r.apply(this,arguments):Ao(l*l+h*h)),A=Eo(xo(h-l)/2,+n.apply(this,arguments)),C=A,O=A;if(S>Co){var z=No(S/l*So(E)),D=No(S/h*So(E));(M-=2*z)>Co?(x+=z*=g?1:-1,w-=z):(M=0,x=w=(d+p)/2),(k-=2*D)>Co?(b+=D*=g?1:-1,_-=D):(k=0,b=_=(d+p)/2)}var N=h*Mo(b),R=h*So(b),T=l*Mo(w),P=l*So(w);if(A>Co){var L=h*Mo(_),q=h*So(_),U=l*Mo(x),F=l*So(x);if(v<Oo){var j=M>Co?function(t,e,n,r,i,a,o,u){var s=n-t,f=r-e,c=o-i,l=u-a,h=(c*(e-a)-l*(t-i))/(l*s-c*f);return[t+h*s,e+h*f]}(N,R,U,F,L,q,T,P):[T,P],I=N-j[0],$=R-j[1],B=L-j[0],W=q-j[1],Y=1/So(((c=(I*B+$*W)/(Ao(I*I+$*$)*Ao(B*B+W*W)))>1?0:c<-1?Oo:Math.acos(c))/2),G=Ao(j[0]*j[0]+j[1]*j[1]);C=Eo(A,(l-G)/(Y-1)),O=Eo(A,(h-G)/(Y+1))}}k>Co?O>Co?(m=Uo(U,F,N,R,h,O,g),y=Uo(L,q,T,P,h,O,g),u.moveTo(m.cx+m.x01,m.cy+m.y01),O<A?u.arc(m.cx,m.cy,O,wo(m.y01,m.x01),wo(y.y01,y.x01),!g):(u.arc(m.cx,m.cy,O,wo(m.y01,m.x01),wo(m.y11,m.x11),!g),u.arc(0,0,h,wo(m.cy+m.y11,m.cx+m.x11),wo(y.cy+y.y11,y.cx+y.x11),!g),u.arc(y.cx,y.cy,O,wo(y.y11,y.x11),wo(y.y01,y.x01),!g))):(u.moveTo(N,R),u.arc(0,0,h,b,_,!g)):u.moveTo(N,R),l>Co&&M>Co?C>Co?(m=Uo(T,P,L,q,l,-C,g),y=Uo(N,R,U,F,l,-C,g),u.lineTo(m.cx+m.x01,m.cy+m.y01),C<A?u.arc(m.cx,m.cy,C,wo(m.y01,m.x01),wo(y.y01,y.x01),!g):(u.arc(m.cx,m.cy,C,wo(m.y01,m.x01),wo(m.y11,m.x11),!g),u.arc(0,0,l,wo(m.cy+m.y11,m.cx+m.x11),wo(y.cy+y.y11,y.cx+y.x11),g),u.arc(y.cx,y.cy,C,wo(y.y11,y.x11),wo(y.y01,y.x01),!g))):u.arc(0,0,l,w,x,g):u.lineTo(T,P)}else u.moveTo(0,0);if(u.closePath(),s)return u=null,s+""||null}return s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Oo/2;return[Mo(r)*n,So(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:_o(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:_o(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:_o(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:_o(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:_o(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:_o(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:_o(+t),s):o},s.context=function(t){return arguments.length?(u=null==t?null:t,s):u},s}().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(Qu),es=Wo().x(Ju).y1(Zu).y0(function(t){return(t.y||0)+(t.height||0)}).defined(Ku),ns=Wo().y(Zu).x1(Ju).x0(function(t){return(t.x||0)+(t.width||0)}).defined(Ku),rs=Bo().x(Ju).y(Zu).defined(Ku),is=Hu().x(Ju).y(Zu).width(function(t){return t.width||0}).height(function(t){return t.height||0}).cornerRadius(Qu),as=function(){var t=_o(Yo),e=_o(64),n=null;function r(){var r;if(n||(n=r=bo()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:_o(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:_o(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type(function(t){return ju(t.shape||"circle")}).size(function(t){return null==t.size?64:t.size}),os=Xu().x(Ju).y(Zu).defined(Ku).size(function(t){return t.size||1});function us(t,e,n,r){return is.context(t)(e,n,r)}function ss(t,e){return e.stroke&&0!==e.opacity&&0!==e.strokeOpacity&&t.expand(null!=e.strokeWidth?+e.strokeWidth:1),t}var fs,cs=2*Math.PI,ls=cs/4,hs=cs-1e-8;function ds(t){return fs=t,ds}function ps(){}function vs(t,e){fs.add(t,e)}function gs(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}function ms(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=gs(t,e,e.fill),!0)}ds.beginPath=ps,ds.closePath=ps,ds.moveTo=vs,ds.lineTo=vs,ds.rect=function(t,e,n,r){vs(t,e),vs(t+n,e+r)},ds.quadraticCurveTo=function(t,e,n,r){vs(t,e),vs(n,r)},ds.bezierCurveTo=function(t,e,n,r,i,a){vs(t,e),vs(n,r),vs(i,a)},ds.arc=function(t,e,n,r,i,a){if(Math.abs(i-r)>hs)return vs(t-n,e-n),void vs(t+n,e+n);var o,u,s,f,c=1/0,l=-1/0,h=1/0,d=-1/0;function p(t){s=n*Math.cos(t),f=n*Math.sin(t),s<c&&(c=s),s>l&&(l=s),f<h&&(h=f),f>d&&(d=f)}if(p(r),p(i),i!==r)if((r%=cs)<0&&(r+=cs),(i%=cs)<0&&(i+=cs),i<r&&(a=!a,o=r,r=i,i=o),a)for(i-=cs,o=r-r%ls,u=0;u<4&&o>i;++u,o-=ls)p(o);else for(o=r-r%ls+ls,u=0;u<4&&o<i;++u,o+=ls)p(o);vs(t+c,e+h),vs(t+l,e+d)};var ys=[];function bs(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=gs(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||ys),t.lineDashOffset=e.strokeDashOffset||0),!0))}function _s(t,e){return t.zindex-e.zindex||t.index-e.index}function xs(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(_s)}function ws(t,e){var n,r,i=t.items;if(i&&i.length){var a=xs(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 Ms(t,e){var n,r,i=t.items;if(!i||!i.length)return null;var a=xs(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 ks(t){return function(e,n,r){ws(n,function(n){r&&!r.intersects(n.bounds)||Es(t,e,n,n)})}}function Es(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(n.fill&&ms(e,n,i)&&e.fill(),n.stroke&&bs(e,n,i)&&e.stroke()))}var Ss=function(){return!0};function As(t){return t||(t=Ss),function(e,n,r,i,a,o){return r*=e.pixelRatio,i*=e.pixelRatio,Ms(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 Cs(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 Os(t){return As(Cs(t))}function zs(t,e){return"translate("+t+","+e+")"}function Ds(t){return zs(t.x||0,t.y||0)}function Ns(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",Ds(n)),t("d",e(null,n))},bound:function(t,n){return e(ds(t),n),ss(t,n).translate(n.x||0,n.y||0)},draw:ks(n),pick:Os(n)}}var Rs=Ns("arc",function(t,e){return ts.context(t)(e)});function Ts(t,e,n){function r(t,n){t.beginPath(),e(t,n)}var i,a=Cs(r);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(ds(t),r),ss(t,r[0]))},draw:(i=r,function(t,e,n){!e.items.length||n&&!n.intersects(e.bounds)||Es(i,t,e.items[0],e.items)}),pick:function(t,e,n,r,i,o){var u=e.items,s=e.bounds;return!u||!u.length||s&&!s.contains(i,o)?null:(n*=t.pixelRatio,r*=t.pixelRatio,a(t,u,n,r)?u[0]:null)},tip:n}}var Ps=Ts("area",function(t,e){var n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?ns:es).curve(Eu(r,n.orient,n.tension)).context(t)(e)},function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],a="horizontal"===t[0].orient?"y":"x",o=t.length,u=1/0;--o>=0;)!1!==t[o].defined&&(r=Math.abs(t[o][a]-i))<u&&(u=r,n=t[o]);return n}),Ls=1;function qs(t,e,n){var r=e.clip,i=t._defs,a=e.clip_id||(e.clip_id="clip"+Ls++),o=i.clipping[a]||(i.clipping[a]={id:a});return F(r)?o.path=r(null):(o.width=n.width||0,o.height=n.height||0),"url(#"+a+")"}var Us=.5;function Fs(t,e){var n=e.stroke?Us:0;t.beginPath(),us(t,e,n,n)}var js=Cs(Fs);var Is={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Ds(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)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),ss(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var r=this;ws(e,function(e){var i,a=e.x||0,o=e.y||0,u=e.width||0,s=e.height||0;t.save(),t.translate(a,o),(e.stroke||e.fill)&&(i=null==e.opacity?1:e.opacity)>0&&(Fs(t,e),e.fill&&ms(t,e,i)&&t.fill(),e.stroke&&bs(t,e,i)&&t.stroke()),e.clip&&(t.beginPath(),t.rect(0,0,u,s),t.clip()),n&&n.translate(-a,-o),ws(e,function(e){r.draw(t,e,n)}),n&&n.translate(a,o),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,u=n*t.pixelRatio,s=r*t.pixelRatio;return Ms(e,function(f){var c,l,h,d;if(!(d=f.bounds)||d.contains(i,a))return l=f.x||0,h=f.y||0,t.save(),t.translate(l,h),l=i-l,h=a-h,!(c=Ms(f,function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,l,h)?o.pick(t,n,r,l,h):null}))&&!1!==e.interactive&&(f.fill||f.stroke)&&js(t,f,u,s)&&(c=f),t.restore(),c||null})},background:function(t,e){var n=e.stroke?Us:0;t("class","background"),t("d",us(null,e,n,n))},foreground:function(t,e,n){t("clip-path",e.clip?qs(n,e,e):null)}};function $s(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 Bs(t,e){return"center"===t?e/2:"right"===t?e:0}function Ws(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var Ys={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var r=$s(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-=Bs(e.align,o),a-=Ws(e.baseline,u),t("href",r.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",zs(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-=Bs(e.align,a),i-=Ws(e.baseline,o),t.set(r,i,r+a,i+o)},draw:function(t,e,n){var r=this;ws(e,function(e){if(!n||n.intersects(e.bounds)){var i,a,o,u,s=$s(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-=Bs(e.align,l),c-=Ws(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:As(),get:$s,xOffset:Bs,yOffset:Ws},Gs=Ts("line",function(t,e){var n=e[0],r=n.interpolate||"linear";return rs.curve(Eu(r,n.orient,n.tension)).context(t)(e)},function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),a=t.length;--a>=0;)if(!1!==t[a].defined&&(n=t[a].x-e[0])*n+(r=t[a].y-e[1])*r<i)return t[a];return null});function Hs(t,e){var n=e.path;if(null==n)return!0;var r=e.pathCache;r&&r.path===n||((e.pathCache=r=Cu(n)).path=n),Pu(t,r,e.x,e.y)}var Vs={type:"path",tag:"path",nested:!1,attr:function(t,e){t("transform",Ds(e)),t("d",e.path)},bound:function(t,e){return Hs(ds(t),e)?t.set(0,0,0,0):ss(t,e)},draw:ks(Hs),pick:Os(Hs)};function Xs(t,e){t.beginPath(),us(t,e)}var Js={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",us(null,e))},bound:function(t,e){var n,r;return ss(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:ks(Xs),pick:Os(Xs)};function Zs(t,e,n){var r,i,a,o;return!(!e.stroke||!bs(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)}var Qs,Ks,tf={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",Ds(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 ss(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){ws(e,function(e){if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Zs(t,e,r)&&t.stroke()}})},pick:As(function(t,e,n,r){return!!t.isPointInStroke&&Zs(t,e,1)&&t.isPointInStroke(n,r)})},ef=Ns("shape",function(t,e){return(e.mark.shape||e.shape).context(t)(e)}),nf=Ns("symbol",function(t,e){return as.context(t)(e)}),rf={height:ff,measureWidth:uf,estimateWidth:af,width:af,canvas:cf};function af(t){return Ks=ff(t),of(lf(t))}function of(t){return~~(.8*t.length*Ks)}function uf(t){return Qs.font=df(t),sf(lf(t))}function sf(t){return Qs.measureText(t).width}function ff(t){return null!=t.fontSize?t.fontSize:11}function cf(t){Qs=t&&(Qs=so(1,1))?Qs.getContext("2d"):null,rf.width=Qs?uf:af}function lf(t){var e=t.text;return null==e?"":t.limit>0?function(t){var e,n=+t.limit,r=t.text+"";Qs?(Qs.font=df(t),e=sf):(Ks=ff(t),e=of);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 hf(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function df(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+ff(t)+"px "+hf(t,e)}function pf(t){var e=t.baseline,n=ff(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}cf(!0);var vf={left:"start",center:"middle",right:"end"},gf=new eo;function mf(t,e,n){var r,i,a=rf.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)+pf(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=rf.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)}var yf={arc:Rs,area:Ps,group:Is,image:Ys,line:Gs,path:Vs,rect:Js,rule:tf,shape:ef,symbol:nf,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+pf(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",vf[e.align]||"start"),u?(n=zs(a,o)+" rotate("+u+")",(r||i)&&(n+=" "+zs(r,i))):n=zs(a+r,o+i),t("transform",n)},bound:mf,draw:function(t,e,n){ws(e,function(e){var r,i,a,o,u,s;n&&!n.intersects(e.bounds)||(s=lf(e))&&0!==(r=null==e.opacity?1:e.opacity)&&(t.font=df(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)+pf(e),e.fill&&ms(t,e,r)&&t.fillText(s,i,a),e.stroke&&bs(t,e,r)&&t.strokeText(s,i,a),e.angle&&t.restore())})},pick:As(function(t,e,n,r,i,a){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var o=mf(gf,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:Ts("trail",function(t,e){return os.context(t)(e)},function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null})};function bf(t,e,n){var r=yf[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new eo),t,n)}var _f={mark:null};function xf(t,e,n){var r,i,a,o,u=yf[t.marktype],s=u.bound,f=t.items,c=f&&f.length;if(u.nested)return c?a=f[0]:(_f.mark=t,a=_f),o=bf(a,s,n),e=e&&e.union(o)||o;if(e=e||t.bounds&&t.bounds.clear()||new eo,c)for(r=0,i=f.length;r<i;++r)e.union(bf(f[r],s,n));return t.bounds=e}var wf=["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"];function Mf(t,e){return JSON.stringify(t,wf,e)}function kf(t){return function t(e){var n,r,i,a=e.marktype,o=e.items;if(o)for(r=0,i=o.length;r<i;++r)n=a?"mark":"group",o[r][n]=e,o[r].zindex&&(o[r][n].zdirty=!0),"group"===(a||n)&&t(o[r]);a&&xf(e);return e}("string"==typeof t?JSON.parse(t):t)}function Ef(t){arguments.length?this.root=kf(t):(this.root=Af({marktype:"group",name:"root",role:"frame"}),this.root.items=[new uo(this.root)])}var Sf=Ef.prototype;function Af(t,e){return{bounds:new eo,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 Cf(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Of(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 zf(t,e,n,r){var i,a=t.childNodes[e];return a&&a.tagName.toLowerCase()===n.toLowerCase()||(i=a||null,a=Cf(t.ownerDocument,n,r),t.insertBefore(a,i)),a}function Df(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function Nf(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function Rf(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function Tf(t,e){this._active=null,this._handlers={},this._loader=t||Pt(),this._tooltip=e||Pf}function Pf(t,e,n,r){t.element().setAttribute("title",r||"")}Sf.toJSON=function(t){return Mf(this.root,t||0)},Sf.mark=function(t,e,n){var r=Af(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r};var Lf=Tf.prototype;function qf(t){this._el=null,this._bgcolor=null,this._loader=new co(t)}Lf.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},Lf.element=function(){return this._el},Lf.canvas=function(){return this._el&&this._el.firstChild},Lf.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},Lf.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},Lf.on=function(){},Lf.off=function(){},Lf._handlerIndex=function(t,e,n){for(var r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},Lf.handlers=function(t){var e,n=this._handlers,r=[];if(t)r.push.apply(r,n[this.eventName(t)]);else for(e in n)r.push.apply(r,n[e]);return r},Lf.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},Lf.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then(function(e){var n=new MouseEvent(t.type,t),r=Cf(null,"a");for(var i in e)r.setAttribute(i,e[i]);r.dispatchEvent(n)}).catch(function(){})},Lf.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,a,o=t&&t.mark;if(o&&(i=yf[o.marktype]).tip){for((a=Rf(e,n))[0]-=r[0],a[1]-=r[1];t=t.mark.group;)a[0]-=t.x||0,a[1]-=t.y||0;t=i.tip(o.items,a)}return t}(e,t,this.canvas(),this._origin);var r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},Lf.getItemBoundingClientRect=function(t){if(e=this.canvas()){for(var e,n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,a=i.x1+r[0]+n.left,o=i.y1+r[1]+n.top,u=i.width(),s=i.height();t.mark&&(t=t.mark.group);)a+=t.x||0,o+=t.y||0;return{x:a,y:o,width:u,height:s,left:a,top:o,right:a+u,bottom:o+s}}};var Uf=qf.prototype;Uf.initialize=function(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},Uf.element=function(){return this._el},Uf.canvas=function(){return this._el&&this._el.firstChild},Uf.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},Uf.resize=function(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},Uf.dirty=function(){},Uf.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},Uf._render=function(){},Uf.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then(function(){return e}):Promise.resolve(e)},Uf._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},Uf.sanitizeURL=function(t){return this._load("sanitizeURL",t)},Uf.loadImage=function(t){return this._load("loadImage",t)};var Ff="mouseout";function jf(t,e){Tf.call(this,t,e),this._down=null,this._touch=null,this._first=!0}var If=H(jf,Tf);function $f(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 Bf(t){return function(e){this.fire(t,e),this._active=null}}If.initialize=function(t,e,n){var r=this._canvas=t&&Of(t,"canvas");if(r){var i=this;this.events.forEach(function(t){r.addEventListener(t,function(e){If[t]?If[t].call(i,e):i.fire(t,e)})})}return Tf.prototype.initialize.call(this,t,e,n)},If.canvas=function(){return this._canvas},If.context=function(){return this._canvas.getContext("2d")},If.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],If.DOMMouseScroll=function(t){this.fire("mousewheel",t)},If.mousemove=$f("mousemove","mouseover","mouseout"),If.dragover=$f("dragover","dragenter","dragleave"),If.mouseout=Bf("mouseout"),If.dragleave=Bf("dragleave"),If.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},If.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},If.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},If.touchmove=function(t){this.fire("touchmove",t,!0)},If.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},If.fire=function(t,e,n){var r,i,a=n?this._touch:this._active,o=this._handlers[t];if(e.vegaType=t,"click"===t&&a&&a.href?this.handleHref(e,a,a.href):"mousemove"!==t&&t!==Ff||this.handleTooltip(e,a,t!==Ff),o)for(r=0,i=o.length;r<i;++r)o[r].handler.call(this._obj,e,a)},If.on=function(t,e){var n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(r[n]||(r[n]=[])).push({type:t,handler:e}),this},If.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},If.pickEvent=function(t){var e=Rf(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},If.pick=function(t,e,n,r,i){var a=this.context();return yf[t.marktype].pick.call(this,a,t,e,n,r,i)};var Wf="undefined"!=typeof window&&window.devicePixelRatio||1;function Yf(t){qf.call(this,t),this._redraw=!1,this._dirty=new eo}var Gf=H(Yf,qf),Hf=qf.prototype,Vf=new eo;function Xf(t,e){Tf.call(this,t,e);var n=this;n._hrefHandler=Zf(n,function(t,e){e&&e.href&&n.handleHref(t,e,e.href)}),n._tooltipHandler=Zf(n,function(t,e){n.handleTooltip(t,e,t.type!==Ff)})}Gf.initialize=function(t,e,n,r,i){return this._canvas=so(1,1),t&&(Df(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Hf.initialize.call(this,t,e,n,r,i)},Gf.resize=function(t,e,n,r){return Hf.resize.call(this,t,e,n,r),function(t,e,n,r,i){var a="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,o=t.getContext("2d"),u=a?Wf:i;t.width=e*u,t.height=n*u,a&&1!==u&&(t.style.width=e+"px",t.style.height=n+"px"),o.pixelRatio=u,o.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale),this._redraw=!0,this},Gf.canvas=function(){return this._canvas},Gf.context=function(){return this._canvas?this._canvas.getContext("2d"):null},Gf.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=Vf.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)},Gf._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},Gf.draw=function(t,e,n){var r=yf[e.marktype];e.clip&&function(t,e){var n=e.clip;if(t.save(),t.beginPath(),F(n))n(t);else{var r=e.group;t.rect(0,0,r.width||0,r.height||0)}t.clip()}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},Gf.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 Jf=H(Xf,Tf);function Zf(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 Qf(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 Kf(t){return"</"+t+">"}Jf.initialize=function(t,e,n){var r=this._svg;return r&&(r.removeEventListener("click",this._hrefHandler),r.removeEventListener("mousemove",this._tooltipHandler),r.removeEventListener(Ff,this._tooltipHandler)),this._svg=r=t&&Of(t,"svg"),r&&(r.addEventListener("click",this._hrefHandler),r.addEventListener("mousemove",this._tooltipHandler),r.addEventListener(Ff,this._tooltipHandler)),Tf.prototype.initialize.call(this,t,e,n)},Jf.canvas=function(){return this._svg},Jf.on=function(t,e){var n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){var i={type:t,handler:e,listener:Zf(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},Jf.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this};var tc={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},ec={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},nc=Object.keys(ec),rc=tc.xmlns;function ic(t){qf.call(this,t),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var ac=H(ic,qf),oc=qf.prototype;function uc(t,e,n){var r,i,a;for((t=zf(t,n,"linearGradient",rc)).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=zf(t,r,"stop",rc)).setAttribute("offset",e.stops[r].offset),a.setAttribute("stop-color",e.stops[r].color);Df(t,r)}function sc(t,e,n){var r;(t=zf(t,n,"clipPath",rc)).setAttribute("id",e.id),e.path?(r=zf(t,0,"path",rc)).setAttribute("d",e.path):((r=zf(t,0,"rect",rc)).setAttribute("x",0),r.setAttribute("y",0),r.setAttribute("width",e.width),r.setAttribute("height",e.height))}function fc(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 cc(t,e,n,r,i){var a,o=t._svg;if(!o&&(o=Cf(a=e.ownerDocument,r,rc),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},"g"===r))){var u=Cf(a,"path",rc);u.setAttribute("class","background"),o.appendChild(u),u.__data__=t;var s=Cf(a,"g",rc);o.appendChild(s),s.__data__=t}return(o.ownerSVGElement!==i||function(t){var e=t.mark||t.group;return e&&e.items.length>1}(t)&&o.previousSibling!==n)&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}ac.initialize=function(t,e,n,r){return t&&(this._svg=zf(t,0,"svg",rc),this._svg.setAttribute("class","marks"),Df(t,1),this._root=zf(this._svg,0,"g",rc),Df(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),oc.initialize.call(this,t,e,n,r)},ac.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),oc.background.apply(this,arguments)},ac.resize=function(t,e,n,r){return oc.resize.call(this,t,e,n,r),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},ac.canvas=function(){return this._svg},ac.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in tc)t[e]=tc[e];var n=this._bgcolor?Qf("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+Kf("rect"):"";return Qf("svg",t)+n+this._svg.innerHTML+Kf("svg")},ac._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),Df(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},ac.updateDefs=function(){var t,e=this._svg,n=this._defs,r=n.el,i=0;for(t in n.gradient)r||(n.el=r=zf(e,0,"defs",rc)),uc(r,n.gradient[t],i++);for(t in n.clipping)r||(n.el=r=zf(e,0,"defs",rc)),sc(r,n.clipping[t],i++);r&&(0===i?(e.removeChild(r),n.el=null):Df(r,i))},ac._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},ac.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},ac.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},ac._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=yf[r]),n.zdirty&&n.dirty!==s&&(this._dirtyAll=!1,fc(e,s),n.items.forEach(function(t){t.dirty=s})),n.zdirty||(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,fc(e,s)),e._update=s));return!this._dirtyAll},ac.draw=function(t,e,n){if(!this.isDirty(e))return e._svg;var r,i=this,a=this._svg,o=yf[e.marktype],u=!1===e.interactive?"none":null,s="g"===o.tag,f=null,c=0;function l(t){var e=i.isDirty(t),n=cc(t,r,f,o.tag,a);e&&(i._update(o,n,t),s&&function(t,e,n){e=e.lastChild;var r,i=0;ws(n,function(n){r=t.draw(e,n,r),++i}),Df(e,1+i)}(i,n,t)),f=n,++c}return(r=cc(e,t,n,"g",a)).setAttribute("class",Nf(e)),s||r.style.setProperty("pointer-events",u),e.clip?r.setAttribute("clip-path",qs(i,e,e.group)):r.removeAttribute("clip-path"),o.nested?e.items.length&&l(e.items[0]):ws(e,l),Df(r,c),r};var lc=null,hc=null,dc={group:function(t,e,n){hc=e.__values__,lc=e.childNodes[1],t.foreground(vc,n,this),lc=e.childNodes[0],t.background(vc,n,this);var r=!1===n.mark.interactive?"none":null;r!==hc.events&&(lc.style.setProperty("pointer-events",r),hc.events=r)},text:function(t,e,n){var r;(r=lf(n))!==hc.text&&(e.textContent=r,hc.text=r),pc(e,"font-family",hf(n)),pc(e,"font-size",ff(n)+"px"),pc(e,"font-style",n.fontStyle),pc(e,"font-variant",n.fontVariant),pc(e,"font-weight",n.fontWeight)}};function pc(t,e,n){n!==hc[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),hc[e]=n)}function vc(t,e,n){e!==hc[t]&&(null!=e?n?lc.setAttributeNS(n,t,e):lc.setAttribute(t,e):n?lc.removeAttributeNS(n,t):lc.removeAttribute(t),hc[t]=e)}function gc(t){qf.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}ac._update=function(t,e,n){lc=e,hc=e.__values__,t.attr(vc,n,this);var r=dc[t.type];r&&r.call(this,t,e,n),this.style(lc,n)},ac.style=function(t,e){var n,r,i,a,o,u;if(null!=e)for(n=0,r=nc.length;n<r;++n)o=e[i=nc[n]],"font"===i&&(o=hf(e)),o!==hc[i]&&(a=ec[i],null==o?"fill"===a?t.style.setProperty(a,"none"):t.style.removeProperty(a):(o.id&&(this._defs.gradient[o.id]=o,o="url("+(u=void 0,"undefined"==typeof window?"":(u=window.location).hash?u.href.slice(0,-u.hash.length):u.href)+"#"+o.id+")"),t.style.setProperty(a,o+"")),hc[i]=o)};var mc,yc=H(gc,qf),bc=qf.prototype;function _c(t,e,n,r){mc[r||t]=e}function xc(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-family: "+hf(t)+"; ",f+="font-size: "+ff(t)+"px; ",t.fontStyle&&(f+="font-style: "+t.fontStyle+"; "),t.fontVariant&&(f+="font-variant: "+t.fontVariant+"; "),t.fontWeight&&(f+="font-weight: "+t.fontWeight+"; ")),i=0,a=nc.length;i<a;++i)o=nc[i],u=ec[o],null==(s=t[o])?"fill"===u&&(f+="fill: none; "):"transparent"!==s||"fill"!==u&&"stroke"!==u?(s.id&&(r.gradient[s.id]=s,s="url(#"+s.id+")"),f+=u+": "+s+"; "):f+=u+": none; ";return f?'style="'+f.trim()+'"':null}yc.resize=function(t,e,n,r){bc.resize.call(this,t,e,n,r);var i=this._origin,a=this._text,o={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var u in tc)o[u]=tc[u];a.head=Qf("svg",o);var s=this._bgcolor;return"transparent"!==s&&"none"!==s||(s=null),a.bg=s?Qf("rect",{width:this._width,height:this._height,style:"fill: "+s+";"})+Kf("rect"):"",a.root=Qf("g",{transform:"translate("+i+")"}),a.foot=Kf("g")+Kf("svg"),this},yc.background=function(){var t=bc.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},yc.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},yc._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},yc.buildDefs=function(){var t,e,n,r,i=this._defs,a="";for(e in i.gradient){for(r=(n=i.gradient[e]).stops,a+=Qf("linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<r.length;++t)a+=Qf("stop",{offset:r[t].offset,"stop-color":r[t].color})+Kf("stop");a+=Kf("linearGradient")}for(e in i.clipping)n=i.clipping[e],a+=Qf("clipPath",{id:e}),n.path?a+=Qf("path",{d:n.path})+Kf("path"):a+=Qf("rect",{x:0,y:0,width:n.width,height:n.height})+Kf("rect"),a+=Kf("clipPath");return a.length>0?Qf("defs")+a+Kf("defs"):""},yc.attributes=function(t,e){return mc={},t(_c,e,this),mc},yc.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},yc.mark=function(t){var e,n=this,r=yf[t.marktype],i=r.tag,a=this._defs,o="";function u(u){var s=n.href(u);s&&(o+=Qf("a",s)),e="g"!==i?xc(u,t,i,a):null,o+=Qf(i,n.attributes(r.attr,u),e),"text"===i?o+=lf(u).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):"g"===i&&(o+=Qf("path",n.attributes(r.background,u),xc(u,t,"bgrect",a))+Kf("path"),o+=Qf("g",n.attributes(r.foreground,u))+n.markGroup(u)+Kf("g")),o+=Kf(i),s&&(o+=Kf("a"))}return"g"!==i&&!1===t.interactive&&(e='style="pointer-events: none;"'),o+=Qf("g",{class:Nf(t),"clip-path":t.clip?qs(n,t,t.group):null},e),r.nested?t.items&&t.items.length&&u(t.items[0]):ws(t,u),o+Kf("g")},yc.markGroup=function(t){var e=this,n="";return ws(t,function(t){n+=e.mark(t)}),n};var wc={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},Mc={};function kc(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(Mc[t]=e,this):Mc[t]}Mc.canvas=Mc.png={renderer:Yf,headless:Yf,handler:jf},Mc.svg={renderer:ic,headless:gc,handler:Xf},Mc.none={};var Ec=new eo;function Sc(t){var e=t.clip;if(F(e))e(ds(Ec.clear()));else{if(!e)return;Ec.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Ec)}var Ac=1e-9;function Cc(t,e,n){return t===e||("path"===n?Oc(t,e):t instanceof Date&&e instanceof Date?+t==+e:J(t)&&J(e)?Math.abs(t-e)<=Ac:t&&e&&(u(t)||u(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],!Cc(t[n],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Oc(t,e){return Cc(Cu(t),Cu(e))}function zc(t){kr.call(this,null,t)}function Dc(t,e,n){return e(t.bounds.clear(),t,n)}H(zc,kr).transform=function(t,e){var n,r=e.dataflow,i=t.mark,a=i.marktype,o=yf[a],u=o.bound,s=i.bounds;return o.nested?(i.items.length&&r.dirty(i.items[0]),s=Dc(i,u),i.items.forEach(function(t){t.bounds.clear().union(s)})):a===Da||t.modified()?(e.visit(e.MOD,function(t){r.dirty(t)}),s.clear(),i.items.forEach(function(t){s.union(Dc(t,u))}),i.role===La&&e.reflow()):(n=e.changed(e.REM),e.visit(e.ADD,function(t){s.union(Dc(t,u))}),e.visit(e.MOD,function(t){n=n||s.alignsWith(t.bounds),r.dirty(t),s.union(Dc(t,u))}),n&&(s.clear(),i.items.forEach(function(t){s.union(t.bounds)}))),Sc(i),e.modifies("bounds")};var Nc=":vega_identifier:";function Rc(t){kr.call(this,0,t)}function Tc(t){kr.call(this,null,t)}function Pc(t){kr.call(this,null,t)}Rc.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},H(Rc,kr).transform=function(t,e){var n=function(t){var e=t._signals[Nc];e||(t._signals[Nc]=e=t.add(0));return 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},H(Tc,kr).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,n.clip=t.clip,n.interactive=t.interactive,this.value=n);var r=n.marktype===Da?uo:oo;return e.visit(e.ADD,function(t){r.call(t,n)}),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e};var Lc=H(Pc,kr),qc={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&&Uc(e.bounds,t.bounds)?t.opacity=0:(e=t,1)})}};function Uc(t,e){return!(t.x2-1<e.x1||t.x1+1>e.x2||t.y2-1<e.y1||t.y1+1>e.y2)}function Fc(t){for(var e,n=1,r=t.length,i=t[0].bounds;n<r;i=e,++n)if(Uc(i,e=t[n].bounds))return!0}function jc(t){var e=t.bounds;return e.width()>1&&e.height()>1}function Ic(t){return t.forEach(function(t){t.opacity=1}),t}function $c(t,e){return t.reflow(e.modified()).modifies("opacity")}function Bc(t){kr.call(this,null,t)}function Wc(t,e){for(var n=0,r=t.length;n<r;++n)e.push(t[n])}function Yc(t){return{x1:0,y1:0,x2:t.width||0,y2:t.height||0}}function Gc(t){var e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function Hc(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 Vc(t,e){return t.bounds[e]}function Xc(t,e,n){var r=u(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function Jc(t){return t<0?Math.ceil(-t):0}function Zc(t,e,n){var r,i,a,o,u,s,f,c,l,h,d,p,v=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(n=(e=r[a]).items,e.marktype===Da)switch(e.role){case Na:case La:break;case qa:Wc(n,o.rowheaders);break;case Ua:Wc(n,o.rowfooters);break;case ja:Wc(n,o.colheaders);break;case Ia:Wc(n,o.colfooters);break;case Fa:o.rowtitle=n[0];break;case $a:o.coltitle=n[0];break;default:Wc(n,o.marks)}return o}(e),g=v.marks,m=n.bounds===Qa,y=m?Yc:Gc,b=new eo(0,0,0,0),_=Xc(n.align,Ka),x=Xc(n.align,to),w=Xc(n.padding,Ka),M=Xc(n.padding,to),k=n.offset,E=e.columns||n.columns||g.length,S=E<0?1:Math.ceil(g.length/E),A=S*E,C=[],O=[],z=0,D=[],N=[],R=0,T=g.length;for(i=0;i<E;++i)O[i]=0;for(i=0;i<S;++i)N[i]=0;for(i=0;i<T;++i)u=y(g[i]),a=i%E,o=~~(i/E),f=Math.ceil(y(g[i]).x2),c=Math.ceil(y(g[i]).y2),z=Math.max(z,f),R=Math.max(R,c),O[a]=Math.max(O[a],f),N[o]=Math.max(N[o],c),C.push(w+Jc(u.x1)),D.push(M+Jc(u.y1)),t.dirty(g[i]);for(i=0;i<T;++i)i%E==0&&(C[i]=0),i<E&&(D[i]=0);if(_===Za)for(a=1;a<E;++a){for(p=0,i=a;i<T;i+=E)p<C[i]&&(p=C[i]);for(i=a;i<T;i+=E)C[i]=p+O[a-1]}else if(_===Ja){for(p=0,i=0;i<T;++i)i%E&&p<C[i]&&(p=C[i]);for(i=0;i<T;++i)i%E&&(C[i]=p+z)}else for(_=!1,a=1;a<E;++a)for(i=a;i<T;i+=E)C[i]+=O[a-1];if(x===Za)for(o=1;o<S;++o){for(p=0,r=(i=o*E)+E;i<r;++i)p<D[i]&&(p=D[i]);for(i=o*E;i<r;++i)D[i]=p+N[o-1]}else if(x===Ja){for(p=0,i=E;i<T;++i)p<D[i]&&(p=D[i]);for(i=E;i<T;++i)D[i]=p+R}else for(x=!1,o=1;o<S;++o)for(r=(i=o*E)+E;i<r;++i)D[i]+=N[o-1];for(l=0,i=0;i<T;++i)f=(s=g[i]).x||0,s.x=l=C[i]+(i%E?l:0),s.bounds.translate(l-f,0);for(a=0;a<E;++a)for(h=0,i=a;i<T;i+=E)c=(s=g[i]).y||0,s.y=h+=D[i],s.bounds.translate(0,h-c);if(Xc(n.center,Ka)&&S>1&&_)for(i=0;i<T;++i)s=g[i],(l=(u=_===Ja?z:O[i%E])-y(s).x2)>0&&(s.x+=f=l/2,s.bounds.translate(f,0));if(Xc(n.center,to)&&1!==E&&x)for(i=0;i<T;++i)s=g[i],(h=(u=x===Ja?R:N[~~(i/E)])-y(s).y2)>0&&(s.y+=c=h/2,s.bounds.translate(0,c));for(i=0;i<T;++i)g[i].mark.bounds.clear();for(i=0;i<T;++i)s=g[i],t.dirty(s),b.union(s.mark.bounds.union(s.bounds));function P(t,e){return Math.floor(Math.min(t,e))}function L(t,e){return Math.ceil(Math.max(t,e))}y=m?Hc:Vc,d=Xc(n.headerBand,to,null),l=Qc(t,v.rowheaders,g,E,S,-Xc(k,"rowHeader"),P,0,y,"x1",0,E,1,d),d=Xc(n.headerBand,Ka,null),h=Qc(t,v.colheaders,g,E,E,-Xc(k,"columnHeader"),P,1,y,"y1",0,1,E,d),d=Xc(n.footerBand,to,null),Qc(t,v.rowfooters,g,E,S,Xc(k,"rowFooter"),L,0,y,"x2",E-1,E,1,d),d=Xc(n.footerBand,Ka,null),Qc(t,v.colfooters,g,E,E,Xc(k,"columnFooter"),L,1,y,"y2",A-E,1,E,d),v.rowtitle&&(p=l-Xc(k,"rowTitle"),d=Xc(n.titleBand,to,.5),Kc(t,v.rowtitle,p,0,b,d)),v.coltitle&&(p=h-Xc(k,"columnTitle"),d=Xc(n.titleBand,Ka,.5),Kc(t,v.coltitle,p,1,b,d))}function Qc(t,e,n,r,i,a,o,u,s,f,c,l,h,d){var p,v,g,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,v=0,m=e.length;v<m;++v)t.dirty(e[v]),e[v].mark.bounds.clear();for(p=c,v=0,m=e.length;v<m;++v,p+=l){for(y=(b=e[v]).mark.bounds,g=p;g>=0&&null==(_=n[g]);g-=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 Kc(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)}}Lc.transform=function(t,e){var n,r,i=qc[t.method]||qc.parity,a=e.materialize(e.SOURCE).source;if(a){if(!t.method)return t.modified("method")&&(Ic(a),e=$c(e,t)),e;if(t.sort&&(a=a.slice().sort(t.sort)),"greedy"===t.method&&(a=a.filter(jc)),n=Ic(a),e=$c(e,t),n.length>=3&&Fc(n)){do{n=i(n)}while(n.length>=3&&Fc(n));n.length<3&&!E(a).opacity&&(n.length>1&&(E(n).opacity=0),E(a).opacity=1)}var o,u,s,f,c;return t.boundScale&&t.boundTolerance>=0&&(o=t.boundScale,u=t.boundOrient,s=+t.boundTolerance,f=o.range(),c=new eo,u===xa||u===ka?c.set(f[0],-1/0,f[1],1/0):c.set(-1/0,f[0],1/0,f[1]),c.expand(s||1),r=function(t){return c.encloses(t.bounds)},a.forEach(function(t){r(t)||(t.opacity=0)})),e}},H(Bc,kr).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 tl=.5,el=new eo;function nl(t){kr.call(this,null,t)}function rl(t,e,n){return t[e]===n?0:(t[e]=n,1)}function il(t){var e=t.items[0].datum.orient;return e===wa||e===Ma}function al(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,v=u.title&&o.items[f[2]].items[0],g=o.titlePadding,m=o.bounds,y=0,b=0;switch(el.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),s){case xa:y=h||0,b=-l,a=Math.max(d,Math.min(p,-m.y1)),v&&(a=ol(v,a,g,0,-1,m)),m.add(0,-a).add(c,0);break;case wa:y=-l,b=h||0,a=Math.max(d,Math.min(p,-m.x1)),v&&(a=ol(v,a,g,1,-1,m)),m.add(-a,0).add(0,c);break;case Ma:y=n+l,b=h||0,a=Math.max(d,Math.min(p,m.x2)),v&&(a=ol(v,a,g,1,1,m)),m.add(0,0).add(a,c);break;case ka:y=h||0,b=r+l,a=Math.max(d,Math.min(p,m.y2)),v&&(a=ol(v,a,g,0,1,m)),m.add(0,0).add(c,a);break;default:y=o.x,b=o.y}return ss(m.translate(y,b),o),rl(o,"x",y+tl)|rl(o,"y",b+tl)&&(o.bounds=el,t.dirty(o),o.bounds=m,t.dirty(o)),o.mark.bounds.clear().union(m)}function ol(t,e,n,r,i,a){var o=t.bounds,u=0,s=0;return t.auto?(e+=n,r?u=(t.x||0)-(t.x=i*e):s=(t.y||0)-(t.y=i*e),o.translate(-u,-s),t.mark.bounds.set(o.x1,o.y1,o.x2,o.y2),r?(a.add(0,o.y1).add(0,o.y2),e+=o.width()):(a.add(o.x1,0).add(o.x2,0),e+=o.height())):a.union(o),e}function ul(t,e){return e.reduce(function(e,n){var r=n.items[0];if(function(t,e,n){var r=e.padding-n.x,i=e.padding-n.y;if(e.datum.title){var a=e.items[1].items[0];i+=e.titlePadding+a.fontSize}(r||i)&&(n.x+=r,n.y+=i,n.bounds.translate(r,i),n.mark.bounds.translate(r,i),t.dirty(n))}(t,r,r.items[0].items[0]),r.datum.orient===wa){var i=el.clear();r.items.forEach(function(t){i.union(t.bounds)}),e=Math.max(e,Math.ceil(i.width()+2*r.padding-1))}return e},0)}function sl(t,e,n,r,i,a,o){var u,s,f,c,l,h=e.items[0],d=h.datum,p=d.orient,v=h.offset,g=h.bounds,m=0,y=0;switch(p===xa||p===ka?(f=i,m=n[p]):p!==wa&&p!==Ma||(f=r,y=n[p]),el.clear().union(g),g.clear(),h.items.forEach(function(t){g.union(t.bounds)}),u=2*h.padding-1,s=2*h.padding-1,g.empty()||(u=Math.ceil(g.width()+u),s=Math.ceil(g.height()+s)),d.type===Wa&&(c=h.items[0].items[0].items[0].items,l=c.reduce(function(t,e){return t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t},{}),c.forEach(function(t){t.width=l[t.column],t.height=t.bounds.y2-t.y})),p){case wa:m-=n.leftWidth+v-Math.floor(f.x1),n.left+=s+n.margin;break;case Ma:m+=v+Math.ceil(f.x2),n.right+=s+n.margin;break;case xa:y-=s+v-Math.floor(f.y1),n.top+=u+n.margin;break;case ka:y+=v+Math.ceil(f.y2),n.bottom+=u+n.margin;break;case Ea:m+=v,y+=v;break;case Sa:m+=a-u-v,y+=v;break;case Aa:m+=v,y+=o-s-v;break;case Ca:m+=a-u-v,y+=o-s-v;break;default:m=h.x,y=h.y}return ss(g.set(m,y,m+u,y+s),h),rl(h,"x",m)|rl(h,"width",u)|rl(h,"y",y)|rl(h,"height",s)&&(h.bounds=el,t.dirty(h),h.bounds=g,t.dirty(h)),h.mark.bounds.clear().union(g)}H(nl,kr).transform=function(t,e){var n=e.dataflow;return t.mark.items.forEach(function(e){t.layout&&Zc(n,e,t.layout),function(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 eo).set(0,0,c,l),d=h.clone(),p=h.clone(),v=[];for(u=0,s=f.length;u<s;++u)switch((i=f[u]).role){case Na:(o=il(i)?d:p).union(al(t,i,c,l));break;case Ra:r=i;break;case La:v.push(i);break;case Ta:case Pa:case qa:case Ua:case Fa:case ja:case Ia:case $a:d.union(i.bounds),p.union(i.bounds);break;default:h.union(i.bounds)}if(v.length)for(a={leftWidth:ul(t,v),margin:n.legendMargin||8,left:0,right:0,top:0,bottom:0},u=0,s=v.length;u<s;++u)if(o=sl(t,v[u],a,d,p,c,l),n.autosize&&n.autosize.type===Ya){var g=v[u].items[0].datum.orient;g===wa||g===Ma?h.add(o.x1,0).add(o.x2,0):g!==xa&&g!==ka||h.add(0,o.y1).add(0,o.y2)}else h.union(o);h.union(d).union(p),r&&h.union(function(t,e,n,r,i){var a,o=e.items[0],u=o.orient,s=o.frame,f=o.anchor,c=o.offset,l=o.bounds,h=0,d=u===wa||u===Ma?r:n,p=0,v=0;s!==Da?u===wa?(h=i.y2,d=i.y1):u===Ma?(h=i.y1,d=i.y2):(h=i.x1,d=i.x2):u===wa&&(h=r,d=0);switch(a=f===Oa?h:f===za?d:(h+d)/2,el.clear().union(l),u){case xa:p=a,v=i.y1-c;break;case wa:p=i.x1-c,v=a;break;case Ma:p=i.x2+c,v=a;break;case ka:p=a,v=i.y2+c;break;default:p=o.x,v=o.y}l.translate(p-o.x,v-o.y),rl(o,"x",p)|rl(o,"y",v)&&(o.bounds=el,t.dirty(o),o.bounds=l,t.dirty(o));return e.bounds.clear().union(l)}(t,r,c,l,h));!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===Ba&&(o-=s.left+s.right,u-=s.top+s.bottom);a===Xa?(c=0,d=0,f=o,h=u):a===Ya?(f=Math.max(0,o-c-l),h=Math.max(0,u-d-p)):a===Ga?(f=Math.max(0,o-c-l),u=h+d+p):a===Ha?(o=f+c+l,h=Math.max(0,u-d-p)):a===Va&&(o=f+c+l,u=h+d+p);t._resizeView(o,u,f,h,[c,d],i.resize)}(t,e,h,n)}(n,e,t)}),t.modified()&&e.reflow(),e};var fl=Object.freeze({bound:zc,identifier:Rc,mark:Tc,overlap:Pc,render:Bc,viewlayout:nl}),cl="log",ll="pow",hl="sqrt",dl="band",pl="point",vl="ordinal",gl="quantile",ml="quantize",yl="threshold",bl="bin-ordinal",_l="sequential";function xl(t,e,n){var r=t-e+2*n;return t?r>0?r:1:0}function wl(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ml(t){var e;return 1===t.length&&(e=t,t=function(t,n){return wl(e(t),n)}),{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}}}var kl=Ml(wl).right;function El(t){return null===t?NaN:+t}var Sl=Math.sqrt(50),Al=Math.sqrt(10),Cl=Math.sqrt(2);function Ol(t,e,n){var r,i,a,o,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(o=zl(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}function zl(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>=Sl?10:a>=Al?5:a>=Cl?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=Sl?10:a>=Al?5:a>=Cl?2:1)}function Dl(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>=Sl?i*=10:a>=Al?i*=5:a>=Cl&&(i*=2),e<t?-i:i}function Nl(t,e,n){if(null==n&&(n=El),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)}}function Rl(){}function Tl(t,e){var n=new Rl;if(t instanceof Rl)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 Pl(){var t,e,n,r=[],i=[];function a(n,i,o,u){if(i>=r.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,f,c,l=-1,h=n.length,d=r[i++],p=Tl(),v=o();++l<h;)(c=p.get(s=d(f=n[l])+""))?c.push(f):p.set(s,[f]);return p.each(function(t,e){u(v,e,a(t,i,o,u))}),v}return n={object:function(t){return a(t,0,Ll,ql)},map:function(t){return a(t,0,Ul,Fl)},entries:function(t){return function t(n,a){if(++a>r.length)return n;var o,u=i[a-1];return null!=e&&a>=r.length?o=n.entries():(o=[],n.each(function(e,n){o.push({key:n,values:t(e,a)})})),null!=u?o.sort(function(t,e){return u(t.key,e.key)}):o}(a(t,0,Ul,Fl),0)},key:function(t){return r.push(t),n},sortKeys:function(t){return i[r.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}}function Ll(){return{}}function ql(t,e,n){t[e]=n}function Ul(){return Tl()}function Fl(t,e,n){t.set(e,n)}function jl(){}Rl.prototype=Tl.prototype={constructor:Rl,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 Il=Tl.prototype;jl.prototype=function(t,e){var n=new jl;if(t instanceof jl)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:jl,has:Il.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Il.remove,clear:Il.clear,values:Il.keys,size:Il.size,empty:Il.empty,each:Il.each};var $l=Array.prototype,Bl=$l.map,Wl=$l.slice,Yl={name:"implicit"};function Gl(t){var e=Tl(),n=[],r=Yl;function i(i){var a=i+"",o=e.get(a);if(!o){if(r!==Yl)return r;e.set(a,o=n.push(i))}return t[(o-1)%t.length]}return t=null==t?[]:Wl.call(t),i.domain=function(t){if(!arguments.length)return n.slice();n=[],e=Tl();for(var r,a,o=-1,u=t.length;++o<u;)e.has(a=(r=t[o])+"")||e.set(a,n.push(r));return i},i.range=function(e){return arguments.length?(t=Wl.call(e),i):t.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Gl().domain(n).range(t).unknown(r)},i}function Hl(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Vl(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Xl(){}var Jl="\\s*([+-]?\\d+)\\s*",Zl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ql="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kl=/^#([0-9a-f]{3})$/,th=/^#([0-9a-f]{6})$/,eh=new RegExp("^rgb\\("+[Jl,Jl,Jl]+"\\)$"),nh=new RegExp("^rgb\\("+[Ql,Ql,Ql]+"\\)$"),rh=new RegExp("^rgba\\("+[Jl,Jl,Jl,Zl]+"\\)$"),ih=new RegExp("^rgba\\("+[Ql,Ql,Ql,Zl]+"\\)$"),ah=new RegExp("^hsl\\("+[Zl,Ql,Ql]+"\\)$"),oh=new RegExp("^hsla\\("+[Zl,Ql,Ql,Zl]+"\\)$"),uh={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};function sh(t){var e;return t=(t+"").trim().toLowerCase(),(e=Kl.exec(t))?new dh((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=th.exec(t))?fh(parseInt(e[1],16)):(e=eh.exec(t))?new dh(e[1],e[2],e[3],1):(e=nh.exec(t))?new dh(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=rh.exec(t))?ch(e[1],e[2],e[3],e[4]):(e=ih.exec(t))?ch(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ah.exec(t))?vh(e[1],e[2]/100,e[3]/100,1):(e=oh.exec(t))?vh(e[1],e[2]/100,e[3]/100,e[4]):uh.hasOwnProperty(t)?fh(uh[t]):"transparent"===t?new dh(NaN,NaN,NaN,0):null}function fh(t){return new dh(t>>16&255,t>>8&255,255&t,1)}function ch(t,e,n,r){return r<=0&&(t=e=n=NaN),new dh(t,e,n,r)}function lh(t){return t instanceof Xl||(t=sh(t)),t?new dh((t=t.rgb()).r,t.g,t.b,t.opacity):new dh}function hh(t,e,n,r){return 1===arguments.length?lh(t):new dh(t,e,n,null==r?1:r)}function dh(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ph(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function vh(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new mh(t,e,n,r)}function gh(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof mh)return new mh(t.h,t.s,t.l,t.opacity);if(t instanceof Xl||(t=sh(t)),!t)return new mh;if(t instanceof mh)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 mh(o,u,s,t.opacity)}(t):new mh(t,e,n,null==r?1:r)}function mh(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function yh(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Hl(Xl,sh,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Hl(dh,hh,Vl(Xl,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new dh(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dh(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},hex:function(){return"#"+ph(this.r)+ph(this.g)+ph(this.b)},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+")")}})),Hl(mh,gh,Vl(Xl,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new mh(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new mh(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 dh(yh(t>=240?t-240:t+120,i,r),yh(t,i,r),yh(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 bh=Math.PI/180,_h=180/Math.PI,xh=.96422,wh=1,Mh=.82521,kh=4/29,Eh=6/29,Sh=3*Eh*Eh,Ah=Eh*Eh*Eh;function Ch(t){if(t instanceof zh)return new zh(t.l,t.a,t.b,t.opacity);if(t instanceof Lh){if(isNaN(t.h))return new zh(t.l,0,0,t.opacity);var e=t.h*bh;return new zh(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof dh||(t=lh(t));var n,r,i=Th(t.r),a=Th(t.g),o=Th(t.b),u=Dh((.2225045*i+.7168786*a+.0606169*o)/wh);return i===a&&a===o?n=r=u:(n=Dh((.4360747*i+.3850649*a+.1430804*o)/xh),r=Dh((.0139322*i+.0971045*a+.7141733*o)/Mh)),new zh(116*u-16,500*(n-u),200*(u-r),t.opacity)}function Oh(t,e,n,r){return 1===arguments.length?Ch(t):new zh(t,e,n,null==r?1:r)}function zh(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Dh(t){return t>Ah?Math.pow(t,1/3):t/Sh+kh}function Nh(t){return t>Eh?t*t*t:Sh*(t-kh)}function Rh(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Th(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ph(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Lh)return new Lh(t.h,t.c,t.l,t.opacity);if(t instanceof zh||(t=Ch(t)),0===t.a&&0===t.b)return new Lh(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*_h;return new Lh(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Lh(t,e,n,null==r?1:r)}function Lh(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}Hl(zh,Oh,Vl(Xl,{brighter:function(t){return new zh(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new zh(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 new dh(Rh(3.1338561*(e=xh*Nh(e))-1.6168667*(t=wh*Nh(t))-.4906146*(n=Mh*Nh(n))),Rh(-.9787684*e+1.9161415*t+.033454*n),Rh(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Hl(Lh,Ph,Vl(Xl,{brighter:function(t){return new Lh(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Lh(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Ch(this).rgb()}}));var qh=-.14861,Uh=1.78277,Fh=-.29227,jh=-.90649,Ih=1.97294,$h=Ih*jh,Bh=Ih*Uh,Wh=Uh*Fh-jh*qh;function Yh(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Gh)return new Gh(t.h,t.s,t.l,t.opacity);t instanceof dh||(t=lh(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Wh*r+$h*e-Bh*n)/(Wh+$h-Bh),a=r-i,o=(Ih*(n-i)-Fh*a)/jh,u=Math.sqrt(o*o+a*a)/(Ih*i*(1-i)),s=u?Math.atan2(o,a)*_h-120:NaN;return new Gh(s<0?s+360:s,u,i,t.opacity)}(t):new Gh(t,e,n,null==r?1:r)}function Gh(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Hh(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 Vh(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 Hh((n-r/e)*e,o,i,a,u)}}function Xh(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 Hh((n-r/e)*e,i,a,o,u)}}function Jh(t){return function(){return t}}function Zh(t,e){return function(n){return t+n*e}}function Qh(t,e){var n=e-t;return n?Zh(t,n>180||n<-180?n-360*Math.round(n/360):n):Jh(isNaN(t)?e:t)}function Kh(t){return 1==(t=+t)?td: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):Jh(isNaN(e)?n:e)}}function td(t,e){var n=e-t;return n?Zh(t,n):Jh(isNaN(t)?e:t)}Hl(Gh,Yh,Vl(Xl,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Gh(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Gh(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*bh,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new dh(255*(e+n*(qh*r+Uh*i)),255*(e+n*(Fh*r+jh*i)),255*(e+n*(Ih*r)),this.opacity)}}));var ed=function t(e){var n=Kh(e);function r(t,e){var r=n((t=hh(t)).r,(e=hh(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=td(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function nd(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=hh(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+""}}}var rd=nd(Vh),id=nd(Xh);function ad(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]=hd(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}}function od(t,e){var n=new Date;return e-=t=+t,function(r){return n.setTime(t+e*r),n}}function ud(t,e){return e-=t=+t,function(n){return t+e*n}}function sd(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=hd(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var fd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cd=new RegExp(fd.source,"g");function ld(t,e){var n,r,i,a=fd.lastIndex=cd.lastIndex=0,o=-1,u=[],s=[];for(t+="",e+="";(n=fd.exec(t))&&(r=cd.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:ud(n,r)})),a=cd.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("")})}function hd(t,e){var n,r=typeof e;return null==e||"boolean"===r?Jh(e):("number"===r?ud:"string"===r?(n=sh(e))?(e=n,ed):ld:e instanceof sh?ed:e instanceof Date?od:Array.isArray(e)?ad:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?sd:ud)(t,e)}function dd(t,e){return e-=t=+t,function(n){return Math.round(t+e*n)}}var pd,vd,gd,md,yd=180/Math.PI,bd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _d(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)*yd,skewX:Math.atan(s)*yd,scaleX:o,scaleY:u}}function xd(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:ud(t,i)},{i:s-2,x:ud(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:ud(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:ud(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:ud(t,n)},{i:u-2,x:ud(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("")}}}var wd=xd(function(t){return"none"===t?bd:(pd||(pd=document.createElement("DIV"),vd=document.documentElement,gd=document.defaultView),pd.style.transform=t,t=gd.getComputedStyle(vd.appendChild(pd),null).getPropertyValue("transform"),vd.removeChild(pd),_d(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),Md=xd(function(t){return null==t?bd:(md||(md=document.createElementNS("http://www.w3.org/2000/svg","g")),md.setAttribute("transform",t),(t=md.transform.baseVal.consolidate())?_d((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):bd)},", ",")",")"),kd=Math.SQRT2,Ed=2,Sd=4,Ad=1e-12;function Cd(t){return((t=Math.exp(t))+1/t)/2}function Od(t){return function(e,n){var r=t((e=gh(e)).h,(n=gh(n)).h),i=td(e.s,n.s),a=td(e.l,n.l),o=td(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+""}}}var zd=Od(Qh),Dd=Od(td);function Nd(t){return function(e,n){var r=t((e=Ph(e)).h,(n=Ph(n)).h),i=td(e.c,n.c),a=td(e.l,n.l),o=td(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+""}}}var Rd=Nd(Qh),Td=Nd(td);function Pd(t){return function e(n){function r(e,r){var i=t((e=Yh(e)).h,(r=Yh(r)).h),a=td(e.s,r.s),o=td(e.l,r.l),u=td(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)}var Ld=Pd(Qh),qd=Pd(td);var Ud=Object.freeze({interpolate:hd,interpolateArray:ad,interpolateBasis:Vh,interpolateBasisClosed:Xh,interpolateDate:od,interpolateDiscrete:function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},interpolateHue:function(t,e){var n=Qh(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},interpolateNumber:ud,interpolateObject:sd,interpolateRound:dd,interpolateString:ld,interpolateTransformCss:wd,interpolateTransformSvg:Md,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<Ad)r=Math.log(f/o)/kd,n=function(t){return[i+t*c,a+t*l,o*Math.exp(kd*t*r)]};else{var d=Math.sqrt(h),p=(f*f-o*o+Sd*h)/(2*o*Ed*d),v=(f*f-o*o-Sd*h)/(2*f*Ed*d),g=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-g)/kd,n=function(t){var e,n=t*r,u=Cd(g),s=o/(Ed*d)*(u*(e=kd*n+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+s*c,a+s*l,o*u/Cd(kd*n+g)]}}return n.duration=1e3*r,n},interpolateRgb:ed,interpolateRgbBasis:rd,interpolateRgbBasisClosed:id,interpolateHsl:zd,interpolateHslLong:Dd,interpolateLab:function(t,e){var n=td((t=Oh(t)).l,(e=Oh(e)).l),r=td(t.a,e.a),i=td(t.b,e.b),a=td(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:Rd,interpolateHclLong:Td,interpolateCubehelix:Ld,interpolateCubehelixLong:qd,piecewise:function(t,e){for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n<r;)a[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return a[e](t-e)}},quantize:function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}});function Fd(t){return function(){return t}}function jd(t){return+t}var Id=[0,1];function $d(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Fd(e)}function Bd(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))}}function Wd(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=kl(t,e,1,i)-1;return o[n](a[n](e))}}function Yd(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function Gd(t,e){var n,r,i,a=Id,o=Id,u=hd,s=!1;function f(){return n=Math.min(a.length,o.length)>2?Wd:Bd,r=i=null,c}function c(e){return(r||(r=n(a,o,s?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,u)))(+e)}return c.invert=function(t){return(i||(i=n(o,a,$d,s?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)},c.domain=function(t){return arguments.length?(a=Bl.call(t,jd),f()):a.slice()},c.range=function(t){return arguments.length?(o=Wl.call(t),f()):o.slice()},c.rangeRound=function(t){return o=Wl.call(t),u=dd,f()},c.clamp=function(t){return arguments.length?(s=!!t,f()):s},c.interpolate=function(t){return arguments.length?(u=t,f()):u},f()}function Hd(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)]}function Vd(t){return(t=Hd(Math.abs(t)))?t[1]:NaN}var Xd,Jd=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zd(t){return new Qd(t)}function Qd(t){if(!(e=Jd.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}function Kd(t,e){var n=Hd(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")}Zd.prototype=Qd.prototype,Qd.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.trim?"~":"")+this.type};var tp={"%":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 Kd(100*t,e)},r:Kd,s:function(t,e){var n=Hd(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Xd=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")+Hd(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)}};function ep(t){return t}var np,rp,ip,ap=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function op(t){var e,n,r=t.grouping&&t.thousands?(e=t.grouping,n=t.thousands,function(t,r){for(var i=t.length,a=[],o=0,u=e[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(t.substring(i-=u,i+u)),!((s+=u+1)>r));)u=e[o=(o+1)%e.length];return a.reverse().join(n)}):ep,i=t.currency,a=t.decimal,o=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(t.numerals):ep,u=t.percent||"%";function s(t){var e=(t=Zd(t)).fill,n=t.align,s=t.sign,f=t.symbol,c=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.trim,v=t.type;"n"===v?(h=!0,v="g"):tp[v]||(null==d&&(d=12),p=!0,v="g"),(c||"0"===e&&"="===n)&&(c=!0,e="0",n="=");var g="$"===f?i[0]:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",m="$"===f?i[1]:/[%p]/.test(v)?u:"",y=tp[v],b=/[defgprs%]/.test(v);function _(t){var i,u,f,_=g,x=m;if("c"===v)x=y(t)+x,t="";else{var w=(t=+t)<0;if(t=y(Math.abs(t),d),p&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),w&&0==+t&&(w=!1),_=(w?"("===s?s:"-":"-"===s||"("===s?"":s)+_,x=("s"===v?ap[8+Xd/3]:"")+x+(w&&"("===s?")":""),b)for(i=-1,u=t.length;++i<u;)if(48>(f=t.charCodeAt(i))||f>57){x=(46===f?a+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!c&&(t=r(t,1/0));var M=_.length+t.length+x.length,k=M<l?new Array(l-M+1).join(e):"";switch(h&&c&&(t=r(k+t,k.length?l-x.length:1/0),k=""),n){case"<":t=_+t+x+k;break;case"=":t=_+k+t+x;break;case"^":t=k.slice(0,M=k.length>>1)+_+t+x+k.slice(M);break;default:t=k+_+t+x}return o(t)}return d=null==d?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:s,formatPrefix:function(t,e){var n=s(((t=Zd(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Vd(e)/3))),i=Math.pow(10,-r),a=ap[8+r/3];return function(t){return n(i*t)+a}}}}function up(t){return np=op(t),rp=np.format,ip=np.formatPrefix,np}function sp(t,e,n){var r,i=t[0],a=t[t.length-1],o=Dl(i,a,null==e?10:e);switch((n=Zd(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(Vd(e)/3)))-Vd(Math.abs(t)))}(o,u))||(n.precision=r),ip(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,Vd(e)-Vd(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,-Vd(Math.abs(t)))}(o))||(n.precision=r-2*("%"===n.type))}return rp(n)}function fp(t){var e=t.domain;return t.ticks=function(t){var n=e();return Ol(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){return sp(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=zl(u,s,n))>0?r=zl(u=Math.floor(u/r)*r,s=Math.ceil(s/r)*r,n):r<0&&(r=zl(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 cp(){var t=Gd($d,ud);return t.copy=function(){return Yd(t,cp())},fp(t)}function lp(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}function hp(t,e){return(e=Math.log(e/t))?function(n){return Math.log(n/t)/e}:Fd(e)}function dp(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 pp(t){return isFinite(t)?+("1e"+t):t<0?0:t}function vp(t){return 10===t?pp:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}function gp(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 mp(t){return function(e){return-t(-e)}}function yp(t,e){return t<0?-Math.pow(-t,e):Math.pow(t,e)}function bp(){var t=1,e=Gd(function(e,n){return(n=yp(n,t)-(e=yp(e,t)))?function(r){return(yp(r,t)-e)/n}:Fd(n)},function(e,n){return n=yp(n,t)-(e=yp(e,t)),function(r){return yp(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 Yd(e,bp().exponent(t))},fp(e)}up({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var _p=1e3,xp=60*_p,wp=60*xp,Mp=24*wp,kp=7*Mp,Ep=30*Mp,Sp=365*Mp;function Ap(t){return new Date(t)}function Cp(t){return t instanceof Date?+t:+new Date(+t)}function Op(t,e,n,r,i,a,o,u,s){var f=Gd($d,ud),c=f.invert,l=f.domain,h=s(".%L"),d=s(":%S"),p=s("%I:%M"),v=s("%I %p"),g=s("%a %d"),m=s("%b %d"),y=s("%B"),b=s("%Y"),_=[[o,1,_p],[o,5,5*_p],[o,15,15*_p],[o,30,30*_p],[a,1,xp],[a,5,5*xp],[a,15,15*xp],[a,30,30*xp],[i,1,wp],[i,3,3*wp],[i,6,6*wp],[i,12,12*wp],[r,1,Mp],[r,2,2*Mp],[n,1,kp],[e,1,Ep],[e,3,3*Ep],[t,1,Sp]];function x(u){return(o(u)<u?h:a(u)<u?d:i(u)<u?p:r(u)<u?v:e(u)<u?n(u)<u?g:m:t(u)<u?y:b)(u)}function w(e,n,r,i){if(null==e&&(e=10),"number"==typeof e){var a=Math.abs(r-n)/e,o=Ml(function(t){return t[2]}).right(_,a);o===_.length?(i=Dl(n/Sp,r/Sp,e),e=t):o?(i=(o=_[a/_[o-1][2]<_[o][2]/a?o-1:o])[1],e=o[0]):(i=Math.max(Dl(n,r,e),1),e=u)}return null==i?e:e.every(i)}return f.invert=function(t){return new Date(c(t))},f.domain=function(t){return arguments.length?l(Bl.call(t,Cp)):l().map(Ap)},f.ticks=function(t,e){var n,r=l(),i=r[0],a=r[r.length-1],o=a<i;return o&&(n=i,i=a,a=n),n=(n=w(t,i,a,e))?n.range(i,a+1):[],o?n.reverse():n},f.tickFormat=function(t,e){return null==e?x:s(e)},f.nice=function(t,e){var n=l();return(t=w(t,n[0],n[n.length-1],e))?l(lp(n,t)):f},f.copy=function(){return Yd(f,Op(t,e,n,r,i,a,o,u,s))},f}function zp(){var t,e,n=Gl().unknown(void 0),r=n.domain,i=n.range,a=[0,1],o=!1,u=0,s=0,f=.5;function c(){var n=r().length,c=a[1]<a[0],l=a[c-0],h=a[1-c],d=xl(n,u,s);t=(h-l)/(d||1),o&&(t=Math.floor(t)),l+=(h-l-t*(n-u))*f,e=t*(1-u),o&&(l=Math.round(l),e=Math.round(e));var p=Gr(n).map(function(e){return l+t*e});return i(c?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),c()):r()},n.range=function(t){return arguments.length?(a=[+t[0],+t[1]],c()):a.slice()},n.rangeRound=function(t){return a=[+t[0],+t[1]],o=!0,c()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(o=!!t,c()):o},n.padding=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),u=s,c()):u},n.paddingInner=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),c()):u},n.paddingOuter=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},n.align=function(t){return arguments.length?(f=Math.max(0,Math.min(1,t)),c()):f},n.invertRange=function(t){if(null!=t[0]&&null!=t[1]){var n,o,u,s=+t[0],f=+t[1],c=a[1]<a[0],l=c?i().reverse():i(),h=l.length-1;if(s==s&&f==f&&(f<s&&(u=s,s=f,f=u),!(f<l[0]||s>a[1-c])))return n=Math.max(0,Br(l,s)-1),o=s===f?n:Br(l,f)-1,s-l[n]>e+1e-10&&++n,c&&(u=n,n=h-o,o=h-u),n>o?void 0:r().slice(n,o+1)}},n.invert=function(t){var e=n.invertRange([t,t]);return e?e[0]:e},n.copy=function(){return zp().domain(r()).range(a).round(o).paddingInner(u).paddingOuter(s).align(f)},c()}var Dp=Array.prototype.map,Np=Array.prototype.slice;function Rp(t){return Dp.call(t,function(t){return+t})}function Tp(t,e){return arguments.length>1?(Pp[t]=function(t,e){return function(){var n=e();return n.invertRange||(n.invertRange=n.invert?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)]}}(n):n.invertExtent?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]]}}(n):void 0),n.type=t,n}}(t,e),this):Pp.hasOwnProperty(t)?Pp[t]:void 0}var Pp={identity:function t(){var e=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Bl.call(t,jd),n):e.slice()},n.copy=function(){return t().domain(e)},fp(n)},linear:cp,log:function t(){var e=Gd(hp,dp).domain([1,10]),n=e.domain,r=10,i=gp(10),a=vp(10);function o(){return i=gp(r),a=vp(r),n()[0]<0&&(i=mp(i),a=mp(a)),e}return e.base=function(t){return arguments.length?(r=+t,o()):r},e.domain=function(t){return arguments.length?(n(t),o()):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,v=[];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;v.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;v.push(l)}}else v=Ol(h,d,Math.min(d-h,p)).map(a);return e?v.reverse():v},e.tickFormat=function(t,n){if(null==n&&(n=10===r?".0e":","),"function"!=typeof n&&(n=rp(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(lp(n(),{floor:function(t){return a(Math.floor(i(t)))},ceil:function(t){return a(Math.ceil(i(t)))}}))},e.copy=function(){return Yd(e,t().base(r))},e},ordinal:Gl,pow:bp,sqrt:function(){return bp().exponent(.5)},quantile:function t(){var e=[],n=[],r=[];function i(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t<i;)r[t-1]=Nl(e,t/i);return a}function a(t){if(!isNaN(t=+t))return n[kl(r,t)]}return a.invertExtent=function(t){var i=n.indexOf(t);return i<0?[NaN,NaN]:[i>0?r[i-1]:e[0],i<r.length?r[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var n,r=0,a=t.length;r<a;++r)null==(n=t[r])||isNaN(n=+n)||e.push(n);return e.sort(wl),i()},a.range=function(t){return arguments.length?(n=Wl.call(t),i()):n.slice()},a.quantiles=function(){return r.slice()},a.copy=function(){return t().domain(e).range(n)},a},quantize:function t(){var e=0,n=1,r=1,i=[.5],a=[0,1];function o(t){if(t<=t)return a[kl(i,t,0,r)]}function u(){var t=-1;for(i=new Array(r);++t<r;)i[t]=((t+1)*n-(t-r)*e)/(r+1);return o}return o.domain=function(t){return arguments.length?(e=+t[0],n=+t[1],u()):[e,n]},o.range=function(t){return arguments.length?(r=(a=Wl.call(t)).length-1,u()):a.slice()},o.invertExtent=function(t){var o=a.indexOf(t);return o<0?[NaN,NaN]:o<1?[e,i[0]]:o>=r?[i[r-1],n]:[i[o-1],i[o]]},o.copy=function(){return t().domain([e,n]).range(a)},fp(o)},threshold:function t(){var e=[.5],n=[0,1],r=1;function i(t){if(t<=t)return n[kl(e,t,0,r)]}return i.domain=function(t){return arguments.length?(e=Wl.call(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Wl.call(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.copy=function(){return t().domain(e).range(n)},i},time:function(){return Op(Ae,Se,Me,xe,_e,be,ye,ve,Ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},utc:function(){return Op(Le,Pe,Ne,ze,Oe,Ce,ye,ve,Be).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},band:zp,point:function(){return function t(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return t(n())},e}(zp().paddingInner(1))},sequential:function t(e){var n=cp(),r=0,i=1,a=!1;function o(){var t=n.domain();r=t[0],i=E(t)-r}function u(t){var n=(t-r)/i;return e(a?Math.max(0,Math.min(1,n)):n)}return u.clamp=function(t){return arguments.length?(a=!!t,u):a},u.domain=function(t){return arguments.length?(n.domain(t),o(),u):n.domain()},u.interpolator=function(t){return arguments.length?(e=t,u):e},u.copy=function(){return t().domain(n.domain()).clamp(a).interpolator(e)},u.ticks=function(t){return n.ticks(t)},u.tickFormat=function(t,e){return n.tickFormat(t,e)},u.nice=function(t){return n.nice(t),o(),u},u},"bin-linear":function t(){var e=cp(),n=[];function r(t){return e(t)}return r.domain=function(t){return arguments.length?(function(t){n=Rp(t),e.domain([n[0],E(n)])}(t),r):n.slice()},r.range=function(t){return arguments.length?(e.range(t),r):e.range()},r.rangeRound=function(t){return arguments.length?(e.rangeRound(t),r):e.rangeRound()},r.interpolate=function(t){return arguments.length?(e.interpolate(t),r):e.interpolate()},r.invert=function(t){return e.invert(t)},r.ticks=function(t){var e=n.length,i=~~(e/(t||e));return i<2?r.domain():n.filter(function(t,e){return!(e%i)})},r.tickFormat=function(){return e.tickFormat.apply(e,arguments)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r},"bin-ordinal":function t(){var e=[],n=[];function r(t){return null==t||t!=t?void 0:n[(Br(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=Rp(t),r):e.slice()},r.range=function(t){return arguments.length?(n=Np.call(t),r):n.slice()},r.tickFormat=function(){var t=cp().domain([e[0],E(e)]);return t.tickFormat.apply(t,arguments)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}};for(var Lp in Pp)Tp(Lp,Pp[Lp]);function qp(t,e){var n=e[0],r=E(e)-n;return function(e){return t(n+e*r)}}function Up(t,e,n){var r=n-e;return r&&isFinite(r)?"linear"===t.type||"sequential"===t.type?function(t){return(t-e)/r}:t.copy().domain([e,n]).range([0,1]).interpolate(Fp):I(0)}function Fp(t,e){var n=e-t;return function(e){return t+e*n}}function jp(t,e){var n=Ud[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 Ip(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}var $p=Ip("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),Bp=Ip("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),Wp=Ip("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),Yp=Ip("4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac"),Gp=Ip("4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"),Hp=new Array(3).concat("67a9cff7f7f7f1a340","0571b092c5defdb863e66101","0571b092c5def7f7f7fdb863e66101","2166ac67a9cfd1e5f0fee0b6f1a340b35806","2166ac67a9cfd1e5f0f7f7f7fee0b6f1a340b35806","2166ac4393c392c5ded1e5f0fee0b6fdb863e08214b35806","2166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b35806","0530612166ac4393c392c5ded1e5f0fee0b6fdb863e08214b358067f3b08","0530612166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b358067f3b08").map(Ip);function Vp(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}var Xp=Vp("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Jp=Vp("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Zp=Vp("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Qp=Vp("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Kp=Vp("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),tv=Vp("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ev=Vp("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),nv=Vp("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),rv=Vp("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function iv(t){return rd(t[t.length-1])}var av=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Vp),ov=iv(av),uv=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Vp),sv=iv(uv),fv=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Vp),cv=iv(fv),lv=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Vp),hv=iv(lv),dv=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Vp),pv=iv(dv),vv=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Vp),gv=iv(vv),mv=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Vp),yv=iv(mv),bv=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Vp),_v=iv(bv),xv=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Vp),wv=iv(xv),Mv=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Vp),kv=iv(Mv),Ev=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Vp),Sv=iv(Ev),Av=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Vp),Cv=iv(Av),Ov=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Vp),zv=iv(Ov),Dv=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Vp),Nv=iv(Dv),Rv=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Vp),Tv=iv(Rv),Pv=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Vp),Lv=iv(Pv),qv=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Vp),Uv=iv(qv),Fv=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Vp),jv=iv(Fv),Iv=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Vp),$v=iv(Iv),Bv=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Vp),Wv=iv(Bv),Yv=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Vp),Gv=iv(Yv),Hv=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Vp),Vv=iv(Hv),Xv=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Vp),Jv=iv(Xv),Zv=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Vp),Qv=iv(Zv),Kv=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Vp),tg=iv(Kv),eg=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Vp),ng=iv(eg),rg=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Vp),ig=iv(rg),ag=qd(Yh(300,.5,0),Yh(-240,.5,1)),og=qd(Yh(-100,.75,.35),Yh(80,1.5,.8)),ug=qd(Yh(260,.75,.35),Yh(80,1.5,.8)),sg=Yh();function fg(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return sg.h=360*t-100,sg.s=1.5-1.5*e,sg.l=.8-.9*e,sg+""}var cg=hh(),lg=Math.PI/3,hg=2*Math.PI/3;function dg(t){var e;return t=(.5-t)*Math.PI,cg.r=255*(e=Math.sin(t))*e,cg.g=255*(e=Math.sin(t+lg))*e,cg.b=255*(e=Math.sin(t+hg))*e,cg+""}function pg(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var vg=pg(Vp("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),gg=pg(Vp("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mg=pg(Vp("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),yg=pg(Vp("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),bg=Object.freeze({schemeCategory10:Xp,schemeAccent:Jp,schemeDark2:Zp,schemePaired:Qp,schemePastel1:Kp,schemePastel2:tv,schemeSet1:ev,schemeSet2:nv,schemeSet3:rv,interpolateBrBG:ov,schemeBrBG:av,interpolatePRGn:sv,schemePRGn:uv,interpolatePiYG:cv,schemePiYG:fv,interpolatePuOr:hv,schemePuOr:lv,interpolateRdBu:pv,schemeRdBu:dv,interpolateRdGy:gv,schemeRdGy:vv,interpolateRdYlBu:yv,schemeRdYlBu:mv,interpolateRdYlGn:_v,schemeRdYlGn:bv,interpolateSpectral:wv,schemeSpectral:xv,interpolateBuGn:kv,schemeBuGn:Mv,interpolateBuPu:Sv,schemeBuPu:Ev,interpolateGnBu:Cv,schemeGnBu:Av,interpolateOrRd:zv,schemeOrRd:Ov,interpolatePuBuGn:Nv,schemePuBuGn:Dv,interpolatePuBu:Tv,schemePuBu:Rv,interpolatePuRd:Lv,schemePuRd:Pv,interpolateRdPu:Uv,schemeRdPu:qv,interpolateYlGnBu:jv,schemeYlGnBu:Fv,interpolateYlGn:$v,schemeYlGn:Iv,interpolateYlOrBr:Wv,schemeYlOrBr:Bv,interpolateYlOrRd:Gv,schemeYlOrRd:Yv,interpolateBlues:Vv,schemeBlues:Hv,interpolateGreens:Jv,schemeGreens:Xv,interpolateGreys:Qv,schemeGreys:Zv,interpolatePurples:tg,schemePurples:Kv,interpolateReds:ng,schemeReds:eg,interpolateOranges:ig,schemeOranges:rg,interpolateCubehelixDefault:ag,interpolateRainbow:fg,interpolateWarm:og,interpolateCool:ug,interpolateSinebow:dg,interpolateViridis:vg,interpolateMagma:gg,interpolateInferno:mg,interpolatePlasma:yg}),_g={blueorange:Hp},xg={category10:Xp,accent:Jp,dark2:Zp,paired:Qp,pastel1:Kp,pastel2:tv,set1:ev,set2:nv,set3:rv,category20:$p,category20b:Bp,category20c:Wp,tableau10:Yp,tableau20:Gp,viridis:vg,magma:gg,inferno:mg,plasma:yg,rainbow:fg,sinebow:dg,blueorange:rd(E(Hp))};function wg(t,e){xg[t]=bg["interpolate"+e],_g[t]=bg["scheme"+e]}function Mg(t,e){if(arguments.length>1)return xg[t]=e,this;var n=t.split("-");return t=n[0],(n=+n[1]+1)&&_g.hasOwnProperty(t)?_g[t][n-1]:!n&&xg.hasOwnProperty(t)?xg[t]:void 0}wg("blues","Blues"),wg("greens","Greens"),wg("greys","Greys"),wg("purples","Purples"),wg("reds","Reds"),wg("oranges","Oranges"),wg("brownbluegreen","BrBG"),wg("purplegreen","PRGn"),wg("pinkyellowgreen","PiYG"),wg("purpleorange","PuOr"),wg("redblue","RdBu"),wg("redgrey","RdGy"),wg("redyellowblue","RdYlBu"),wg("redyellowgreen","RdYlGn"),wg("spectral","Spectral"),wg("bluegreen","BuGn"),wg("bluepurple","BuPu"),wg("greenblue","GnBu"),wg("orangered","OrRd"),wg("purplebluegreen","PuBuGn"),wg("purpleblue","PuBu"),wg("purplered","PuRd"),wg("redpurple","RdPu"),wg("yellowgreenblue","YlGnBu"),wg("yellowgreen","YlGn"),wg("yelloworangebrown","YlOrBr"),wg("yelloworangered","YlOrRd");var kg={millisecond:ve,second:ye,minute:be,hour:_e,day:xe,week:Me,month:Se,year:Ae},Eg={millisecond:ve,second:ye,minute:Ce,hour:Oe,day:ze,week:Ne,month:Pe,year:Le};function Sg(t){return kg.hasOwnProperty(t)&&kg[t]}function Ag(t){return Eg.hasOwnProperty(t)&&Eg[t]}function Cg(t,e){var n;return u(e)&&(n=e.step,e=e.interval),s(e)&&(e="time"===t.type?Sg(e):"utc"===t.type?Ag(e):i("Only time and utc scales accept interval strings."),n&&(e=e.every(n))),e}function Og(t,e,n){var r=t.range(),i=r[0],a=E(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],E(e)];e.length>n&&e.length>=3;)e=e.filter(function(t,e){return!(e%2)});e.length<3&&(e=o)}return e}function zg(t,e){return t.ticks?t.ticks(e):t.domain()}function Dg(t,e,n){var r,i,a=t.tickFormat?t.tickFormat(e,n):n?rp(n):String;return t.type===cl?(r=a,i=function(t){var e=Zd(t||",");if(null==e.precision){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1}return n=rp(e),r=rp(".1f")(1)[1],function(t){var e,i,a=n(t),o=a.indexOf(r);if(o<0)return a;for(e=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=e<a.length?a.slice(e):"";--e>o;)if("0"!==a[e]){++e;break}return a.slice(0,e)+i}}return rp(e);var n,r}(n),function(t){return r(t)?i(t):""}):a}function Ng(t){kr.call(this,null,t)}function Rg(t){kr.call(this,null,t)}function Tg(){return vt({})}function Pg(t){return t.exit}function Lg(t){kr.call(this,null,t)}H(Ng,kr).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:Cg(i,t.count),o=t.format||Dg(i,a,t.formatSpecifier),u=t.values?Og(i,t.values,a):zg(i,a);return r&&(n.rem=r),r=u.map(function(t,e){return vt({index:e/(u.length-1),value:t,label:o(t)})}),t.extra&&r.length&&r.push(vt({index:-1,extra:{value:r[0].value},label:""})),n.source=r,n.add=r,this.value=r,n},H(Rg,kr).transform=function(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),a=t.item||Tg,u=t.key||dt,s=this.value;return o(r.encode)&&(r.encode=null),s&&(t.modified("key")||e.modified(u))&&i("DataJoin does not support modified key function or fields."),s||(e=e.addAll(),this.value=s=G().test(Pg),s.lookup=function(t){return s.get(u(t))}),e.visit(e.ADD,function(t){var e=u(t),n=s.get(e);n?n.exit?(s.empty--,r.add.push(n)):r.mod.push(n):(s.set(e,n=a(t)),r.add.push(n)),n.datum=t,n.exit=!1}),e.visit(e.MOD,function(t){var e=u(t),n=s.get(e);n&&(n.datum=t,r.mod.push(n))}),e.visit(e.REM,function(t){var e=u(t),n=s.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++s.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),t.clean&&s.empty>n.cleanThreshold&&n.runAfter(s.clean),r},H(Lg,kr).transform=function(t,e){var n=e.fork(e.ADD_REM),r=t.encoders,i=e.encode;if(o(i)){if(!n.changed()&&!i.every(function(t){return r[t]}))return e.StopPropagation;i=i[0],n.encode=null}var a="enter"===i,u=r.update||m,s=r.enter||m,f=r.exit||m,c=(i&&!a?r[i]:u)||m;if(e.changed(e.ADD)&&(e.visit(e.ADD,function(e){s(e,t),u(e,t),c!==m&&c!==u&&c(e,t)}),n.modifies(s.output),n.modifies(u.output),c!==m&&c!==u&&n.modifies(c.output)),e.changed(e.REM)&&f!==m&&(e.visit(e.REM,function(e){f(e,t)}),n.modifies(f.output)),a||c!==m){var l=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(l,function(e){var r=s(e,t);(c(e,t)||r)&&n.mod.push(e)}),n.mod.length&&n.modifies(s.output)):e.visit(l,function(e){c(e,t)&&n.mod.push(e)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:e.StopPropagation};var qg="symbol",Ug="discrete",Fg={};function jg(t,e,n){return n===qg&&Fg[t.type]?function(t){return function(e,n,r){var i=r[n+1]||r.max||1/0,a=Ig(e,t),o=Ig(i,t);return a&&o?a+""+o:o?"< "+o:"≥ "+a}}(e):n===Ug?function(t){return function(e,n){return n?t(e):null}}(e):function(t){return function(e){return t(e)}}(e)}function Ig(t,e){return isFinite(t)?e(t):null}function $g(t){kr.call(this,[],t)}Fg[gl]=function(t){var e=[-1/0].concat(t.quantiles());return e.max=1/0,e},Fg[ml]=function(t){var e=t.domain(),n=e[0],r=E(e),i=t.range().length,a=new Array(i),o=0;a[0]=-1/0;for(;++o<i;)a[o]=(o*r-(o-i)*n)/i;return a.max=1/0,a},Fg[yl]=function(t){var e=[-1/0].concat(t.domain());return e.max=1/0,e},Fg["bin-linear"]=Fg[bl]=function(t){var e=t.domain();return e.max=e.pop(),e},H($g,kr).transform=function(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,a,o=e.fork(e.NO_SOURCE|e.NO_FIELDS),u=this.value,s=t.type||qg,f=t.scale,c=null==t.count?5:Cg(f,t.count),l=t.format||Dg(f,c,t.formatSpecifier),h=t.values||function(t,e){var n=Fg[t.type];return n?n(t):zg(t,e)}(f,c);return l=jg(f,l,s),u&&(o.rem=u),s===qg?(F(i=t.size)?(t.values||0!==f(h[0])||(h=h.slice(1)),a=h.reduce(function(e,n){return Math.max(e,i(n,t))},0)):i=I(a=i||8),u=h.map(function(e,n){return vt({index:n,label:l(e,n,h),value:e,offset:a,size:i(e,t)})})):"gradient"===s?(n=f.domain(),r=Up(f,n[0],E(n)),h.length<3&&!t.values&&n[0]!==E(n)&&(h=[n[0],E(n)]),u=h.map(function(t,e){return vt({index:e,label:l(t,e,h),value:t,perc:r(t)})})):(i=h.length-1,r=function(t){var e=t.domain(),n=e.length-1,r=+e[0],i=+E(e),a=i-r;if(t.type===yl){var o=n?a/n:.1;a=(i+=o)-(r-=o)}return function(t){return(t-r)/a}}(f),u=h.map(function(t,e){return vt({index:e,label:l(t,e,h),value:t,perc:e?r(t):0,perc2:e===i?1:r(h[e+1])})})),o.source=u,o.add=u,this.value=u,o};var Bg=G({line:Xg,"line-radial":function(t,e,n,r){return Xg(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},arc:Jg,"arc-radial":function(t,e,n,r){return Jg(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},curve:Zg,"curve-radial":function(t,e,n,r){return Zg(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),s=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*a+"A"+e+","+e+" 0 0,"+(s?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}});function Wg(t){return t.source.x}function Yg(t){return t.source.y}function Gg(t){return t.target.x}function Hg(t){return t.target.y}function Vg(t){kr.call(this,{},t)}function Xg(t,e,n,r){return"M"+t+","+e+"L"+n+","+r}function Jg(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 Zg(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 Qg(t){kr.call(this,null,t)}Vg.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},H(Vg,kr).transform=function(t,e){var n=t.sourceX||Wg,r=t.sourceY||Yg,a=t.targetX||Gg,o=t.targetY||Hg,u=t.as||"path",s=t.orient||"vertical",f=t.shape||"line",c=Bg.get(f+"-"+s)||Bg.get(f);return c||i("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,function(t){t[u]=c(n(t),r(t),a(t),o(t))}),e.reflow(t.modified()).modifies(u)},Qg.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"]}]},H(Qg,kr).transform=function(t,e){var n,r,i,a=t.as||["startAngle","endAngle"],o=a[0],u=a[1],s=t.field||v,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){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}(h),m=Gr(d);for(t.sort&&m.sort(function(t,e){return h[t]-h[e]}),n=0;n<d;++n)i=h[m[n]],(r=l[m[n]])[o]=p,r[u]=p+=i*g;return this.value=h,e.reflow(t.modified()).modifies(a)};var Kg=5,tm=ot(["linear",ll,hl]),em=ot(["linear",cl,ll,hl,"time","utc"]),nm=ot(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function rm(t){kr.call(this,null,t),this.modified(!0)}function im(t,e,n){t===cl&&(Math.abs(e.reduce(function(t,e){return t+(e<0?-1:e>0?1:0)},0))!==e.length&&n.warn("Log scale domain includes zero: "+f(e)));return e}function am(t,e,n){return F(t)&&(e||n)?qp(t,om(e||[0,1],n)):t}function om(t,e){return e?t.slice().reverse():t}function um(t){kr.call(this,null,t)}H(rm,kr).transform=function(t,e){var n,r=e.dataflow,a=this.value;for(n in a&&!t.modified("type")||(this.value=a=Tp((t.type||"linear").toLowerCase())()),t)if(!nm[n]){if("padding"===n&&em[a.type])continue;F(a[n])?a[n](t[n]):r.warn("Unsupported scale property: "+n)}return function(t,e,n){var r=e.round||!1,a=e.range;if(null!=e.rangeStep)a=function(t,e,n){t!==dl&&t!==pl&&i("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,a=t===pl?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*xl(n,a,r)]}(t.type,e,n);else if(e.scheme){if(a=function(t,e,n){var r,a=e.scheme.toLowerCase(),o=Mg(a),u=e.schemeExtent;o||i("Unrecognized scheme name: "+e.scheme);return n=t===yl?n+1:t===bl?n-1:t===gl||t===ml?+e.schemeCount||Kg:n,t===_l?am(o,u,e.reverse):!u&&(r=Mg(a+"-"+n))?r:F(o)?function(t,e){for(var n=new Array(e),r=e+1,i=0;i<e;)n[i]=t(++i/r);return n}(am(o,u),n):t===vl?o:o.slice(0,n)}(t.type,e,n),F(a))return t.interpolator(a)}else if(a&&t.type===_l)return t.interpolator(rd(om(a,e.reverse)));a&&e.interpolate&&t.interpolate?t.interpolate(jp(e.interpolate,e.interpolateGamma)):F(t.round)?t.round(r):F(t.rangeRound)&&t.interpolate(r?dd:hd);a&&t.range(om(a,e.reverse))}(a,t,function(t,e,n){var r=function(t,e,n){return e?(t.domain(im(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,a,o=e.domain,u=t.type,s=e.zero||void 0===e.zero&&tm[u];if(!o)return 0;em[u]&&e.padding&&o[0]!==E(o)&&(o=function(t,e,n,r,i){var a=Math.abs(E(n)-n[0]),o=a/(a-2*r),u=t===cl?L(e,null,o):t===hl?q(e,null,o,.5):t===ll?q(e,null,o,i):P(e,null,o);return(e=e.slice())[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(im(u,o,n)),u===vl&&t.unknown(e.domainImplicit?Yl:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&Cg(t,e.nice)||null);return o.length}(a,t,r)),e.fork(e.NO_SOURCE|e.NO_FIELDS)},H(um,kr).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};var sm=["y0","y1"];function fm(t){kr.call(this,null,t)}function cm(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))}function lm(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 hm(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)}fm.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:sm}]},H(fm,kr).transform=function(t,e){var n,r,i,a,o=t.as||sm,u=o[0],s=o[1],f=t.field||v,c="center"===t.offset?cm:"normalize"===t.offset?lm:hm;for(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],f=e.map(p),(c=i[f])||(i[f]=c=[],d.push(c)),c.push(s);for(f=0,h=0,u=d.length;f<u;++f){for(c=d[f],a=0,l=0,o=c.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),r=0,i=n.length,a=n.max;r<i;++r)c(n[r],a,f,u,s);return e.reflow(t.modified()).modifies(o)};var dm=Object.freeze({axisticks:Ng,datajoin:Rg,encode:Lg,legendentries:$g,linkpath:Vg,pie:Qg,scale:rm,sortitems:um,stack:fm,validTicks:Og});function pm(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}!function(t){var e;1===t.length&&(e=t,t=function(t,n){return pm(e(t),n)})}(pm);function vm(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}var gm=Math.sqrt(50),mm=Math.sqrt(10),ym=Math.sqrt(2);function bm(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>=gm?i*=10:a>=mm?i*=5:a>=ym&&(i*=2),e<t?-i:i}function _m(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}var xm=Array.prototype.slice;function wm(t,e){return t-e}function Mm(t){return function(){return t}}function km(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=Em(t,e[r]))return n;return 0}function Em(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(Sm(s,l,e))return 0;c>r!=d>r&&n<(h-f)*(r-c)/(d-c)+f&&(i=-i)}return i}function Sm(t,e,n){var r,i,a,o;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)&&(i=t[r=+(t[0]===e[0])],a=n[r],o=e[r],i<=a&&a<=o||o<=a&&a<=i)}function Am(){}var Cm=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Om(){var t=1,e=1,n=_m,r=u;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(wm);else{var r=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]}(t),i=r[0],o=r[1];e=bm(i,o,e),e=vm(Math.floor(i/e)*e,Math.floor(o/e)*e,e)}return e.map(function(e){return a(t,e)})}function a(n,i){var a=[],u=[];return function(n,r,i){var a,u,s,f,c,l,h=new Array,d=new Array;a=u=-1,f=n[0]>=r,Cm[f<<1].forEach(p);for(;++a<t-1;)s=f,f=n[a+1]>=r,Cm[s|f<<1].forEach(p);Cm[f<<0].forEach(p);for(;++u<e-1;){for(a=-1,f=n[u*t+t]>=r,c=n[u*t]>=r,Cm[f<<1|c<<2].forEach(p);++a<t-1;)s=f,f=n[u*t+t+a+1]>=r,l=c,c=n[u*t+a+1]>=r,Cm[s|f<<1|c<<2|l<<3].forEach(p);Cm[f|c<<3].forEach(p)}a=-1,c=n[u*t]>=r,Cm[c<<2].forEach(p);for(;++a<t-1;)l=c,c=n[u*t+a+1]>=r,Cm[c<<2|l<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+u],s=[t[1][0]+a,t[1][1]+u],f=o(r),c=o(s);(e=d[f])?(n=h[c])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(s),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(s),d[e.end=c]=e):(e=h[c])?(n=d[f])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(s),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=f]=e):h[f]=d[c]={start:f,end:c,ring:[r,s]}}Cm[c<<3].forEach(p)}(n,i,function(t){r(t,n,i),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}(t)>0?a.push([t]):u.push(t)}),u.forEach(function(t){for(var e,n=0,r=a.length;n<r;++n)if(-1!==km((e=a[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:i,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function u(n,r,i){n.forEach(function(n){var a,o=n[0],u=n[1],s=0|o,f=0|u,c=r[f*t+s];o>0&&o<t&&s===o&&(a=r[f*t+s-1],n[0]=o+(i-a)/(c-a)-.5),u>0&&u<e&&f===u&&(a=r[(f-1)*t+s],n[1]=u+(i-a)/(c-a)-.5)})}return i.contour=a,i.size=function(n){if(!arguments.length)return[t,e];var r=Math.ceil(n[0]),a=Math.ceil(n[1]);if(!(r>0&&a>0))throw new Error("invalid size");return t=r,e=a,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Mm(xm.call(t)):Mm(t),i):n},i.smooth=function(t){return arguments.length?(r=t?u:Am,i):r===u},i}function zm(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 Dm(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 Nm(t){return t[0]}function Rm(t){return t[1]}function Tm(){return 1}var Pm=["size","smooth"],Lm=["x","y","weight","size","cellSize","bandwidth"];function qm(t){kr.call(this,null,t)}qm.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"smooth",type:"boolean"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0}]},H(qm,kr).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i,a,o=e.fork(e.NO_SOURCE|e.NO_FIELDS),u=t.count||10;return t.values?(n=Om(),r=Pm,i=t.values):(n=function(){var t=Nm,e=Rm,n=Tm,r=960,i=500,a=20,o=2,u=3*a,s=r+2*u>>o,f=i+2*u>>o,c=Mm(20);function l(r){var i=new Float32Array(s*f),l=new Float32Array(s*f);r.forEach(function(r,a,c){var l=+t(r,a,c)+u>>o,h=+e(r,a,c)+u>>o,d=+n(r,a,c);l>=0&&l<s&&h>=0&&h<f&&(i[l+h*s]+=d)}),zm({width:s,height:f,data:i},{width:s,height:f,data:l},a>>o),Dm({width:s,height:f,data:l},{width:s,height:f,data:i},a>>o),zm({width:s,height:f,data:i},{width:s,height:f,data:l},a>>o),Dm({width:s,height:f,data:l},{width:s,height:f,data:i},a>>o),zm({width:s,height:f,data:i},{width:s,height:f,data:l},a>>o),Dm({width:s,height:f,data:l},{width:s,height:f,data:i},a>>o);var d=c(i);if(!Array.isArray(d)){var p=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}(i);d=bm(0,p,d),(d=vm(0,Math.floor(p/d)*d,d)).shift()}return Om().thresholds(d).size([s,f])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,o)-u,t[1]=t[1]*Math.pow(2,o)-u}function g(){return s=r+2*(u=3*a)>>o,f=i+2*u>>o,l}return l.x=function(e){return arguments.length?(t="function"==typeof e?e:Mm(+e),l):t},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Mm(+t),l):e},l.weight=function(t){return arguments.length?(n="function"==typeof t?t:Mm(+t),l):n},l.size=function(t){if(!arguments.length)return[r,i];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return r=e,i=n,g()},l.cellSize=function(t){if(!arguments.length)return 1<<o;if(!((t=+t)>=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),g()},l.thresholds=function(t){return arguments.length?(c="function"==typeof t?t:Array.isArray(t)?Mm(xm.call(t)):Mm(t),l):c},l.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),g()},l}(),r=Lm,i=e.materialize(e.SOURCE).source),n.thresholds(t.thresholds||(t.nice?u:(a=u,function(t){for(var e=Yr(t),n=e[0],r=e[1]-n,i=[],o=1;o<=a;++o)i.push(n+r*o/(a+1));return i}))),r.forEach(function(e){null!=t[e]&&n[e](t[e])}),this.value&&(o.rem=this.value),i=i&&i.length?n(i).map(vt):[],this.value=o.source=o.add=i,o};var Um="FeatureCollection";function Fm(t){kr.call(this,null,t)}function jm(){return new Im}function Im(){this.reset()}Fm.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},H(Fm,kr).transform=function(t,e){var n,i=this._features,a=this._points,o=t.fields,u=o&&o[0],s=o&&o[1],f=t.geojson,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(r(f))||u&&e.modified(r(u))||s&&e.modified(r(s)),this.value&&!n||(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:Um,features:i}},Im.prototype={constructor:Im,reset:function(){this.s=this.t=0},add:function(t){Bm($m,t,this.t),Bm(this,$m.s,this.s),this.s?this.t+=$m.t:this.s=$m.t},valueOf:function(){return this.s}};var $m=new Im;function Bm(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}var Wm=1e-6,Ym=1e-12,Gm=Math.PI,Hm=Gm/2,Vm=Gm/4,Xm=2*Gm,Jm=180/Gm,Zm=Gm/180,Qm=Math.abs,Km=Math.atan,ty=Math.atan2,ey=Math.cos,ny=Math.ceil,ry=Math.exp,iy=Math.log,ay=Math.pow,oy=Math.sin,uy=Math.sign||function(t){return t>0?1:t<0?-1:0},sy=Math.sqrt,fy=Math.tan;function cy(t){return t>1?0:t<-1?Gm:Math.acos(t)}function ly(t){return t>1?Hm:t<-1?-Hm:Math.asin(t)}function hy(){}function dy(t,e){t&&vy.hasOwnProperty(t.type)&&vy[t.type](t,e)}var py={Feature:function(t,e){dy(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)dy(n[r].geometry,e)}},vy={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){gy(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)gy(n[r],e,0)},Polygon:function(t,e){my(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)my(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)dy(n[r],e)}};function gy(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 my(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)gy(t[n],e,1);e.polygonEnd()}function yy(t,e){t&&py.hasOwnProperty(t.type)?py[t.type](t,e):dy(t,e)}var by,_y,xy,wy,My,ky=jm(),Ey=jm(),Sy={point:hy,lineStart:hy,lineEnd:hy,polygonStart:function(){ky.reset(),Sy.lineStart=Ay,Sy.lineEnd=Cy},polygonEnd:function(){var t=+ky;Ey.add(t<0?Xm+t:t),this.lineStart=this.lineEnd=this.point=hy},sphere:function(){Ey.add(Xm)}};function Ay(){Sy.point=Oy}function Cy(){zy(by,_y)}function Oy(t,e){Sy.point=zy,by=t,_y=e,xy=t*=Zm,wy=ey(e=(e*=Zm)/2+Vm),My=oy(e)}function zy(t,e){var n=(t*=Zm)-xy,r=n>=0?1:-1,i=r*n,a=ey(e=(e*=Zm)/2+Vm),o=oy(e),u=My*o,s=wy*a+u*ey(i),f=u*r*oy(i);ky.add(ty(f,s)),xy=t,wy=a,My=o}function Dy(t){return[ty(t[1],t[0]),ly(t[2])]}function Ny(t){var e=t[0],n=t[1],r=ey(n);return[r*ey(e),r*oy(e),oy(n)]}function Ry(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ty(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 Py(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ly(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function qy(t){var e=sy(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Uy,Fy,jy,Iy,$y,By,Wy,Yy,Gy,Hy,Vy,Xy,Jy,Zy,Qy,Ky,tb,eb,nb,rb,ib,ab,ob,ub,sb,fb,cb=jm(),lb={point:hb,lineStart:pb,lineEnd:vb,polygonStart:function(){lb.point=gb,lb.lineStart=mb,lb.lineEnd=yb,cb.reset(),Sy.polygonStart()},polygonEnd:function(){Sy.polygonEnd(),lb.point=hb,lb.lineStart=pb,lb.lineEnd=vb,ky<0?(Uy=-(jy=180),Fy=-(Iy=90)):cb>Wm?Iy=90:cb<-Wm&&(Fy=-90),Hy[0]=Uy,Hy[1]=jy}};function hb(t,e){Gy.push(Hy=[Uy=t,jy=t]),e<Fy&&(Fy=e),e>Iy&&(Iy=e)}function db(t,e){var n=Ny([t*Zm,e*Zm]);if(Yy){var r=Ty(Yy,n),i=Ty([r[1],-r[0],0],r);qy(i),i=Dy(i);var a,o=t-$y,u=o>0?1:-1,s=i[0]*Jm*u,f=Qm(o)>180;f^(u*$y<s&&s<u*t)?(a=i[1]*Jm)>Iy&&(Iy=a):f^(u*$y<(s=(s+360)%360-180)&&s<u*t)?(a=-i[1]*Jm)<Fy&&(Fy=a):(e<Fy&&(Fy=e),e>Iy&&(Iy=e)),f?t<$y?bb(Uy,t)>bb(Uy,jy)&&(jy=t):bb(t,jy)>bb(Uy,jy)&&(Uy=t):jy>=Uy?(t<Uy&&(Uy=t),t>jy&&(jy=t)):t>$y?bb(Uy,t)>bb(Uy,jy)&&(jy=t):bb(t,jy)>bb(Uy,jy)&&(Uy=t)}else Gy.push(Hy=[Uy=t,jy=t]);e<Fy&&(Fy=e),e>Iy&&(Iy=e),Yy=n,$y=t}function pb(){lb.point=db}function vb(){Hy[0]=Uy,Hy[1]=jy,lb.point=hb,Yy=null}function gb(t,e){if(Yy){var n=t-$y;cb.add(Qm(n)>180?n+(n>0?360:-360):n)}else By=t,Wy=e;Sy.point(t,e),db(t,e)}function mb(){Sy.lineStart()}function yb(){gb(By,Wy),Sy.lineEnd(),Qm(cb)>Wm&&(Uy=-(jy=180)),Hy[0]=Uy,Hy[1]=jy,Yy=null}function bb(t,e){return(e-=t)<0?e+360:e}function _b(t,e){return t[0]-e[0]}function xb(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var wb={sphere:hy,point:Mb,lineStart:Eb,lineEnd:Cb,polygonStart:function(){wb.lineStart=Ob,wb.lineEnd=zb},polygonEnd:function(){wb.lineStart=Eb,wb.lineEnd=Cb}};function Mb(t,e){t*=Zm;var n=ey(e*=Zm);kb(n*ey(t),n*oy(t),oy(e))}function kb(t,e,n){Jy+=(t-Jy)/++Vy,Zy+=(e-Zy)/Vy,Qy+=(n-Qy)/Vy}function Eb(){wb.point=Sb}function Sb(t,e){t*=Zm;var n=ey(e*=Zm);ub=n*ey(t),sb=n*oy(t),fb=oy(e),wb.point=Ab,kb(ub,sb,fb)}function Ab(t,e){t*=Zm;var n=ey(e*=Zm),r=n*ey(t),i=n*oy(t),a=oy(e),o=ty(sy((o=sb*a-fb*i)*o+(o=fb*r-ub*a)*o+(o=ub*i-sb*r)*o),ub*r+sb*i+fb*a);Xy+=o,Ky+=o*(ub+(ub=r)),tb+=o*(sb+(sb=i)),eb+=o*(fb+(fb=a)),kb(ub,sb,fb)}function Cb(){wb.point=Mb}function Ob(){wb.point=Db}function zb(){Nb(ab,ob),wb.point=Mb}function Db(t,e){ab=t,ob=e,t*=Zm,e*=Zm,wb.point=Nb;var n=ey(e);ub=n*ey(t),sb=n*oy(t),fb=oy(e),kb(ub,sb,fb)}function Nb(t,e){t*=Zm;var n=ey(e*=Zm),r=n*ey(t),i=n*oy(t),a=oy(e),o=sb*a-fb*i,u=fb*r-ub*a,s=ub*i-sb*r,f=sy(o*o+u*u+s*s),c=ly(f),l=f&&-c/f;nb+=l*o,rb+=l*u,ib+=l*s,Xy+=c,Ky+=c*(ub+(ub=r)),tb+=c*(sb+(sb=i)),eb+=c*(fb+(fb=a)),kb(ub,sb,fb)}function Rb(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}function Tb(t,e){return[Qm(t)>Gm?t+Math.round(-t/Xm)*Xm:t,e]}function Pb(t,e,n){return(t%=Xm)?e||n?Rb(qb(t),Ub(e,n)):qb(t):e||n?Ub(e,n):Tb}function Lb(t){return function(e,n){return[(e+=t)>Gm?e-Xm:e<-Gm?e+Xm:e,n]}}function qb(t){var e=Lb(t);return e.invert=Lb(-t),e}function Ub(t,e){var n=ey(t),r=oy(t),i=ey(e),a=oy(e);function o(t,e){var o=ey(e),u=ey(t)*o,s=oy(t)*o,f=oy(e),c=f*n+u*r;return[ty(s*i-c*a,u*n-f*r),ly(c*i+s*a)]}return o.invert=function(t,e){var o=ey(e),u=ey(t)*o,s=oy(t)*o,f=oy(e),c=f*i-s*a;return[ty(s*i+f*a,u*n+c*r),ly(c*n-u*r)]},o}function Fb(t,e){(e=Ny(e))[0]-=t,qy(e);var n=cy(-e[1]);return((-e[2]<0?-n:n)+Xm-Wm)%Xm}function jb(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:hy,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ib(t,e){return Qm(t[0]-e[0])<Wm&&Qm(t[1]-e[1])<Wm}function $b(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 Bb(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(Ib(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 $b(r,t,null,!0)),s.push(n.o=new $b(r,null,n,!1)),u.push(n=new $b(o,t,null,!1)),s.push(n.o=new $b(o,null,n,!0))}}),u.length){for(s.sort(e),Wb(u),Wb(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()}}}function Wb(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}}Tb.invert=Tb;var Yb=jm();function Gb(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}!function(t){var e;1===t.length&&(e=t,t=function(t,n){return Gb(e(t),n)})}(Gb);function Hb(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}function Vb(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}function Xb(t,e,n,r){return function(i){var a,o,u,s=e(i),f=jb(),c=e(f),l=!1,h={point:d,lineStart:v,lineEnd:g,polygonStart:function(){h.point=m,h.lineStart=y,h.lineEnd=b,o=[],a=[]},polygonEnd:function(){h.point=d,h.lineStart=v,h.lineEnd=g,o=Vb(o);var t=function(t,e){var n=e[0],r=e[1],i=oy(r),a=[oy(n),-ey(n),0],o=0,u=0;Yb.reset(),1===i?r=Hm+Wm:-1===i&&(r=-Hm-Wm);for(var s=0,f=t.length;s<f;++s)if(l=(c=t[s]).length)for(var c,l,h=c[l-1],d=h[0],p=h[1]/2+Vm,v=oy(p),g=ey(p),m=0;m<l;++m,d=b,v=x,g=w,h=y){var y=c[m],b=y[0],_=y[1]/2+Vm,x=oy(_),w=ey(_),M=b-d,k=M>=0?1:-1,E=k*M,S=E>Gm,A=v*x;if(Yb.add(ty(A*k*oy(E),g*w+A*ey(E))),o+=S?M+k*Xm:M,S^d>=n^b>=n){var C=Ty(Ny(h),Ny(y));qy(C);var O=Ty(a,C);qy(O);var z=(S^M>=0?-1:1)*ly(O[2]);(r>z||r===z&&(C[0]||C[1]))&&(u+=S^M>=0?1:-1)}}return(o<-Wm||o<Wm&&Yb<-Wm)^1&u}(a,r);o.length?(l||(i.polygonStart(),l=!0),Bb(o,Zb,t,n,i)):t&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){s.point(t,e)}function v(){h.point=p,s.lineStart()}function g(){h.point=d,s.lineEnd()}function m(t,e){u.push([t,e]),c.point(t,e)}function y(){c.lineStart(),u=[]}function b(){m(u[0][0],u[0][1]),c.lineEnd();var t,e,n,r,s=c.clean(),h=f.result(),d=h.length;if(u.pop(),a.push(u),u=null,d)if(1&s){if((e=(n=h[0]).length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&s&&h.push(h.pop().concat(h.shift())),o.push(h.filter(Jb))}return h}}function Jb(t){return t.length>1}function Zb(t,e){return((t=t.x)[0]<0?t[1]-Hm-Wm:Hm-t[1])-((e=e.x)[0]<0?e[1]-Hm-Wm:Hm-e[1])}var Qb=Xb(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?Gm:-Gm,s=Qm(a-n);Qm(s-Gm)<Wm?(t.point(n,r=(r+o)/2>0?Hm:-Hm),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(a,r),e=0):i!==u&&s>=Gm&&(Qm(n-i)<Wm&&(n-=i*Wm),Qm(a-u)<Wm&&(a-=u*Wm),r=function(t,e,n,r){var i,a,o=oy(t-n);return Qm(o)>Wm?Km((oy(e)*(a=ey(r))*oy(n)-oy(r)*(i=ey(e))*oy(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*Hm,r.point(-Gm,i),r.point(0,i),r.point(Gm,i),r.point(Gm,0),r.point(Gm,-i),r.point(0,-i),r.point(-Gm,-i),r.point(-Gm,0),r.point(-Gm,i);else if(Qm(t[0]-e[0])>Wm){var a=t[0]<e[0]?Gm:-Gm;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])},[-Gm,-Hm]);function Kb(t){var e=ey(t),n=6*Zm,r=e>0,i=Qm(e)>Wm;function a(t,n){return ey(t)*ey(n)>e}function o(t,n,r){var i=[1,0,0],a=Ty(Ny(t),Ny(n)),o=Ry(a,a),u=a[0],s=o-u*u;if(!s)return!r&&t;var f=e*o/s,c=-e*u/s,l=Ty(i,a),h=Ly(i,f);Py(h,Ly(a,c));var d=l,p=Ry(h,d),v=Ry(d,d),g=p*p-v*(Ry(h,h)-1);if(!(g<0)){var m=sy(g),y=Ly(d,(-p-m)/v);if(Py(y,h),y=Dy(y),!r)return y;var b,_=t[0],x=n[0],w=t[1],M=n[1];x<_&&(b=_,_=x,x=b);var k=x-_,E=Qm(k-Gm)<Wm;if(!E&&M<w&&(b=w,w=M,M=b),E||k<Wm?E?w+M>0^y[1]<(Qm(y[0]-_)<Wm?w:M):w<=y[1]&&y[1]<=M:k>Gm^(_<=y[0]&&y[0]<=x)){var S=Ly(d,(-p+m)/v);return Py(S,h),[y,Dy(S)]}}}function u(e,n){var i=r?t:Gm-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return Xb(a,function(t){var e,n,s,f,c;return{lineStart:function(){f=s=!1,c=1},point:function(l,h){var d,p=[l,h],v=a(l,h),g=r?v?0:u(l,h):v?u(l+(l<0?Gm:-Gm),h):0;if(!e&&(f=s=v)&&t.lineStart(),v!==s&&(!(d=o(e,p))||Ib(e,d)||Ib(p,d))&&(p[0]+=Wm,p[1]+=Wm,v=a(p[0],p[1])),v!==s)c=0,v?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(i&&e&&r^v){var m;g&n||!(m=o(p,e,!0))||(c=0,r?(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])))}!v||e&&Ib(e,p)||t.point(p[0],p[1]),e=p,s=v,n=g},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return c|(f&&s)<<1}}},function(e,r,i,a){!function(t,e,n,r,i,a){if(n){var o=ey(e),u=oy(e),s=r*n;null==i?(i=e+r*Xm,a=e-s/2):(i=Fb(o,i),a=Fb(o,a),(r>0?i<a:i>a)&&(i+=r*Xm));for(var f,c=i;r>0?c>a:c<a;c-=s)f=Dy([o,-u*ey(c),-u*oy(c)]),t.point(f[0],f[1])}}(a,t,n,i,e,r)},r?[0,-t]:[-Gm,t-Gm])}var t_=1e9,e_=-t_;function n_(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 Qm(r[0]-t)<Wm?i>0?0:3:Qm(r[0]-n)<Wm?i>0?2:1:Qm(r[1]-e)<Wm?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){var s,f,c,l,h,d,p,v,g,m,y,b=o,_=jb(),x={point:w,lineStart:function(){x.point=M,f&&f.push(c=[]);m=!0,g=!1,p=v=NaN},lineEnd:function(){s&&(M(l,h),d&&g&&_.rejoin(),s.push(_.result()));x.point=w,g&&b.lineEnd()},polygonStart:function(){b=_,s=[],f=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=f.length;n<i;++n)for(var a,o,u=f[n],s=1,c=u.length,l=u[0],h=l[0],d=l[1];s<c;++s)a=h,o=d,l=u[s],h=l[0],d=l[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=y&&e,i=(s=Vb(s)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&Bb(s,u,e,a,o),o.polygonEnd());b=o,s=f=c=null}};function w(t,e){i(t,e)&&b.point(t,e)}function M(a,o){var u=i(a,o);if(f&&c.push([a,o]),m)l=a,h=o,d=u,m=!1,u&&(b.lineStart(),b.point(a,o));else if(u&&g)b.point(a,o);else{var s=[p=Math.max(e_,Math.min(t_,p)),v=Math.max(e_,Math.min(t_,v))],_=[a=Math.max(e_,Math.min(t_,a)),o=Math.max(e_,Math.min(t_,o))];!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}}}}}(s,_,t,e,n,r)?u&&(b.lineStart(),b.point(a,o),y=!1):(g||(b.lineStart(),b.point(s[0],s[1])),b.point(_[0],_[1]),u||b.lineEnd(),y=!1)}p=a,v=o,g=u}return x}}jm();function r_(t,e,n){var r=Hb(t,e-Wm,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function i_(t,e,n){var r=Hb(t,e-Wm,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function a_(t){return t}var o_,u_,s_,f_,c_=jm(),l_=jm(),h_={point:hy,lineStart:hy,lineEnd:hy,polygonStart:function(){h_.lineStart=d_,h_.lineEnd=g_},polygonEnd:function(){h_.lineStart=h_.lineEnd=h_.point=hy,c_.add(Qm(l_)),l_.reset()},result:function(){var t=c_/2;return c_.reset(),t}};function d_(){h_.point=p_}function p_(t,e){h_.point=v_,o_=s_=t,u_=f_=e}function v_(t,e){l_.add(f_*t-s_*e),s_=t,f_=e}function g_(){v_(o_,u_)}var m_=1/0,y_=m_,b_=-m_,__=b_,x_={point:function(t,e){t<m_&&(m_=t);t>b_&&(b_=t);e<y_&&(y_=e);e>__&&(__=e)},lineStart:hy,lineEnd:hy,polygonStart:hy,polygonEnd:hy,result:function(){var t=[[m_,y_],[b_,__]];return b_=__=-(y_=m_=1/0),t}};var w_,M_,k_,E_,S_=0,A_=0,C_=0,O_=0,z_=0,D_=0,N_=0,R_=0,T_=0,P_={point:L_,lineStart:q_,lineEnd:j_,polygonStart:function(){P_.lineStart=I_,P_.lineEnd=$_},polygonEnd:function(){P_.point=L_,P_.lineStart=q_,P_.lineEnd=j_},result:function(){var t=T_?[N_/T_,R_/T_]:D_?[O_/D_,z_/D_]:C_?[S_/C_,A_/C_]:[NaN,NaN];return S_=A_=C_=O_=z_=D_=N_=R_=T_=0,t}};function L_(t,e){S_+=t,A_+=e,++C_}function q_(){P_.point=U_}function U_(t,e){P_.point=F_,L_(k_=t,E_=e)}function F_(t,e){var n=t-k_,r=e-E_,i=sy(n*n+r*r);O_+=i*(k_+t)/2,z_+=i*(E_+e)/2,D_+=i,L_(k_=t,E_=e)}function j_(){P_.point=L_}function I_(){P_.point=B_}function $_(){W_(w_,M_)}function B_(t,e){P_.point=W_,L_(w_=k_=t,M_=E_=e)}function W_(t,e){var n=t-k_,r=e-E_,i=sy(n*n+r*r);O_+=i*(k_+t)/2,z_+=i*(E_+e)/2,D_+=i,N_+=(i=E_*t-k_*e)*(k_+t),R_+=i*(E_+e),T_+=3*i,L_(k_=t,E_=e)}function Y_(t){this._context=t}Y_.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,Xm)}},result:hy};var G_,H_,V_,X_,J_,Z_=jm(),Q_={point:hy,lineStart:function(){Q_.point=K_},lineEnd:function(){G_&&tx(H_,V_),Q_.point=hy},polygonStart:function(){G_=!0},polygonEnd:function(){G_=null},result:function(){var t=+Z_;return Z_.reset(),t}};function K_(t,e){Q_.point=tx,H_=X_=t,V_=J_=e}function tx(t,e){X_-=t,J_-=e,Z_.add(sy(X_*X_+J_*J_)),X_=t,J_=e}function ex(){this._string=[]}function nx(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function rx(t,e){var n,r,i=4.5;function a(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),yy(t,n(r))),r.result()}return a.area=function(t){return yy(t,n(h_)),h_.result()},a.measure=function(t){return yy(t,n(Q_)),Q_.result()},a.bounds=function(t){return yy(t,n(x_)),x_.result()},a.centroid=function(t){return yy(t,n(P_)),P_.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,a_):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new ex):new Y_(e=t),"function"!=typeof i&&r.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),a):i},a.projection(t).context(e)}function ix(t){return function(e){var n=new ax;for(var r in t)n[r]=t[r];return n.stream=e,n}}function ax(){}function ox(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),yy(n,t.stream(x_)),e(x_.result()),null!=r&&t.clipExtent(r),t}function ux(t,e,n){return ox(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 sx(t,e,n){return ux(t,[[0,0],e],n)}function fx(t,e,n){return ox(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 cx(t,e,n){return ox(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)}ex.prototype={_radius:4.5,_circle:nx(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=nx(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}},ax.prototype={constructor:ax,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 lx=16,hx=ey(30*Zm);function dx(t,e){return+e?function(t,e){function n(r,i,a,o,u,s,f,c,l,h,d,p,v,g){var m=f-r,y=c-i,b=m*m+y*y;if(b>4*e&&v--){var _=o+h,x=u+d,w=s+p,M=sy(_*_+x*x+w*w),k=ly(w/=M),E=Qm(Qm(w)-1)<Wm||Qm(a-l)<Wm?(a+l)/2:ty(x,_),S=t(E,k),A=S[0],C=S[1],O=A-r,z=C-i,D=y*O-m*z;(D*D/b>e||Qm((m*O+y*z)/b-.5)>.3||o*h+u*d+s*p<hx)&&(n(r,i,a,o,u,s,A,C,E,_/=M,x/=M,w,v,g),g.point(A,C),n(A,C,E,_,x,w,f,c,l,h,d,p,v,g))}}return function(e){var r,i,a,o,u,s,f,c,l,h,d,p,v={point:g,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function g(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){c=NaN,v.point=y,e.lineStart()}function y(r,i){var a=Ny([r,i]),o=t(r,i);n(c,l,f,h,d,p,c=o[0],l=o[1],f=r,h=a[0],d=a[1],p=a[2],lx,e),e.point(c,l)}function b(){v.point=g,e.lineEnd()}function _(){m(),v.point=x,v.lineEnd=w}function x(t,e){y(r=t,e),i=c,a=l,o=h,u=d,s=p,v.point=y}function w(){n(c,l,f,h,d,p,i,a,r,o,u,s,lx,e),v.lineEnd=b,b()}return v}}(t,e):function(t){return ix({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var px=ix({point:function(t,e){this.stream.point(t*Zm,e*Zm)}});function vx(t,e,n,r){var i=ey(r),a=oy(r),o=i*t,u=a*t,s=i/t,f=a/t,c=(a*n-i*e)/t,l=(a*e+i*n)/t;function h(t,r){return[o*t-u*r+e,n-u*t-o*r]}return h.invert=function(t,e){return[s*t-f*e+c,l-f*t-s*e]},h}function gx(t){return mx(function(){return t})()}function mx(t){var e,n,r,i,a,o,u,s,f,c,l=150,h=480,d=250,p=0,v=0,g=0,m=0,y=0,b=0,_=null,x=Qb,w=null,M=a_,k=.5;function E(t){return s(t[0]*Zm,t[1]*Zm)}function S(t){return(t=s.invert(t[0],t[1]))&&[t[0]*Jm,t[1]*Jm]}function A(){var t=vx(l,0,0,b).apply(null,e(p,v)),r=(b?vx:function(t,e,n){function r(r,i){return[e+t*r,n-t*i]}return r.invert=function(r,i){return[(r-e)/t,(n-i)/t]},r})(l,h-t[0],d-t[1],b);return n=Pb(g,m,y),u=Rb(e,r),s=Rb(n,u),o=dx(u,k),C()}function C(){return f=c=null,E}return E.stream=function(t){return f&&c===t?f:f=px(function(t){return ix({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(x(o(M(c=t)))))},E.preclip=function(t){return arguments.length?(x=t,_=void 0,C()):x},E.postclip=function(t){return arguments.length?(M=t,w=r=i=a=null,C()):M},E.clipAngle=function(t){return arguments.length?(x=+t?Kb(_=t*Zm):(_=null,Qb),C()):_*Jm},E.clipExtent=function(t){return arguments.length?(M=null==t?(w=r=i=a=null,a_):n_(w=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),C()):null==w?null:[[w,r],[i,a]]},E.scale=function(t){return arguments.length?(l=+t,A()):l},E.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],A()):[h,d]},E.center=function(t){return arguments.length?(p=t[0]%360*Zm,v=t[1]%360*Zm,A()):[p*Jm,v*Jm]},E.rotate=function(t){return arguments.length?(g=t[0]%360*Zm,m=t[1]%360*Zm,y=t.length>2?t[2]%360*Zm:0,A()):[g*Jm,m*Jm,y*Jm]},E.angle=function(t){return arguments.length?(b=t%360*Zm,A()):b*Jm},E.precision=function(t){return arguments.length?(o=dx(u,k=t*t),C()):sy(k)},E.fitExtent=function(t,e){return ux(E,t,e)},E.fitSize=function(t,e){return sx(E,t,e)},E.fitWidth=function(t,e){return fx(E,t,e)},E.fitHeight=function(t,e){return cx(E,t,e)},function(){return e=t.apply(this,arguments),E.invert=e.invert&&S,A()}}function yx(t){var e=0,n=Gm/3,r=mx(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Zm,n=t[1]*Zm):[e*Jm,n*Jm]},i}function bx(t,e){var n=oy(t),r=(n+oy(e))/2;if(Qm(r)<Wm)return function(t){var e=ey(t);function n(t,n){return[t*e,oy(n)/e]}return n.invert=function(t,n){return[t/e,ly(n*e)]},n}(t);var i=1+n*(2*r-n),a=sy(i)/r;function o(t,e){var n=sy(i-2*r*oy(e))/r;return[n*oy(t*=r),a-n*ey(t)]}return o.invert=function(t,e){var n=a-e;return[ty(t,Qm(n))/r*uy(n),ly((i-(t*t+n*n)*r*r)/(2*r))]},o}function _x(){return yx(bx).scale(155.424).center([0,33.6442])}function xx(){return _x().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function wx(t){return function(e,n){var r=ey(e),i=ey(n),a=t(r*i);return[a*i*oy(e),a*oy(n)]}}function Mx(t){return function(e,n){var r=sy(e*e+n*n),i=t(r),a=oy(i),o=ey(i);return[ty(e*a,r*o),ly(r&&n*a/r)]}}var kx=wx(function(t){return sy(2/(1+t))});kx.invert=Mx(function(t){return 2*ly(t/2)});var Ex=wx(function(t){return(t=cy(t))&&t/oy(t)});function Sx(t,e){return[t,iy(fy((Hm+e)/2))]}function Ax(t){var e,n,r,i=gx(t),a=i.center,o=i.scale,u=i.translate,s=i.clipExtent,f=null;function c(){var a=Gm*o(),u=i(function(t){function e(e){return(e=t(e[0]*Zm,e[1]*Zm))[0]*=Jm,e[1]*=Jm,e}return t=Pb(t[0]*Zm,t[1]*Zm,t.length>2?t[2]*Zm:0),e.invert=function(e){return(e=t.invert(e[0]*Zm,e[1]*Zm))[0]*=Jm,e[1]*=Jm,e},e}(i.rotate()).invert([0,0]));return s(null==f?[[u[0]-a,u[1]-a],[u[0]+a,u[1]+a]]:t===Sx?[[Math.max(u[0]-a,f),e],[Math.min(u[0]+a,n),r]]:[[f,Math.max(u[1]-a,e)],[n,Math.min(u[1]+a,r)]])}return i.scale=function(t){return arguments.length?(o(t),c()):o()},i.translate=function(t){return arguments.length?(u(t),c()):u()},i.center=function(t){return arguments.length?(a(t),c()):a()},i.clipExtent=function(t){return arguments.length?(null==t?f=e=n=r=null:(f=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==f?null:[[f,e],[n,r]]},c()}function Cx(t){return fy((Hm+t)/2)}function Ox(t,e){var n=ey(t),r=t===e?oy(t):iy(n/ey(e))/iy(Cx(e)/Cx(t)),i=n*ay(Cx(t),r)/r;if(!r)return Sx;function a(t,e){i>0?e<-Hm+Wm&&(e=-Hm+Wm):e>Hm-Wm&&(e=Hm-Wm);var n=i/ay(Cx(e),r);return[n*oy(r*t),i-n*ey(r*t)]}return a.invert=function(t,e){var n=i-e,a=uy(r)*sy(t*t+n*n);return[ty(t,Qm(n))/r*uy(n),2*Km(ay(i/a,1/r))-Hm]},a}function zx(t,e){return[t,e]}function Dx(t,e){var n=ey(t),r=t===e?oy(t):(n-ey(e))/(e-t),i=n/r+t;if(Qm(r)<Wm)return zx;function a(t,e){var n=i-e,a=r*t;return[n*oy(a),i-n*ey(a)]}return a.invert=function(t,e){var n=i-e;return[ty(t,Qm(n))/r*uy(n),i-uy(r)*sy(t*t+n*n)]},a}function Nx(t,e){var n=ey(e),r=ey(t)*n;return[n*oy(t)/r,oy(e)/r]}function Rx(t,e,n,r){return 1===t&&1===e&&0===n&&0===r?a_:ix({point:function(i,a){this.stream.point(i*t+n,a*e+r)}})}function Tx(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function Px(t,e){return[ey(e)*oy(t),oy(e)]}function Lx(t,e){var n=ey(e),r=1+ey(t)*n;return[n*oy(t)/r,oy(e)/r]}function qx(t,e){return[iy(fy((Hm+e)/2)),-t]}Ex.invert=Mx(function(t){return t}),Sx.invert=function(t,e){return[t,2*Km(ry(e))-Hm]},zx.invert=zx,Nx.invert=Mx(Km),Tx.invert=function(t,e){var n,r=e,i=25;do{var a=r*r,o=a*a;r-=n=(r*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Qm(n)>Wm&&--i>0);return[t/(.8707+(a=r*r)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),r]},Px.invert=Mx(ly),Lx.invert=Mx(function(t){return 2*Km(t)}),qx.invert=function(t,e){return[-e,2*Km(ry(t))-Hm]};var Ux=rx(),Fx=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function jx(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?($x[t]=function(t,e){return function n(){var r=e();return r.type=t,r.path=rx().projection(r),r.copy=r.copy||function(){var t=n();return Fx.forEach(function(e){r.hasOwnProperty(e)&&t[e](r[e]())}),t.path.pointRadius(r.path.pointRadius()),t},r}}(t,e),this):$x.hasOwnProperty(t)?$x[t]:null}function Ix(t){return t&&t.path||Ux}var $x={albers:xx,albersusa:function(){var t,e,n,r,i,a,o=xx(),u=_x().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=_x().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f={point:function(t,e){a=[t,e]}};function c(t){var e=t[0],o=t[1];return a=null,n.point(e,o),a||(r.point(e,o),a)||(i.point(e,o),a)}function l(){return t=e=null,c}return c.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:o).invert(t)},c.stream=function(n){return t&&e===n?t:(r=[o.stream(e=n),u.stream(n),s.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},c.precision=function(t){return arguments.length?(o.precision(t),u.precision(t),s.precision(t),l()):o.precision()},c.scale=function(t){return arguments.length?(o.scale(t),u.scale(.35*t),s.scale(t),c.translate(o.translate())):o.scale()},c.translate=function(t){if(!arguments.length)return o.translate();var e=o.scale(),a=+t[0],c=+t[1];return n=o.translate(t).clipExtent([[a-.455*e,c-.238*e],[a+.455*e,c+.238*e]]).stream(f),r=u.translate([a-.307*e,c+.201*e]).clipExtent([[a-.425*e+Wm,c+.12*e+Wm],[a-.214*e-Wm,c+.234*e-Wm]]).stream(f),i=s.translate([a-.205*e,c+.212*e]).clipExtent([[a-.214*e+Wm,c+.166*e+Wm],[a-.115*e-Wm,c+.234*e-Wm]]).stream(f),l()},c.fitExtent=function(t,e){return ux(c,t,e)},c.fitSize=function(t,e){return sx(c,t,e)},c.fitWidth=function(t,e){return fx(c,t,e)},c.fitHeight=function(t,e){return cx(c,t,e)},c.scale(1070)},azimuthalequalarea:function(){return gx(kx).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return gx(Ex).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return yx(Ox).scale(109.5).parallels([30,30])},conicequalarea:_x,conicequidistant:function(){return yx(Dx).scale(131.154).center([0,13.9389])},equirectangular:function(){return gx(zx).scale(152.63)},gnomonic:function(){return gx(Nx).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,a,o=1,u=0,s=0,f=1,c=1,l=a_,h=null,d=a_;function p(){return r=i=null,a}return a={stream:function(t){return r&&i===t?r:r=l(d(i=t))},postclip:function(r){return arguments.length?(d=r,h=t=e=n=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=e=n=null,a_):n_(h=+r[0][0],t=+r[0][1],e=+r[1][0],n=+r[1][1]),p()):null==h?null:[[h,t],[e,n]]},scale:function(t){return arguments.length?(l=Rx((o=+t)*f,o*c,u,s),p()):o},translate:function(t){return arguments.length?(l=Rx(o*f,o*c,u=+t[0],s=+t[1]),p()):[u,s]},reflectX:function(t){return arguments.length?(l=Rx(o*(f=t?-1:1),o*c,u,s),p()):f<0},reflectY:function(t){return arguments.length?(l=Rx(o*f,o*(c=t?-1:1),u,s),p()):c<0},fitExtent:function(t,e){return ux(a,t,e)},fitSize:function(t,e){return sx(a,t,e)},fitWidth:function(t,e){return fx(a,t,e)},fitHeight:function(t,e){return cx(a,t,e)}}},mercator:function(){return Ax(Sx).scale(961/Xm)},naturalEarth1:function(){return gx(Tx).scale(175.295)},orthographic:function(){return gx(Px).scale(249.5).clipAngle(90+Wm)},stereographic:function(){return gx(Lx).scale(250).clipAngle(142)},transversemercator:function(){var t=Ax(qx),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(var Bx in $x)jx(Bx,$x[Bx]);function Wx(t){kr.call(this,null,t)}function Yx(t){kr.call(this,null,t)}function Gx(t){kr.call(this,null,t)}function Hx(t){kr.call(this,[],t),this.generator=function(){var t,e,n,r,i,a,o,u,s,f,c,l,h=10,d=h,p=90,v=360,g=2.5;function m(){return{type:"MultiLineString",coordinates:y()}}function y(){return Hb(ny(r/p)*p,n,p).map(c).concat(Hb(ny(u/v)*v,o,v).map(l)).concat(Hb(ny(e/h)*h,t,h).filter(function(t){return Qm(t%p)>Wm}).map(s)).concat(Hb(ny(a/d)*d,i,d).filter(function(t){return Qm(t%v)>Wm}).map(f))}return m.lines=function(){return y().map(function(t){return{type:"LineString",coordinates:t}})},m.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(l(o).slice(1),c(n).reverse().slice(1),l(u).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],u=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),u>o&&(t=u,u=o,o=t),m.precision(g)):[[r,u],[n,o]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),m.precision(g)):[[e,a],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(p=+t[0],v=+t[1],m):[p,v]},m.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],m):[h,d]},m.precision=function(h){return arguments.length?(g=+h,s=r_(a,i,90),f=i_(e,t,g),c=r_(u,o,90),l=i_(r,n,g),m):g},m.extentMajor([[-180,-90+Wm],[180,90-Wm]]).extentMinor([[-180,-80-Wm],[180,80+Wm]])}()}function Vx(t){kr.call(this,null,t),this.modified(!0)}function Xx(t,e,n){F(t[e])&&t[e](n)}Wx.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},H(Wx,kr).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||d,a=t.as||"path",o=n.SOURCE;!r||t.modified()?(this.value=r=Ix(t.projection),n.materialize().reflow()):o=i===d||e.modified(i.fields)?n.ADD_MOD:n.ADD;var u=function(t,e){var n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(o,function(t){t[a]=r(i(t))}),r.pointRadius(u),n.modifies(a)},Yx.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"]}]},H(Yx,kr).transform=function(t,e){var n,r=t.projection,i=t.fields[0],a=t.fields[1],o=t.as||["x","y"],u=o[0],s=o[1];function f(t){var e=r([i(t),a(t)]);e?(t[u]=e[0],t[s]=e[1]):(t[u]=void 0,t[s]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,f):(n=e.modified(i.fields)||e.modified(a.fields),e.visit(n?e.ADD_MOD:e.ADD,f)),e.modifies(o)},Gx.Definition={type:"GeoShape",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},H(Gx,kr).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||c("datum"),a=t.as||"shape",o=n.ADD_MOD;return r&&!t.modified()||(this.value=r=function(t,e,n){var r=null==n?function(n){return t(e(n))}:function(r){var i=t.pointRadius(),a=t.pointRadius(n)(e(r));return t.pointRadius(i),a};return r.context=function(e){return t.context(e),r},r}(Ix(t.projection),i,t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,function(t){t[a]=r}),n.modifies(a)},Hx.Definition={type:"Graticule",metadata:{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}]},H(Hx,kr).transform=function(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(var a in t)F(i[a])&&i[a](t[a]);return n=i(),r.length?e.mod.push(yt(r[0],n)):e.add.push(vt(n)),r[0]=n,e},H(Vx,kr).transform=function(t,e){var n=this.value;return!n||t.modified("type")?(this.value=n=function(t){var e=jx((t||"mercator").toLowerCase());e||i("Unrecognized projection type: "+t);return e()}(t.type),Fx.forEach(function(e){null!=t[e]&&Xx(n,e,t[e])})):Fx.forEach(function(e){t.modified(e)&&Xx(n,e,t[e])}),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){var n=(r=e.fit,1===(r=U(r)).length?r[0]:{type:Um,features:r.reduce(function(t,e){return e&&e.type===Um?t.push.apply(t,e.features):o(e)?t.push.apply(t,e):t.push(e),t},[])});var r;e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)};var Jx=Object.freeze({contour:qm,geojson:Fm,geopath:Wx,geopoint:Yx,geoshape:Gx,graticule:Hx,projection:Vx});function Zx(t){return function(){return t}}function Qx(){return 1e-6*(Math.random()-.5)}function Kx(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},v=t._x0,g=t._y0,m=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((f=e>=(a=(v+m)/2))?v=a:m=a,(c=n>=(o=(g+y)/2))?g=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=(v+m)/2))?v=a:m=a,(c=n>=(o=(g+y)/2))?g=o:y=o}while((l=c<<1|f)==(h=(s>=o)<<1|u>=a));return i[h]=d,i[l]=p,t}function tw(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function ew(t){return t[0]}function nw(t){return t[1]}function rw(t,e,n){var r=new iw(null==e?ew:e,null==n?nw:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function iw(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 aw(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var ow=rw.prototype=iw.prototype;function uw(t){return t.x+t.vx}function sw(t){return t.y+t.vy}function fw(t){return t.index}function cw(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}ow.copy=function(){var t,e,n=new iw(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=aw(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]=aw(e));return n},ow.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return Kx(this.cover(e,n),e,n,t)},ow.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)Kx(this,o[n],u[n],t[n]);return this},ow.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))[u]=f,f=o}while(a=r+(s*=2),t>(i=n+s)||e>a);break;case 1:do{(o=new Array(4))[u]=f,f=o}while(a=r+(s*=2),(n=i-s)>t||e>a);break;case 2:do{(o=new Array(4))[u]=f,f=o}while(r=a-(s*=2),t>(i=n+s)||r>e);break;case 3:do{(o=new Array(4))[u]=f,f=o}while(r=a-(s*=2),(n=i-s)>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},ow.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},ow.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]]},ow.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=[],v=this._root;for(v&&p.push(new tw(v,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(!(!(v=s.node)||(i=s.x0)>h||(a=s.y0)>d||(o=s.x1)<c||(u=s.y1)<l))if(v.length){var g=(i+o)/2,m=(a+u)/2;p.push(new tw(v[3],g,m,o,u),new tw(v[2],i,m,g,u),new tw(v[1],g,a,o,m),new tw(v[0],i,a,g,m)),(f=(e>=m)<<1|t>=g)&&(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,v.data),b=e-+this._y.call(null,v.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=v.data}}return r},ow.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,v=this._y0,g=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((f=a>=(u=(p+g)/2))?p=u:g=u,(c=o>=(s=(v+m)/2))?v=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)},ow.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},ow.root=function(){return this._root},ow.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},ow.visit=function(t){var e,n,r,i,a,o,u=[],s=this._root;for(s&&u.push(new tw(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 tw(n,f,c,a,o)),(n=s[2])&&u.push(new tw(n,r,c,f,o)),(n=s[1])&&u.push(new tw(n,f,i,a,c)),(n=s[0])&&u.push(new tw(n,r,i,f,c))}return this},ow.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new tw(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 tw(a,o,u,c,l)),(a=i[1])&&n.push(new tw(a,c,u,s,l)),(a=i[2])&&n.push(new tw(a,o,l,c,f)),(a=i[3])&&n.push(new tw(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},ow.x=function(t){return arguments.length?(this._x=t,this):this._x},ow.y=function(t){return arguments.length?(this._y=t,this):this._y};var lw={value:function(){}};function hw(){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 dw(r)}function dw(t){this._=t}function pw(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function vw(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=lw,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}dw.prototype=hw.prototype={constructor:dw,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,u=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<u;)if(n=(t=a[o]).type)i[n]=vw(i[n],t.name,e);else if(null==e)for(n in i)i[n]=vw(i[n],t.name,null);return this}for(;++o<u;)if((n=(t=a[o]).type)&&(n=pw(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new dw(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 gw,mw,yw=0,bw=0,_w=0,xw=1e3,ww=0,Mw=0,kw=0,Ew="object"==typeof performance&&performance.now?performance:Date,Sw="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Aw(){return Mw||(Sw(Cw),Mw=Ew.now()+kw)}function Cw(){Mw=0}function Ow(){this._call=this._time=this._next=null}function zw(t,e,n){var r=new Ow;return r.restart(t,e,n),r}function Dw(){Mw=(ww=Ew.now())+kw,yw=bw=0;try{!function(){Aw(),++yw;for(var t,e=gw;e;)(t=Mw-e._time)>=0&&e._call.call(null,t),e=e._next;--yw}()}finally{yw=0,function(){var t,e,n=gw,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:gw=e);mw=t,Rw(r)}(),Mw=0}}function Nw(){var t=Ew.now(),e=t-ww;e>xw&&(kw-=e,ww=t)}function Rw(t){yw||(bw&&(bw=clearTimeout(bw)),t-Mw>24?(t<1/0&&(bw=setTimeout(Dw,t-Ew.now()-kw)),_w&&(_w=clearInterval(_w))):(_w||(ww=Ew.now(),_w=setInterval(Nw,xw)),yw=1,Sw(Dw)))}function Tw(t){return t.x}function Pw(t){return t.y}Ow.prototype=zw.prototype={constructor:Ow,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Aw():+n)+(null==e?0:+e),this._next||mw===this||(mw?mw._next=this:gw=this,mw=this),this._call=t,this._time=n,Rw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rw())}};var Lw=10,qw=Math.PI*(3-Math.sqrt(5));var Uw={center:function(t,e){var n;function r(){var r,i,a=n.length,o=0,u=0;for(r=0;r<a;++r)o+=(i=n[r]).x,u+=i.y;for(o=o/a-t,u=u/a-e,r=0;r<a;++r)(i=n[r]).x-=o,i.y-=u}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r},collide:function(t){var e,n,r=1,i=1;function a(){for(var t,a,u,s,f,c,l,h=e.length,d=0;d<i;++d)for(a=rw(e,uw,sw).visitAfter(o),t=0;t<h;++t)u=e[t],c=n[u.index],l=c*c,s=u.x+u.vx,f=u.y+u.vy,a.visit(p);function p(t,e,n,i,a){var o=t.data,h=t.r,d=c+h;if(!o)return e>s+d||i<s-d||n>f+d||a<f-d;if(o.index>u.index){var p=s-o.x-o.vx,v=f-o.y-o.vy,g=p*p+v*v;g<d*d&&(0===p&&(g+=(p=Qx())*p),0===v&&(g+=(v=Qx())*v),g=(d-(g=Math.sqrt(g)))/g*r,u.vx+=(p*=g)*(d=(h*=h)/(l+h)),u.vy+=(v*=g)*d,o.vx-=p*(d=1-d),o.vy-=v*d)}}}function o(t){if(t.data)return t.r=n[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 u(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r<a;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=Zx(null==t?1:+t)),a.initialize=function(t){e=t,u()},a.iterations=function(t){return arguments.length?(i=+t,a):i},a.strength=function(t){return arguments.length?(r=+t,a):r},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:Zx(+e),u(),a):t},a},nbody:function(){var t,e,n,r,i=Zx(-30),a=1,o=1/0,u=.81;function s(r){var i,a=t.length,o=rw(t,Tw,Pw).visitAfter(c);for(n=r,i=0;i<a;++i)e=t[i],o.visit(l)}function f(){if(t){var e,n,a=t.length;for(r=new Array(a),e=0;e<a;++e)n=t[e],r[n.index]=+i(n,e,t)}}function c(t){var e,n,i,a,o,u=0,s=0;if(t.length){for(i=a=o=0;o<4;++o)(e=t[o])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,i+=n*e.x,a+=n*e.y);t.x=i/s,t.y=a/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=r[e.data.index]}while(e=e.next)}t.value=u}function l(t,i,s,f){if(!t.value)return!0;var c=t.x-e.x,l=t.y-e.y,h=f-i,d=c*c+l*l;if(h*h/u<d)return d<o&&(0===c&&(d+=(c=Qx())*c),0===l&&(d+=(l=Qx())*l),d<a&&(d=Math.sqrt(a*d)),e.vx+=c*t.value*n/d,e.vy+=l*t.value*n/d),!0;if(!(t.length||d>=o)){(t.data!==e||t.next)&&(0===c&&(d+=(c=Qx())*c),0===l&&(d+=(l=Qx())*l),d<a&&(d=Math.sqrt(a*d)));do{t.data!==e&&(h=r[t.data.index]*n/d,e.vx+=c*h,e.vy+=l*h)}while(t=t.next)}}return s.initialize=function(e){t=e,f()},s.strength=function(t){return arguments.length?(i="function"==typeof t?t:Zx(+t),f(),s):i},s.distanceMin=function(t){return arguments.length?(a=t*t,s):Math.sqrt(a)},s.distanceMax=function(t){return arguments.length?(o=t*t,s):Math.sqrt(o)},s.theta=function(t){return arguments.length?(u=t*t,s):Math.sqrt(u)},s},link:function(t){var e,n,r,i,a,o=fw,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},s=Zx(30),f=1;function c(r){for(var i=0,o=t.length;i<f;++i)for(var u,s,c,l,h,d,p,v=0;v<o;++v)s=(u=t[v]).source,l=(c=u.target).x+c.vx-s.x-s.vx||Qx(),h=c.y+c.vy-s.y-s.vy||Qx(),l*=d=((d=Math.sqrt(l*l+h*h))-n[v])/d*r*e[v],h*=d,c.vx-=l*(p=a[v]),c.vy-=h*p,s.vx+=l*(p=1-p),s.vy+=h*p}function l(){if(r){var u,s,f=r.length,c=t.length,l=Tl(r,o);for(u=0,i=new Array(f);u<c;++u)(s=t[u]).index=u,"object"!=typeof s.source&&(s.source=cw(l,s.source)),"object"!=typeof s.target&&(s.target=cw(l,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(u=0,a=new Array(c);u<c;++u)s=t[u],a[u]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(c),h(),n=new Array(c),d()}}function h(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function d(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+s(t[e],e,t)}return null==t&&(t=[]),c.initialize=function(t){r=t,l()},c.links=function(e){return arguments.length?(t=e,l(),c):t},c.id=function(t){return arguments.length?(o=t,c):o},c.iterations=function(t){return arguments.length?(f=+t,c):f},c.strength=function(t){return arguments.length?(u="function"==typeof t?t:Zx(+t),h(),c):u},c.distance=function(t){return arguments.length?(s="function"==typeof t?t:Zx(+t),d(),c):s},c},x:function(t){var e,n,r,i=Zx(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(r[a]-i.x)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=Zx(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:Zx(+t),o(),a):i},a.x=function(e){return arguments.length?(t="function"==typeof e?e:Zx(+e),o(),a):t},a},y:function(t){var e,n,r,i=Zx(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(r[a]-i.y)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=Zx(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:Zx(+t),o(),a):i},a.y=function(e){return arguments.length?(t="function"==typeof e?e:Zx(+e),o(),a):t},a}},Fw="forces",jw=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Iw=["static","iterations"],$w=["x","y","vx","vy"];function Bw(t){kr.call(this,null,t)}Bw.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:$w}]};var Ww=H(Bw,kr);function Yw(t,e,n,r){var i,a,o,u,s=U(e.forces);for(i=0,a=jw.length;i<a;++i)(o=jw[i])!==Fw&&e.modified(o)&&t[o](e[o]);for(i=0,a=s.length;i<a;++i)u=Fw+i,(o=n||e.modified(Fw,i)?Hw(s[i]):r&&Gw(s[i],r)?t.force(u):null)&&t.force(u,o);for(a=t.numForces||0;i<a;++i)t.force(Fw+i,null);return t.numForces=s.length,t}function Gw(t,e){var n,i;for(n in t)if(F(i=t[n])&&e.modified(r(i)))return 1;return 0}function Hw(t){var e,n;for(n in Uw.hasOwnProperty(t.force)||i("Unrecognized force: "+t.force),e=Uw[t.force](),t)F(e[n])&&Vw(e[n],t[n],t);return e}function Vw(t,e,n){t(F(e)?function(t){return e(t,n)}:e)}Ww.transform=function(t,e){var n,r,i=this.value,a=e.changed(e.ADD_REM),o=t.modified(jw),u=t.iterations||300;if(i?(a&&(e.modifies("index"),i.nodes(e.source)),(o||e.changed(e.MOD))&&Yw(i,t,0,e)):(this.value=i=function(t,e){var n=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,u=Tl(),s=zw(c),f=hw("tick","end");function c(){l(),f.call("tick",e),n<r&&(s.stop(),f.call("end",e))}function l(){var e,r,s=t.length;for(n+=(a-n)*i,u.each(function(t){t(n)}),e=0;e<s;++e)null==(r=t[e]).fx?r.x+=r.vx*=o:(r.x=r.fx,r.vx=0),null==r.fy?r.y+=r.vy*=o:(r.y=r.fy,r.vy=0)}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,isNaN(e.x)||isNaN(e.y)){var i=Lw*Math.sqrt(n),a=n*qw;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function d(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),h(),e={tick:l,restart:function(){return s.restart(c),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),u.each(d),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},force:function(t,n){return arguments.length>1?(null==n?u.remove(t):u.set(t,d(n)),e):u.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,n){return arguments.length>1?(f.on(t,n),e):f.on(t)}}}(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()},Yw(n,e,!0).on("end",function(){r=!0})}(e.source,t),i.on("tick",(n=e.dataflow,r=this,function(){n.touch(r).run()})),t.static||(a=!0,i.tick()),e.modifies("index")),o||a||t.modified(Iw)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/u)),t.static)for(i.stop();--u>=0;)i.tick();else if(i.stopped()&&i.restart(),!a)return e.StopPropagation;return this.finish(t,e)},Ww.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===Fw&&"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($w)};var Xw=Object.freeze({force:Bw});function Jw(t,e,n){var r={};return t.each(function(t){var i=t.data;n(i)&&(r[e(i)]=t)}),t.lookup=r,t}function Zw(t,e){return t.parent===e.parent?1:2}function Qw(t,e){return t+e.x}function Kw(t,e){return Math.max(t,e.y)}function tM(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 eM(t,e){var n,r,i,a,o,u=new aM(t),s=+t.value&&(u.value=t.value),f=[u];for(null==e&&(e=nM);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 aM(i[a])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(iM)}function nM(t){return t.children}function rM(t){t.data=t.data.data}function iM(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function aM(t){this.data=t,this.depth=this.height=0,this.parent=null}aM.prototype=eM.prototype={constructor:aM,count:function(){return this.eachAfter(tM)},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 eM(this).eachBefore(rM)}};var oM=Array.prototype.slice;function uM(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}(oM.call(t))).length,a=[];r<i;)e=t[r],n&&cM(n,e)?++r:(n=hM(a=sM(a,e)),r=0);return n}function sM(t,e){var n,r;if(lM(e,t))return[e];for(n=0;n<t.length;++n)if(fM(e,t[n])&&lM(dM(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(fM(dM(t[n],t[r]),e)&&fM(dM(t[n],e),t[r])&&fM(dM(t[r],e),t[n])&&lM(pM(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function fM(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 cM(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 lM(t,e){for(var n=0;n<e.length;++n)if(!cM(t,e[n]))return!1;return!0}function hM(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return dM(t[0],t[1]);case 3:return pM(t[0],t[1],t[2])}var e}function dM(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 pM(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,v=i-c,g=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*v,w=(p*_-v*b)/(2*x)-r,M=(v*g-p*m)/x,k=(d*b-h*_)/(2*x)-i,E=(h*m-d*g)/x,S=M*M+E*E-1,A=2*(a+w*M+k*E),C=w*w+k*k-a*a,O=-(S?(A+Math.sqrt(A*A-4*S*C))/(2*S):C/A);return{x:r+w+M*O,y:i+k+E*O,r:O}}function vM(t,e,n){var r,i,a,o,u=t.x-e.x,s=t.y-e.y,f=u*u+s*s;f?(i=e.r+n.r,i*=i,o=t.r+n.r,i>(o*=o)?(r=(f+o-i)/(2*f),a=Math.sqrt(Math.max(0,o/f-r*r)),n.x=t.x-r*u-a*s,n.y=t.y-r*s+a*u):(r=(f+i-o)/(2*f),a=Math.sqrt(Math.max(0,i/f-r*r)),n.x=e.x+r*u-a*s,n.y=e.y+r*s+a*u)):(n.x=e.x+n.r,n.y=e.y)}function gM(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 mM(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 yM(t){this._=t,this.next=null,this.previous=null}function bM(t){if("function"!=typeof t)throw new Error;return t}function _M(){return 0}function xM(t){return function(){return t}}function wM(t){return Math.sqrt(t.value)}function MM(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function kM(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]).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;vM(n,e,r=t[2]),e=new yM(e),n=new yM(n),r=new yM(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(u=3;u<i;++u){vM(e._,n._,r=t[u]),r=new yM(r),s=n.next,f=e.previous,c=n._.r,l=e._.r;do{if(c<=l){if(gM(s._,r._)){n=s,e.next=n,n.previous=e,--u;continue t}c+=s._.r,s=s.next}else{if(gM(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=mM(e);(r=r.next)!==n;)(o=mM(r))<a&&(e=r,a=o);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=uM(e),u=0;u<i;++u)(e=t[u]).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 EM(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 SM(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function AM(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}var CM="$",OM={depth:-1},zM={};function DM(t){return t.id}function NM(t){return t.parentId}function RM(){var t=DM,e=NM;function n(n){var r,i,a,o,u,s,f,c=n.length,l=new Array(c),h={};for(i=0;i<c;++i)r=n[i],u=l[i]=new aM(r),null!=(s=t(r,i,n))&&(s+="")&&(h[f=CM+(u.id=s)]=f in h?zM:u);for(i=0;i<c;++i)if(u=l[i],null!=(s=e(n[i],i,n))&&(s+="")){if(!(o=h[CM+s]))throw new Error("missing: "+s);if(o===zM)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=OM,a.eachBefore(function(t){t.depth=t.parent.depth+1,--c}).eachBefore(iM),a.parent=null,c>0)throw new Error("cycle");return a}return n.id=function(e){return arguments.length?(t=bM(e),n):t},n.parentId=function(t){return arguments.length?(e=bM(t),n):e},n}function TM(t,e){return t.parent===e.parent?1:2}function PM(t){var e=t.children;return e?e[0]:t.t}function LM(t){var e=t.children;return e?e[e.length-1]:t.t}function qM(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 UM(t,e,n){return t.a.parent===e.parent?t.a:n}function FM(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 jM(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}FM.prototype=Object.create(aM.prototype);var IM=(1+Math.sqrt(5))/2;function $M(t,e,n,r,i,a){for(var o,u,s,f,c,l,h,d,p,v,g,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,g=c*c*(v=Math.max(f/s,s/f)/(w*t)),p=Math.max(h/g,g/l);_<x;++_){if(c+=u=y[_].value,u<l&&(l=u),u>h&&(h=u),g=c*c*v,(d=Math.max(h/g,g/l))>p){c-=u;break}p=d}m.push(o={value:c,dice:s<f,children:y.slice(b,_)}),o.dice?AM(o,n,r,i,w?r+=f*c/w:a):jM(o,n,r,w?n+=s*c/w:i,a),w-=c,b=_}return m}var BM=function t(e){function n(t,n,r,i,a){$M(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(IM);var WM=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?AM(u,n,r,i,r+=(a-r)*u.value/d):jM(u,n,r,n+=(i-n)*u.value/d,a),d-=u.value}else t._squarify=o=$M(e,t,n,r,i,a),o.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(IM);function YM(t){kr.call(this,null,t)}function GM(t){return t.values}function HM(t){kr.call(this,null,t)}function VM(t,e){return t.parent===e.parent?1:2}YM.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]},H(YM,kr).transform=function(t,e){e.source||i("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),a=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(function(t){t.children&&ht(t.data)&&a.rem.push(t.data)}),this.value=o=eM({values:U(t.keys).reduce(function(t,e){return t.key(e),t},Pl()).entries(a.source)},GM),n&&o.each(function(t){t.children&&(t=vt(t.data),a.add.push(t),a.source.push(t))}),Jw(o,dt,dt)),a.source.root=o,a},H(HM,kr).transform=function(t,e){e.source&&e.source.root||i(this.constructor.name+" transform requires a backing tree data source.");var n=this.layout(t.method),r=this.fields,a=e.source.root,o=t.as||r;t.field&&a.sum(t.field),t.sort&&a.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),n.separation&&n.separation(!1!==t.separation?VM:v);try{this.value=n(a)}catch(t){i(t)}return a.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,o)}),e.reflow(t.modified()).modifies(o).modifies("leaf")};var XM=["x","y","r","depth","children"];function JM(t){HM.call(this,t)}JM.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:XM.length,default:XM}]};var ZM=H(JM,HM);ZM.layout=function(){var t=null,e=1,n=1,r=_M;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(MM(t)).eachAfter(kM(r,.5)).eachBefore(EM(1)):i.eachBefore(MM(wM)).eachAfter(kM(_M,1)).eachAfter(kM(r,i.r/Math.min(e,n))).eachBefore(EM(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(n=e)?null:bM(n),i):t;var n},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:xM(+t),i):r},i},ZM.params=["size","padding"],ZM.fields=XM;var QM=["x0","y0","x1","y1","depth","children"];function KM(t){HM.call(this,t)}KM.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:QM.length,default:QM}]};var tk=H(KM,HM);function ek(t){kr.call(this,null,t)}tk.layout=function(){var t=1,e=1,n=0,r=!1;function i(i){var a=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(r){r.children&&AM(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,a=r.y0,o=r.x1-n,u=r.y1-n;o<i&&(i=o=(i+o)/2),u<a&&(a=u=(a+u)/2),r.x0=i,r.y0=a,r.x1=o,r.y1=u}}(e,a)),r&&i.eachBefore(SM),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},tk.params=["size","round","padding"],tk.fields=QM,ek.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},H(ek,kr).transform=function(t,e){e.source||i("Stratify transform requires an upstream data source.");var n=this.value,r=t.modified(),a=e.fork(e.ALL).materialize(e.SOURCE),o=!this.value||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return a.source=a.source.slice(),o&&(n=a.source.length?Jw(RM().id(t.key).parentId(t.parentKey)(a.source),t.key,g):Jw(RM()([{}]),t.key,t.key)),a.source.root=this.value=n,a};var nk={tidy:function(){var t=TM,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,a,o=new FM(t,0),u=[o];e=u.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;i>=0;--i)u.push(n=e.children[i]=new FM(r[i],i)),n.parent=e;return(o.parent=new FM(null,0)).children=[o],o}(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(u);else{var f=i,c=i,l=i;i.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:t(f,c)/2,d=h-f.x,p=e/(c.x+h+d),v=n/(l.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*v})}return i}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var a=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,a=e,o=e,u=n,s=a.parent.children[0],f=a.m,c=o.m,l=u.m,h=s.m;u=LM(u),a=PM(a),u&&a;)s=PM(s),(o=LM(o)).a=e,(i=u.z+l-a.z-f+t(u._,a._))>0&&(qM(UM(u,e,r),e,i),f+=i,c+=i),l+=u.m,f+=a.m,h+=s.m,c+=o.m;u&&!LM(o)&&(o.t=u,o.m+=l-c),a&&!PM(s)&&(s.t=a,s.m+=f-h,r=e)}return r}(e,i,e.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=Zw,e=1,n=1,r=!1;function i(i){var a,o=0;i.eachAfter(function(e){var n=e.children;n?(e.x=function(t){return t.reduce(Qw,0)/t.length}(n),e.y=function(t){return 1+t.reduce(Kw,0)}(n)):(e.x=a?o+=t(e,a):0,e.y=0,a=e)});var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),f=u.x-t(u,s)/2,c=s.x+t(s,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-f)/(c-f)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},rk=["x","y","depth","children"];function ik(t){HM.call(this,t)}ik.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:rk.length,default:rk}]};var ak=H(ik,HM);function ok(t){kr.call(this,[],t)}ak.layout=function(t){var e=t||"tidy";if(nk.hasOwnProperty(e))return nk[e]();i("Unrecognized Tree layout method: "+e)},ak.params=["size","nodeSize"],ak.fields=rk,ok.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},H(ok,kr).transform=function(t,e){var n=this.value,r=e.source&&e.source.root,a=e.fork(e.NO_SOURCE),o={};return r||i("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(a.rem=n,e.visit(e.SOURCE,function(t){o[dt(t)]=1}),r.each(function(t){var e=t.data,n=t.parent&&t.parent.data;n&&o[dt(e)]&&o[dt(n)]&&a.add.push(vt({source:n,target:e}))}),this.value=a.add):e.changed(e.MOD)&&(e.visit(e.MOD,function(t){o[dt(t)]=1}),n.forEach(function(t){(o[dt(t.source)]||o[dt(t.target)])&&a.mod.push(t)})),a};var uk={binary:function(t,e,n,r,i){var a,o,u=t.children,s=u.length,f=new Array(s+1);for(f[0]=o=a=0;a<s;++a)f[a+1]=o+=u[a].value;!function t(e,n,r,i,a,o,s){if(e>=n-1){var c=u[e];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=s)}for(var l=f[e],h=r/2+l,d=e+1,p=n-1;d<p;){var v=d+p>>>1;f[v]<h?d=v+1:p=v}h-f[d-1]<f[d]-h&&e+1<d&&--d;var g=f[d]-l,m=r-g;if(o-i>s-a){var y=(i*m+o*g)/r;t(e,d,g,i,a,y,s),t(d,n,m,y,a,o,s)}else{var b=(a*m+s*g)/r;t(e,d,g,i,a,o,b),t(d,n,m,i,b,o,s)}}(0,s,t.value,e,n,r,i)},dice:AM,slice:jM,slicedice:function(t,e,n,r,i){(1&t.depth?jM:AM)(t,e,n,r,i)},squarify:BM,resquarify:WM},sk=["x0","y0","x1","y1","depth","children"];function fk(t){HM.call(this,t)}fk.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:sk.length,default:sk}]};var ck=H(fk,HM);ck.layout=function(){var t=function(){var t=BM,e=!1,n=1,r=1,i=[0],a=_M,o=_M,u=_M,s=_M,f=_M;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(l),i=[0],e&&t.eachBefore(SM),t}function l(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,l=e.x1-n,h=e.y1-n;l<r&&(r=l=(r+l)/2),h<c&&(c=h=(c+h)/2),e.x0=r,e.y0=c,e.x1=l,e.y1=h,e.children&&(n=i[e.depth+1]=a(e)/2,r+=f(e)-n,c+=o(e)-n,(l-=u(e)-n)<r&&(r=l=(r+l)/2),(h-=s(e)-n)<c&&(c=h=(c+h)/2),t(e,r,c,l,h))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=bM(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:xM(+t),c):a},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:xM(+t),c):o},c.paddingRight=function(t){return arguments.length?(u="function"==typeof t?t:xM(+t),c):u},c.paddingBottom=function(t){return arguments.length?(s="function"==typeof t?t:xM(+t),c):s},c.paddingLeft=function(t){return arguments.length?(f="function"==typeof t?t:xM(+t),c):f},c}();return t.ratio=function(e){var n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=function(e){uk.hasOwnProperty(e)?t.tile(uk[e]):i("Unrecognized Treemap layout method: "+e)},t},ck.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],ck.fields=sk;var lk=Object.freeze({nest:YM,pack:JM,partition:KM,stratify:ek,tree:ik,treelinks:ok,treemap:fk});function hk(t){return function(){return t}}function dk(t){return t[0]}function pk(t){return t[1]}function vk(){this._=null}function gk(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function mk(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 yk(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 bk(t){for(;t.L;)t=t.L;return t}function _k(t,e,n,r){var i=[null,null],a=Wk.push(i)-1;return i.left=t,i.right=e,n&&wk(i,t,e,n),r&&wk(i,e,t,r),$k[t.index].halfedges.push(a),$k[e.index].halfedges.push(a),i}function xk(t,e,n){var r=[e,n];return r.left=t,r}function wk(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 Mk(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 kk(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],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v<e||v>=r)return;if(l>d){if(s){if(s[1]>=i)return}else s=[v,n];a=[v,i]}else{if(s){if(s[1]<n)return}else s=[v,i];a=[v,n]}}else if(u=g-(o=(l-d)/(p-h))*v,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 Ek(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 Sk(t,e){return e[+(e.left!==t.site)]}function Ak(t,e){return e[+(e.left===t.site)]}vk.prototype={constructor:vk,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=bk(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&&(mk(this,n),n=(t=n).U),n.C=!1,r.C=!0,yk(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(yk(this,n),n=(t=n).U),n.C=!1,r.C=!0,mk(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?bk(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,mk(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,yk(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,mk(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,yk(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,mk(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,yk(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Ck,Ok=[];function zk(){gk(this),this.x=this.y=this.arc=this.site=this.cy=null}function Dk(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>=-Gk)){var d=s*s+f*f,p=c*c+l*l,v=(l*d-f*p)/h,g=(s*p-c*d)/h,m=Ok.pop()||new zk;m.arc=t,m.site=i,m.x=v+o,m.y=(m.cy=g+u)+Math.sqrt(v*v+g*g),t.circle=m;for(var y=null,b=Bk._;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}Bk.insert(y,m),y||(Ck=m)}}}}function Nk(t){var e=t.circle;e&&(e.P||(Ck=e.N),Bk.remove(e),Ok.push(e),gk(e),t.circle=null)}var Rk=[];function Tk(){gk(this),this.edge=this.site=this.circle=null}function Pk(t){var e=Rk.pop()||new Tk;return e.site=t,e}function Lk(t){Nk(t),Ik.remove(t),Rk.push(t),gk(t)}function qk(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],a=t.P,o=t.N,u=[t];Lk(t);for(var s=a;s.circle&&Math.abs(n-s.circle.x)<Yk&&Math.abs(r-s.circle.cy)<Yk;)a=s.P,u.unshift(s),Lk(s),s=a;u.unshift(s),Nk(s);for(var f=o;f.circle&&Math.abs(n-f.circle.x)<Yk&&Math.abs(r-f.circle.cy)<Yk;)o=f.N,u.push(f),Lk(f),f=o;u.push(f),Nk(f);var c,l=u.length;for(c=1;c<l;++c)f=u[c],s=u[c-1],wk(f.edge,s.site,f.site,i);s=u[0],(f=u[l-1]).edge=_k(s.site,f.site,null,i),Dk(s),Dk(f)}function Uk(t){for(var e,n,r,i,a=t[0],o=t[1],u=Ik._;u;)if((r=Fk(u,o)-a)>Yk)u=u.L;else{if(!((i=a-jk(u,o))>Yk)){r>-Yk?(e=u.P,n=u):i>-Yk?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}!function(t){$k[t.index]={site:t,halfedges:[]}}(t);var s=Pk(t);if(Ik.insert(e,s),e||n){if(e===n)return Nk(e),n=Pk(e.site),Ik.insert(s,n),s.edge=n.edge=_k(e.site,s.site),Dk(e),void Dk(n);if(n){Nk(e),Nk(n);var f=e.site,c=f[0],l=f[1],h=t[0]-c,d=t[1]-l,p=n.site,v=p[0]-c,g=p[1]-l,m=2*(h*g-d*v),y=h*h+d*d,b=v*v+g*g,_=[(g*y-d*b)/m+c,(h*b-v*y)/m+l];wk(n.edge,f,p,_),s.edge=_k(f,t,null,_),n.edge=_k(t,p,null,_),Dk(e),Dk(n)}else s.edge=_k(e.site,s.site)}}function Fk(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 jk(t,e){var n=t.N;if(n)return Fk(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var Ik,$k,Bk,Wk,Yk=1e-6,Gk=1e-12;function Hk(t,e){return e[1]-t[1]||e[0]-t[0]}function Vk(t,e){var n,r,i,a=t.sort(Hk).pop();for(Wk=[],$k=new Array(t.length),Ik=new vk,Bk=new vk;;)if(i=Ck,a&&(!i||a[1]<i.y||a[1]===i.y&&a[0]<i.x))a[0]===n&&a[1]===r||(Uk(a),n=a[0],r=a[1]),a=t.pop();else{if(!i)break;qk(i.arc)}if(function(){for(var t,e,n,r,i=0,a=$k.length;i<a;++i)if((t=$k[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]=Ek(t,Wk[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=Wk.length;a--;)kk(i=Wk[a],t,e,n,r)&&Mk(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>Yk||Math.abs(i[0][1]-i[1][1])>Yk)||delete Wk[a]}(o,u,s,f),function(t,e,n,r){var i,a,o,u,s,f,c,l,h,d,p,v,g=$k.length,m=!0;for(i=0;i<g;++i)if(a=$k[i]){for(o=a.site,u=(s=a.halfedges).length;u--;)Wk[s[u]]||s.splice(u,1);for(u=0,f=s.length;u<f;)p=(d=Ak(a,Wk[s[u]]))[0],v=d[1],l=(c=Sk(a,Wk[s[++u%f]]))[0],h=c[1],(Math.abs(p-l)>Yk||Math.abs(v-h)>Yk)&&(s.splice(u,0,Wk.push(xk(o,d,Math.abs(p-t)<Yk&&r-v>Yk?[t,Math.abs(l-t)<Yk?h:r]:Math.abs(v-r)<Yk&&n-p>Yk?[Math.abs(h-r)<Yk?l:n,r]:Math.abs(p-n)<Yk&&v-e>Yk?[n,Math.abs(l-n)<Yk?h:e]:Math.abs(v-e)<Yk&&p-t>Yk?[Math.abs(h-e)<Yk?l:t,e]:null))-1),++f);f&&(m=!1)}if(m){var y,b,_,x=1/0;for(i=0,m=null;i<g;++i)(a=$k[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(Wk.push(xk(o=m.site,w,M))-1,Wk.push(xk(o,M,k))-1,Wk.push(xk(o,k,E))-1,Wk.push(xk(o,E,w))-1)}}for(i=0;i<g;++i)(a=$k[i])&&(a.halfedges.length||delete $k[i])}(o,u,s,f)}this.edges=Wk,this.cells=$k,Ik=Bk=Wk=$k=null}function Xk(t){kr.call(this,null,t)}Vk.prototype={constructor:Vk,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return Sk(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,s,f,c=n.site,l=-1,h=e[i[a-1]],d=h.left===c?h.right:h.left;++l<a;)o=d,d=(h=e[i[l]]).left===c?h.right:h.left,o&&d&&r<o.index&&r<d.index&&(s=o,f=d,((u=c)[0]-f[0])*(s[1]-u[1])-(u[0]-s[0])*(f[1]-u[1])<0)&&t.push([c.data,o.data,d.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}},Xk.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 Jk=H(Xk,kr),Zk=[[-1e5,-1e5],[1e5,1e5]];Jk.transform=function(t,e){var n,r,i,a,o=t.as||"path",u=e.source;for(n=function(){var t=dk,e=pk,n=null;function r(r){return new Vk(r.map(function(n,i){var a=[Math.round(t(n,i,r)/Yk)*Yk,Math.round(e(n,i,r)/Yk)*Yk];return a.index=i,a.data=n,a}),n)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e?e:hk(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:hk(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x(t.x).y(t.y),t.size?n.size(t.size):n.extent(t.extent||Zk),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 Qk=Object.freeze({voronoi:Xk}),Kk=Math.PI/180,tE=64,eE=2048;function nE(){var t,e,n,r,i,a,o,u=[256,256],s=oE,f=[],c=Math.random,l={};function h(t,e,n){for(var r,i,a,o,f,l=e.x,h=e.y,d=Math.sqrt(u[0]*u[0]+u[1]*u[1]),p=s(u),v=c()<.5?1:-1,g=-v;(r=p(g+=v))&&(i=~~r[0],a=~~r[1],!(Math.min(Math.abs(i),Math.abs(a))>=d));)if(e.x=l+i,e.y=h+a,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>u[0]||e.y+e.y1>u[1]||n&&iE(e,t,u[0])||n&&(f=n,!((o=e).x+o.x1>f[0].x&&o.x+o.x0<f[1].x&&o.y+o.y1>f[0].y&&o.y+o.y0<f[1].y)))){for(var m,y=e.sprite,b=e.width>>5,_=u[0]>>5,x=e.x-(b<<4),w=127&x,M=32-w,k=e.y1-e.y0,E=(e.y+e.y0)*_+(x>>5),S=0;S<k;S++){m=0;for(var A=0;A<=b;A++)t[E+A]|=m<<M|(A<b?(m=y[S*b+A])>>>w:0);E+=_}return e.sprite=null,!0}return!1}return l.layout=function(){for(var s=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(tE<<5)/e,t.height=eE/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(so()),l=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((u[0]>>5)*u[1]),d=null,p=f.length,v=-1,g=[],m=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<p;){var y=m[v];y.x=u[0]*(c()+.5)>>1,y.y=u[1]*(c()+.5)>>1,rE(s,y,m,v),y.hasText&&h(l,y,d)&&(g.push(y),d?aE(d,y):d=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=u[0]>>1,y.y-=u[1]>>1)}return g},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=uE(t),l):e},l.fontStyle=function(t){return arguments.length?(r=uE(t),l):r},l.fontWeight=function(t){return arguments.length?(i=uE(t),l):i},l.rotate=function(t){return arguments.length?(a=uE(t),l):a},l.text=function(e){return arguments.length?(t=uE(e),l):t},l.spiral=function(t){return arguments.length?(s=sE[t]||t,l):s},l.fontSize=function(t){return arguments.length?(n=uE(t),l):n},l.padding=function(t){return arguments.length?(o=uE(t),l):o},l.random=function(t){return arguments.length?(c=t,l):c},l}function rE(t,e,n,r){if(!e.sprite){var i=t.context,a=t.ratio;i.clearRect(0,0,(tE<<5)/a,eE/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 v=Math.sin(e.rotate*Kk),g=Math.cos(e.rotate*Kk),m=o*g,y=o*v,b=s*g,_=s*v;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>=tE<<5&&(l=0,h+=d,d=0),h+s>=eE)break;i.translate((l+(o>>1))/a,(h+(s>>1))/a),e.rotate&&i.rotate(e.rotate*Kk),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,(tE<<5)/a,eE/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)*(tE<<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)}}}function iE(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}function aE(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)}function oE(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function uE(t){return"function"==typeof t?t:function(){return t}}var sE={archimedean:oE,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]}}},fE=["x","y","font","fontSize","fontStyle","fontWeight","angle"],cE=["text","font","rotate","fontSize","fontStyle","fontWeight"];function lE(t){kr.call(this,nE(),t)}lE.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:fE}]},H(lE,kr).transform=function(e,n){var r=e.modified();if(r||n.changed(n.ADD_REM)||cE.some(function(t){var r=e[t];return F(r)&&n.modified(r.fields)})){var i,a=n.materialize(n.SOURCE).source,o=this.value,u=e.as||fE,s=e.fontSize||14;if(F(s)?i=e.fontSizeRange:s=I(s),i){var f=s,c=Tp("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(),v=p[0]>>1,g=p[1]>>1,m=0,y=d.length;m<y;++m)(h=(l=d[m]).datum)[u[0]]=l.x+v,h[u[1]]=l.y+g,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 hE=Object.freeze({wordcloud:lE});function dE(t){return new Uint32Array(t)}function pE(t,e,n){var r=(e<257?function(t){return new Uint8Array(t)}:e<65537?function(t){return new Uint16Array(t)}:dE)(t);return n&&r.set(n),r}function vE(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}}}function gE(){var t=dE(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=dE(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}),function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r}(t,e)}(l,h),f)o=e,u=t,e=Array(f+c),t=dE(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),[Wr(r,t[0],0,i),Br(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 mE(t){var e,n,r,i,a;kr.call(this,(e=8,n=[],r=dE(0),i=pE(0,e),a=pE(0,e),{data:function(){return n},seen:function(){return t=r,e=n.length,r=t.length>=e?t:((i=i||new t.constructor(e)).set(t),i);var t,e,i},add:function(t){for(var e,r=0,i=n.length,a=t.length;r<a;++r)(e=t[r])._index=i++,n.push(e)},remove:function(t,e){var r,o,u,s=n.length,f=Array(s-t),c=n;for(o=0;!e[o]&&o<s;++o)f[o]=n[o],c[o]=o;for(u=o;o<s;++o)r=n[o],e[o]?c[o]=-1:(c[o]=u,i[u]=i[o],a[u]=a[o],f[u]=r,r._index=u++),i[o]=0;return n=f,c},size:function(){return n.length},curr:function(){return i},prev:function(){return a},reset:function(t){a[t]=i[t]},all:function(){return e<257?255:e<65537?65535:4294967295},set:function(t,e){i[t]|=e},clear:function(t,e){i[t]&=~e},resize:function(t,n){(t>i.length||n>e)&&(e=Math.max(n,e),i=pE(t,e,i),a=pE(t,e))}}),t),this._indices=null,this._dims=null}mE.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 yE=H(mE,kr);function bE(t){kr.call(this,null,t)}yE.transform=function(t,e){return this._dims?t.modified("fields")||t.fields.some(function(t){return e.modified(t.fields)})?this.reinit(t,e):this.eval(t,e):this.init(t,e)},yE.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]=gE()),u.push(vE(r,f,a[f]));return this.eval(t,e)},yE.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,v=this._dims,g=this.value,m=g.curr(),y=g.prev(),b=g.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&&g.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],(!v[s]||t.modified("fields",s)||e.modified(c.fields))&&((n=M[i=c.fname])||(p[i]=r=gE(),M[i]=n=r.insert(c,e.source,0)),v[s]=vE(r,s,d[s]).onAdd(n,m));for(s=0,f=g.data().length;s<f;++s)o[s]||(y[s]!==m[s]?_.push(s):u[s]&&m[s]!==b&&x.push(s));return g.mask=(1<<w)-1,l},yE.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},yE.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,v=s.length;u.resize(p,v),u.add(o);var g=u.curr(),m=u.prev(),y=u.all();for(r=0;r<v;++r)a=l[i=c[r].fname]||(l[i]=f[i].insert(c[r],o,d)),s[r].onAdd(a,g);for(;d<p;++d)m[d]=y,g[d]!==y&&h.push(d)},yE.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)},yE.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},yE.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)})},yE.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},yE.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],v=d[1],g=h[0],m=h[1],y=t.one;if(p<g)for(i=p,a=Math.min(g,v);i<a;++i)s[o=l[i]]!==n&&(c[o]=f[o],s[o]=n,r.push(o)),f[o]^=y;else if(p>g)for(i=g,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(v>m)for(i=Math.max(p,m),a=v;i<a;++i)s[o=l[i]]!==n&&(c[o]=f[o],s[o]=n,r.push(o)),f[o]^=y;else if(v<m)for(i=Math.max(g,v),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()},yE.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],v=t.one;if(l<d)for(i=l,a=Math.min(d,h);i<a;++i)u[o=s[i]]^=v,n.push(o);else if(l>d)for(i=d,a=Math.min(l,p);i<a;++i)u[o=s[i]]^=v,r.push(o);if(h>p)for(i=Math.max(l,p),a=h;i<a;++i)u[o=s[i]]^=v,n.push(o);else if(h<p)for(i=Math.max(d,h),a=p;i<a;++i)u[o=s[i]]^=v,r.push(o);t.range=e.slice()},bE.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."}]},H(bE,kr).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 _E=Object.freeze({crossfilter:mE,resolvefilter:bE}),xE="default";function wE(t){var e=t._signals.cursor;e||(t._signals.cursor=e=t.add({user:xE,item:null})),t.on(t.events("view","mousemove"),e,function(t,n){var r=e.value,i=r?s(r)?r:r.user:xE,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,n=t.cursor,r=this.value;return s(n)||(r=n.item,n=n.user),e=n&&n!==xE?n:r||n,"undefined"!=typeof document&&document.body&&(document.body.style.cursor=e),r},{cursor:e})}function ME(t,e){var n=t._runtime.data;return n.hasOwnProperty(e)||i("Unrecognized data set: "+e),n[e]}function kE(t,e){bt(e)||i("Second argument to changes must be a changeset.");var n=ME(this,t);return n.modified=!0,this.pulse(n.input,e)}function EE(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function SE(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function AE(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function CE(t,e,n){var r,i,a=t._renderer.canvas();return a&&(i=AE(t),(r=Rf(e.changedTouches?e.changedTouches[0]:e,a))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.vega=function(t,e,n){var r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function a(t){if(!t)return n;s(t)&&(t=i(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}return{view:I(t),item:I(e||{}),group:i,xy:a,x:function(t){return a(t)[0]},y:function(t){return a(t)[1]}}}(t,n,r),e.item=n,e}var OE="view",zE="timer",DE="window",NE={trap:!1};function RE(t){return t.item}function TE(t){var e=t.item.mark.source;return e.source||e}function PE(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function LE(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}var qE="vega-bind",UE="vega-bind-name",FE="vega-bind-radio",jE="vega-option-";function IE(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){e!==t.signal(r.signal)&&(i.source=!0,t.signal(r.signal,e).run())}},r.debounce&&(i.update=$(r.debounce,i.update))),function(t,e,n,r){var i=LE("div",{class:qE});i.appendChild(LE("span",{class:UE},n.name||n.signal)),e.appendChild(i);var a=$E;switch(n.input){case"checkbox":a=BE;break;case"select":a=WE;break;case"radio":a=YE;break;case"range":a=GE}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}}function $E(t,e,n,r){var i=LE("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 BE(t,e,n,r){var i={type:"checkbox",name:n.signal};r&&(i.checked=!0);var a=LE("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 WE(t,e,n,r){var i=LE("select",{name:n.signal});n.options.forEach(function(t){var e={value:t};HE(t,r)&&(e.selected=!0),i.appendChild(LE("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(HE(n.options[e],t))return void(i.selectedIndex=e)}}function YE(t,e,n,r){var i=LE("span",{class:FE});e.appendChild(i),t.elements=n.options.map(function(e){var a=jE+n.signal+"-"+e,o={id:a,type:"radio",name:n.signal,value:e};HE(e,r)&&(o.checked=!0);var u=LE("input",o);return u.addEventListener("change",function(){t.update(e)}),i.appendChild(u),i.appendChild(LE("label",{for:a},e+"")),u}),t.set=function(e){for(var n=t.elements,r=0,i=n.length;r<i;++r)HE(n[r].value,e)&&(n[r].checked=!0)}}function GE(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;var i,a,o,u,s,f,c=n.min||Math.min(0,+r)||0,l=n.max||Math.max(100,+r)||100,h=n.step||(i=c,a=l,o=100,u=Math.abs(a-i)/Math.max(0,o),s=Math.pow(10,Math.floor(Math.log(u)/Math.LN10)),(f=u/s)>=Hr?s*=10:f>=Vr?s*=5:f>=Xr&&(s*=2),a<i?-s:s),d=LE("input",{type:"range",name:n.signal,min:c,max:l,step:h});d.value=r;var p=LE("label",{},+r);function v(){p.textContent=d.value,t.update(+d.value)}e.appendChild(d),e.appendChild(p),d.addEventListener("input",v),d.addEventListener("change",v),t.elements=[d],t.set=function(t){d.value=t,p.textContent=t}}function HE(t,e){return t===e||t+""==e+""}function VE(t,e,n,r,i){return(e=e||new r(t.loader())).initialize(n,EE(t),SE(t),AE(t),i).background(t._background)}function XE(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function JE(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 ZE(t,e,n){var r=kc(e),i=r&&r.headless;return i?t.runAsync().then(function(){return VE(t,null,null,i,n).renderAsync(t._scenegraph.root)}):Promise.reject("Unrecognized renderer type: "+e)}function QE(t){return+t||0}var KE,tS,eS,nS,rS,iS="outer",aS=["value","update","init","react","bind"];function oS(t,e){i(t+' for "outer" push: '+f(e))}function uS(t,e){var n=t.name;if(t.push===iS)e.signals[n]||oS("No prior signal definition",n),aS.forEach(function(e){void 0!==t[e]&&oS("Invalid property ",e)});else{var r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function sS(t){this.type=t}sS.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 fS=1,cS=2,lS=3,hS=4,dS=5,pS=6,vS=7,gS=8;(KE={})[fS]="Boolean",KE[cS]="<end>",KE[lS]="Identifier",KE[hS]="Keyword",KE[dS]="Null",KE[pS]="Numeric",KE[vS]="Punctuator",KE[gS]="String",KE[9]="RegularExpression";var mS="ArrayExpression",yS="BinaryExpression",bS="CallExpression",_S="ConditionalExpression",xS="Identifier",wS="Literal",MS="LogicalExpression",kS="MemberExpression",ES="ObjectExpression",SS="Property",AS="UnaryExpression",CS="Unexpected token %0",OS="Unexpected number",zS="Unexpected string",DS="Unexpected identifier",NS="Unexpected reserved word",RS="Unexpected end of input",TS="Invalid regular expression",PS="Invalid regular expression: missing /",LS="Octal literals are not allowed in strict mode.",qS="Duplicate data property in object literal not allowed in strict mode",US="ILLEGAL",FS="Disabled.",jS=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ--ℝℤΩℨK--ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA--zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),IS=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ--ℝℤΩℨK--ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0--_-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");function $S(t,e){if(!t)throw new Error("ASSERT: "+e)}function BS(t){return t>=48&&t<=57}function WS(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function YS(t){return"01234567".indexOf(t)>=0}function GS(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 HS(t){return 10===t||13===t||8232===t||8233===t}function VS(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&jS.test(String.fromCharCode(t))}function XS(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&IS.test(String.fromCharCode(t))}var JS={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function ZS(){for(var t;eS<nS&&(GS(t=tS.charCodeAt(eS))||HS(t));)++eS}function QS(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)eS<nS&&WS(tS[eS])?(r=tS[eS++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):pA({},CS,US);return String.fromCharCode(i)}function KS(){var t,e,n,r;for(e=0,"}"===(t=tS[eS])&&pA({},CS,US);eS<nS&&WS(t=tS[eS++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&pA({},CS,US),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function tA(){var t,e;for(t=tS.charCodeAt(eS++),e=String.fromCharCode(t),92===t&&(117!==tS.charCodeAt(eS)&&pA({},CS,US),++eS,(t=QS("u"))&&"\\"!==t&&VS(t.charCodeAt(0))||pA({},CS,US),e=t);eS<nS&&XS(t=tS.charCodeAt(eS));)++eS,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==tS.charCodeAt(eS)&&pA({},CS,US),++eS,(t=QS("u"))&&"\\"!==t&&XS(t.charCodeAt(0))||pA({},CS,US),e+=t);return e}function eA(){var t,e;return t=eS,{type:1===(e=92===tS.charCodeAt(eS)?tA():function(){var t,e;for(t=eS++;eS<nS;){if(92===(e=tS.charCodeAt(eS)))return eS=t,tA();if(!XS(e))break;++eS}return tS.slice(t,eS)}()).length?lS:JS.hasOwnProperty(e)?hS:"null"===e?dS:"true"===e||"false"===e?fS:lS,value:e,start:t,end:eS}}function nA(){var t,e,n,r,i=eS,a=tS.charCodeAt(eS),o=tS[eS];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++eS,{type:vS,value:String.fromCharCode(a),start:i,end:eS};default:if(61===(t=tS.charCodeAt(eS+1)))switch(a){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return eS+=2,{type:vS,value:String.fromCharCode(a)+String.fromCharCode(t),start:i,end:eS};case 33:case 61:return eS+=2,61===tS.charCodeAt(eS)&&++eS,{type:vS,value:tS.slice(i,eS),start:i,end:eS}}}return">>>="===(r=tS.substr(eS,4))?{type:vS,value:r,start:i,end:eS+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:vS,value:n,start:i,end:eS+=3}:o===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(o)>=0||"=>"===e?{type:vS,value:e,start:i,end:eS+=2}:"<>=!+-*%&|^/".indexOf(o)>=0?{type:vS,value:o,start:i,end:++eS}:void pA({},CS,US)}function rA(){var t,e,n;if($S(BS((n=tS[eS]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=eS,t="","."!==n){if(t=tS[eS++],n=tS[eS],"0"===t){if("x"===n||"X"===n)return++eS,function(t){for(var e="";eS<nS&&WS(tS[eS]);)e+=tS[eS++];return 0===e.length&&pA({},CS,US),VS(tS.charCodeAt(eS))&&pA({},CS,US),{type:pS,value:parseInt("0x"+e,16),start:t,end:eS}}(e);if(YS(n))return function(t){for(var e="0"+tS[eS++];eS<nS&&YS(tS[eS]);)e+=tS[eS++];return(VS(tS.charCodeAt(eS))||BS(tS.charCodeAt(eS)))&&pA({},CS,US),{type:pS,value:parseInt(e,8),octal:!0,start:t,end:eS}}(e);n&&BS(n.charCodeAt(0))&&pA({},CS,US)}for(;BS(tS.charCodeAt(eS));)t+=tS[eS++];n=tS[eS]}if("."===n){for(t+=tS[eS++];BS(tS.charCodeAt(eS));)t+=tS[eS++];n=tS[eS]}if("e"===n||"E"===n)if(t+=tS[eS++],"+"!==(n=tS[eS])&&"-"!==n||(t+=tS[eS++]),BS(tS.charCodeAt(eS)))for(;BS(tS.charCodeAt(eS));)t+=tS[eS++];else pA({},CS,US);return VS(tS.charCodeAt(eS))&&pA({},CS,US),{type:pS,value:parseFloat(t),start:e,end:eS}}function iA(){var t,e,n,r;return rS=null,ZS(),t=eS,e=function(){var t,e,n,r;for($S("/"===(t=tS[eS]),"Regular expression literal must start with a slash"),e=tS[eS++],n=!1,r=!1;eS<nS;)if(e+=t=tS[eS++],"\\"===t)HS((t=tS[eS++]).charCodeAt(0))&&pA({},PS),e+=t;else if(HS(t.charCodeAt(0)))pA({},PS);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||pA({},PS),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";eS<nS&&XS((t=tS[eS]).charCodeAt(0));)++eS,"\\"===t&&eS<nS?pA({},CS,US):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&pA({},TS,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";pA({},TS)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));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:eS}}function aA(){var t;return ZS(),eS>=nS?{type:cS,start:eS,end:eS}:VS(t=tS.charCodeAt(eS))?eA():40===t||41===t||59===t?nA():39===t||34===t?function(){var t,e,n,r,i="",a=!1;for($S("'"===(t=tS[eS])||'"'===t,"String literal must starts with a quote"),e=eS,++eS;eS<nS;){if((n=tS[eS++])===t){t="";break}if("\\"===n)if((n=tS[eS++])&&HS(n.charCodeAt(0)))"\r"===n&&"\n"===tS[eS]&&++eS;else switch(n){case"u":case"x":"{"===tS[eS]?(++eS,i+=KS()):i+=QS(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:YS(n)?(0!==(r="01234567".indexOf(n))&&(a=!0),eS<nS&&YS(tS[eS])&&(a=!0,r=8*r+"01234567".indexOf(tS[eS++]),"0123".indexOf(n)>=0&&eS<nS&&YS(tS[eS])&&(r=8*r+"01234567".indexOf(tS[eS++]))),i+=String.fromCharCode(r)):i+=n}else{if(HS(n.charCodeAt(0)))break;i+=n}}return""!==t&&pA({},CS,US),{type:gS,value:i,octal:a,start:e,end:eS}}():46===t?BS(tS.charCodeAt(eS+1))?rA():nA():BS(t)?rA():nA()}function oA(){var t;return eS=(t=rS).end,rS=aA(),eS=t.end,t}function uA(){var t;t=eS,rS=aA(),eS=t}function sA(t,e,n){var r=new sS("||"===t||"&&"===t?MS:yS);return r.operator=t,r.left=e,r.right=n,r}function fA(t,e){var n=new sS(bS);return n.callee=t,n.arguments=e,n}function cA(t){var e=new sS(xS);return e.name=t,e}function lA(t){var e=new sS(wS);return e.value=t.value,e.raw=tS.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function hA(t,e,n){var r=new sS(kS);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function dA(t,e,n){var r=new sS(SS);return r.key=e,r.value=n,r.kind=t,r}function pA(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,function(t,e){return $S(e<r.length,"Message reference must be in range"),r[e]});throw(n=new Error(i)).index=eS,n.description=i,n}function vA(t){t.type===cS&&pA(t,RS),t.type===pS&&pA(t,OS),t.type===gS&&pA(t,zS),t.type===lS&&pA(t,DS),t.type===hS&&pA(t,NS),pA(t,CS,t.value)}function gA(t){var e=oA();e.type===vS&&e.value===t||vA(e)}function mA(t){return rS.type===vS&&rS.value===t}function yA(t){return rS.type===hS&&rS.value===t}function bA(){var t=[];for(eS=rS.start,gA("[");!mA("]");)mA(",")?(oA(),t.push(null)):(t.push(DA()),mA("]")||gA(","));return oA(),function(t){var e=new sS(mS);return e.elements=t,e}(t)}function _A(){var t;return eS=rS.start,(t=oA()).type===gS||t.type===pS?(t.octal&&pA(t,LS),lA(t)):cA(t.value)}function xA(){var t,e,n;return eS=rS.start,(t=rS).type===lS?(n=_A(),gA(":"),dA("init",n,DA())):t.type!==cS&&t.type!==vS?(e=_A(),gA(":"),dA("init",e,DA())):void vA(t)}function wA(){var t,e,n=[],r={},i=String;for(eS=rS.start,gA("{");!mA("}");)e="$"+((t=xA()).key.type===xS?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?pA({},qS):r[e]=!0,n.push(t),mA("}")||gA(",");return gA("}"),function(t){var e=new sS(ES);return e.properties=t,e}(n)}var MA={if:1,this:1};function kA(){var t,e,n;if(mA("("))return function(){var t;return gA("("),t=NA(),gA(")"),t}();if(mA("["))return bA();if(mA("{"))return wA();if(t=rS.type,eS=rS.start,t===lS||MA[rS.value])n=cA(oA().value);else if(t===gS||t===pS)rS.octal&&pA(rS,LS),n=lA(oA());else{if(t===hS)throw new Error(FS);t===fS?((e=oA()).value="true"===e.value,n=lA(e)):t===dS?((e=oA()).value=null,n=lA(e)):mA("/")||mA("/=")?(n=lA(iA()),uA()):vA(oA())}return n}function EA(){var t=[];if(gA("("),!mA(")"))for(;eS<nS&&(t.push(DA()),!mA(")"));)gA(",");return gA(")"),t}function SA(){var t;return eS=rS.start,function(t){return t.type===lS||t.type===hS||t.type===fS||t.type===dS}(t=oA())||vA(t),cA(t.value)}function AA(){var t;return gA("["),t=NA(),gA("]"),t}function CA(){var t=function(){var t;for(t=kA();;)if(mA("."))gA("."),t=hA(".",t,SA());else if(mA("("))t=fA(t,EA());else{if(!mA("["))break;t=hA("[",t,AA())}return t}();if(rS.type===vS&&(mA("++")||mA("--")))throw new Error(FS);return t}function OA(){var t,e,n,r,i;if(rS.type!==vS&&rS.type!==hS)e=CA();else{if(mA("++")||mA("--"))throw new Error(FS);if(mA("+")||mA("-")||mA("~")||mA("!"))t=oA(),e=OA(),n=t.value,r=e,(i=new sS(AS)).operator=n,i.argument=r,i.prefix=!0,e=i;else{if(yA("delete")||yA("void")||yA("typeof"))throw new Error(FS);e=CA()}}return e}function zA(t){var e=0;if(t.type!==vS&&t.type!==hS)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 DA(){var t,e;return t=function(){var t,e,n,r,i,a,o,u,s,f;if(t=rS,s=OA(),0===(i=zA(r=rS)))return s;for(r.prec=i,oA(),e=[t,rS],a=[s,r,o=OA()];(i=zA(rS))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),u=a.pop().value,s=a.pop(),e.pop(),n=sA(u,s,o),a.push(n);(r=oA()).prec=i,a.push(r),e.push(rS),n=OA(),a.push(n)}for(n=a[f=a.length-1],e.pop();f>1;)e.pop(),n=sA(a[f-1].value,a[f-2],n),f-=2;return n}(),mA("?")&&(oA(),e=DA(),gA(":"),t=function(t,e,n){var r=new sS(_S);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,DA())),t}function NA(){var t=DA();if(mA(","))throw new Error(FS);return t}var RA={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function TA(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&&i("Missing arguments to clamp function."),e.length>3&&i("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"),split:e("split","String"),replace:e("replace","String"),regexp:"RegExp",test:e("test","RegExp"),if:function(e){e.length<3&&i("Missing arguments to if function."),e.length>3&&i("Too many arguments to if function.");var n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var PA={};function LA(t,e,n){var r=t+":"+n,i=PA[r];return i&&i[0]===e||(PA[r]=i=[e,e(n)]),i[1]}function qA(t,e){return LA("timeFormat",Ie,e)(t)}var UA=new Date(2e3,0,1);function FA(t,e,n){return UA.setMonth(t),UA.setDate(e),qA(UA,n)}function jA(t,e,n,r){var i,a=e[0],o=e[e.length-1];return a>o&&(i=a,a=o,o=i),r=void 0===r||r,((n=void 0===n||n)?a<=t:a<t)&&(r?t<=o:t<o)}function IA(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}var $A="undefined"!=typeof window&&window||null;var BA="Literal",WA="Identifier",YA="@",GA="%",HA=":";function VA(t,e){var n;return F(t)?t:s(t)?(n=e.scales[t])&&n.value:void 0}function XA(t,e,n){var r=GA+n;if(!e.hasOwnProperty(r))try{e[r]=t.scaleRef(n)}catch(t){}}function JA(t,e,n,r){if(e[0].type===BA)XA(n,r,e[0].value);else if(e[0].type===WA)for(t in n.scales)XA(n,r,t)}function ZA(t,e){return function(n,r,i){if(n){var a=VA(n,(i||this).context);return a&&a.path[t](r)}return e(r)}}var QA=ZA("area",function(t){return Ey.reset(),yy(t,Sy),2*Ey}),KA=ZA("bounds",function(t){var e,n,r,i,a,o,u;if(Iy=jy=-(Uy=Fy=1/0),Gy=[],yy(t,lb),n=Gy.length){for(Gy.sort(_b),e=1,a=[r=Gy[0]];e<n;++e)xb(r,(i=Gy[e])[0])||xb(r,i[1])?(bb(r[0],i[1])>bb(r[0],r[1])&&(r[1]=i[1]),bb(i[0],r[1])>bb(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(u=bb(r[1],i[0]))>o&&(o=u,Uy=i[0],jy=r[1])}return Gy=Hy=null,Uy===1/0||Fy===1/0?[[NaN,NaN],[NaN,NaN]]:[[Uy,Fy],[jy,Iy]]}),tC=ZA("centroid",function(t){Vy=Xy=Jy=Zy=Qy=Ky=tb=eb=nb=rb=ib=0,yy(t,wb);var e=nb,n=rb,r=ib,i=e*e+n*n+r*r;return i<Ym&&(e=Ky,n=tb,r=eb,Xy<Wm&&(e=Jy,n=Zy,r=Qy),(i=e*e+n*n+r*r)<Ym)?[NaN,NaN]:[ty(n,e)*Jm,ly(r/sy(i))*Jm]});function eC(t){var e=this.context.data[t];return e?e.values.value:[]}function nC(t,e,n,r){e[0].type!==BA&&i("First argument to data functions must be a string literal.");var a=e[0].value,o=HA+a;r.hasOwnProperty(o)||(r[o]=n.getData(a).tuplesRef())}var rC={};function iC(t){return t.data}function aC(t,e){var n=eC.call(e,t);return n.root&&n.root.lookup||rC}function oC(t,e){return t===e||t!=t&&e!=e||!(!o(t)||!o(e)||t.length!==e.length)&&function(t,e){for(var n=0,r=t.length;n<r;++n)if(!oC(t[n],e[n]))return!1;return!0}(t,e)}function uC(t){return function(e){for(var n in t)if(!oC(e[n],t[n]))return!1;return!0}}var sC="E",fC="R",cC="R-E",lC="R-LE",hC="R-RE",dC="intersect",pC="union",vC="index:unit";function gC(t,e){for(var n,r,i=e.fields,a=e.values,u=i.length,s=0;s<u;++s)if((r=i[s]).getter=c.getter||c(r.field),X(n=r.getter(t))&&(n=S(n)),X(a[s])&&(a[s]=S(a[s])),X(a[s][0])&&(a[s]=a[s].map(S)),r.type===sC){if(o(a[s])?a[s].indexOf(n)<0:n!==a[s])return!1}else if(r.type===fC){if(!jA(n,a[s]))return!1}else if(r.type===hC){if(!jA(n,a[s],!0,!1))return!1}else if(r.type===cC){if(!jA(n,a[s],!1,!1))return!1}else if(r.type===lC&&!jA(n,a[s],!1,!0))return!1;return!0}function mC(t,e,n,r){e[0].type!==BA&&i("First argument to indata must be a string literal.");var a=e[0].value,o=e.length>=2&&e[e.length-1].value,u=YA+"unit";o!==dC||r.hasOwnProperty(u)||(r[u]=n.getData(a).indataRef(n,"unit")),nC(0,e,n,r)}var yC={E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter(function(t){return e.indexOf(t)>=0}):e},R_union:function(t,e){var n=S(e[0]),r=S(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=S(e[0]),r=S(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}},bC="bin_",_C="intersect",xC="union",wC="index:unit";function MC(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]||c(r[u]),X(n=a[u](t))&&(n=S(n)),X(i[u])&&(i[u]=S(i[u])),e[bC+r[u]]){if(X(i[u][0])&&(i[u]=i[u].map(S)),!jA(n,i[u],!0,!1))return!1}else if(n!==i[u])return!1;return!0}function kC(t,e){for(var n,r,i=e.intervals,a=i.length,o=0;o<a;++o){if(n=i[o].extent,r=(i[o].getter||(i[o].getter=c(i[o].field)))(t),!n||n[0]===n[1])return!1;if(X(r)&&(r=S(r)),X(n[0])&&(n=i[o].extent=n.map(S)),J(n[0])&&!jA(r,n))return!1;if(s(n[0])&&n.indexOf(r)<0)return!1}return!0}function EC(t,e,n,r){for(var i,a,o,u,s,f=this.context.data[t],c=f?f.values.value:[],l=f?f[wC]&&f[wC].value:void 0,h=n===_C,d=c.length,p=0;p<d;++p)if(i=c[p],l&&h){if(-1===(o=(a=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(h^(s=r(e,i)))return s;return d&&h}function SC(t,e,n){return EC.call(this,t,e,n,MC)}function AC(t,e,n,r){e[0].type!==BA&&i("First argument to indata must be a string literal.");var a=e[0].value,o=e.length>=2&&e[e.length-1].value,u=YA+"unit";o!==_C||r.hasOwnProperty(u)||(r[u]=n.getData(a).indataRef(n,"unit")),nC(0,e,n,r)}function CC(t,e,n,r){var i,a,o,u,s,f=this.context.data[t],c=f?f.values.value:[],l=f?f[wC]&&f[wC].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[bC+h.fields[d]];break}return l&&1===l.size&&(r=xC),l&&r===_C?(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?zC(s[t],xC):OC(s[t],xC)}})):o=c.map(function(t){return{unit:t.unit,value:t.values[a]}}),u?zC(o,r):OC(o,r)}}function OC(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===_C&&i.count!==u||f.push(i.value);return f.length?f:void 0}function zC(t,e){for(var n,r,i,a,o=e===_C?NC:DC,u=0,s=t.length;u<s;++u)X((n=t[u].value)[0])&&(n=n.map(S)),(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 DC(t,e,n){return t[0]>e&&(t[0]=e),t[1]<n&&(t[1]=n),t}function NC(t,e,n){return n<t[0]||t[1]<e?[]:(t[0]<e&&(t[0]=e),t[1]>n&&(t[1]=n),t)}var RC={random:function(){return t.random()},isArray:o,isBoolean:V,isDate:X,isNumber:J,isObject:u,isRegExp:Z,isString:s,isTuple:ht,toBoolean:nt,toDate:it,toNumber:S,toString:at,pad:et,peek:E,truncate:ut,rgb:hh,lab:Oh,hcl:Ph,hsl:gh,sequence:Gr,format:function(t,e){return LA("format",rp,e)(t)},utcFormat:function(t,e){return LA("utcFormat",Be,e)(t)},utcParse:function(t,e){return LA("utcParse",We,e)(t)},timeFormat:qA,timeParse:function(t,e){return LA("timeParse",$e,e)(t)},monthFormat:function(t){return FA(t,1,"%B")},monthAbbrevFormat:function(t){return FA(t,1,"%b")},dayFormat:function(t){return FA(0,2+t,"%A")},dayAbbrevFormat:function(t){return FA(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 IA(this.context.dataflow,"warn",arguments)},info:function(){return IA(this.context.dataflow,"info",arguments)},debug:function(){return IA(this.context.dataflow,"debug",arguments)},extent:function(t){var e,n,r,i,a=0;if(t&&(e=t.length)){for(n=t[a];null==n||n!=n;n=t[++a]);for(r=i=n;a<e;++a)null!=(n=t[a])&&(n<r&&(r=n),n>i&&(i=n))}return[r,i]},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]:[i=Math.min(Math.max(i,e),n-r),i+r]},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 $A?$A.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 $A?[$A.innerWidth,$A.innerHeight]:[void 0,void 0]},span:function(t){return t[t.length-1]-t[0]||0},merge:function(){var t=[].slice.call(arguments);return t.unshift({}),B.apply(null,t)},flush:function(t,e,n,r,i,a){if(!n&&0!==n)return a;var o,u,s=t[0],f=E(t),c=+n;return f<s&&(o=s,s=f,f=o),(o=Math.abs(e-s))<(u=Math.abs(f-e))&&o<=c?r:u<=c?i:a},bandspace:function(t,e,n){return xl(t||0,e||0,n||0)},inrange:jA,setdata:function(t,e){var n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(g).insert(e)),1},pathShape:function(t){var e=null;return function(n){return n?Pu(n,e=e||Cu(t)):t}},panLinear:D,panLog:N,panPow:R,zoomLinear:P,zoomLog:L,zoomPow:q,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 u,s,f=this.context.dataflow,c=this.context.data[t],l=c.input,h=c.changes,d=f.stamp();if(!1===f._trigger||!(l.value.length||e||r))return 0;if((!h||h.stamp<d)&&(c.changes=h=f.changeset(),h.stamp=d,f.runAfter(function(){c.modified=!0,f.pulse(l,h).run()},!0,1)),n&&(u=!0===n?g:o(n)||ht(n)?n:uC(n),h.remove(u)),e&&h.insert(e),r&&(u=uC(r),l.value.some(u)?h.remove(u):h.insert(r)),i)for(s in a)h.modify(i,s,a[s]);return 1}},TC=["view","item","group","xy","x","y"],PC="event.vega.",LC="this.",qC={};function UC(t,e,n){return 1===arguments.length?RC[t]:(RC[t]=e,n&&(qC[t]=n),jC&&(jC.functions[t]=LC+t),this)}UC("bandwidth",function(t,e){var n=VA(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0},JA),UC("copy",function(t,e){var n=VA(t,(e||this).context);return n?n.copy():void 0},JA),UC("domain",function(t,e){var n=VA(t,(e||this).context);return n?n.domain():[]},JA),UC("range",function(t,e){var n=VA(t,(e||this).context);return n&&n.range?n.range():[]},JA),UC("invert",function(t,e,n){var r=VA(t,(n||this).context);return r?o(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0},JA),UC("scale",function(t,e,n){var r=VA(t,(n||this).context);return r?r(e):void 0},JA),UC("gradient",function(t,e,n,r,i){t=VA(t,(i||this).context);var a=ao(e,n),o=t.domain(),u=o[0],s=E(o),f=Up(t,u,s);t.ticks&&(u!==(o=t.ticks(+r||15))[0]&&o.unshift(u),s!==E(o)&&o.push(s));for(var c=0,l=o.length;c<l;++c)a.stop(f(o[c]),t(o[c]));return a},JA),UC("geoArea",QA,JA),UC("geoBounds",KA,JA),UC("geoCentroid",tC,JA),UC("geoShape",function(t,e,n){var r=VA(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}},JA),UC("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!==BA&&i("First argument to indata must be a string literal."),e[1].type!==BA&&i("Second argument to indata must be a string literal.");var a=e[0].value,o=e[1].value,u=YA+o;r.hasOwnProperty(u)||(r[u]=n.getData(a).indataRef(n,o))}),UC("data",eC,nC),UC("treePath",function(t,e,n){var r=aC(t,this),i=r[e],a=r[n];return i&&a?i.path(a).map(iC):void 0},nC),UC("treeAncestors",function(t,e){var n=aC(t,this)[e];return n?n.ancestors().map(iC):void 0},nC),UC("vlSelectionTest",function(t,e,n){for(var r,i,a,o,u,s=this.context.data[t],f=s?s.values.value:[],c=s?s[vC]&&s[vC].value:void 0,l=n===dC,h=f.length,d=0;d<h;++d)if(r=f[d],c&&l){if(-1===(a=(i=i||{})[o=r.unit]||0))continue;if(u=gC(e,r),i[o]=u?-1:++a,u&&1===c.size)return!0;if(!u&&a===c.get(o).count)return!1}else if(l^(u=gC(e,r)))return u;return h&&l},mC),UC("vlSelectionResolve",function(t,e){for(var n,r,i,a,o,u,s,f,c,l,h,d=this.context.data[t],p=d?d.values.value:[],v={},g={},m=p.length,y=0;y<m;++y)for(a=(n=p[y]).unit,r=n.fields,i=n.values,l=0,h=r.length;l<h;++l)o=r[l],s=(u=v[o.field]||(v[o.field]={}))[a]||(u[a]=[]),g[o.field]=f=o.type.charAt(0),c=yC[f+"_union"],u[a]=c(s,U(i[l]));return e=e||pC,Object.keys(v).forEach(function(t){v[t]=Object.keys(v[t]).map(function(e){return v[t][e]}).reduce(function(n,r){return void 0===n?r:yC[g[t]+"_"+e](n,r)})}),v},mC),UC("vlSingle",SC,nC),UC("vlSingleDomain",CC,nC),UC("vlMulti",SC,AC),UC("vlMultiDomain",CC,AC),UC("vlInterval",function(t,e,n){return EC.call(this,t,e,n,kC)},nC),UC("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?OC(u,r):zC(u,r)}},nC);var FC={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function(t){return"_["+f("$"+t)+"]"},functions:function(t){var e=TA(t);for(var n in TC.forEach(function(t){e[t]=PC+t}),RC)e[n]=LC+n;return e},constants:RA,visitors:qC},jC=function(t){var e=(t=t||{}).whitelist?ot(t.whitelist):{},n=t.blacklist?ot(t.blacklist):{},r=t.constants||RA,a=(t.functions||TA)(d),o=t.globalvar,u=t.fieldvar,f={},c={},l=0,h=F(o)?o:function(t){return o+'["'+t+'"]'};function d(t){if(s(t))return t;var e=p[t.type];return null==e&&i("Unsupported type: "+t.type),e(t)}var p={Literal:function(t){return t.raw},Identifier:function(t){var a=t.name;return l>0?a:n.hasOwnProperty(a)?i("Illegal identifier: "+a):r.hasOwnProperty(a)?r[a]:e.hasOwnProperty(a)?a:(f[a]=1,h(a))},MemberExpression:function(t){var e=!t.computed,n=d(t.object);e&&(l+=1);var r=d(t.property);return n===u&&(c[r]=1),e&&(l-=1),n+(e?"."+r:"["+r+"]")},CallExpression:function(t){"Identifier"!==t.callee.type&&i("Illegal callee type: "+t.callee.type);var e=t.callee.name,n=t.arguments,r=a.hasOwnProperty(e)&&a[e];return r||i("Unrecognized function: "+e),F(r)?r(n):r+"("+n.map(d).join(",")+")"},ArrayExpression:function(t){return"["+t.elements.map(d).join(",")+"]"},BinaryExpression:function(t){return"("+d(t.left)+t.operator+d(t.right)+")"},UnaryExpression:function(t){return"("+t.operator+d(t.argument)+")"},ConditionalExpression:function(t){return"("+d(t.test)+"?"+d(t.consequent)+":"+d(t.alternate)+")"},LogicalExpression:function(t){return"("+d(t.left)+t.operator+d(t.right)+")"},ObjectExpression:function(t){return"{"+t.properties.map(d).join(",")+"}"},Property:function(t){l+=1;var e=d(t.key);return l-=1,e+":"+d(t.value)}};function v(t){var e={code:d(t),globals:Object.keys(f),fields:Object.keys(c)};return f={},c={},e}return v.functions=a,v.constants=r,v}(FC),IC="$";function $C(t,e,n){var r,a,o={};try{r=function(t){eS=0,nS=(tS=t).length,rS=null,uA();var e=NA();if(rS.type!==cS)throw new Error("Unexpect token after expression.");return e}(t=s(t)?t:f(t)+"")}catch(e){i("Expression parse error: "+t)}return r.visit(function(t){if("CallExpression"===t.type){var n=t.callee.name,r=FC.visitors[n];r&&r(n,t.arguments,e,o)}}),(a=jC(r)).globals.forEach(function(t){var n=IC+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}}function BC(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function WC(t,e,n,r){return new BC(t,e,n,r)}function YC(t,e){return WC("operator",t,e)}function GC(t){var e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}var HC={$tupleid:1,toString:function(){return":_tupleid_:"}};function VC(t,e){return e?{$field:t,$name:e}:{$field:t}}var XC=VC("key");function JC(t,e){return{$compare:t,$order:e}}var ZC="descending";function QC(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}var KC="scope",tO="view";function eO(t){return t&&t.signal}function nO(t){if(eO(t))return!0;if(u(t))for(var e in t)if(nO(t[e]))return!0;return!1}function rO(t,e){return null!=t?t:e}function iO(t){return t&&t.signal||t}var aO="timer";function oO(t,e){return(t.merge?uO:t.stream?sO:t.type?fO:i("Invalid stream specification: "+f(t)))(t,e)}function uO(t,e){var n=cO({merge:t.merge.map(function(t){return oO(t,e)})},t,e);return e.addStream(n).id}function sO(t,e){var n=cO({stream:oO(t.stream,e)},t,e);return e.addStream(n).id}function fO(t,e){var n,r,i;return t.type===aO?(n=e.event(aO,t.throttle),t={between:t.between,filter:t.filter}):n=e.event((i=t.source)===KC?tO:i||tO,t.type),r=cO({stream:n},t,e),1===Object.keys(r).length?n:e.addStream(r).id}function cO(t,e,n){var r,a,o,u,s=e.between;return s&&(2!==s.length&&i('Stream "between" parameter must have 2 entries: '+f(e)),t.between=[oO(s[0],n),oO(s[1],n)]),s=e.filter?U(e.filter):[],(e.marktype||e.markname||e.markrole)&&s.push((r=e.marktype,a=e.markname,o=e.markrole,(u="event.item")+(r&&"*"!==r?"&&"+u+".mark.marktype==='"+r+"'":"")+(o?"&&"+u+".mark.role==='"+o+"'":"")+(a?"&&"+u+".mark.name==='"+a+"'":""))),e.source===KC&&s.push("inScope(event.item)"),s.length&&(t.filter=$C("("+s.join(")&&(")+")").$expr),null!=(s=e.throttle)&&(t.throttle=+s),null!=(s=e.debounce)&&(t.debounce=+s),e.consume&&(t.consume=!0),t}var lO,hO,dO="view",pO="[",vO="]",gO="{",mO="}",yO=":",bO=",",_O="@",xO=">",wO=/[[\]{}]/,MO={"*":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};function kO(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 EO(t){for(var e=[],n=0,r=t.length,i=0;i<r;)i=kO(t,i,bO,pO+gO,vO+mO),e.push(t.substring(n,i).trim()),n=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function SO(t){return"["===t[0]?function(t){var e,n,r=t.length,i=1;if((i=kO(t,i,vO,pO,vO))===r)throw"Empty between selector: "+t;if(2!==(e=EO(t.substring(1,i))).length)throw"Between selector must have two elements: "+t;if((t=t.slice(i+1).trim())[0]!==xO)throw"Expected '>' after between selector: "+t;if(e=e.map(SO),(n=SO(t.slice(1).trim())).between)return{between:e,stream:n};n.between=e;return n}(t):function(t){var e,n,r={source:lO},i=[],a=[0,0],o=0,u=0,s=t.length,f=0;if(t[s-1]===mO){if(!((f=t.lastIndexOf(gO))>=0))throw"Unmatched right brace: "+t;try{a=function(t){var e=t.split(bO);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]===_O&&(o=++f);(e=kO(t,f,yO))<s&&(i.push(t.substring(u,e).trim()),u=f=++e);if((f=kO(t,f,pO))===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=kO(t,f,vO))===s)throw"Unmatched left bracket: "+t;if(n.push(t.substring(u,f).trim()),f<s-1&&t[++f]!==pO)throw"Expected left bracket: "+t;u=++f}if(!(s=i.length)||wO.test(i[s-1]))throw"Invalid event selector: "+t;s>1?(r.type=i[1],o?r.markname=i[0].slice(1):(c=i[0],hO.hasOwnProperty(c)?r.marktype=i[0]:r.source=i[0])):r.type=i[0];var c;"!"===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)}var AO="var datum=event.item&&event.item.datum;";function CO(t,e,n){var r,a,o=t.events,u=t.update,c=t.encode,l=[];o||i("Signal update missing events specification."),s(o)&&(o=function(t,e,n){return lO=e||dO,hO=n||MO,EO(t.trim()).map(SO)}(o,e.isSubscope()?KC:tO)),(o=U(o).filter(function(t){return t.signal||t.scale?(l.push(t),0):1})).length&&l.push(o.length>1?{merge:o}:o[0]),null!=c&&(u&&i("Signal encode and update are mutually exclusive."),u="encode(item(),"+f(c)+")"),r=s(u)?$C(u,e,AO):null!=u.expr?$C(u.expr,e,AO):null!=u.value?u.value:null!=u.signal?{$expr:"_.value",$params:{value:e.signalRef(u.signal)}}:i("Invalid signal update specification."),a={target:n,update:r},t.force&&(a.options={force:!0}),l.forEach(function(t){e.addUpdate(B(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):oO(t,e)}}(t,e),a))})}function OO(t){return function(e,n,r){return WC(t,n,e||void 0,r)}}var zO=OO("aggregate"),DO=OO("axisticks"),NO=OO("bound"),RO=OO("collect"),TO=OO("compare"),PO=OO("datajoin"),LO=OO("encode"),qO=OO("expression"),UO=OO("facet"),FO=OO("field"),jO=OO("key"),IO=OO("legendentries"),$O=OO("load"),BO=OO("mark"),WO=OO("multiextent"),YO=OO("multivalues"),GO=OO("overlap"),HO=OO("params"),VO=OO("prefacet"),XO=OO("projection"),JO=OO("proxy"),ZO=OO("relay"),QO=OO("render"),KO=OO("scale"),tz=OO("sieve"),ez=OO("sortitems"),nz=OO("viewlayout"),rz=OO("values"),iz=0,az=["identity","ordinal","band","point","bin-linear","bin-ordinal","quantize","quantile","threshold","linear","pow","sqrt","log","sequential","time","utc"],oz=ot(az),uz=ot(az.slice(4,9)),sz=ot(az.slice(9)),fz=ot(az.slice(1,6));function cz(t){return fz.hasOwnProperty(t)}function lz(t){return uz.hasOwnProperty(t)}function hz(t){return"quantile"===t}function dz(t,e){var n,r=e.getScale(t.name).params;for(n in r.domain=gz(t.domain,t,e),null!=t.range&&(r.range=function t(e,n,r){var a=e.range,u=n.config.range;if(a.signal)return n.signalRef(a.signal);if(s(a)){if(u&&u.hasOwnProperty(a))return e=B({},e,{range:u[a]}),t(e,n,r);"width"===a?a=[0,{signal:"width"}]:"height"===a?a=cz(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:i("Unrecognized scale range value: "+f(a))}else{if(a.scheme)return r.scheme=pz(a.scheme,n),a.extent&&(r.schemeExtent=function(t,e){return t.signal?e.signalRef(t.signal):t.map(function(t){return pz(t,e)})}(a.extent,n)),void(a.count&&(r.schemeCount=pz(a.count,n)));if(a.step)return void(r.rangeStep=pz(a.step,n));if(cz(e.type)&&!o(a))return gz(a,e,n);o(a)||i("Unsupported range type: "+f(a))}return a.map(function(t){return pz(t,n)})}(t,e,r)),null!=t.interpolate&&function(t,e){e.interpolate=pz(t.type||t),null!=t.gamma&&(e.interpolateGamma=pz(t.gamma))}(t.interpolate,r),null!=t.nice&&function(t,e){e.nice=u(t)?{interval:pz(t.interval),step:pz(t.step)}:pz(t)}(t.nice,r),t)r.hasOwnProperty(n)||"name"===n||(r[n]=pz(t[n],e))}function pz(t,e){return u(t)?t.signal?e.signalRef(t.signal):i("Unsupported object: "+f(t)):t}function vz(t){i("Can not find data set: "+f(t))}function gz(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(o(t)?function(t,e,n){return t.map(function(t){return pz(t,n)})}:t.fields?function(t,e,n){var r=t.data,i=t.fields.reduce(function(t,e){return e=s(e)?{data:r,field:e}:o(e)||e.signal?function(t,e){var n="_:vega:_"+iz++,r=RO({});if(o(t))r.value={$ingest:t};else if(t.signal){var i="setdata("+f(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,tz({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t},[]);return(cz(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||vz(t.data),n.countsRef(e,t.field)}),i=e.add(zO({groupby:XC,ops:["sum"],fields:[e.fieldRef("count")],as:["count"],pulse:r})),a=e.add(RO({pulse:GC(i)})),o=e.add(rz({field:XC,sort:e.sortRef(mz(t.sort,!0)),pulse:GC(a)})),GC(o)}:hz(e.type)?function(t,e,n){var r=n.map(function(t){var n=e.getData(t.data);return n||vz(t.data),n.domainRef(e,t.field)});return GC(e.add(YO({values:r})))}:function(t,e,n){var r=n.map(function(t){var n=e.getData(t.data);return n||vz(t.data),n.extentRef(e,t.field)});return GC(e.add(WO({extents:r})))})(t,n,i)}:function(t,e,n){var r=n.getData(t.data);r||vz(t.data);return cz(e.type)?r.valuesRef(n,t.field,mz(t.sort,!1)):hz(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)})(t,e,n);null==e.domainMin&&null==e.domainMax||i("No scale domain defined for domainMin/domainMax to override.")}function mz(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field?i("Multiple domain scales can not sort by field."):e&&t.op&&"count"!==t.op&&i("Multiple domain scales support op count only."):i("No field provided for sort aggregate op: "+t.op):u(t)?t.field="key":t={field:"key"}),t}function yz(t,e,n){return o(t)?t.map(function(t){return yz(t,e,n)}):u(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:i("Unsupported parameter object: "+f(t)):t}var bz="top",_z="left",xz="right",wz="bottom",Mz="vertical",kz="start",Ez="end",Sz="index",Az="label",Cz="offset",Oz="perc",zz="perc2",Dz="size",Nz="value",Rz="guide-label",Tz="guide-title",Pz="group-title",Lz="symbol",qz="gradient",Uz="discrete",Fz=["size","shape","fill","stroke","strokeDash","opacity"],jz={name:1,interactive:1},Iz=ot(["rule"]),$z=ot(["group","image","rect"]);function Bz(t,e,n,r){var i=$C(t,e);return i.$fields.forEach(function(t){r[t]=1}),B(n,i.$params),i.$expr}function Wz(t,e,n,r){return function t(e,n,r,o){var u,c,l;if(e.signal)u="datum",l=Bz(e.signal,n,r,o);else if(e.group||e.parent){for(c=Math.max(1,e.level||1),u="item";c-- >0;)u+=".mark.group";e.parent?(l=e.parent,u+=".datum"):l=e.group}else e.datum?(u="datum",l=e.datum):i("Invalid field reference: "+f(e));e.signal||(s(l)?(o[l]=1,l=a(l).map(f).join("][")):l=t(l,n,r,o));return u+"["+l+"]"}(u(t)?t:{datum:t},e,n,r)}function Yz(t,e,n,r,i){var a,o,u,f=Gz(t.scale,n,r,i);return null!=t.range?(o=f+".range()",e=0===(a=+t.range)?o+"[0]":"($="+o+","+(1===a?"$[$.length-1]":"$[0]+"+a+"*($[$.length-1]-$[0])")+")"):(void 0!==e&&(e=f+"("+e+")"),t.band&&(u=function(t,e){if(!s(t))return-1;var n=e.scaleType(t);return"band"===n||"point"===n?1:0}(t.scale,n))&&(a=(o=f+".bandwidth")+"()"+(1===(a=+t.band)?"":"*"+a),u<0&&(a="("+o+"?"+a+":0)"),e=(e?e+"+":"")+a,t.extra&&(e="(datum.extra?"+f+"(datum.extra.value):"+e+")")),null==e&&(e="0")),e}function Gz(t,e,n,r){var i;if(s(t))i=GA+t,n.hasOwnProperty(i)||(n[i]=e.scaleRef(t)),i=f(i);else{for(i in e.scales)n[GA+i]=e.scaleRef(i);i=f(GA)+"+"+(t.signal?"("+Bz(t.signal,e,n,r)+")":Wz(t,e,n,r))}return"_["+i+"]"}function Hz(t,e,n,r){return u(t)?"("+Vz(null,t,e,n,r)+")":t}function Vz(t,e,n,r,i){if(null!=e.gradient)return function(t,e,n,r){return"this.gradient("+Gz(t.gradient,e,n,r)+","+f(t.start)+","+f(t.stop)+","+f(t.count)+")"}(e,n,r,i);var a=e.signal?Bz(e.signal,n,r,i):e.color?function(t,e,n,r){function i(t,i,a,o){return"this."+t+"("+[Vz(null,i,e,n,r),Vz(null,a,e,n,r),Vz(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,r,i):null!=e.field?Wz(e.field,n,r,i):void 0!==e.value?f(e.value):void 0;return null!=e.scale&&(a=Yz(e,a,n,r,i)),void 0===a&&(a=null),null!=e.exponent&&(a="Math.pow("+a+","+Hz(e.exponent,n,r,i)+")"),null!=e.mult&&(a+="*"+Hz(e.mult,n,r,i)),null!=e.offset&&(a+="+"+Hz(e.offset,n,r,i)),e.round&&(a="Math.round("+a+")"),a}function Xz(t,e,n){return t+"["+f(e)+"]="+n+";"}function Jz(t,e,n,r,i){var a="";return e.forEach(function(t){var e=Vz(0,t,n,r,i);a+=t.test?Bz(t.test,n,r,i)+"?"+e+":":e}),":"===E(a)&&(a+="null"),Xz("o",t,a)}function Zz(t,e,n,r){var i,a,u={},s="var o=item,datum=o.datum,$;";for(i in t)a=t[i],o(a)?s+=Jz(i,a,r,n,u):s+=Xz("o",i,Vz(0,a,r,n,u));return s+=function(t,e){var n="";return Iz[e]?n:(t.x2&&(t.x?($z[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?($z[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)}(t,e),{$expr:s+="return 1;",$fields:Object.keys(u),$output:Object.keys(t)}}var Qz="mark",Kz="frame",tD="scope",eD="axis",nD="axis-domain",rD="axis-grid",iD="axis-label",aD="axis-tick",oD="axis-title",uD="legend",sD="legend-band",fD="legend-entry",cD="legend-gradient",lD="legend-label",hD="legend-symbol",dD="legend-title",pD="title";function vD(t){return u(t)?B({},t):{value:t}}function gD(t,e,n,r){return null!=n?(u(n)&&!o(n)?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function mD(t,e,n){for(var r in e)n&&n.hasOwnProperty(r)||(t[r]=B(t[r]||{},e[r]));return t}function yD(t,e,n,r,i,a){var o,u;for(u in(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);for(a in o=n===Kz?i.group:n===Qz?B({},i.mark,i[e]):null)_D(a,t)||("fill"===a||"stroke"===a)&&(_D("fill",t)||_D("stroke",t))||(u[a]=bD(o[a]));return U(r).forEach(function(e){var n=i.style&&i.style[e];for(var r in n)_D(r,t)||(u[r]=bD(n[r]))}),(t=B({},t)).enter=B(u,t.enter),t}(t,e,n,r,i.config))o[u]=Zz(t[u],e,a,i);return a}function bD(t){return t&&t.signal?{signal:t.signal}:{value:t}}function _D(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}function xD(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:mD(a,o,jz)}}function wD(t,e,n){return rO(e[t],n[t])}function MD(t,e){return rO(t.direction,e)===Mz}function kD(t,e){return rO(t.gradientLength,e.gradientLength||e.gradientWidth)}function ED(t,e){return rO(t.gradientThickness,e.gradientThickness||e.gradientHeight)}function SD(t,e){return rO(t.columns,rO(e.columns,+MD(t,e.symbolDirection)))}function AD(t,e){var n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}var CD="group",OD="rect",zD="rule",DD="symbol",ND="text";function RD(t,e,n,r){var i,a,o,u,s,f,c={value:0},l=MD(t,n.gradientDirection),h=ED(t,n),d=kD(t,n);return l?(o=[0,1],u=[0,0],s=h,f=d):(o=[0,0],u=[1,0],s=d,f=h),gD(i={enter:a={opacity:c,x:c,y:c,width:vD(s),height:vD(f)},update:B({},a,{opacity:{value:1},fill:{gradient:e,start:o,stop:u}}),exit:{opacity:c}},"stroke",wD("gradientStrokeColor",t,n)),gD(i,"strokeWidth",wD("gradientStrokeWidth",t,n)),gD(i,"opacity",wD("gradientOpacity",t,n),"update"),xD(OD,cD,null,void 0,void 0,i,r)}function TD(t,e,n,r,i){var a,o,u,s,f,c,l={value:0},h=MD(t,n.gradientDirection),d=ED(t,n),p=kD(t,n),v="";return h?(u="y",f="y2",s="x",c="width",v="1-"):(u="x",f="x2",s="y",c="height"),(o={opacity:l,fill:{scale:e,field:Nz}})[u]={signal:v+"datum."+Oz,mult:p},o[s]=l,o[f]={signal:v+"datum."+zz,mult:p},o[c]=vD(d),gD(a={enter:o,update:B({},o,{opacity:{value:1}}),exit:{opacity:l}},"stroke",wD("gradientStrokeColor",t,n)),gD(a,"strokeWidth",wD("gradientStrokeWidth",t,n)),gD(a,"opacity",wD("gradientOpacity",t,n),"update"),xD(OD,sD,null,Nz,i,a,r)}var PD="datum."+Oz+'<=0?"left":datum.'+Oz+'>=1?"right":"center"',LD="datum."+Oz+'<=0?"bottom":datum.'+Oz+'>=1?"top":"middle"';function qD(t,e,n,r){var i,a,o,u,s,f={value:0},c=MD(t,e.gradientDirection),l=vD(ED(t,e)),h=kD(t,e),d=wD("labelOverlap",t,e),p="";return gD(i={enter:a={opacity:f},update:o={opacity:{value:1},text:{field:Az}},exit:{opacity:f}},"fill",wD("labelColor",t,e)),gD(i,"font",wD("labelFont",t,e)),gD(i,"fontSize",wD("labelFontSize",t,e)),gD(i,"fontWeight",wD("labelFontWeight",t,e)),gD(i,"fillOpacity",wD("labelOpacity",t,e)),gD(i,"limit",rO(t.labelLimit,e.gradientLabelLimit)),c?(a.align={value:"left"},a.baseline=o.baseline={signal:LD},u="y",s="x",p="1-"):(a.align=o.align={signal:PD},a.baseline={value:"top"},u="x",s="y"),a[u]=o[u]={signal:p+"datum."+Oz,mult:h},a[s]=o[s]=l,l.offset=rO(t.labelOffset,e.gradientLabelOffset)||0,t=xD(ND,lD,Rz,Nz,r,i,n),d&&(t.overlap={method:d,order:"datum."+Sz}),t}function UD(t,e,n,r,i,a,o,u){return{type:CD,name:n,role:t,style:e,from:r,interactive:i||!1,encode:a,marks:o,layout:u}}var FD={value:0};function jD(t,e,n,r,i){var a,o,u,s,f,c,l,h=n.entries,d=!(!h||!h.interactive),p=h?h.name:void 0,v=wD("clipHeight",t,e),g=wD("symbolOffset",t,e),m={data:"value"},y={},b=i+"?datum."+Cz+":datum."+Dz,_=v?vD(v):{field:Dz},x="datum."+Sz,w="max(1,"+i+")";return _.mult=.5,y={enter:a={opacity:FD,x:{signal:b,mult:.5,offset:g},y:_},update:o={opacity:{value:1},x:a.x,y:a.y},exit:{opacity:FD}},t.fill||(gD(y,"fill",e.symbolBaseFillColor),gD(y,"stroke",e.symbolBaseStrokeColor)),gD(y,"shape",wD("symbolType",t,e)),gD(y,"size",wD("symbolSize",t,e)),gD(y,"strokeWidth",wD("symbolStrokeWidth",t,e)),gD(y,"fill",wD("symbolFillColor",t,e)),gD(y,"stroke",wD("symbolStrokeColor",t,e)),gD(y,"opacity",wD("symbolOpacity",t,e),"update"),Fz.forEach(function(e){t[e]&&(o[e]=a[e]={scale:t[e],field:Nz})}),s=xD(DD,hD,null,Nz,m,y,n.symbols),v&&(s.clip=!0),(u=vD(g)).offset=wD("labelOffset",t,e),gD(y={enter:a={opacity:FD,x:{signal:b,offset:u},y:_},update:o={opacity:{value:1},text:{field:Az},x:a.x,y:a.y},exit:{opacity:FD}},"align",wD("labelAlign",t,e)),gD(y,"baseline",wD("labelBaseline",t,e)),gD(y,"fill",wD("labelColor",t,e)),gD(y,"font",wD("labelFont",t,e)),gD(y,"fontSize",wD("labelFontSize",t,e)),gD(y,"fontWeight",wD("labelFontWeight",t,e)),gD(y,"limit",wD("labelLimit",t,e)),gD(y,"fillOpacity",wD("labelOpacity",t,e)),f=xD(ND,lD,Rz,Nz,m,y,n.labels),y={enter:{noBound:{value:!0},width:FD,height:v?vD(v):FD,opacity:FD},exit:{opacity:FD},update:o={opacity:{value:1},row:{signal:null},column:{signal:null}}},MD(t,e.symbolDirection)?(c="ceil(item.mark.items.length/"+w+")",o.row.signal=x+"%"+c,o.column.signal="floor("+x+"/"+c+")",l={field:["row",x]}):(o.row.signal="floor("+x+"/"+w+")",o.column.signal=x+"%"+w,l={field:x}),o.column.signal=i+"?"+o.column.signal+":"+x,(t=UD(tD,null,p,r={facet:{data:r,name:"value",groupby:Sz}},d,mD(y,h,jz),[s,f])).sort=l,t}function ID(t,e){var n;return u(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+$D(t.path)+")":t.sphere&&(n="geoShape("+$D(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function $D(t){return u(t)&&t.signal?t.signal:f(t)}function BD(t){var e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")?t.type===CD?tD:e||Qz:e}function WD(t){return{marktype:t.type,name:t.name||void 0,role:t.role||BD(t),zindex:+t.zindex||void 0}}function YD(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function GD(t,e){var n=Ar(t.type);n||i("Unrecognized transform type: "+f(t.type));var r=WC(n.type.toLowerCase(),null,HD(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function HD(t,e,n){var r,i,a,o={};for(i=0,a=t.params.length;i<a;++i)o[(r=t.params[i]).name]=VD(r,e,n);return o}function VD(t,e,n){var r=t.type,a=e[t.name];return"index"===r?function(t,e,n){s(e.from)||i('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==a?"param"===r?function(t,e,n){var r=e[t.name];return t.array?(o(r)||i("Expected an array of sub-parameters. Instead: "+f(r)),r.map(function(e){return JD(t,e,n)})):JD(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!eO(a)?a.map(function(e){return XD(t,e,n)}):XD(t,a,n):void(t.required&&i("Missing required "+f(e.type)+" parameter: "+f(t.name)))}function XD(t,e,n){var r=t.type;if(eO(e))return ZD(r)?i("Expression references can not be signals."):QD(r)?n.fieldRef(e):KD(r)?n.compareRef(e):n.signalRef(e.signal);var a,o=t.expr||QD(r);return o&&((a=e)&&a.expr)?n.exprRef(e.expr,e.as):o&&function(t){return t&&t.field}(e)?VC(e.field,e.as):ZD(r)?$C(e,n):function(t){return"data"===t}(r)?GC(n.getData(e).values):QD(r)?VC(e):KD(r)?n.compareRef(e):e}function JD(t,e,n){var r,a,o,u,s;for(u=0,s=t.params.length;u<s;++u){for(o in(a=t.params[u]).key)if(a.key[o]!==e[o]){a=null;break}if(a)break}return a||i("Unsupported parameter: "+f(e)),r=B(HD(a,e,n),a.key),GC(n.add(HO(r)))}function ZD(t){return"expr"===t}function QD(t){return"field"===t}function KD(t){return"compare"===t}function tN(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:GC(e.getData(t.data).output)}function eN(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}eN.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=GC(e[r-1]),t.add(e[r]),"aggregate"===e[r].type&&(u=e[r]);return new eN(t,i,o,a,u)};var nN=eN.prototype;function rN(t){return s(t)?t:null}function iN(t,e,n){var r,i=QC(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 aN(t,e,n,r,i,a,o){var s,f,c=e[n]||(e[n]={}),l=function(t){return u(t)?(t.order===ZC?"-":"+")+QC(t.op,t.field):""}(a),h=rN(i);if(null!=h&&(t=e.scope,s=c[h+=l?"|"+l:""]),!s){var d=a?{field:XC,pulse:e.countsRef(t,i,a)}:{field:t.fieldRef(i),pulse:GC(e.output)};l&&(d.sort=t.sortRef(a)),f=t.add(WC(r,void 0,d)),o&&(e.index[i]=f),s=GC(f),null!=h&&(c[h]=s)}return s}function oN(t,e,n){var r,i=t.remove,a=t.insert,o=t.toggle,u=t.modify,s=t.values,f=e.add(YC());r=$C("if("+t.trigger+',modify("'+n+'",'+[a,i,o,u,s].map(function(t){return null==t?"null":t}).join(",")+"),0)",e),f.update=r.$expr,f.params=r.$params}function uN(t,e){var n,r,a,o,u,s,c,l,h,d,p,v,g,m=BD(t),y=t.type===CD,b=t.from&&t.from.facet,_=t.layout||m===tD||m===Kz,x=m===Qz||_||b,w=t.overlap;a=function(t,e,n){var r,a,o,u,s;return t?(r=t.facet)&&(e||i("Only group marks can be faceted."),null!=r.field?u=s=tN(r,n):(t.data?s=GC(n.getData(t.data).aggregate):((o=GD(B({type:"aggregate",groupby:U(r.groupby)},r.aggregate),n)).params.key=n.keyRef(r.groupby),o.params.pulse=tN(r,n),u=s=GC(n.add(o))),a=n.keyRef(r.groupby,!0))):u=GC(n.add(RO(null,[{}]))),u||(u=tN(t,n)),{key:a,pulse:u,parent:s}}(t.from,y,e),h=GC(r=e.add(PO({key:a.key||(t.key?VC(t.key):void 0),pulse:a.pulse,clean:!y}))),r=o=e.add(RO({pulse:h})),r=e.add(BO({markdef:WD(t),interactive:YD(t.interactive,e),clip:ID(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:GC(r)})),d=GC(r),(r=e.add(LO(yD(t.encode,t.type,m,t.style,e,{pulse:d})))).params.parent=e.encode(),t.transform&&t.transform.forEach(function(t){var n=GD(t,e);(n.metadata.generates||n.metadata.changes)&&i("Mark transforms should not generate new data."),n.params.pulse=GC(r),e.add(r=n)}),t.sort&&(r=e.add(ez({sort:e.compareRef(t.sort,!0),pulse:GC(r)}))),p=GC(r),(b||_)&&(v=GC(_=e.add(nz({layout:e.objectProperty(t.layout),legendMargin:e.config.legendMargin,mark:d,pulse:p})))),g=GC(u=e.add(NO({mark:d,pulse:v||p}))),y&&(x&&((n=e.operators).pop(),_&&n.pop()),e.pushState(p,v||g,h),b?function(t,e,n){var r,a,o,u,s=t.from.facet,c=s.name,l=tN(s,e);s.name||i("Facet must have a name: "+f(s)),s.data||i("Facet must reference a data set: "+f(s)),s.field?u=e.add(VO({field:e.fieldRef(s.field),pulse:l})):s.groupby?u=e.add(UO({key:e.keyRef(s.groupby),group:GC(e.proxy(n.parent)),pulse:l})):i("Facet must specify groupby or field: "+f(s)),a=(r=e.fork()).add(RO()),o=r.add(tz({pulse:GC(a)})),r.addData(c,new eN(r,a,a,o)),r.addSignal("parent",null),u.params.subflow={$subflow:bN(t,r).toRuntime()}}(t,e,a):x?function(t,e,n){var r=e.add(VO({pulse:n.pulse})),i=e.fork();i.add(tz()),i.addSignal("parent",null),r.params.subflow={$subflow:bN(t,i).toRuntime()}}(t,e,a):bN(t,e),e.popState(),x&&(_&&n.push(_),n.push(u))),w&&(g=function(t,e,n){var r,i=t.method,a=t.bound,o={method:eO(i)?n.signalRef(i.signal):i,pulse:e};t.order&&(o.sort=n.compareRef({field:t.order}));a&&(r=a.tolerance,o.boundTolerance=eO(r)?n.signalRef(r.signal):+r,o.boundScale=n.scaleRef(a.scale),o.boundOrient=a.orient);return GC(n.add(GO(o)))}(w,g,e)),s=e.add(QO({pulse:g})),c=e.add(tz({pulse:GC(s)},void 0,e.parent())),null!=t.name&&(l=t.name,e.addData(l,new eN(e,o,s,c)),t.on&&t.on.forEach(function(t){(t.insert||t.remove||t.toggle)&&i("Marks only support modify triggers."),oN(t,e,l)}))}function sN(t,e){var n,r,a,o,u,s,f,c,l,h=e.config.legend,d=t.encode||{},p=d.legend||{},v=p.name||void 0,g=p.interactive,m=p.style,y=Fz.reduce(function(e,n){return e||t[n]},0);return y||i("Missing valid scale for legend."),u=function(t,e){var n=t.type||Lz;t.type||1!==function(t){return Fz.reduce(function(e,n){return e+(t[n]?1:0)},0)}(t)||!t.fill&&!t.stroke||(n=function(t){return sz.hasOwnProperty(t)}(e)?qz:lz(e)?Uz:Lz);return n!==qz?n:lz(e)?Uz:qz}(t,e.scaleType(y)),s={orient:wD("orient",t,h),title:null!=t.title,type:u},f=GC(e.add(RO(null,[s]))),p=mD(function(t,e){var n={enter:{},update:{}};return gD(n,"offset",wD("offset",t,e)),gD(n,"padding",wD("padding",t,e)),gD(n,"titlePadding",wD("titlePadding",t,e)),gD(n,"fill",wD("fillColor",t,e)),gD(n,"stroke",wD("strokeColor",t,e)),gD(n,"strokeWidth",wD("strokeWidth",t,e)),gD(n,"cornerRadius",wD("cornerRadius",t,e)),gD(n,"strokeDash",e.strokeDash),n}(t,h),p,jz),n={enter:{x:{value:0},y:{value:0}}},c=GC(e.add(IO(a={type:u,scale:e.scaleRef(y),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),formatSpecifier:e.property(t.format)}))),u===qz?(o=[RD(t,y,h,d.gradient),qD(t,h,d.labels,c)],a.count=a.count||e.signalRef("max(2,2*floor(("+iO(kD(t,h))+")/100))")):u===Uz?o=[TD(t,y,h,d.gradient,c),qD(t,h,d.labels,c)]:(r=function(t,e){return{align:wD("gridAlign",t,e),center:{row:!0,column:!1},columns:SD(t,e),padding:{row:wD("rowPadding",t,e),column:wD("columnPadding",t,e)}}}(t,h),o=[jD(t,h,d,c,iO(r.columns))],a.size=function(t,e,n){var r,i,a;return a=AD("strokeWidth",n[0].encode),i=t.size?'scale("'+t.size+'",datum)':AD("size",n[0].encode),r=function(t,e,n){return AD("fontSize",t)||function(t,e,n){var r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,Rz),$C("max(ceil(sqrt("+iO(i)+")+"+iO(a)+"),"+iO(r)+")",e)}(t,e,o[0].marks)),o=[UD(fD,null,null,f,g,n,o,r)],s.title&&o.push(function(t,e,n,r){var i,a,o={value:0};return gD(i={enter:a={opacity:o,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},update:{opacity:{value:1},text:vD(t.title),x:a.x,y:a.y},exit:{opacity:o}},"align",wD("titleAlign",t,e)),gD(i,"baseline",wD("titleBaseline",t,e)),gD(i,"fill",wD("titleColor",t,e)),gD(i,"font",wD("titleFont",t,e)),gD(i,"fontSize",wD("titleFontSize",t,e)),gD(i,"fontWeight",wD("titleFontWeight",t,e)),gD(i,"limit",wD("titleLimit",t,e)),gD(i,"fillOpacity",wD("titleOpacity",t,e)),xD(ND,dD,Tz,null,r,i,n)}(t,h,d.title,f)),l=UD(uD,m,v,f,g,p,o),t.zindex&&(l.zindex=t.zindex),uN(l,e)}function fN(t,e,n){return'item.anchor==="'+kz+'"?'+t+':item.anchor==="'+Ez+'"?'+e+":"+n}nN.countsRef=function(t,e,n){var r,i,a,o=this.counts||(this.counts={}),u=rN(e);return null!=u&&(t=this.scope,r=o[u]),r?n&&n.field&&iN(t,r.agg.params,n):(a={groupby:t.fieldRef(e,"key"),pulse:GC(this.output)},n&&n.field&&iN(t,a,n),i=t.add(zO(a)),r=t.add(RO({pulse:GC(i)})),r={agg:i,ref:GC(r)},null!=u&&(o[u]=r)),r.ref},nN.tuplesRef=function(){return GC(this.values)},nN.extentRef=function(t,e){return aN(t,this,"extent","extent",e,!1)},nN.domainRef=function(t,e){return aN(t,this,"domain","values",e,!1)},nN.valuesRef=function(t,e,n){return aN(t,this,"vals","values",e,n||!0)},nN.lookupRef=function(t,e){return aN(t,this,"lookup","tupleindex",e,!1)},nN.indataRef=function(t,e){return aN(t,this,"indata","tupleindex",e,!0,!0)};var cN=fN(f(_z),f(xz),f("center")),lN=fN('+(item.orient==="'+xz+'")','+(item.orient!=="'+_z+'")',"0.5");function hN(t,e){t=s(t)?{text:t}:t;var n,r,i,a=e.config.title,o=B({},t.encode);return n={orient:wD("orient",t,a)},r=GC(e.add(RO(null,[n]))),o.name=t.name,o.interactive=t.interactive,i=function(t,e,n,r){var i,a,o,u,s,f={value:0},c=t.text,l=wD("orient",t,e),h=wD("anchor",t,e),d=l===_z||l===bz?-1:1,p=l===bz||l===wz,v={group:p?"width":"height"};u={field:v,mult:{signal:lN}},s=d<0?f:p?{field:{group:"height"}}:{field:{group:"width"}},i={enter:a={opacity:f},update:o={opacity:{value:1},text:vD(c),anchor:vD(h),orient:vD(l),extent:{field:v},align:{signal:cN}},exit:{opacity:f}},p?(o.x=u,o.y=s,a.angle=f,a.baseline={value:l===bz?wz:bz}):(o.x=s,o.y=u,a.angle={value:90*d},a.baseline={value:wz});return gD(i,"align",wD("align",t,e),"update"),gD(i,"angle",wD("angle",t,e)),gD(i,"baseline",wD("baseline",t,e)),gD(i,"fill",wD("color",t,e)),gD(i,"font",wD("font",t,e)),gD(i,"fontSize",wD("fontSize",t,e)),gD(i,"fontWeight",wD("fontWeight",t,e)),gD(i,"frame",wD("frame",t,e)),gD(i,"limit",wD("limit",t,e)),gD(i,"offset",wD("offset",t,e)||0),xD(ND,pD,t.style||Pz,null,r,i,n)}(t,a,o,r),t.zindex&&(i.zindex=t.zindex),uN(i,e)}function dN(t,e){var n=[];t.transform&&t.transform.forEach(function(t){n.push(GD(t,e))}),t.on&&t.on.forEach(function(n){oN(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=pN({$ingest:t.values,$format:t.format})):t.url?(f=nO(t.url)||nO(t.format)?{$load:GC(e.add(vN(e,t)))}:{$request:t.url,$format:t.format},s.push(f=pN(f))):t.source&&(f=r=U(t.source).map(function(t){return GC(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=pN()),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]=ZO({derive:c,pulse:a?r:r[0]}),(c||a)&&s.splice(1,0,pN()));f||s.push(pN());return s.push(tz({})),s}(t,e,n))}function pN(t){var e=RO({},t);return e.metadata={source:!0},e}function vN(t,e){return $O({url:t.property(e.url),format:t.objectProperty(e.format)})}function gN(t,e){return{scale:t.scale,range:e}}function mN(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function yN(t,e){var n,r,i,a,o,u,s=function(t,e){var n=e.config,r=t.orient,i=r===bz||r===wz?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?B({},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:!!wD("ticks",t,s),labels:!!wD("labels",t,s),grid:!!wD("grid",t,s),domain:!!wD("domain",t,s),title:!!rO(t.title,!1)},r=GC(e.add(RO({},[n]))),c=mD({update:{range:{signal:'abs(span(range("'+t.scale+'")))'},offset:vD(rO(t.offset,0)),position:vD(rO(t.position,0)),titlePadding:vD(wD("titlePadding",t,s)),minExtent:vD(wD("minExtent",t,s)),maxExtent:vD(wD("maxExtent",t,s))}},f.axis,jz),i=GC(e.add(DO({scale:e.scaleRef(t.scale),extra:e.property(wD("tickExtra",t,s)),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,d=t.orient,p=t.gridScale,v=d===_z||d===bz?1:-1,g=v*t.offset||0,m={value:0};return gD(i={enter:a={opacity:m},update:u={opacity:{value:1}},exit:o={opacity:m}},"stroke",wD("gridColor",t,e)),gD(i,"strokeDash",wD("gridDash",t,e)),gD(i,"strokeOpacity",wD("gridOpacity",t,e)),gD(i,"strokeWidth",wD("gridWidth",t,e)),s={scale:t.scale,field:Nz,band:wD("bandPosition",t,e),round:wD("tickRound",t,e),extra:wD("tickExtra",t,e),offset:wD("tickOffset",t,e)},d===bz||d===wz?(f="x",c="y",h="height"):(f="y",c="x",h="width"),l=c+"2",u[f]=a[f]=o[f]=s,p?(a[c]={scale:p,range:0,mult:v,offset:g},u[l]=a[l]={scale:p,range:1,mult:v,offset:g}):(a[c]={value:g},u[l]=a[l]={signal:h,mult:v,offset:g}),xD(zD,rD,null,Nz,r,i,n)}(t,s,f.grid,i)),n.ticks&&(a=wD("tickSize",t,s),u.push(function(t,e,n,r,i){var a,o,u,s,f,c,l=t.orient,h=l===_z||l===bz?-1:1,d={value:0};return gD(a={enter:o={opacity:d},update:s={opacity:{value:1}},exit:u={opacity:d}},"stroke",wD("tickColor",t,e)),gD(a,"strokeOpacity",wD("tickOpacity",t,e)),gD(a,"strokeWidth",wD("tickWidth",t,e)),(f=vD(i)).mult=h,c={scale:t.scale,field:Nz,band:wD("bandPosition",t,e),round:wD("tickRound",t,e),extra:wD("tickExtra",t,e),offset:wD("tickOffset",t,e)},l===bz||l===wz?(s.y=o.y=d,s.y2=o.y2=f,s.x=o.x=u.x=c):(s.x=o.x=d,s.x2=o.x2=f,s.y=o.y=u.y=c),xD(zD,aD,null,Nz,r,a,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,l,h,d,p=t.orient,v=p===_z||p===bz?-1:1,g=p===bz||p===wz,m=t.scale,y=iO(wD("labelFlush",t,e)),b=iO(wD("labelFlushOffset",t,e)),_=0===y||!!y,x=wD("labelAlign",t,e),w=wD("labelBaseline",t,e),M={value:0};return(u=vD(i)).mult=v,u.offset=vD(wD("labelPadding",t,e)||0),u.offset.mult=v,s={scale:m,field:Nz,band:.5,offset:wD("tickOffset",t,e)},g?(f=x||(_?mN(m,y,'"left"','"right"','"center"'):"center"),c=w||(p===bz?"bottom":"top"),l=!x):(f=x||(p===xz?"left":"right"),c=w||(_?mN(m,y,'"top"','"bottom"','"middle"'):"middle"),l=!w),l=l&&_&&b?mN(m,y,"-"+b,b,0):null,gD(a={enter:o={opacity:M,x:g?s:u,y:g?u:s},update:{opacity:{value:1},text:{field:Az},x:o.x,y:o.y},exit:{opacity:M,x:o.x,y:o.y}},g?"dx":"dy",l),gD(a,"align",f),gD(a,"baseline",c),gD(a,"angle",wD("labelAngle",t,e)),gD(a,"fill",wD("labelColor",t,e)),gD(a,"font",wD("labelFont",t,e)),gD(a,"fontSize",wD("labelFontSize",t,e)),gD(a,"fontWeight",wD("labelFontWeight",t,e)),gD(a,"limit",wD("labelLimit",t,e)),gD(a,"fillOpacity",wD("labelOpacity",t,e)),h=wD("labelBound",t,e),d=wD("labelOverlap",t,e),t=xD(ND,iD,Rz,Nz,r,a,n),(d||h)&&(t.overlap={method:d,order:"datum.index",bound:h?{scale:m,orient:p,tolerance:h}:null}),t}(t,s,f.labels,i,a))),n.domain&&u.push(function(t,e,n,r){var i,a,o,u,s,f,c=t.orient,l={value:0};return gD(i={enter:a={opacity:l},update:o={opacity:{value:1}},exit:{opacity:l}},"stroke",wD("domainColor",t,e)),gD(i,"strokeWidth",wD("domainWidth",t,e)),gD(i,"strokeOpacity",wD("domainOpacity",t,e)),c===bz||c===wz?(u="x",f="y"):(u="y",f="x"),s=u+"2",a[f]=l,o[u]=a[u]=gN(t,0),o[s]=a[s]=gN(t,1),xD(zD,nD,null,null,r,i,n)}(t,s,f.domain,r)),n.title&&u.push(function(t,e,n,r){var i,a,o,u,s=t.orient,f=s===_z||s===bz?-1:1,c=s===bz||s===wz,l={value:0};return i={enter:a={opacity:l},update:o={opacity:{value:1},text:vD(t.title)},exit:{opacity:l}},u={scale:t.scale,range:.5},c?(o.x=u,a.angle={value:0},a.baseline={value:s===bz?"bottom":"top"}):(o.y=u,a.angle={value:90*f},a.baseline={value:"bottom"}),gD(i,"align",wD("titleAlign",t,e)),gD(i,"angle",wD("titleAngle",t,e)),gD(i,"baseline",wD("titleBaseline",t,e)),gD(i,"fill",wD("titleColor",t,e)),gD(i,"font",wD("titleFont",t,e)),gD(i,"fontSize",wD("titleFontSize",t,e)),gD(i,"fontWeight",wD("titleFontWeight",t,e)),gD(i,"limit",wD("titleLimit",t,e)),gD(i,"fillOpacity",wD("titleOpacity",t,e)),!gD(i,"x",wD("titleX",t,e),"update")&&c&&!_D("x",n)&&(i.enter.auto={value:!0}),!gD(i,"y",wD("titleY",t,e),"update")&&!c&&!_D("y",n)&&(i.enter.auto={value:!0}),xD(ND,oD,Tz,null,r,i,n)}(t,s,f.title,r)),o=UD(eD,d,l,r,h,c,u),t.zindex&&(o.zindex=t.zindex),uN(o,e)}function bN(t,e,n){var r=U(t.signals),a=U(t.scales);return n||r.forEach(function(t){uS(t,e)}),U(t.projections).forEach(function(t){!function(t,e){var n={};for(var r in t)"name"!==r&&(n[r]=yz(t[r],r,e));e.addProjection(t.name,n)}(t,e)}),a.forEach(function(t){!function(t,e){var n=t.type||"linear";oz.hasOwnProperty(n)||i("Unrecognized scale type: "+f(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e)}),U(t.data).forEach(function(t){dN(t,e)}),a.forEach(function(t){dz(t,e)}),r.forEach(function(t){!function(t,e){var n=e.getSignal(t.name),r=t.update;t.init&&(r?i("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=$C(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach(function(t){CO(t,e,n.id)})}(t,e)}),U(t.axes).forEach(function(t){yN(t,e)}),U(t.marks).forEach(function(t){uN(t,e)}),U(t.legends).forEach(function(t){sN(t,e)}),t.title&&hN(t.title,e),e.parseLambdas(),e}var _N=ot(["width","height","padding","autosize"]);function xN(t,e){var n,r,i,a,o,s=e.config;return e.background=t.background||s.background,e.eventConfig=s.events,o=GC(e.root=e.add(YC())),e.addSignal("width",t.width||0),e.addSignal("height",t.height||0),e.addSignal("padding",function(t,e){return u(t=t||e.padding)?{top:QE(t.top),bottom:QE(t.bottom),left:QE(t.left),right:QE(t.right)}:{top:n=QE(t),bottom:n,left:n,right:n};var n}(t.padding,s)),e.addSignal("autosize",function(t,e){return u(t=t||e.autosize)?t:{type:t=t||"pad"}}(t.autosize,s)),U(t.signals).forEach(function(t){_N[t.name]||uS(t,e)}),r=e.add(RO()),i=mD({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t.encode),i=e.add(LO(yD(i,CD,Kz,t.style,e,{pulse:GC(r)}))),a=e.add(nz({layout:e.objectProperty(t.layout),legendMargin:s.legendMargin,autosize:e.signalRef("autosize"),mark:o,pulse:GC(i)})),e.operators.pop(),e.pushState(GC(i),GC(a),null),bN(t,e,!0),e.operators.push(a),n=e.add(NO({mark:o,pulse:GC(a)})),n=e.add(QO({pulse:GC(n)})),n=e.add(tz({pulse:GC(n)})),e.addData("root",new eN(e,r,r,n)),e}function wN(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 MN(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}var kN=wN.prototype=MN.prototype;function EN(t){return(o(t)?function(t){for(var e,n="[",r=0,i=t.length;r<i;++r)e=t[r],n+=(r>0?",":"")+(u(e)?e.signal||EN(e):f(e));return n+"]"}:function(t){var e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+f(e)+":"+(u(n)?n.signal||EN(n):f(n));return r+"}"})(t)}function SN(t){var e={padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:zN},area:{fill:zN},image:null,line:{stroke:zN,strokeWidth:ON},path:{stroke:zN},rect:{fill:zN},rule:{stroke:DN},shape:{stroke:zN},symbol:{fill:zN,size:64},text:{fill:DN,font:AN,fontSize:11},style:{"guide-label":{fill:DN,font:AN,fontSize:10},"guide-title":{fill:DN,font:AN,fontSize:11,fontWeight:"bold"},"group-title":{fill:DN,font:AN,fontSize:13,fontWeight:"bold"},point:{size:CN,strokeWidth:ON,shape:"circle"},circle:{size:CN,strokeWidth:ON},square:{size:CN,strokeWidth:ON,shape:"square"},cell:{fill:"transparent",stroke:RN}},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:NN,grid:!1,gridWidth:1,gridColor:RN,labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:NN,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titleAlign:"center",titlePadding:4},axisBand:{tickOffset:-1},legend:{orient:"right",offset:18,padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:RN,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:NN,titleAlign:"left",titleBaseline:"top",titleLimit:180,titlePadding:5},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,i;if(t)for(n in t)if("style"===n)for(n in i=e.style||(e.style={}),t.style)i[n]=B(i[n]||{},t.style[n]);else r=t[n],e[n]=u(r)&&!o(r)?B(u(e[n])?e[n]:{},r):r}),e}kN.fork=function(){return new MN(this)},kN.isSubscope=function(){return this._subid>0},kN.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},kN.id=function(){return(this._subid?this._subid+":":0)+this._id++},kN.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},kN.proxy=function(t){var e=t instanceof BC?GC(t):t;return this.add(JO({value:e}))},kN.addStream=function(t){return this.streams.push(t),t.id=this.id(),t},kN.addUpdate=function(t){return this.updates.push(t),t},kN.finish=function(){var t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){var r;t&&((r=t.data||(t.data={}))[e]||(r[e]=[])).push(n)}for(t in this.data)for(var r in n((e=this.data[t]).input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values"),e.index)n(e.index[r],t,"index:"+r);return this},kN.pushState=function(t,e,n){this._encode.push(GC(this.add(tz({pulse:t})))),this._parent.push(e),this._lookup.push(n?GC(this.proxy(n)):null),this._markpath.push(-1)},kN.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},kN.parent=function(){return E(this._parent)},kN.encode=function(){return E(this._encode)},kN.lookup=function(){return E(this._lookup)},kN.markpath=function(){var t=this._markpath;return++t[t.length-1]},kN.fieldRef=function(t,e){if(s(t))return VC(t,e);t.signal||i("Unsupported field reference: "+f(t));var n,r=t.signal,a=this.field[r];return a||(n={name:this.signalRef(r)},e&&(n.as=e),this.field[r]=a=GC(this.add(FO(n)))),a},kN.compareRef=function(t,e){function n(t){return eO(t)?(i=!0,r.signalRef(t.signal)):t}var r=this,i=!1,a=U(t.field).map(n),o=U(t.order).map(n);return e&&a.push(HC),i?GC(this.add(TO({fields:a,orders:o}))):JC(a,o)},kN.keyRef=function(t,e){var n=this.signals,r=!1;return t=U(t).map(function(t){return eO(t)?(r=!0,GC(n[t.signal])):t}),r?GC(this.add(jO({fields:t,flat:e}))):function(t,e){var n={$key:t};return e&&(n.$flat=!0),n}(t,e)},kN.sortRef=function(t){if(!t)return t;var e=[QC(t.op,t.field),HC],n=t.order||"ascending";return n.signal?GC(this.add(TO({fields:e,orders:[n=this.signalRef(n.signal),n]}))):JC(e,[n,n])},kN.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]},kN.addSignal=function(t,e){this.signals.hasOwnProperty(t)&&i("Duplicate signal name: "+f(t));var n=e instanceof BC?e:this.add(YC(e));return this.signals[t]=n},kN.getSignal=function(t){return this.signals[t]||i("Unrecognized signal name: "+f(t)),this.signals[t]},kN.signalRef=function(t){return this.signals[t]?GC(this.signals[t]):(this.lambdas.hasOwnProperty(t)||(this.lambdas[t]=this.add(YC(null))),GC(this.lambdas[t]))},kN.parseLambdas=function(){for(var t=Object.keys(this.lambdas),e=0,n=t.length;e<n;++e){var r=t[e],i=$C(r,this),a=this.lambdas[r];a.params=i.$params,a.update=i.$expr}},kN.property=function(t){return t&&t.signal?this.signalRef(t.signal):t},kN.objectProperty=function(t){return t&&u(t)?this.signalRef(t.signal||EN(t)):t},kN.exprRef=function(t,e){var n={expr:$C(t,this)};return e&&(n.expr.$name=e),GC(this.add(qO(n)))},kN.addBinding=function(t,e){this.bindings||i("Nested signals do not support binding: "+f(t)),this.bindings.push(B({signal:t},e))},kN.addScaleProj=function(t,e){this.scales.hasOwnProperty(t)&&i("Duplicate scale or projection name: "+f(t)),this.scales[t]=this.add(e)},kN.addScale=function(t,e){this.addScaleProj(t,KO(e))},kN.addProjection=function(t,e){this.addScaleProj(t,XO(e))},kN.getScale=function(t){return this.scales[t]||i("Unrecognized scale name: "+f(t)),this.scales[t]},kN.projectionRef=kN.scaleRef=function(t){return GC(this.getScale(t))},kN.projectionType=kN.scaleType=function(t){return this.getScale(t).params.type},kN.addData=function(t,e){return this.data.hasOwnProperty(t)&&i("Duplicate data set name: "+f(t)),this.data[t]=e},kN.getData=function(t){return this.data[t]||i("Undefined data set name: "+f(t)),this.data[t]},kN.addDataPipeline=function(t,e){return this.data.hasOwnProperty(t)&&i("Duplicate data set name: "+f(t)),this.addData(t,eN.fromEntries(this,e))};var AN="sans-serif",CN=30,ON=2,zN="#4c78a8",DN="#000",NN="#888",RN="#ddd";function TN(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 PN(t,e){return TN(["event"],t,e)}function LN(t,e){return TN(["item","_"],t,e)}function qN(t,e,n){var r,i;for(r in n=n||{},t)i=t[r],n[r]=o(i)?i.map(function(t){return UN(t,e,n)}):UN(i,e,n);return n}function UN(t,e,n){if(!t||!u(t))return t;for(var r,i=0,a=FN.length;i<a;++i)if(r=FN[i],t.hasOwnProperty(r.key))return r.parse(t,e,n);return t}var FN=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||i("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]=Q(t.$key,t.$flat))}},{key:"$expr",parse:function(t,n,r){t.$params&&qN(t.$params,n,r);var i="e:"+t.$expr+"_"+t.$name;return n.fn[i]||(n.fn[i]=e(function(t,e){return TN(["datum","_"],t,e)}(t.$expr,n),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]=c(t.$field,t.$name))}},{key:"$encode",parse:function(t,n){var r,i,a=t.$encode,o={};for(r in a)i=a[r],o[r]=e(LN(i.$expr,n),i.$fields),o[r].output=i.$output;return o}},{key:"$compare",parse:function(t,e){var n="c:"+t.$compare+"_"+t.$order,r=U(t.$compare).map(function(t){return t&&t.$tupleid?dt:t});return e.fn[n]||(e.fn[n]=j(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=BN(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 dt}}];function jN(t){return(t+"").toLowerCase()}function IN(t,e){"operator"!==jN(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?function(t,e){return TN(["_"],t,e)}(t.update,e):null)}function $N(t,e){var n=u(n=t.source)?n.$ref:n,r=e.get(n),a=null,o=t.update,s=void 0;r||i("Source not defined: "+t.source),a=t.target&&t.target.$expr?PN(t.target.$expr,e):e.get(t.target),o&&o.$expr&&(o.$params&&(s=qN(o.$params,e)),o=function(t,e){return TN(["_","event"],t,e)}(o.$expr,e)),e.update(t,r,a,o,s)}function BN(t,e){var n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),n.forEach(function(t){IN(t,e)}),n.forEach(function(t){!function(t,e){if(t.params){var n=e.get(t.id);n||i("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(qN(t.params,e),t.react,t.initonly))}}(t,e)}),(t.streams||[]).forEach(function(t){!function(t,e){var n,r=null!=t.filter?PN(t.filter,e):void 0,a=null!=t.stream?e.get(t.stream):void 0;t.source?a=e.events(t.source,t.type,r):t.merge&&(a=(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)),a=a.between(n[0],n[1])),t.filter&&(a=a.filter(r)),null!=t.throttle&&(a=a.throttle(+t.throttle)),null!=t.debounce&&(a=a.debounce(+t.debounce)),null==a&&i("Invalid stream definition: "+JSON.stringify(t)),t.consume&&a.consume(!0),e.stream(t,a)}(t,e)}),(t.updates||[]).forEach(function(t){$N(t,e)}),e.resolve()}var WN={skip:!0};function YN(t,e,n){return new GN(t,e,n)}function GN(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 HN(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)}GN.prototype=HN.prototype={fork:function(){var t=new HN(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),"collect"===jN(t.type)&&(n=t.value)&&(n.$ingest?i.ingest(e,n.$ingest,n.$format):n.$load?r.get(n.$load.$ref).target=e: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){this.add(t,this.dataflow.add(t.value,e))},transform:function(t,e){this.add(t,this.dataflow.add(this.transforms[jN(e)]))},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],WN)}),Object.keys(r||{}).forEach(function(t){n.pulse(e.data[t].input,n.changeset().remove(g).insert(r[t]))}),(t.subcontext||[]).forEach(function(t,n){var r=e.subcontext[n];r&&r.setState(t)})}};var VN="width",XN="height",JN="padding",ZN={skip:!0};function QN(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===JN?r.left+r.right:0)}function KN(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===JN?r.top+r.bottom:0)}function tR(t,e){return e.modified&&o(e.input.value)&&t.indexOf("_:vega:_")}function eR(t,e){return!("parent"===t||e instanceof Sr.proxy)}function nR(t,e,n,r){var i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":o(t)?rR(t):u(t)&&!X(t)?(e=t,Object.keys(e).map(function(t){var n=e[t];return t+": "+(o(n)?rR(n):iR(n))}).join("\n")):t+"";var e}(r))}function rR(t){return"["+t.map(iR).join(", ")+"]"}function iR(t){return o(t)?"[…]":u(t)&&!X(t)?"{…}":t}function aR(t,e){e=e||{},xr.call(this),this.loader(e.loader||this._loader),this.logLevel(e.logLevel||0),this._el=null,this._renderType=e.renderer||wc.Canvas,this._scenegraph=new Ef;var n=this._scenegraph.root;this._renderer=null,this._tooltip=e.tooltip||nR,this._redraw=!0,this._handler=(new jf).scene(n),this._preventDefault=!1,this._timers=[],this._eventListeners=[],this._resizeListeners=[];var r,i,a=function(t,e,n){return BN(e,YN(t,Sr,n||RC))}(this,t,e.functions);this._runtime=a,this._signals=a.signals,this._bind=(t.bindings||[]).map(function(t){return{state:null,param:B({},t)}}),a.root&&a.root.set(n),n.source=a.data.root.input,this.pulse(a.data.root.input,this.changeset().insert(n.items)),this._background=a.background||null,this._eventConfig=(r=a.eventConfig,(i=(r=B({},r)).defaults)&&(o(i.prevent)&&(i.prevent=ot(i.prevent)),o(i.allow)&&(i.allow=ot(i.allow))),r),this._width=this.width(),this._height=this.height(),this._viewWidth=QN(this,this._width),this._viewHeight=KN(this,this._height),this._origin=[0,0],this._resize=0,this._autosize=1,function(t){var e=t._signals,n=e[VN],r=e[XN],i=e[JN];function a(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,function(e){t._width=e.size,t._viewWidth=QN(t,e.size),a()},{size:n}),t._resizeHeight=t.add(null,function(e){t._height=e.size,t._viewHeight=KN(t,e.size),a()},{size:r});var o=t.add(null,a,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,o.rank=i.rank+1}(this),wE(this)}var oR=H(aR,xr);function uR(t,e){return t._signals.hasOwnProperty(e)?t._signals[e]:i("Unrecognized signal name: "+f(e))}function sR(t,e){var n=(t._targets||[]).filter(function(t){var n=t._update;return n&&n.handler===e});return n.length?n[0]:null}function fR(t,e,n,r){var i=sR(n,r);return i||((i=XE(this,function(){r(e,n.value)})).handler=r,t.on(n,null,i)),t}function cR(t,e,n){var r=sR(e,n);return r&&e._targets.remove(r),t}oR.run=function(t){if(xr.prototype.run.call(this,t),this._pending)this.resize();else if(this._redraw||this._resize)try{this.render()}catch(t){this.error(t)}return this},oR.render=function(){var t,e,n,r;return this._renderer&&(this._resize&&(this._resize=0,e=AE(t=this),n=EE(t),r=SE(t),t._renderer.background(t._background),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach(function(e){try{e(n,r)}catch(e){t.error(e)}})),this._renderer.render(this._scenegraph.root)),this._redraw=!1,this},oR.dirty=function(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},oR.container=function(){return this._el},oR.scenegraph=function(){return this._scenegraph},oR.origin=function(){return this._origin.slice()},oR.signal=function(t,e,n){var r=uR(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},oR.background=function(t){return arguments.length?(this._background=t,this._resize=1,this):this._background},oR.width=function(t){return arguments.length?this.signal("width",t):this.signal("width")},oR.height=function(t){return arguments.length?this.signal("height",t):this.signal("height")},oR.padding=function(t){return arguments.length?this.signal("padding",t):this.signal("padding")},oR.autosize=function(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},oR.renderer=function(t){return arguments.length?(kc(t)||i("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},oR.tooltip=function(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},oR.loader=function(t){return arguments.length?(t!==this._loader&&(xr.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},oR.resize=function(){return this._autosize=1,this.touch(uR(this,"autosize"))},oR._resetRenderer=function(){this._renderer&&(this._renderer=null,this.initialize(this._el))},oR._resizeView=function(t,e,n,r,i,a){this.runAfter(function(o){var u=0;o._autosize=0,o.width()!==n&&(u=1,o.signal(VN,n,ZN),o._resizeWidth.skip(!0)),o.height()!==r&&(u=1,o.signal(XN,r,ZN),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()})},!1,1)},oR.addEventListener=function(t,e,n){var r=e;return n&&!1===n.trap||((r=XE(this,e)).raw=e),this._handler.on(t,r),this},oR.removeEventListener=function(t,e){for(var n,r,i=this._handler.handlers(t),a=i.length;--a>=0;)if(r=i[a].type,n=i[a].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},oR.addResizeListener=function(t){var e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},oR.removeResizeListener=function(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},oR.addSignalListener=function(t,e){return fR(this,t,uR(this,t),e)},oR.removeSignalListener=function(t,e){return cR(this,uR(this,t),e)},oR.addDataListener=function(t,e){return fR(this,t,ME(this,t).values,e)},oR.removeDataListener=function(t,e){return cR(this,ME(this,t).values,e)},oR.preventDefault=function(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},oR.timer=function(t,e){this._timers.push(function(t,e,n){var r=new Ow,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?Aw():+n,r.restart(function a(o){o+=i,r.restart(a,i+=e,n),t(o)},e,n),r)}(function(e){t({timestamp:Date.now(),elapsed:e})},e))},oR.events=function(t,e,n){var r,i=this,a=new zt(n),o=function(n,r){t===OE&&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(CE(i,n,r))}catch(t){i.error(t)}finally{i.run()}};if(t===zE)i.timer(o,e);else if(t===OE)i.addEventListener(e,o,NE);else if(t===DE?"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&(r=document.querySelectorAll(t)),r){for(var u=0,s=r.length;u<s;++u)r[u].addEventListener(e,o);i._eventListeners.push({type:e,sources:r,handler:o})}else i.warn("Can not resolve event source: "+t);return a},oR.finalize=function(){var t,e,n,r=this._tooltip,i=this._timers,a=this._eventListeners;for(t=i.length;--t>=0;)i[t].stop();for(t=a.length;--t>=0;)for(e=(n=a[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},oR.hover=function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",RE),TE,PE(t)),this.on(this.events("view","mouseout",RE),TE,PE(e)),this},oR.data=function(t){return ME(this,t).values.value},oR.change=kE,oR.insert=function(t,e){return kE.call(this,t,_t().insert(e))},oR.remove=function(t,e){return kE.call(this,t,_t().remove(e))},oR.scale=function(t){var e=this._runtime.scales;return e.hasOwnProperty(t)||i("Unrecognized scale or projection: "+t),e[t].value},oR.initialize=function(t,e){var n,r,i=this,a=i._renderType,o=kc(a);return t=i._el=t?JE(i,t):null,o||i.error("Unrecognized renderer type: "+a),n=o.handler||jf,r=t?o.renderer:o.headless,i._renderer=r?VE(i,i._renderer,t,r):null,i._handler=function(t,e,n,r){var i=new r(t.loader(),XE(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,AE(t),t);return e&&e.handlers().forEach(function(t){i.on(t.type,t.handler)}),i}(i,i._handler,t,n),i._redraw=!0,t&&(e=e?JE(i,e):t.appendChild(LE("div",{class:"vega-bindings"})),i._bind.forEach(function(t){t.param.element&&(t.element=JE(i,t.param.element))}),i._bind.forEach(function(t){IE(i,t.element||e,t)})),i},oR.toImageURL=function(t,e){return t!==wc.Canvas&&t!==wc.SVG&&t!==wc.PNG?Promise.reject("Unrecognized image type: "+t):ZE(this,t,e).then(function(e){return t===wc.SVG?(n=e.svg(),r=new Blob([n],{type:"image/svg+xml"}),window.URL.createObjectURL(r)):e.canvas().toDataURL("image/png");var n,r})},oR.toCanvas=function(t){return ZE(this,wc.Canvas,t).then(function(t){return t.canvas()})},oR.toSVG=function(t){return ZE(this,wc.SVG,t).then(function(t){return t.svg()})},oR.getState=function(t){return this._runtime.getState(t||{data:tR,signals:eR,recurse:!0})},oR.setState=function(t){var e=this;return e.runAfter(function(){e._trigger=!1,e._runtime.setState(t),e.run().runAfter(function(){e._trigger=!0})}),this},B(Sr,_a,fl,dm,Jx,Xw,lk,Qk,hE,_E),t.version="4.4.0",t.Dataflow=xr,t.EventStream=zt,t.Parameters=wt,t.Pulse=sr,t.MultiPulse=dr,t.Operator=St,t.Transform=kr,t.changeset=_t,t.ingest=vt,t.isTuple=ht,t.definition=Ar,t.transform=Cr,t.transforms=Sr,t.tupleid=dt,t.scale=Tp,t.scheme=Mg,t.schemeDiscretized=function(t,e,n){return arguments.length>1?(_g[t]=e,xg[t]=n||rd(E(e)),this):_g.hasOwnProperty(t)?_g[t]:void 0},t.interpolate=jp,t.interpolateRange=qp,t.timeInterval=Sg,t.utcInterval=Ag,t.projection=jx,t.View=aR,t.parse=function(t,e){return u(t)||i("Input Vega specification must be an object."),xN(t,new wN(SN([e,t.config]))).toRuntime()},t.expressionFunction=UC,t.formatLocale=up,t.timeFormatLocale=nr,t.runtime=BN,t.runtimeContext=YN,t.bin=qr,t.bootstrapCI=Kr,t.quartiles=ti,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?(a=i-(r=t||0),o):r},o.max=function(t){return arguments.length?(a=(i=t||0)-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=ni,t.randomMixture=ri,t.randomNormal=ei,t.randomUniform=ii,t.accessor=e,t.accessorName=n,t.accessorFields=r,t.id=h,t.identity=d,t.zero=p,t.one=v,t.truthy=g,t.falsy=m,t.logger=k,t.None=b,t.Error=_,t.Warn=x,t.Info=w,t.Debug=M,t.panLinear=D,t.panLog=N,t.panPow=R,t.zoomLinear=P,t.zoomLog=L,t.zoomPow=q,t.array=U,t.compare=j,t.constant=I,t.debounce=$,t.error=i,t.extend=B,t.extentIndex=W,t.fastmap=G,t.field=c,t.inherits=H,t.isArray=o,t.isBoolean=V,t.isDate=X,t.isFunction=F,t.isNumber=J,t.isObject=u,t.isRegExp=Z,t.isString=s,t.key=Q,t.merge=K,t.pad=et,t.peek=E,t.repeat=tt,t.splitAccessPath=a,t.stringValue=f,t.toBoolean=nt,t.toDate=it,t.toNumber=S,t.toString=at,t.toSet=ot,t.truncate=ut,t.visitArray=st,t.loader=Pt,t.read=rr,t.inferType=Yt,t.inferTypes=Gt,t.typeParsers=$t,t.format=ce,t.formats=le,t.Bounds=eo,t.Gradient=ao,t.GroupItem=uo,t.ResourceLoader=co,t.Item=oo,t.Scenegraph=Ef,t.Handler=Tf,t.Renderer=qf,t.CanvasHandler=jf,t.CanvasRenderer=Yf,t.SVGHandler=Xf,t.SVGRenderer=ic,t.SVGStringRenderer=gc,t.RenderType=wc,t.renderModule=kc,t.Marks=yf,t.boundClip=Sc,t.boundContext=ds,t.boundStroke=ss,t.boundItem=bf,t.boundMark=xf,t.pathCurves=Eu,t.pathSymbols=ju,t.pathRectangle=Hu,t.pathTrail=Xu,t.pathParse=Cu,t.pathRender=Pu,t.point=Rf,t.domCreate=Cf,t.domFind=Of,t.domChild=zf,t.domClear=Df,t.openTag=Qf,t.closeTag=Kf,t.font=df,t.fontFamily=hf,t.fontSize=ff,t.textMetrics=rf,t.resetSVGClipId=function(){Ls=1},t.sceneEqual=Cc,t.pathEqual=Oc,t.sceneToJSON=Mf,t.sceneFromJSON=kf,t.sceneZOrder=xs,t.sceneVisit=ws,t.scenePickVisit=Ms,Object.defineProperty(t,"__esModule",{value:!0})});