!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function r(n){return n.length}function i(n){for(var t=1;n*t%1;)t*=10;return t}function u(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(e){n.prototype=t}}function o(){}function a(n){return ro+n in this}function c(n){return n=ro+n,n in this&&delete this[n]}function l(){var n=[];return this.forEach(function(t){n.push(t)}),n}function f(){var n=0;for(var t in this)t.charCodeAt(0)===io&&++n;return n}function s(){for(var n in this)if(n.charCodeAt(0)===io)return!1;return!0}function h(){}function p(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function g(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=uo.length;r>e;++e){var i=uo[e]+t;if(i in n)return i}}function v(){}function d(){}function y(n){function t(){for(var t,r=e,i=-1,u=r.length;++ie;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function U(n){return ao(n,go),n}function j(n){var t,e;return function(r,i,u){var o,a=n[u].update,c=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t0&&(n=n.substring(0,a));var l=yo.get(n);return l&&(n=l,c=Y),a?t?i:r:t?v:u}function O(n,t){return function(e){var r=Zu.event;Zu.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{Zu.event=r}}}function Y(n,t){var e=O(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function I(){var n=".dragsuppress-"+ ++xo,t="click"+n,e=Zu.select(Wu).on("touchmove"+n,m).on("dragstart"+n,m).on("selectstart"+n,m);if(mo){var r=Bu.style,i=r[mo];r[mo]="none"}return function(u){function o(){e.on(t,null)}e.on(n,null),mo&&(r[mo]=i),u&&(e.on(t,function(){m(),o()},!0),setTimeout(o,0))}}function Z(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>Mo&&(Wu.scrollX||Wu.scrollY)){e=Zu.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=e[0][0].getScreenCTM();Mo=!(i.f||i.e),e.remove()}return Mo?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var u=n.getBoundingClientRect();return[t.clientX-u.left-n.clientLeft,t.clientY-u.top-n.clientTop]}function V(){return Zu.event.changedTouches[0].identifier}function X(){return Zu.event.target}function $(){return Wu}function B(n){return n>0?1:0>n?-1:0}function W(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function J(n){return n>1?0:-1>n?_o:Math.acos(n)}function G(n){return n>1?wo:-1>n?-wo:Math.asin(n)}function K(n){return((n=Math.exp(n))-1/n)/2}function Q(n){return((n=Math.exp(n))+1/n)/2}function nn(n){return((n=Math.exp(2*n))-1)/(n+1)}function tn(n){return(n=Math.sin(n/2))*n}function en(){}function rn(n,t,e){return this instanceof rn?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof rn?new rn(n.h,n.s,n.l):mn(""+n,xn,rn):new rn(n,t,e)}function un(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new gn(i(n+120),i(n),i(n-120))}function on(n,t,e){return this instanceof on?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof on?new on(n.h,n.c,n.l):n instanceof cn?fn(n.l,n.a,n.b):fn((n=Mn((n=Zu.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new on(n,t,e)}function an(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new cn(e,Math.cos(n*=No)*t,Math.sin(n)*t)}function cn(n,t,e){return this instanceof cn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof cn?new cn(n.l,n.a,n.b):n instanceof on?an(n.l,n.c,n.h):Mn((n=gn(n)).r,n.g,n.b):new cn(n,t,e)}function ln(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=sn(i)*Uo,r=sn(r)*jo,u=sn(u)*Ho,new gn(pn(3.2404542*i-1.5371385*r-.4985314*u),pn(-.969266*i+1.8760108*r+.041556*u),pn(.0556434*i-.2040259*r+1.0572252*u))}function fn(n,t,e){return n>0?new on(Math.atan2(e,t)*Eo,Math.sqrt(t*t+e*e),n):new on(NaN,NaN,n)}function sn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function hn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function pn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function gn(n,t,e){return this instanceof gn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof gn?new gn(n.r,n.g,n.b):mn(""+n,gn,un):new gn(n,t,e)}function vn(n){return new gn(n>>16,255&n>>8,255&n)}function dn(n){return vn(n)+""}function yn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function mn(n,t,e){var r,i,u,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(bn(i[0]),bn(i[1]),bn(i[2]))}return(u=Yo.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.substring(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,c=15&u,c=c<<4|c):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,c=255&u)),t(o,a,c))}function xn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,c=(o+u)/2;return a?(i=.5>c?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=c>0&&1>c?0:r),new rn(r,i,c)}function Mn(n,t,e){n=_n(n),t=_n(t),e=_n(e);var r=hn((.4124564*n+.3575761*t+.1804375*e)/Uo),i=hn((.2126729*n+.7151522*t+.072175*e)/jo),u=hn((.0193339*n+.119192*t+.9503041*e)/Ho);return cn(116*i-16,500*(r-i),200*(i-u))}function _n(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function bn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function wn(n){return"function"==typeof n?n:function(){return n}}function Sn(n){return n}function kn(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Nn(t,e,n,r)}}function Nn(n,t,e,r){function i(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=e.call(u,c)}catch(n){return void o.error.call(u,n)}o.load.call(u,n)}else o.error.call(u,c)}var u={},o=Zu.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!Wu.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=i:c.onreadystatechange=function(){c.readyState>3&&i()},c.onprogress=function(n){var t=Zu.event;Zu.event=n;try{o.progress.call(u,c)}finally{Zu.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(l=n,u):l},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(Xu(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var f in a)c.setRequestHeader(f,a[f]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,c),c.send(null==r?null:r),u},u.abort=function(){return c.abort(),u},Zu.rebind(u,o,"on"),null==r?u:u.get(En(r))}function En(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function An(){var n=Cn(),t=zn()-n;t>24?(isFinite(t)&&(clearTimeout(Xo),Xo=setTimeout(An,t)),Vo=0):(Vo=1,Bo(An))}function Cn(){var n=Date.now();for($o=Io;$o;)n>=$o.t&&($o.f=$o.c(n-$o.t)),$o=$o.n;return n}function zn(){for(var n,t=Io,e=1/0;t;)t.f?t=n?n.n=t.n:Io=t.n:(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function qn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r?function(n){for(var t=n.length,i=[],u=0,o=r[0];t>0&&o>0;)i.push(n.substring(t-=o,t+o)),o=r[u=(u+1)%r.length];return i.reverse().join(e)}:Sn;return function(n){var e=Jo.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"",c=e[4]||"",l=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="=",s&&(f-=Math.floor((f-1)/4))),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+p.toLowerCase());case"c":case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===c&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):("e"==p||"f"==p)&&(h=Math.max(0,Math.min(20,h)))),p=Go.get(p)||Rn;var m=l&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):a;if(0>g){var c=Zu.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=g;n=p(n,h);var x=n.lastIndexOf("."),M=0>x?n:n.substring(0,x),_=0>x?"":t+n.substring(x+1);!l&&s&&(M=u(M));var b=v.length+M.length+_.length+(m?0:i.length),w=f>b?new Array(b=f-b+1).join(r):"";return m&&(M=u(w+M)),i+=v,n=M+_,("<"===o?i+n+w:">"===o?w+i+n:"^"===o?w.substring(0,b>>=1)+i+n+w.substring(b):i+(m?n:w+n))+e}}}function Rn(n){return n+""}function Dn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Pn(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new Qo(e-1)),1),e}function u(n,e){return t(n=new Qo((+n)),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date((+o))),t(o,1);else for(;r>o;)a.push(new Date((+o))),t(o,1);return a}function a(n,t,e){try{Qo=Dn;var r=new Dn;return r._=n,o(r,t,e)}finally{Qo=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var c=n.utc=Un(n);return c.floor=c,c.round=Un(r),c.ceil=Un(i),c.offset=Un(u),c.range=a,n}function Un(n){return function(t,e){try{Qo=Dn;var r=new Dn;return r._=t,n(r,e)._}finally{Qo=Date}}}function jn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,c=0;++aa;){if(r>=l)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ta?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){b.lastIndex=0;var r=b.exec(t.substring(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){M.lastIndex=0;var r=M.exec(t.substring(e));return r?(n.w=_.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.substring(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.substring(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function c(n,t,r){return e(n,A.x.toString(),t,r)}function l(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=x.get(t.substring(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{Qo=Dn;var t=new Qo;return t._=n,r(t)}finally{Qo=Date}}var r=t(n);return e.parse=function(n){try{Qo=Dn;var t=r.parse(n);return t&&t._}finally{Qo=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=it;var x=Zu.map(),M=Fn(v),_=On(v),b=Fn(d),w=On(d),S=Fn(y),k=On(y),N=Fn(m),E=On(m);g.forEach(function(n,t){x.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Hn(n.getDate(),t,2)},e:function(n,t){return Hn(n.getDate(),t,2)},H:function(n,t){return Hn(n.getHours(),t,2)},I:function(n,t){return Hn(n.getHours()%12||12,t,2)},j:function(n,t){return Hn(1+Ko.dayOfYear(n),t,3)},L:function(n,t){return Hn(n.getMilliseconds(),t,3)},m:function(n,t){return Hn(n.getMonth()+1,t,2)},M:function(n,t){return Hn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Hn(n.getSeconds(),t,2)},U:function(n,t){return Hn(Ko.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Hn(Ko.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Hn(n.getFullYear()%100,t,2)},Y:function(n,t){return Hn(n.getFullYear()%1e4,t,4)},Z:et,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:Jn,e:Jn,H:Kn,I:Kn,j:Gn,L:tt,m:Wn,M:Qn,p:f,S:nt,U:In,w:Yn,W:Zn,x:c,X:l,y:Xn,Y:Vn,Z:$n,"%":rt};return t}function Hn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Fn(n){return new RegExp("^(?:"+n.map(Zu.requote).join("|")+")","i")}function On(n){for(var t=new o,e=-1,r=n.length;++e68?1900:2e3)}function Wn(n,t,e){ea.lastIndex=0;var r=ea.exec(t.substring(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Jn(n,t,e){ea.lastIndex=0;var r=ea.exec(t.substring(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Gn(n,t,e){ea.lastIndex=0;var r=ea.exec(t.substring(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function Kn(n,t,e){ea.lastIndex=0;var r=ea.exec(t.substring(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function Qn(n,t,e){ea.lastIndex=0;var r=ea.exec(t.substring(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function nt(n,t,e){ea.lastIndex=0;var r=ea.exec(t.substring(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function tt(n,t,e){ea.lastIndex=0;var r=ea.exec(t.substring(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function et(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(eo(t)/60),i=eo(t)%60;return e+Hn(r,"0",2)+Hn(i,"0",2)}function rt(n,t,e){ra.lastIndex=0;var r=ra.exec(t.substring(e,e+1));return r?e+r[0].length:-1}function it(n){for(var t=n.length,e=-1;++e=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),f=u*l,s=i*c+f*Math.cos(a),h=f*o*Math.sin(a);la.add(Math.atan2(h,s)),r=n,i=c,u=l}var t,e,r,i,u;fa.point=function(o,a){fa.point=n,r=(t=o)*No,i=Math.cos(a=(e=a)*No/2+_o/4),u=Math.sin(a)},fa.lineEnd=function(){n(t,e)}}function st(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function ht(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function pt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function gt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function vt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function dt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function yt(n){return[Math.atan2(n[1],n[0]),G(n[2])]}function mt(n,t){return eo(n[0]-t[0])a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var c=new Et(e,n,null,(!0)),l=new Et(e,null,c,(!1));c.o=l,u.push(c),o.push(l),c=new Et(r,n,null,(!1)),l=new Et(r,null,c,(!0)),c.o=l,u.push(c),o.push(l)}}),o.sort(t),Nt(u),Nt(o),u.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,l=f.length;l>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function Nt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r0){for(_||(u.polygonStart(),_=!0),u.lineStart();++o1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Ct))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:c,lineEnd:l,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=c,m.lineEnd=l,p=Zu.merge(p);var n=Tt(y,g);p.length?(_||(u.polygonStart(),_=!0),kt(p,Lt,n,e,u)):n&&(_||(u.polygonStart(),_=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),_&&(u.polygonEnd(),_=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},x=zt(),M=t(x),_=!1;return m}}function Ct(n){return n.length>1}function zt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:v,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Lt(n,t){return((n=n.x)[0]<0?n[1]-wo-So:wo-n[1])-((t=t.x)[0]<0?t[1]-wo-So:wo-t[1])}function Tt(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],u=0,o=0;la.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],f=l.length;if(f)for(var s=l[0],h=s[0],p=s[1]/2+_o/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=l[d];var y=n[0],m=n[1]/2+_o/4,x=Math.sin(m),M=Math.cos(m),_=y-h,b=_>=0?1:-1,w=b*_,S=w>_o,k=g*x;if(la.add(Math.atan2(k*b*Math.sin(w),v*M+k*Math.cos(w))),u+=S?_+b*bo:_,S^h>=e^y>=e){var N=pt(st(s),st(n));dt(N);var E=pt(i,N);dt(E);var A=(S^_>=0?-1:1)*G(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^_>=0?1:-1)}if(!d++)break;h=y,g=x,v=M,s=n}}return(-So>u||So>u&&0>la)^1&o}function qt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?_o:-_o,c=eo(u-e);eo(c-_o)0?wo:-wo),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&c>=_o&&(eo(e-i)So?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Dt(n,t,e,r){var i;if(null==n)i=e*wo,r.point(-_o,i),r.point(0,i),r.point(_o,i),r.point(_o,0),r.point(_o,-i),r.point(0,-i),r.point(-_o,-i),r.point(-_o,0),r.point(-_o,i);else if(eo(n[0]-t[0])>So){var u=n[0]u}function e(n){var e,u,c,l,f;return{lineStart:function(){l=c=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?_o:-_o),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(p=r(e,g),(mt(e,p)||mt(g,p))&&(g[0]+=So,g[1]+=So,v=t(g[0],g[1]))),v!==c)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&mt(e,g)||n.point(g[0],g[1]),e=g,c=v,u=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return f|(l&&c)<<1}}}function r(n,t,e){var r=st(n),i=st(t),o=[1,0,0],a=pt(r,i),c=ht(a,a),l=a[0],f=c-l*l;if(!f)return!e&&n;var s=u*c/f,h=-u*l/f,p=pt(o,a),g=vt(o,s),v=vt(a,h);gt(g,v);var d=p,y=ht(g,d),m=ht(d,d),x=y*y-m*(ht(g,g)-1);if(!(0>x)){var M=Math.sqrt(x),_=vt(d,(-y-M)/m);if(gt(_,g),_=yt(_),!e)return _;var b,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(b=w,w=S,S=b);var E=S-w,A=eo(E-_o)E;if(!A&&k>N&&(b=k,k=N,N=b),C?A?k+N>0^_[1]<(eo(_[0]-w)_o^(w<=_[0]&&_[0]<=S)){var z=vt(d,(-y+M)/m);return gt(z,g),[_,yt(z)]}}}function i(t,e){var r=o?n:_o-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=eo(u)>So,c=fe(n,6*No);return At(t,e,c,o?[0,-n]:[-_o,n-_o])}function Ut(n,t,e,r){return function(i){var u,o=i.a,a=i.b,c=o.x,l=o.y,f=a.x,s=a.y,h=0,p=1,g=f-c,v=s-l;if(u=n-c,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-c,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-l,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-l,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:c+h*g,y:l+h*v}),1>p&&(i.b={x:c+p*g,y:l+p*v}),i}}}}}}function jt(n,t,e,r){function i(r,i){return eo(r[0]-n)0?0:3:eo(r[0]-e)0?2:1:eo(r[1]-t)0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],c=a.length,l=a[0];c>o;++o)u=a[o],l[1]<=r?u[1]>r&&W(l,u,n)>0&&++t:u[1]<=r&&W(l,u,n)<0&&--t,l=u;return 0!==t}function l(u,a,c,l){var f=0,s=0;if(null==u||(f=i(u,c))!==(s=i(a,c))||o(u,a)<0^c>0){do l.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+c+4)%4)!==s)}else l.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,_=b=NaN}function p(){v&&(g(m,x),M&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Sa,Math.min(Sa,n)),t=Math.max(-Sa,Math.min(Sa,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,x=t,M=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:_,y:b},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}_=n,b=t,w=e}var v,d,y,m,x,M,_,b,w,S,k,N=a,E=zt(),A=Ut(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=Zu.merge(v);var t=c([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),i&&kt(v,u,t,l,a),a.polygonEnd()),v=d=y=null}};return C}}function Ht(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function Ft(n){var t=0,e=_o/3,r=ee(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*_o/180,e=n[1]*_o/180):[180*(t/_o),180*(e/_o)]},i}function Ot(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,G((u-(n*n+e*e)*i*i)/(2*i))]},e}function Yt(){function n(n,t){Na+=i*n-r*t,r=n,i=t}var t,e,r,i;La.point=function(u,o){La.point=n,t=r=u,e=i=o},La.lineEnd=function(){n(t,e)}}function It(n,t){Ea>n&&(Ea=n),n>Ca&&(Ca=n),Aa>t&&(Aa=t),t>za&&(za=t)}function Zt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Vt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Vt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Vt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Xt(n,t){pa+=n,ga+=t,++va}function $t(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);da+=o*(t+n)/2,ya+=o*(e+r)/2,ma+=o,Xt(t=n,e=r)}var t,e;qa.point=function(r,i){qa.point=n,Xt(t=r,e=i)}}function Bt(){qa.point=Xt}function Wt(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);da+=o*(r+n)/2,ya+=o*(i+t)/2,ma+=o,o=i*n-r*t,xa+=o*(r+n),Ma+=o*(i+t),_a+=3*o,Xt(r=n,i=t)}var t,e,r,i;qa.point=function(u,o){qa.point=n,Xt(t=r=u,e=i=o)},qa.lineEnd=function(){n(t,e)}}function Jt(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,o,0,bo)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:v};return a}function Gt(n){function t(n){return(a?r:e)(n)}function e(t){return ne(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){x=NaN,S.point=u,t.lineStart()}function u(e,r){var u=st([e,r]),o=n(e,r);i(x,M,m,_,b,w,x=o[0],M=o[1],m=e,_=u[0],b=u[1],w=u[2],a,t),t.point(x,M)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=f}function l(n,t){u(s=n,h=t),p=x,g=M,v=_,d=b,y=w,S.point=u}function f(){i(x,M,m,_,b,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,x,M,_,b,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,c,l,f,s,h,p,g,v,d,y){var m=f-t,x=s-e,M=m*m+x*x;if(M>4*u&&d--){var _=a+p,b=c+g,w=l+v,S=Math.sqrt(_*_+b*b+w*w),k=Math.asin(w/=S),N=eo(eo(w)-1)u||eo((m*z+x*L)/M-.5)>.3||o>a*p+c*g+l*v)&&(i(t,e,r,a,c,l,A,C,N,_/=S,b/=S,w,d,y),y.point(A,C),i(A,C,N,_,b,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*No),a=16; return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function Kt(n){var t=Gt(function(t,e){return n([t*Eo,e*Eo])});return function(n){return re(t(n))}}function Qt(n){this.stream=n}function ne(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function te(n){return ee(function(){return n})()}function ee(n){function t(n){return n=a(n[0]*No,n[1]*No),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Eo,n[1]*Eo]}function r(){a=Ht(o=oe(y,m,x),u);var n=u(v,d);return c=p-n[0]*h,l=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,c,l,f,s=Gt(function(n,t){return n=u(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,m=0,x=0,M=wa,_=Sn,b=null,w=null;return t.stream=function(n){return f&&(f.valid=!1),f=re(M(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(M=null==n?(b=n,wa):Pt((b=+n)*No),i()):b},t.clipExtent=function(n){return arguments.length?(w=n,_=n?jt(n[0][0],n[0][1],n[1][0],n[1][1]):Sn,i()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*No,d=n[1]%360*No,r()):[v*Eo,d*Eo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*No,m=n[1]%360*No,x=n.length>2?n[2]%360*No:0,r()):[y*Eo,m*Eo,x*Eo]},Zu.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function re(n){return ne(n,function(t,e){n.point(t*No,e*No)})}function ie(n,t){return[n,t]}function ue(n,t){return[n>_o?n-bo:-_o>n?n+bo:n,t]}function oe(n,t,e){return n?t||e?Ht(ce(n),le(t,e)):ce(n):t||e?le(t,e):ue}function ae(n){return function(t,e){return t+=n,[t>_o?t-bo:-_o>t?t+bo:t,e]}}function ce(n){var t=ae(n);return t.invert=ae(-n),t}function le(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),f=l*r+a*i;return[Math.atan2(c*u-f*o,a*r-l*i),G(f*u+c*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),f=l*u-c*o;return[Math.atan2(c*u+l*o,a*r+f*i),G(f*r-a*i)]},e}function fe(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var c=o*t;null!=i?(i=se(e,i),u=se(e,u),(o>0?u>i:i>u)&&(i+=o*bo)):(i=n+o*bo,u=n-.5*c);for(var l,f=i;o>0?f>u:u>f;f-=c)a.point((l=yt([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],l[1])}}function se(n,t){var e=st(t);e[0]-=n,dt(e);var r=J(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-So)%(2*Math.PI)}function he(n,t,e){var r=Zu.range(n,t-So,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function pe(n,t,e){var r=Zu.range(n,t-So,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function ge(n){return n.source}function ve(n){return n.target}function de(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=i*Math.cos(n),l=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(tn(r-t)+i*o*tn(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*c+t*f,i=e*l+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Eo,Math.atan2(o,Math.sqrt(r*r+i*i))*Eo]}:function(){return[n*Eo,t*Eo]};return g.distance=h,g}function ye(){function n(n,i){var u=Math.sin(i*=No),o=Math.cos(i),a=eo((n*=No)-t),c=Math.cos(a);Ra+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*c)*a),e*u+r*o*c),t=n,e=u,r=o}var t,e,r;Da.point=function(i,u){t=i*No,e=Math.sin(u*=No),r=Math.cos(u),Da.point=n},Da.lineEnd=function(){Da.point=Da.lineEnd=v}}function me(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function xe(n,t){function e(n,t){o>0?-wo+So>t&&(t=-wo+So):t>wo-So&&(t=wo-So);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(_o/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=B(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-wo]},e):_e}function Me(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return eo(i)i;i++){for(;r>1&&W(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function Ee(n,t){return n[0]-t[0]||n[1]-t[1]}function Ae(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Ce(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,c=n[1],l=e[1],f=t[1]-c,s=r[1]-l,h=(a*(c-l)-s*(i-u))/(s*o-a*f);return[i+h*o,c+h*f]}function ze(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Le(){Ke(this),this.edge=this.site=this.circle=null}function Te(n){var t=$a.pop()||new Le;return t.site=n,t}function qe(n){Ie(n),Za.remove(n),$a.push(n),Ke(n)}function Re(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];qe(n);for(var c=u;c.circle&&eo(e-c.circle.x)f;++f)l=a[f],c=a[f-1],We(l.edge,c.site,l.site,i);c=a[0],l=a[s-1],l.edge=$e(c.site,l.site,null,i),Ye(c),Ye(l)}function De(n){for(var t,e,r,i,u=n.x,o=n.y,a=Za._;a;)if(r=Pe(a,o)-u,r>So)a=a.L;else{if(i=u-Ue(a,o),!(i>So)){r>-So?(t=a.P,e=a):i>-So?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Te(n);if(Za.insert(t,c),t||e){if(t===e)return Ie(t),e=Te(t.site),Za.insert(c,e),c.edge=e.edge=$e(t.site,c.site),Ye(t),void Ye(e);if(!e)return void(c.edge=$e(t.site,c.site));Ie(t),Ie(e);var l=t.site,f=l.x,s=l.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,x=v*v+d*d,M={x:(d*m-p*x)/y+f,y:(h*x-v*m)/y+s};We(e.edge,l,g,M),c.edge=$e(l,n,null,M),e.edge=$e(n,g,null,M),Ye(t),Ye(e)}}function Pe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var f=a-r,s=1/u-1/l,h=f/l;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*l)-c+l/2+i-u/2)))/s+r:(r+a)/2}function Ue(n,t){var e=n.N;if(e)return Pe(e,t);var r=n.site;return r.y===t?r.x:1/0}function je(n){this.site=n,this.edges=[]}function He(n){for(var t,e,r,i,u,o,a,c,l,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=Ia,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,c=a.length,o=0;c>o;)f=a[o].end(),r=f.x,i=f.y,l=a[++o%c].start(),t=l.x,e=l.y,(eo(r-t)>So||eo(i-e)>So)&&(a.splice(o,0,new Je(Be(u.site,f,eo(r-s)So?{x:s,y:eo(t-s)So?{x:eo(e-g)So?{x:h,y:eo(t-h)So?{x:eo(e-p)=-ko)){var p=c*c+l*l,g=f*f+s*s,v=(s*p-l*g)/h,d=(c*g-f*p)/h,s=d+a,y=Ba.pop()||new Oe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,x=Xa._;x;)if(y.yd||d>=a)return;if(h>g){if(u){if(u.y>=l)return}else u={x:d,y:c};e={x:d,y:l}}else{if(u){if(u.yr||r>1)if(h>g){if(u){if(u.y>=l)return}else u={x:(c-i)/r,y:c};e={x:(l-i)/r,y:l}}else{if(u){if(u.yp){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.xu&&(i=t.substring(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:sr(e,r)})),u=Ga.lastIndex;return ur;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function pr(n,t){for(var e,r=Zu.interpolators.length;--r>=0&&!(e=Zu.interpolators[r](n,t)););return e}function gr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(pr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function vr(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function dr(n){return function(t){return 1-n(1-t)}}function yr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function mr(n){return n*n}function xr(n){return n*n*n}function Mr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function _r(n){return function(t){return Math.pow(t,n)}}function br(n){return 1-Math.cos(n*wo)}function wr(n){return Math.pow(2,10*(n-1))}function Sr(n){return 1-Math.sqrt(1-n*n)}function kr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/bo*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*bo/t)}}function Nr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Er(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Ar(n,t){n=Zu.hcl(n),t=Zu.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return an(e+u*n,r+o*n,i+a*n)+""}}function Cr(n,t){n=Zu.hsl(n),t=Zu.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return un(e+u*n,r+o*n,i+a*n)+""}}function zr(n,t){n=Zu.lab(n),t=Zu.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return ln(e+u*n,r+o*n,i+a*n)+""}}function Lr(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Tr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Rr(t),i=qr(t,e),u=Rr(Dr(e,t,-i))||0;t[0]*e[1]180?f+=360:f-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:sr(l,f)})):f&&r.push(r.pop()+"rotate("+f+")"),s!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:sr(s,h)}):h&&r.push(r.pop()+"skewX("+h+")"),p[0]!=g[0]||p[1]!=g[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:e-4,x:sr(p[0],g[0])},{i:e-2,x:sr(p[1],g[1])})):(1!=g[0]||1!=g[1])&&r.push(r.pop()+"scale("+g+")"),e=i.length,function(n){for(var t,u=-1;++u=0;)e.push(i[r])}function Wr(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++oe;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function oi(n){return n.reduce(ai,0)}function ai(n,t){return n+t[1]}function ci(n,t){return li(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function li(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function fi(n){return[Zu.min(n),Zu.max(n)]}function si(n,t){return n.value-t.value}function hi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function pi(n,t){n._pack_next=t,t._pack_prev=n}function gi(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function vi(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(l=e.length)){var e,r,i,u,o,a,c,l,f=1/0,s=-1/0,h=1/0,p=-1/0;if(e.forEach(di),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(i=e[1],i.x=i.r,i.y=0,t(i),l>2))for(u=e[2],xi(r,i,u),t(u),hi(r,u),r._pack_prev=u,hi(u,i),i=r._pack_next,o=3;l>o;o++){xi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(gi(a,u)){g=1;break}if(1==g)for(c=r._pack_prev;c!==a._pack_prev&&!gi(c,u);c=c._pack_prev,d++);g?(d>v||v==d&&i.ro;o++)u=e[o],u.x-=y,u.y-=m,x=Math.max(x,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=x,e.forEach(yi)}}function di(n){n._pack_next=n._pack_prev=n}function yi(n){delete n._pack_next,delete n._pack_prev}function mi(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function ki(n,t,e){return n.a.parent===t.parent?n.a:e}function Ni(n){return 1+Zu.max(n,function(n){return n.y})}function Ei(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ai(n){var t=n.children;return t&&t.length?Ai(t[0]):n}function Ci(n){var t,e=n.children;return e&&(t=e.length)?Ci(e[t-1]):n}function zi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Li(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Ti(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function qi(n){return n.rangeExtent?n.rangeExtent():Ti(n.range())}function Ri(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Di(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function Pi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:cc}function Ui(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]2?Ui:Ri,c=r?jr:Ur;return o=i(n,t,c,e),a=i(t,n,c,pr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Lr)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Yi(n,t)},u.tickFormat=function(t,e){return Ii(n,t,e)},u.nice=function(t){return Fi(n,t),i()},u.copy=function(){return ji(n,t,e,r)},i()}function Hi(n,t){return Zu.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Fi(n,t){return Di(n,Pi(Oi(n,t)[2]))}function Oi(n,t){null==t&&(t=10);var e=Ti(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Yi(n,t){return Zu.range.apply(Zu,Oi(n,t))}function Ii(n,t,e){var r=Oi(n,t);if(e){var i=Jo.exec(e);if(i.shift(),"s"===i[8]){var u=Zu.formatPrefix(Math.max(eo(r[0]),eo(r[1])));return i[7]||(i[7]="."+Zi(u.scale(r[2]))),i[8]="f",e=Zu.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+Vi(i[8],r)),e=i.join("")}else e=",."+Zi(r[2])+"f";return Zu.format(e)}function Zi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Vi(n,t){var e=Zi(t[2]);return n in lc?Math.abs(e-Zi(Math.max(eo(t[0]),eo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Xi(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Di(r.map(i),e?Math:sc);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Ti(r),o=[],a=n[0],c=n[1],l=Math.floor(i(a)),f=Math.ceil(i(c)),s=t%1?2:t;if(isFinite(f-l)){if(e){for(;f>l;l++)for(var h=1;s>h;h++)o.push(u(l)*h);o.push(u(l))}else for(o.push(u(l));l++0;h--)o.push(u(l)*h);for(l=0;o[l]c;f--);o=o.slice(l,f)}return o},o.tickFormat=function(n,t){if(!arguments.length)return fc;arguments.length<2?t=fc:"function"!=typeof t&&(t=Zu.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/u(c(i(n)+r))<=a?t(n):""}},o.copy=function(){return Xi(n.copy(),t,e,r)},Hi(o,n)}function $i(n,t,e){function r(t){return n(i(t))}var i=Bi(t),u=Bi(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Yi(e,n)},r.tickFormat=function(n,t){return Ii(e,n,t)},r.nice=function(n){return r.domain(Fi(e,n))},r.exponent=function(o){return arguments.length?(i=Bi(t=o),u=Bi(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return $i(n.copy(),t,e)},Hi(r,n)}function Bi(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Wi(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return Zu.range(n.length).map(function(n){return t+e*n})}var i,u,a;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new o;for(var u,a=-1,c=r.length;++an?[NaN,NaN]:[n>0?o[n-1]:e[0],nt?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return Gi(n,t,e)},i()}function Ki(n,t){function e(e){return e>=e?t[Zu.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return Ki(n,t)},e}function Qi(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Yi(n,t)},t.tickFormat=function(t,e){return Ii(n,t,e)},t.copy=function(){return Qi(n)},t}function nu(n){return n.innerRadius}function tu(n){return n.outerRadius}function eu(n){return n.startAngle}function ru(n){return n.endAngle}function iu(n){function t(t){function o(){l.push("M",u(n(f),a))}for(var c,l=[],f=[],s=-1,h=t.length,p=wn(e),g=wn(r);++s1&&i.push("H",r[0]),i.join("")}function cu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[c],c++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var l=2;l9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=c;)i=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Su(n){return n.length<3?uu(n):n[0]+pu(n,wu(n))}function ku(n){for(var t,e,r,i=-1,u=n.length;++ie?l():(i.active=e,u.event&&u.event.start.call(n,f,t),u.tween.forEach(function(e,r){(r=r.call(n,f,t))&&v.push(r)}),void Zu.timer(function(){return g.c=c(r||1)?St:c,1},0,a))}function c(r){if(i.active!==e)return l();for(var o=r/p,a=s(o),c=v.length;c>0;)v[--c].call(n,a); return o>=1?(u.event&&u.event.end.call(n,f,t),l()):void 0}function l(){return--i.count?delete i[e]:delete n.__transition__,1}var f=n.__data__,s=u.ease,h=u.delay,p=u.duration,g=$o,v=[];return g.t=h+a,r>=h?o(r-h):void(g.c=o)},0,a)}}function Uu(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function ju(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function Hu(n){return n.toISOString()}function Fu(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=Zu.bisect(Pc,i);return u==Pc.length?[t.year,Oi(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Pc[u-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=Ou(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ou(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Ti(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],Ou(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Fu(n.copy(),t,e)},Hi(r,n)}function Ou(n){return new Date(n)}function Yu(n){return JSON.parse(n.responseText)}function Iu(n){var t=$u.createRange();return t.selectNode($u.body),t.createContextualFragment(n.responseText)}var Zu={version:"3.4.11"};Date.now||(Date.now=function(){return+new Date});var Vu=[].slice,Xu=function(n){return Vu.call(n)},$u=document,Bu=$u.documentElement,Wu=window;try{Xu(Bu.childNodes)[0].nodeType}catch(n){Xu=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{$u.createElement("div").style.setProperty("opacity",0,"")}catch(n){var Ju=Wu.Element.prototype,Gu=Ju.setAttribute,Ku=Ju.setAttributeNS,Qu=Wu.CSSStyleDeclaration.prototype,no=Qu.setProperty;Ju.setAttribute=function(n,t){Gu.call(this,n,t+"")},Ju.setAttributeNS=function(n,t,e){Ku.call(this,n,t,e+"")},Qu.setProperty=function(n,t,e){no.call(this,n,t+"",e)}}Zu.ascending=n,Zu.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},Zu.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=e);)e=void 0;for(;++ir&&(e=r)}else{for(;++i=e);)e=void 0;for(;++ir&&(e=r)}return e},Zu.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=e);)e=void 0;for(;++ie&&(e=r)}else{for(;++i=e);)e=void 0;for(;++ie&&(e=r)}return e},Zu.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=e);)e=i=void 0;for(;++ur&&(e=r),r>i&&(i=r))}else{for(;++u=e);)e=void 0;for(;++ur&&(e=r),r>i&&(i=r))}return[e,i]},Zu.sum=function(n,t){var e,r=0,i=n.length,u=-1;if(1===arguments.length)for(;++u1&&(e=e.map(r)),e=e.filter(t),e.length?Zu.quantile(e.sort(n),.5):void 0};var to=e(n);Zu.bisectLeft=to.left,Zu.bisect=Zu.bisectRight=to.right,Zu.bisector=function(t){return e(1===t.length?function(e,r){return n(t(e),r)}:t)},Zu.shuffle=function(n){for(var t,e,r=n.length;r;)e=0|Math.random()*r--,t=n[r],n[r]=n[e],n[e]=t;return n},Zu.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},Zu.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},Zu.zip=function(){if(!(i=arguments.length))return[];for(var n=-1,t=Zu.min(arguments,r),e=new Array(t);++n=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var eo=Math.abs;Zu.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var r,u=[],o=i(eo(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(r=n+e*++a)>t;)u.push(r/o);else for(;(r=n+e*++a)=u.length)return r?r.call(i,a):e?a.sort(e):a;for(var l,f,s,h,p=-1,g=a.length,v=u[c++],d=new o;++p=u.length)return n;var r=[],i=a[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],a=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(Zu.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return a[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},Zu.set=function(n){var t=new h;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},u(h,{has:a,add:function(n){return this[ro+n]=!0,n},remove:function(n){return n=ro+n,n in this&&delete this[n]},values:l,size:f,empty:s,forEach:function(n){for(var t in this)t.charCodeAt(0)===io&&n.call(this,t.substring(1))}}),Zu.behavior={},Zu.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},Zu.event=null,Zu.requote=function(n){return n.replace(oo,"\\$&")};var oo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ao={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},co=function(n,t){return t.querySelector(n)},lo=function(n,t){return t.querySelectorAll(n)},fo=Bu.matches||Bu[g(Bu,"matchesSelector")],so=function(n,t){return fo.call(n,t)};"function"==typeof Sizzle&&(co=function(n,t){return Sizzle(n,t)[0]||null},lo=Sizzle,so=Sizzle.matchesSelector),Zu.selection=function(){return vo};var ho=Zu.selection.prototype=[];ho.select=function(n){var t,e,r,i,u=[];n=b(n);for(var o=-1,a=this.length;++o=0&&(e=n.substring(0,t),n=n.substring(t+1)),po.hasOwnProperty(e)?{space:po[e],local:n}:n}},ho.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=Zu.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(S(t,n[t]));return this}return this.each(S(n,t))},ho.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=E(n)).length,i=-1;if(t=e.classList){for(;++ir){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(z(e,n[e],t));return this}if(2>r)return Wu.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(z(n,t,e))},ho.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(L(t,n[t]));return this}return this.each(L(n,t))},ho.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},ho.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},ho.append=function(n){return n=T(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},ho.insert=function(n,t){return n=T(n),t=b(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},ho.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},ho.data=function(n,t){function e(n,e){var r,i,u,a=n.length,s=e.length,h=Math.min(a,s),p=new Array(s),g=new Array(s),v=new Array(a);if(t){var d,y=new o,m=new o,x=[];for(r=-1;++rr;++r)g[r]=q(e[r]);for(;a>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,c.push(g),l.push(p),f.push(v)}var r,i,u=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++uu;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return _(i)},ho.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},ho.sort=function(n){n=D.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},ho.size=function(){var n=0;return this.each(function(){++n}),n};var go=[];Zu.selection.enter=U,Zu.selection.enter.prototype=go,go.append=ho.append,go.empty=ho.empty,go.node=ho.node,go.call=ho.call,go.size=ho.size,go.select=function(n){for(var t,e,r,i,u,o=[],a=-1,c=this.length;++ar){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(F(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(F(n,t,e))};var yo=Zu.map({mouseenter:"mouseover",mouseleave:"mouseout"});yo.forEach(function(n){"on"+n in $u&&yo.remove(n)});var mo="onselectstart"in $u?null:g(Bu.style,"userSelect"),xo=0;Zu.mouse=function(n){return Z(n,x())};var Mo=/WebKit/.test(Wu.navigator.userAgent)?-1:0;Zu.touches=function(n,t){return arguments.length<2&&(t=x().touches),t?Xu(t).map(function(t){var e=Z(n,t);return e.identifier=t.identifier,e}):[]},Zu.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",u)}function t(n,t,i,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-x[0],e=r[1]-x[1],g|=n|e,x=r,p({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g&&Zu.event.target===s),p({type:"dragend"}))}var l,f=this,s=Zu.event.target,h=f.parentNode,p=e.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=Zu.select(i()).on(u+d,a).on(o+d,c),m=I(),x=t(h,v);r?(l=r.apply(f,arguments),l=[l.x-x[0],l.y-x[1]]):l=[0,0],p({type:"dragstart"})}}var e=M(n,"drag","dragstart","dragend"),r=null,i=t(v,Zu.mouse,$,"mousemove","mouseup"),u=t(V,Zu.touch,X,"touchmove","touchend");return n.origin=function(t){return arguments.length?(r=t,n):r},Zu.rebind(n,e,"on")};var _o=Math.PI,bo=2*_o,wo=_o/2,So=1e-6,ko=So*So,No=_o/180,Eo=180/_o,Ao=Math.SQRT2,Co=2,zo=4;Zu.interpolateZoom=function(n,t){function e(n){var t=n*m;if(y){var e=Q(v),o=u/(Co*h)*(e*nn(Ao*t+v)-K(v));return[r+o*l,i+o*f,u*e/Q(Ao*t+v)]}return[r+n*l,i+n*f,u*Math.exp(Ao*t)]}var r=n[0],i=n[1],u=n[2],o=t[0],a=t[1],c=t[2],l=o-r,f=a-i,s=l*l+f*f,h=Math.sqrt(s),p=(c*c-u*u+zo*s)/(2*u*Co*h),g=(c*c-u*u-zo*s)/(2*c*Co*h),v=Math.log(Math.sqrt(p*p+1)-p),d=Math.log(Math.sqrt(g*g+1)-g),y=d-v,m=(y||Math.log(c/u))/Ao;return e.duration=1e3*m,e},Zu.behavior.zoom=function(){function n(n){n.on(E,l).on(qo+".zoom",s).on("dblclick.zoom",h).on(z,f)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function e(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function r(n){S.k=Math.max(N[0],Math.min(N[1],n))}function i(n,t){t=e(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function u(){_&&_.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(b.range().map(function(n){return(n-S.y)/S.k}).map(b.invert))}function o(n){n({type:"zoomstart"})}function a(n){u(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function l(){function n(){f=1,i(Zu.mouse(r),h),a(l)}function e(){s.on(A,null).on(C,null),p(f&&Zu.event.target===u),c(l)}var r=this,u=Zu.event.target,l=L.of(r,arguments),f=0,s=Zu.select(Wu).on(A,n).on(C,e),h=t(Zu.mouse(r)),p=I();H.call(r),o(l)}function f(){function n(){var n=Zu.touches(p);return h=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function e(){var t=Zu.event.target;Zu.select(t).on(M,u).on(_,s),b.push(t);for(var e=Zu.event.changedTouches,o=0,c=e.length;c>o;++o)v[e[o].identifier]=null;var l=n(),f=Date.now();if(1===l.length){if(500>f-y){var h=l[0],p=v[h.identifier];r(2*S.k),i(h,p),m(),a(g)}y=f}else if(l.length>1){var h=l[0],x=l[1],w=h[0]-x[0],k=h[1]-x[1];d=w*w+k*k}}function u(){for(var n,t,e,u,o=Zu.touches(p),c=0,l=o.length;l>c;++c,u=null)if(e=o[c],u=v[e.identifier]){if(t)break;n=e,t=u}if(u){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=d&&Math.sqrt(f/d);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+u[0])/2,(t[1]+u[1])/2],r(s*h)}y=null,i(n,t),a(g)}function s(){if(Zu.event.touches.length){for(var t=Zu.event.changedTouches,e=0,r=t.length;r>e;++e)delete v[t[e].identifier];for(var i in v)return void n()}Zu.selectAll(b).on(x,null),w.on(E,l).on(z,f),k(),c(g)}var h,p=this,g=L.of(p,arguments),v={},d=0,x=".zoom-"+Zu.event.changedTouches[0].identifier,M="touchmove"+x,_="touchend"+x,b=[],w=Zu.select(p).on(E,null).on(z,e),k=I();H.call(p),e(),o(g)}function s(){var n=L.of(this,arguments);d?clearTimeout(d):(p=t(g=v||Zu.mouse(this)),H.call(this),o(n)),d=setTimeout(function(){d=null,c(n)},50),m(),r(Math.pow(2,.002*Lo())*S.k),i(g,p),a(n)}function h(){var n=L.of(this,arguments),e=Zu.mouse(this),u=t(e),l=Math.log(S.k)/Math.LN2;o(n),r(Math.pow(2,Zu.event.shiftKey?Math.ceil(l)-1:Math.floor(l)+1)),i(e,u),a(n),c(n)}var p,g,v,d,y,x,_,b,w,S={x:0,y:0,k:1},k=[960,500],N=To,E="mousedown.zoom",A="mousemove.zoom",C="mouseup.zoom",z="touchstart.zoom",L=M(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=L.of(this,arguments),t=S;wc?Zu.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var e=k[0],r=k[1],i=e/2,u=r/2,o=Zu.interpolateZoom([(i-S.x)/S.k,(u-S.y)/S.k,e/S.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),c=e/r[2];this.__chart__=S={x:i-r[0]*c,y:u-r[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},u(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},u(),n):S.k},n.scaleExtent=function(t){return arguments.length?(N=null==t?To:[+t[0],+t[1]],n):N},n.center=function(t){return arguments.length?(v=t&&[+t[0],+t[1]],n):v},n.size=function(t){return arguments.length?(k=t&&[+t[0],+t[1]],n):k},n.x=function(t){return arguments.length?(_=t,x=t.copy(),S={x:0,y:0,k:1},n):_},n.y=function(t){return arguments.length?(w=t,b=t.copy(),S={x:0,y:0,k:1},n):w},Zu.rebind(n,L,"on")};var Lo,To=[0,1/0],qo="onwheel"in $u?(Lo=function(){return-Zu.event.deltaY*(Zu.event.deltaMode?120:1)},"wheel"):"onmousewheel"in $u?(Lo=function(){return Zu.event.wheelDelta},"mousewheel"):(Lo=function(){return-Zu.event.detail},"MozMousePixelScroll");Zu.color=en,en.prototype.toString=function(){return this.rgb()+""},Zu.hsl=rn;var Ro=rn.prototype=new en;Ro.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new rn(this.h,this.s,this.l/n)},Ro.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new rn(this.h,this.s,n*this.l)},Ro.rgb=function(){return un(this.h,this.s,this.l)},Zu.hcl=on;var Do=on.prototype=new en;Do.brighter=function(n){return new on(this.h,this.c,Math.min(100,this.l+Po*(arguments.length?n:1)))},Do.darker=function(n){return new on(this.h,this.c,Math.max(0,this.l-Po*(arguments.length?n:1)))},Do.rgb=function(){return an(this.h,this.c,this.l).rgb()},Zu.lab=cn;var Po=18,Uo=.95047,jo=1,Ho=1.08883,Fo=cn.prototype=new en;Fo.brighter=function(n){return new cn(Math.min(100,this.l+Po*(arguments.length?n:1)),this.a,this.b)},Fo.darker=function(n){return new cn(Math.max(0,this.l-Po*(arguments.length?n:1)),this.a,this.b)},Fo.rgb=function(){return ln(this.l,this.a,this.b)},Zu.rgb=gn;var Oo=gn.prototype=new en;Oo.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new gn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new gn(i,i,i)},Oo.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new gn(n*this.r,n*this.g,n*this.b)},Oo.hsl=function(){return xn(this.r,this.g,this.b)},Oo.toString=function(){return"#"+yn(this.r)+yn(this.g)+yn(this.b)};var Yo=Zu.map({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,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});Yo.forEach(function(n,t){Yo.set(n,vn(t))}),Zu.functor=wn,Zu.xhr=kn(Sn),Zu.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Nn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=l)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==c)continue;return n.substring(t,f-a)}return n.substring(t)}for(var r,i,u={},o={},a=[],l=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();(!t||(h=t(h,s++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new h,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},Zu.csv=Zu.dsv(",","text/csv"),Zu.tsv=Zu.dsv(" ","text/tab-separated-values"),Zu.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=x().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return Z(n,r)};var Io,Zo,Vo,Xo,$o,Bo=Wu[g(Wu,"requestAnimationFrame")]||function(n){setTimeout(n,17)};Zu.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,f:!1,n:null};Zo?Zo.n=u:Io=u,Zo=u,Vo||(Xo=clearTimeout(Xo),Vo=1,Bo(An))},Zu.timer.flush=function(){Cn(),zn()},Zu.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var Wo=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"].map(Tn);Zu.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=Zu.round(n,Ln(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),Wo[8+e/3]};var Jo=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Go=Zu.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=Zu.round(n,Ln(n,t))).toFixed(Math.max(0,Math.min(20,Ln(n*(1+1e-15),t))))}}),Ko=Zu.time={},Qo=Date;Dn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){na.setUTCDate.apply(this._,arguments)},setDay:function(){na.setUTCDay.apply(this._,arguments)},setFullYear:function(){na.setUTCFullYear.apply(this._,arguments)},setHours:function(){na.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){na.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){na.setUTCMinutes.apply(this._,arguments)},setMonth:function(){na.setUTCMonth.apply(this._,arguments)},setSeconds:function(){na.setUTCSeconds.apply(this._,arguments)},setTime:function(){na.setTime.apply(this._,arguments)}};var na=Date.prototype;Ko.year=Pn(function(n){return n=Ko.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Ko.years=Ko.year.range,Ko.years.utc=Ko.year.utc.range,Ko.day=Pn(function(n){var t=new Qo(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),Ko.days=Ko.day.range,Ko.days.utc=Ko.day.utc.range,Ko.dayOfYear=function(n){var t=Ko.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=Ko[n]=Pn(function(n){return(n=Ko.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Ko.year(n).getDay();return Math.floor((Ko.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Ko[n+"s"]=e.range,Ko[n+"s"].utc=e.utc.range,Ko[n+"OfYear"]=function(n){var e=Ko.year(n).getDay();return Math.floor((Ko.dayOfYear(n)+(e+t)%7)/7)}}),Ko.week=Ko.sunday,Ko.weeks=Ko.sunday.range,Ko.weeks.utc=Ko.sunday.utc.range,Ko.weekOfYear=Ko.sundayOfYear;var ta={"-":"",_:" ",0:"0"},ea=/^\s*\d+/,ra=/^%/;Zu.locale=function(n){return{numberFormat:qn(n),timeFormat:jn(n)}};var ia=Zu.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});Zu.format=ia.numberFormat,Zu.geo={},ut.prototype={s:0,t:0,add:function(n){ot(n,this.t,ua),ot(ua.s,this.s,this),this.s?this.t+=ua.t:this.s=ua.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ua=new ut;Zu.geo.stream=function(n,t){n&&oa.hasOwnProperty(n.type)?oa[n.type](n,t):at(n,t)};var oa={Feature:function(n,t){at(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++rn?4*_o+n:n,fa.lineStart=fa.lineEnd=fa.point=v}};Zu.geo.bounds=function(){function n(n,t){x.push(M=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=st([t*No,e*No]);if(y){var i=pt(y,r),u=[i[1],-i[0],0],o=pt(u,i);dt(o),o=yt(o);var c=t-g,l=c>0?1:-1,v=o[0]*Eo*l,d=eo(c)>180;if(d^(v>l*g&&l*t>v)){var m=o[1]*Eo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>l*g&&l*t>v)){var m=-o[1]*Eo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){_.point=t}function r(){M[0]=f,M[1]=h,_.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=eo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;fa.point(n,e),t(n,e)}function u(){fa.lineStart()}function o(){i(v,d),fa.lineEnd(),eo(m)>So&&(f=-(h=180)),M[0]=f,M[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nla?(f=-(h=180),s=-(p=90)):m>So?p=90:-So>m&&(s=-90),M[0]=f,M[1]=h}};return function(n){p=h=-(f=s=1/0),x=[],Zu.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var e,r=1,i=x[0],u=[i];t>r;++r)e=x[r],l(e[0],i)||l(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e); for(var o,e,g=-1/0,t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return x=M=null,1/0===f||1/0===s?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),Zu.geo.centroid=function(n){sa=ha=pa=ga=va=da=ya=ma=xa=Ma=_a=0,Zu.geo.stream(n,ba);var t=xa,e=Ma,r=_a,i=t*t+e*e+r*r;return ko>i&&(t=da,e=ya,r=ma,So>ha&&(t=pa,e=ga,r=va),i=t*t+e*e+r*r,ko>i)?[NaN,NaN]:[Math.atan2(e,t)*Eo,G(r/Math.sqrt(i))*Eo]};var sa,ha,pa,ga,va,da,ya,ma,xa,Ma,_a,ba={sphere:v,point:xt,lineStart:_t,lineEnd:bt,polygonStart:function(){ba.lineStart=wt},polygonEnd:function(){ba.lineStart=_t}},wa=At(St,qt,Dt,[-_o,-_o/2]),Sa=1e9;Zu.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=jt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(Zu.geo.conicEqualArea=function(){return Ft(Ot)}).raw=Ot,Zu.geo.albers=function(){return Zu.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Zu.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=Zu.geo.albers(),o=Zu.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=Zu.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var l=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*l,s-.238*l],[f+.455*l,s+.238*l]]).stream(c).point,r=o.translate([f-.307*l,s+.201*l]).clipExtent([[f-.425*l+So,s+.12*l+So],[f-.214*l-So,s+.234*l-So]]).stream(c).point,i=a.translate([f-.205*l,s+.212*l]).clipExtent([[f-.214*l+So,s+.166*l+So],[f-.115*l-So,s+.234*l-So]]).stream(c).point,n},n.scale(1070)};var ka,Na,Ea,Aa,Ca,za,La={point:v,lineStart:v,lineEnd:v,polygonStart:function(){Na=0,La.lineStart=Yt},polygonEnd:function(){La.lineStart=La.lineEnd=La.point=v,ka+=eo(Na/2)}},Ta={point:It,lineStart:v,lineEnd:v,polygonStart:v,polygonEnd:v},qa={point:Xt,lineStart:$t,lineEnd:Bt,polygonStart:function(){qa.lineStart=Wt},polygonEnd:function(){qa.point=Xt,qa.lineStart=$t,qa.lineEnd=Bt}};Zu.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),Zu.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return ka=0,Zu.geo.stream(n,i(La)),ka},n.centroid=function(n){return pa=ga=va=da=ya=ma=xa=Ma=_a=0,Zu.geo.stream(n,i(qa)),_a?[xa/_a,Ma/_a]:ma?[da/ma,ya/ma]:va?[pa/va,ga/va]:[NaN,NaN]},n.bounds=function(n){return Ca=za=-(Ea=Aa=1/0),Zu.geo.stream(n,i(Ta)),[[Ea,Aa],[Ca,za]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||Kt(n):Sn,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Zt:new Jt(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(Zu.geo.albersUsa()).context(null)},Zu.geo.transform=function(n){return{stream:function(t){var e=new Qt(t);for(var r in n)e[r]=n[r];return e}}},Qt.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zu.geo.projection=te,Zu.geo.projectionMutator=ee,(Zu.geo.equirectangular=function(){return te(ie)}).raw=ie.invert=ie,Zu.geo.rotation=function(n){function t(t){return t=n(t[0]*No,t[1]*No),t[0]*=Eo,t[1]*=Eo,t}return n=oe(n[0]%360*No,n[1]*No,n.length>2?n[2]*No:0),t.invert=function(t){return t=n.invert(t[0]*No,t[1]*No),t[0]*=Eo,t[1]*=Eo,t},t},ue.invert=ie,Zu.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=oe(-n[0]*No,-n[1]*No,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Eo,n[1]*=Eo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=fe((t=+r)*No,i*No),n):t},n.precision=function(r){return arguments.length?(e=fe(t*No,(i=+r)*No),n):i},n.angle(90)},Zu.geo.distance=function(n,t){var e,r=(t[0]-n[0])*No,i=n[1]*No,u=t[1]*No,o=Math.sin(r),a=Math.cos(r),c=Math.sin(i),l=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=l*f-c*s*a)*e),c*f+l*s*a)},Zu.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return Zu.range(Math.ceil(u/d)*d,i,d).map(h).concat(Zu.range(Math.ceil(l/y)*y,c,y).map(p)).concat(Zu.range(Math.ceil(r/g)*g,e,g).filter(function(n){return eo(n%d)>So}).map(f)).concat(Zu.range(Math.ceil(a/v)*v,o,v).filter(function(n){return eo(n%y)>So}).map(s))}var e,r,i,u,o,a,c,l,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(c).slice(1),h(i).reverse().slice(1),p(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],l=+t[0][1],c=+t[1][1],u>i&&(t=u,u=i,i=t),l>c&&(t=l,l=c,c=t),n.precision(m)):[[u,l],[i,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=he(a,o,90),s=pe(r,e,m),h=he(l,c,90),p=pe(u,i,m),n):m},n.majorExtent([[-180,-90+So],[180,90-So]]).minorExtent([[-180,-80-So],[180,80+So]])},Zu.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=ge,i=ve;return n.distance=function(){return Zu.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},Zu.geo.interpolate=function(n,t){return de(n[0]*No,n[1]*No,t[0]*No,t[1]*No)},Zu.geo.length=function(n){return Ra=0,Zu.geo.stream(n,Da),Ra};var Ra,Da={sphere:v,point:v,lineStart:ye,lineEnd:v,polygonStart:v,polygonEnd:v},Pa=me(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(Zu.geo.azimuthalEqualArea=function(){return te(Pa)}).raw=Pa;var Ua=me(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},Sn);(Zu.geo.azimuthalEquidistant=function(){return te(Ua)}).raw=Ua,(Zu.geo.conicConformal=function(){return Ft(xe)}).raw=xe,(Zu.geo.conicEquidistant=function(){return Ft(Me)}).raw=Me;var ja=me(function(n){return 1/n},Math.atan);(Zu.geo.gnomonic=function(){return te(ja)}).raw=ja,_e.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-wo]},(Zu.geo.mercator=function(){return be(_e)}).raw=_e;var Ha=me(function(){return 1},Math.asin);(Zu.geo.orthographic=function(){return te(Ha)}).raw=Ha;var Fa=me(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(Zu.geo.stereographic=function(){return te(Fa)}).raw=Fa,we.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-wo]},(Zu.geo.transverseMercator=function(){var n=be(we),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=we,Zu.geom={},Zu.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=wn(e),u=wn(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(Ee),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=Ne(a),f=Ne(c),s=f[0]===l[0],h=f[f.length-1]===l[l.length-1],p=[];for(t=l.length-1;t>=0;--t)p.push(n[a[l[t]][2]]);for(t=+s;t=r&&l.x<=u&&l.y>=i&&l.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/So)*So,y:Math.round(o(n,t)/So)*So,i:t}})}var r=Se,i=ke,u=r,o=i,a=Wa;return n?t(n):(t.links=function(n){return er(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return er(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Fe),c=-1,l=a.length,f=a[l-1].edge,s=f.l===o?f.r:f.l;++c=l,h=r>=f,p=(h<<1)+s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=ar()),s?i=l:a=l,h?o=f:c=f,u(n,t,e,r,i,o,a,c)}var f,s,h,p,g,v,d,y,m,x=wn(a),M=wn(c);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.xy&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var _=+x(f=n[p],p),b=+M(f,p);v>_&&(v=_),d>b&&(d=b),_>y&&(y=_),b>m&&(m=b),s.push(_),h.push(b)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=ar();if(k.add=function(n){u(k,n,+x(n,++p),+M(n,p),v,d,y,m)},k.visit=function(n){cr(n,k,v,d,y,m)},p=-1,null==t){for(;++p=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=Qa.get(e)||Ka,r=nc.get(r)||Sn,vr(r(e.apply(null,Vu.call(arguments,1))))},Zu.interpolateHcl=Ar,Zu.interpolateHsl=Cr,Zu.interpolateLab=zr,Zu.interpolateRound=Lr,Zu.transform=function(n){var t=$u.createElementNS(Zu.ns.prefix.svg,"g");return(Zu.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Tr(e?e.matrix:tc)})(n)},Tr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var tc={a:1,b:0,c:0,d:1,e:0,f:0};Zu.interpolateTransform=Pr,Zu.layout={},Zu.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++ea*a/d){if(g>c){var l=t.charge/c;n.px-=u*l,n.py-=o*l}return!0}if(t.point&&c&&g>c){var l=t.pointCharge/c;n.px-=u*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=Zu.event.x,n.py=Zu.event.y,a.resume()}var e,r,i,u,o,a={},c=Zu.dispatch("start","tick","end"),l=[1,1],f=.9,s=ec,h=rc,p=-30,g=ic,v=.1,d=.64,y=[],m=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,s,h,g,d,x,M,_=y.length,b=m.length;for(e=0;b>e;++e)a=m[e],s=a.source,h=a.target,x=h.x-s.x,M=h.y-s.y,(g=x*x+M*M)&&(g=r*u[e]*((g=Math.sqrt(g))-i[e])/g,x*=g,M*=g,h.x-=x*(d=s.weight/(h.weight+s.weight)),h.y-=M*d,s.x+=x*(d=1-d),s.y+=M*d);if((d=r*v)&&(x=l[0]/2,M=l[1]/2,e=-1,d))for(;++e<_;)a=y[e],a.x+=(x-a.x)*d,a.y+=(M-a.y)*d;if(p)for(Xr(t=Zu.geom.quadtree(y),r,o),e=-1;++e<_;)(a=y[e]).fixed||t.visit(n(a));for(e=-1;++e<_;)a=y[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*f,a.y-=(a.py-(a.py=a.y))*f);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(y=n,a):y},a.links=function(n){return arguments.length?(m=n,a):m},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(s="function"==typeof n?n:+n,a):s},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(f=+n,a):f},a.charge=function(n){return arguments.length?(p="function"==typeof n?n:+n,a):p},a.chargeDistance=function(n){return arguments.length?(g=n*n,a):Math.sqrt(g)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),Zu.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;l>a;++a){var i=m[a];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var u,o=e[t],a=-1,l=o.length;++at;++t)(r=y[t]).index=t,r.weight=0;for(t=0;f>t;++t)r=m[t],"number"==typeof r.source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=y[t],isNaN(r.x)&&(r.x=n("x",g)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof s)for(t=0;f>t;++t)i[t]=+s.call(this,m[t],t);else for(t=0;f>t;++t)i[t]=s;if(u=[],"function"==typeof h)for(t=0;f>t;++t)u[t]=+h.call(this,m[t],t);else for(t=0;f>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,y[t],t);else for(t=0;c>t;++t)o[t]=p;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=Zu.behavior.drag().origin(Sn).on("dragstart.force",Yr).on("drag.force",t).on("dragend.force",Ir)),arguments.length?void this.on("mouseover.force",Zr).on("mouseout.force",Vr).call(e):e},Zu.rebind(a,c,"on")};var ec=20,rc=1,ic=1/0;Zu.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(l=e.call(n,u,u.depth))&&(c=l.length)){for(var c,l,f;--c>=0;)o.push(f=l[c]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=l}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return Wr(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=Kr,e=Jr,r=Gr;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Br(t,function(n){n.children&&(n.value=0)}),Wr(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},Zu.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++lp;++p)for(i.call(n,l[0][p],g=v[p],f[0][p][1]),h=1;d>h;++h)i.call(n,l[h][p],g+=f[h-1][p][1],f[h][p][1]);return a}var t=Sn,e=ri,r=ii,i=ei,u=ni,o=ti;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:oc.get(t)||ri,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:ac.get(t)||ii,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var oc=Zu.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(ui),u=n.map(oi),o=Zu.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,c=0,l=[],f=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=u[e],l.push(e)):(c+=u[e],f.push(e));return f.reverse().concat(l)},reverse:function(n){return Zu.range(n.length).reverse()},default:ri}),ac=Zu.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,c=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,i,u,o,a,c,l,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=c=l=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=c-=i?u/i*a:0,l>c&&(l=c)}for(e=0;h>e;++e)p[e]-=l;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:ii});Zu.layout.histogram=function(){function n(n,u){for(var o,a,c=[],l=n.map(e,this),f=r.call(this,l,u),s=i.call(this,f,l,u),u=-1,h=l.length,p=s.length-1,g=t?1:1/h;++u0)for(u=-1;++u=f[0]&&a<=f[1]&&(o=c[Zu.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return c}var t=!0,e=Number,r=fi,i=ci;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=wn(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return li(n,t)}:wn(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},Zu.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],c=i[0],l=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Wr(a,function(n){n.r=+f(n.value)}),Wr(a,vi),r){var s=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Wr(a,function(n){n.r+=s}),Wr(a,vi),Wr(a,function(n){n.r-=s})}return mi(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=Zu.layout.hierarchy().sort(si),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},$r(n,e)},Zu.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(Wr(h,e),h.parent.m=-h.z,Br(h,r),l)Br(s,u);else{var p=s,g=s,v=s;Br(s,function(n){n.xg.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=c[0]/(g.x+a(g,p)/2+d),m=c[1]/(v.depth||1);Br(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Si(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,c=i.parent.children[0],l=i.m,f=u.m,s=o.m,h=c.m;o=bi(o),i=_i(i),o&&i;)c=_i(c),u=bi(u),u.a=n,r=o.z+s-i.z-l+a(o._,i._),r>0&&(wi(ki(o,n,e),n,r),l+=r,f+=r),s+=o.m,l+=i.m,h+=c.m,f+=u.m;o&&!bi(u)&&(u.t=o,u.m+=s-f),i&&!_i(c)&&(c.t=i,c.m+=l-h,e=n)}return e}function u(n){n.x*=c[0],n.y=n.depth*c[1]}var o=Zu.layout.hierarchy().sort(null).value(null),a=Mi,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?u:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:u,n):l?c:null},$r(n,o)},Zu.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),c=a[0],l=0;Wr(c,function(n){var t=n.children;t&&t.length?(n.x=Ei(t),n.y=Ni(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var f=Ai(c),s=Ci(c),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return Wr(c,i?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=Zu.layout.hierarchy().sort(null).value(null),e=Mi,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},$r(n,t)},Zu.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++it?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,c,l=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?l.dx:"dice"===p?l.dy:"slice-dice"===p?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),f.area=0;(c=h.length)>0;)f.push(o=h[c-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,l,!1),v=Math.min(l.dx,l.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,l,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;u=a.pop();)c.push(u),c.area+=u.area,null!=u.z&&(i(c,u.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oe&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,l=e.y,f=t?c(n.area/t):0;if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++ue.dx)&&(f=e.dx);++ue&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=Zu.random.normal.apply(Zu,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=Zu.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},Zu.scale={};var cc={floor:Sn,ceil:Sn};Zu.scale.linear=function(){return ji([0,1],[0,1],pr,!1)};var lc={s:1,g:1,p:1,r:1,e:1};Zu.scale.log=function(){return Xi(Zu.scale.linear().domain([0,1]),10,!0,[1,10])};var fc=Zu.format(".0e"),sc={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};Zu.scale.pow=function(){return $i(Zu.scale.linear(),1,[0,1])},Zu.scale.sqrt=function(){return Zu.scale.pow().exponent(.5)},Zu.scale.ordinal=function(){return Wi([],{t:"range",a:[[]]})},Zu.scale.category10=function(){return Zu.scale.ordinal().range(hc)},Zu.scale.category20=function(){return Zu.scale.ordinal().range(pc)},Zu.scale.category20b=function(){return Zu.scale.ordinal().range(gc)},Zu.scale.category20c=function(){return Zu.scale.ordinal().range(vc)};var hc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(dn),pc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(dn),gc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(dn),vc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(dn);Zu.scale.quantile=function(){return Ji([],[])},Zu.scale.quantize=function(){return Gi(0,1,[0,1])},Zu.scale.threshold=function(){return Ki([.5],[0,1])},Zu.scale.identity=function(){return Qi([0,1])},Zu.svg={},Zu.svg.arc=function(){ function n(){var n=t.apply(this,arguments),u=e.apply(this,arguments),o=r.apply(this,arguments)+dc,a=i.apply(this,arguments)+dc,c=(o>a&&(c=o,o=a,a=c),a-o),l=_o>c?"0":"1",f=Math.cos(o),s=Math.sin(o),h=Math.cos(a),p=Math.sin(a);return c>=yc?n?"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"Z":n?"M"+u*f+","+u*s+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*p+"L"+n*h+","+n*p+"A"+n+","+n+" 0 "+l+",0 "+n*f+","+n*s+"Z":"M"+u*f+","+u*s+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*p+"L0,0Z"}var t=nu,e=tu,r=eu,i=ru;return n.innerRadius=function(e){return arguments.length?(t=wn(e),n):t},n.outerRadius=function(t){return arguments.length?(e=wn(t),n):e},n.startAngle=function(t){return arguments.length?(r=wn(t),n):r},n.endAngle=function(t){return arguments.length?(i=wn(t),n):i},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,u=(r.apply(this,arguments)+i.apply(this,arguments))/2+dc;return[Math.cos(u)*n,Math.sin(u)*n]},n};var dc=-wo,yc=bo-So;Zu.svg.line=function(){return iu(Sn)};var mc=Zu.map({linear:uu,"linear-closed":ou,step:au,"step-before":cu,"step-after":lu,basis:vu,"basis-open":du,"basis-closed":yu,bundle:mu,cardinal:hu,"cardinal-open":fu,"cardinal-closed":su,monotone:Su});mc.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var xc=[0,2/3,1/3,0],Mc=[0,1/3,2/3,0],_c=[0,1/6,2/3,1/6];Zu.svg.line.radial=function(){var n=iu(ku);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},cu.reverse=lu,lu.reverse=cu,Zu.svg.area=function(){return Nu(Sn)},Zu.svg.area.radial=function(){var n=Nu(ku);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},Zu.svg.chord=function(){function n(n,a){var c=t(this,u,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?i(c.r,c.p1,c.r,c.p0):i(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=c.call(n,i,r)+dc,f=l.call(n,i,r)+dc;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>_o)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=ge,o=ve,a=Eu,c=eu,l=ru;return n.radius=function(t){return arguments.length?(a=wn(t),n):a},n.source=function(t){return arguments.length?(u=wn(t),n):u},n.target=function(t){return arguments.length?(o=wn(t),n):o},n.startAngle=function(t){return arguments.length?(c=wn(t),n):c},n.endAngle=function(t){return arguments.length?(l=wn(t),n):l},n},Zu.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,c=[u,{x:u.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=ge,e=ve,r=Au;return n.source=function(e){return arguments.length?(t=wn(e),n):t},n.target=function(t){return arguments.length?(e=wn(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},Zu.svg.diagonal.radial=function(){var n=Zu.svg.diagonal(),t=Au,e=n.projection;return n.projection=function(n){return arguments.length?e(Cu(t=n)):t},n},Zu.svg.symbol=function(){function n(n,r){return(bc.get(t.call(this,n,r))||Tu)(e.call(this,n,r))}var t=Lu,e=zu;return n.type=function(e){return arguments.length?(t=wn(e),n):t},n.size=function(t){return arguments.length?(e=wn(t),n):e},n};var bc=Zu.map({circle:Tu,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Nc)),e=t*Nc;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/kc),e=t*kc/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/kc),e=t*kc/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});Zu.svg.symbolTypes=bc.keys();var wc,Sc,kc=Math.sqrt(3),Nc=Math.tan(30*No),Ec=[],Ac=0;Ec.call=ho.call,Ec.empty=ho.empty,Ec.node=ho.node,Ec.size=ho.size,Zu.transition=function(n){return arguments.length?wc?n.transition():n:vo.transition()},Zu.transition.prototype=Ec,Ec.select=function(n){var t,e,r,i=this.id,u=[];n=b(n);for(var o=-1,a=this.length;++ou;u++){i.push(t=[]);for(var e=this[u],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return qu(i,this.id)},Ec.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):P(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Ec.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Pr:pr,a=Zu.ns.qualify(n);return Ru(this,"attr."+n,t,a.local?u:i)},Ec.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=Zu.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Ec.style=function(n,t,e){function r(){this.style.removeProperty(n)}function i(t){return null==t?r:(t+="",function(){var r,i=Wu.getComputedStyle(this,null).getPropertyValue(n);return i!==t&&(r=pr(i,t),function(t){this.style.setProperty(n,r(t),e)})})}var u=arguments.length;if(3>u){if("string"!=typeof n){2>u&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return Ru(this,"style."+n,t,i)},Ec.styleTween=function(n,t,e){function r(r,i){var u=t.call(this,r,i,Wu.getComputedStyle(this,null).getPropertyValue(n));return u&&function(t){this.style.setProperty(n,u(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Ec.text=function(n){return Ru(this,"text",n,Du)},Ec.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Ec.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=Zu.ease.apply(Zu,arguments)),P(this,function(e){e.__transition__[t].ease=n}))},Ec.delay=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].delay:P(this,"function"==typeof n?function(e,r,i){e.__transition__[t].delay=+n.call(e,e.__data__,r,i)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Ec.duration=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].duration:P(this,"function"==typeof n?function(e,r,i){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,i))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Ec.each=function(n,t){var e=this.id;if(arguments.length<2){var r=Sc,i=wc;wc=e,P(this,function(t,r,i){Sc=t.__transition__[e],n.call(t,t.__data__,r,i)}),Sc=r,wc=i}else P(this,function(r){var i=r.__transition__[e];(i.event||(i.event=Zu.dispatch("start","end"))).on(n,t)});return this},Ec.transition=function(){for(var n,t,e,r,i=this.id,u=++Ac,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],l=0,f=t.length;f>l;l++)(e=t[l])&&(r=Object.create(e.__transition__[i]),r.delay+=r.duration,Pu(e,l,u,r)),n.push(e)}return qu(o,u)},Zu.svg.axis=function(){function n(n){n.each(function(){var n,l=Zu.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==c?s.ticks?s.ticks.apply(s,a):s.domain():c,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):Sn:t,g=l.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",So),d=Zu.transition(g.exit()).style("opacity",So).remove(),y=Zu.transition(g.order()).style("opacity",1),m=qi(s),x=l.selectAll(".domain").data([0]),M=(x.enter().append("path").attr("class","domain"),Zu.transition(x));v.append("line"),v.append("text");var _=v.select("line"),b=y.select("line"),w=g.select("text").text(p),S=v.select("text"),k=y.select("text");switch(r){case"bottom":n=Uu,_.attr("y2",i),S.attr("y",Math.max(i,0)+o),b.attr("x2",0).attr("y2",i),k.attr("x",0).attr("y",Math.max(i,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),M.attr("d","M"+m[0]+","+u+"V0H"+m[1]+"V"+u);break;case"top":n=Uu,_.attr("y2",-i),S.attr("y",-(Math.max(i,0)+o)),b.attr("x2",0).attr("y2",-i),k.attr("x",0).attr("y",-(Math.max(i,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),M.attr("d","M"+m[0]+","+-u+"V0H"+m[1]+"V"+-u);break;case"left":n=ju,_.attr("x2",-i),S.attr("x",-(Math.max(i,0)+o)),b.attr("x2",-i).attr("y2",0),k.attr("x",-(Math.max(i,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),M.attr("d","M"+-u+","+m[0]+"H0V"+m[1]+"H"+-u);break;case"right":n=ju,_.attr("x2",i),S.attr("x",Math.max(i,0)+o),b.attr("x2",i).attr("y2",0),k.attr("x",Math.max(i,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),M.attr("d","M"+u+","+m[0]+"H0V"+m[1]+"H"+u)}if(s.rangeBand){var N=s,E=N.rangeBand()/2;f=s=function(n){return N(n)+E}}else f.rangeBand?f=s:d.call(n,s);v.call(n,f),y.call(n,s)})}var t,e=Zu.scale.linear(),r=Cc,i=6,u=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in zc?t+"":Cc,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Cc="bottom",zc={top:1,right:1,bottom:1,left:1};Zu.svg.brush=function(){function n(u){u.each(function(){var u=Zu.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=u.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),u.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=u.selectAll(".resize").data(g,Sn);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Lc[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var f,s=Zu.transition(u),h=Zu.transition(o);c&&(f=qi(c),h.attr("x",f[0]).attr("width",f[1]-f[0]),e(s)),l&&(f=qi(l),h.attr("y",f[0]).attr("height",f[1]-f[0]),r(s)),t(s)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+s[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function r(n){n.select(".extent").attr("y",s[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function i(){function i(){32==Zu.event.keyCode&&(A||(x=null,z[0]-=f[1],z[1]-=s[1],A=2),m())}function g(){32==Zu.event.keyCode&&2==A&&(z[0]+=f[1],z[1]+=s[1],A=0,m())}function v(){var n=Zu.mouse(_),i=!1;M&&(n[0]+=M[0],n[1]+=M[1]),A||(Zu.event.altKey?(x||(x=[(f[0]+f[1])/2,(s[0]+s[1])/2]),z[0]=f[+(n[0]g?(i=r,r=g):i=g),v[0]!=r||v[1]!=i?(e?o=null:u=null,v[0]=r,v[1]=i,!0):void 0}function y(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),Zu.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),w({type:"brushend"})}var x,M,_=this,b=Zu.select(Zu.event.target),w=a.of(_,arguments),S=Zu.select(_),k=b.datum(),N=!/^(n|s)$/.test(k)&&c,E=!/^(e|w)$/.test(k)&&l,A=b.classed("extent"),C=I(),z=Zu.mouse(_),L=Zu.select(Wu).on("keydown.brush",i).on("keyup.brush",g);if(Zu.event.changedTouches?L.on("touchmove.brush",v).on("touchend.brush",y):L.on("mousemove.brush",v).on("mouseup.brush",y),S.interrupt().selectAll("*").interrupt(),A)z[0]=f[0]-z[0],z[1]=s[0]-z[1];else if(k){var T=+/w$/.test(k),q=+/^n/.test(k);M=[f[1-T]-z[0],s[1-q]-z[1]],z[0]=f[T],z[1]=s[q]}else Zu.event.altKey&&(x=z.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),Zu.select("body").style("cursor",b.style("cursor")),w({type:"brushstart"}),v()}var u,o,a=M(n,"brushstart","brush","brushend"),c=null,l=null,f=[0,0],s=[0,0],h=!0,p=!0,g=Tc[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:f,y:s,i:u,j:o},e=this.__chart__||t;this.__chart__=t,wc?Zu.select(this).transition().each("start.brush",function(){u=e.i,o=e.j,f=e.x,s=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=gr(f,t.x),r=gr(s,t.y);return u=o=null,function(i){f=t.x=e(i),s=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,g=Tc[!c<<1|!l],n):c},n.y=function(t){return arguments.length?(l=t,g=Tc[!c<<1|!l],n):l},n.clamp=function(t){return arguments.length?(c&&l?(h=!!t[0],p=!!t[1]):c?h=!!t:l&&(p=!!t),n):c&&l?[h,p]:c?h:l?p:null},n.extent=function(t){var e,r,i,a,h;return arguments.length?(c&&(e=t[0],r=t[1],l&&(e=e[0],r=r[0]),u=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(h=e,e=r,r=h),(e!=f[0]||r!=f[1])&&(f=[e,r])),l&&(i=t[0],a=t[1],c&&(i=i[1],a=a[1]),o=[i,a],l.invert&&(i=l(i),a=l(a)),i>a&&(h=i,i=a,a=h),(i!=s[0]||a!=s[1])&&(s=[i,a])),n):(c&&(u?(e=u[0],r=u[1]):(e=f[0],r=f[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(h=e,e=r,r=h))),l&&(o?(i=o[0],a=o[1]):(i=s[0],a=s[1],l.invert&&(i=l.invert(i),a=l.invert(a)),i>a&&(h=i,i=a,a=h))),c&&l?[[e,i],[r,a]]:c?[e,r]:l&&[i,a])},n.clear=function(){return n.empty()||(f=[0,0],s=[0,0],u=o=null),n},n.empty=function(){return!!c&&f[0]==f[1]||!!l&&s[0]==s[1]},Zu.rebind(n,a,"on")};var Lc={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Tc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],qc=Ko.format=ia.timeFormat,Rc=qc.utc,Dc=Rc("%Y-%m-%dT%H:%M:%S.%LZ");qc.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Hu:Dc,Hu.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Hu.toString=Dc.toString,Ko.second=Pn(function(n){return new Qo(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Ko.seconds=Ko.second.range,Ko.seconds.utc=Ko.second.utc.range,Ko.minute=Pn(function(n){return new Qo(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Ko.minutes=Ko.minute.range,Ko.minutes.utc=Ko.minute.utc.range,Ko.hour=Pn(function(n){var t=n.getTimezoneOffset()/60;return new Qo(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Ko.hours=Ko.hour.range,Ko.hours.utc=Ko.hour.utc.range,Ko.month=Pn(function(n){return n=Ko.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Ko.months=Ko.month.range,Ko.months.utc=Ko.month.utc.range;var Pc=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Uc=[[Ko.second,1],[Ko.second,5],[Ko.second,15],[Ko.second,30],[Ko.minute,1],[Ko.minute,5],[Ko.minute,15],[Ko.minute,30],[Ko.hour,1],[Ko.hour,3],[Ko.hour,6],[Ko.hour,12],[Ko.day,1],[Ko.day,2],[Ko.week,1],[Ko.month,1],[Ko.month,3],[Ko.year,1]],jc=qc.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",St]]),Hc={range:function(n,t,e){return Zu.range(Math.ceil(n/e)*e,+t,e).map(Ou)},floor:Sn,ceil:Sn};Uc.year=Ko.year,Ko.scale=function(){return Fu(Zu.scale.linear(),Uc,jc)};var Fc=Uc.map(function(n){return[n[0].utc,n[1]]}),Oc=Rc.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",St]]);Fc.year=Ko.year.utc,Ko.scale.utc=function(){return Fu(Zu.scale.linear(),Fc,Oc)},Zu.text=kn(function(n){return n.responseText}),Zu.json=function(n,t){return Nn(n,"application/json",Yu,t)},Zu.html=function(n,t){return Nn(n,"text/html",Iu,t)},Zu.xml=kn(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(Zu):"object"==typeof module&&module.exports&&(module.exports=Zu),this.d3=Zu}();