Ee?r=90:s<-Ee&&(t=-90),f[0]=e,f[1]=n}};function h(a,i){c.push(f=[e=a,n=a]),ir&&(r=i)}function p(i,o){var l=In([i*De,o*De]);if(u){var s=Bn(u,l),c=Bn([s[1],-s[0],0],s);qn(c),c=Wn(c);var f=i-a,d=f>0?1:-1,p=c[0]*ze*d,g=k(f)>180;if(g^(d*ar&&(r=m);else if(g^(d*a<(p=(p+360)%360-180)&&pr&&(r=o);g?iw(e,n)&&(n=i):w(i,n)>w(e,n)&&(e=i):n>=e?(in&&(n=i)):i>a?w(e,i)>w(e,n)&&(n=i):w(i,n)>w(e,n)&&(e=i)}else h(i,o);u=l,a=i}function g(){d.point=p}function m(){f[0]=e,f[1]=n,d.point=h,u=null}function v(e,t){if(u){var n=e-a;s+=k(n)>180?n+(n>0?360:-360):n}else o=e,l=t;Rn.point(e,t),p(e,t)}function y(){Rn.lineStart()}function b(){v(o,l),Rn.lineEnd(),k(s)>Ee&&(e=-(n=180)),f[0]=e,f[1]=n,u=null}function w(e,t){return(t-=e)<0?t+360:t}function x(e,t){return e[0]-t[0]}function M(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:ew(g[0],g[1])&&(g[1]=h[1]),w(h[0],g[1])>w(g[0],g[1])&&(g[0]=h[0])):l.push(g=h);for(var u,s,h,p=-1/0,g=(o=0,l[s=l.length-1]);o<=s;g=h,++o)h=l[o],(u=w(g[1],h[0]))>p&&(p=u,e=h[0],n=g[1])}return c=f=null,e===1/0||t===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,t],[n,r]]}}(),i.geo.centroid=function(e){Nn=_n=Cn=En=jn=Tn=An=Ln=Pn=Dn=zn=0,i.geo.stream(e,$n);var t=Pn,n=Dn,r=zn,a=t*t+n*n+r*r;return a=0;--l)a.point((f=c[l])[0],f[1]);else r(h.x,h.p.x,-1,a);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);a.lineEnd()}}}function nr(e){if(t=e.length){for(var t,n,r=0,a=e[0];++r=0?1:-1,M=k*x,S=M>Te,N=p*b;if(On.add(Math.atan2(N*k*Math.sin(M),g*w+N*Math.cos(M))),i+=S?x+k*Ae:x,S^d>=n^v>=n){var _=Bn(In(f),In(e));qn(_);var C=Bn(a,_);qn(C);var E=(S^x>=0?-1:1)*Ie(C[2]);(r>E||r===E&&(_[0]||_[1]))&&(o+=S^x>=0?1:-1)}if(!m++)break;d=v,p=b,g=w,f=e}}return(i<-Ee||i0){for(b||(o.polygonStart(),b=!0),o.lineStart();++i1&&2&t&&n.push(n.pop().concat(n.shift())),l.push(n.filter(ir))}return c}}function ir(e){return e.length>1}function or(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:I,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function lr(e,t){return((e=e.x)[0]<0?e[1]-Pe-Ee:Pe-e[1])-((t=t.x)[0]<0?t[1]-Pe-Ee:Pe-t[1])}var ur=ar(er,(function(e){var t,n=NaN,r=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,o){var l=i>0?Te:-Te,u=k(i-n);k(u-Te)0?Pe:-Pe),e.point(a,r),e.lineEnd(),e.lineStart(),e.point(l,r),e.point(i,r),t=0):a!==l&&u>=Te&&(k(n-a)Ee?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(n)-Math.sin(r)*(a=Math.cos(t))*Math.sin(e))/(a*i*o)):(t+r)/2}(n,r,i,o),e.point(a,r),e.lineEnd(),e.lineStart(),e.point(l,r),t=0),e.point(n=i,r=o),a=l},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var a;if(null==e)a=n*Pe,r.point(-Te,a),r.point(0,a),r.point(Te,a),r.point(Te,0),r.point(Te,-a),r.point(0,-a),r.point(-Te,-a),r.point(-Te,0),r.point(-Te,a);else if(k(e[0]-t[0])>Ee){var i=e[0]0)){if(i/=d,d<0){if(i0){if(i>f)return;i>c&&(c=i)}if(i=n-u,d||!(i<0)){if(i/=d,d<0){if(i>f)return;i>c&&(c=i)}else if(d>0){if(i0)){if(i/=h,h<0){if(i0){if(i>f)return;i>c&&(c=i)}if(i=r-s,h||!(i<0)){if(i/=h,h<0){if(i>f)return;i>c&&(c=i)}else if(h>0){if(i0&&(a.a={x:u+c*d,y:s+c*h}),f<1&&(a.b={x:u+f*d,y:s+f*h}),a}}}}}}var cr=1e9;function fr(e,t,n,r){return function(u){var s,c,f,d,h,p,g,m,v,y,b,w=u,x=or(),k=sr(e,t,n,r),M={point:_,lineStart:function(){M.point=C,c&&c.push(f=[]);y=!0,v=!1,g=m=NaN},lineEnd:function(){s&&(C(d,h),p&&v&&x.rejoin(),s.push(x.buffer()));M.point=_,v&&u.lineEnd()},polygonStart:function(){u=x,s=[],c=[],b=!0},polygonEnd:function(){u=w,s=i.merge(s);var t=function(e){for(var t=0,n=c.length,r=e[1],a=0;ar&&Re(s,i,e)>0&&++t:i[1]<=r&&Re(s,i,e)<0&&--t,s=i;return 0!==t}([e,r]),n=b&&t,a=s.length;(n||a)&&(u.polygonStart(),n&&(u.lineStart(),S(null,null,1,u),u.lineEnd()),a&&tr(s,o,t,S,u),u.polygonEnd()),s=c=f=null}};function S(i,o,u,s){var c=0,f=0;if(null==i||(c=a(i,u))!==(f=a(o,u))||l(i,o)<0^u>0)do{s.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+u+4)%4)!==f);else s.point(o[0],o[1])}function N(a,i){return e<=a&&a<=n&&t<=i&&i<=r}function _(e,t){N(e,t)&&u.point(e,t)}function C(e,t){var n=N(e=Math.max(-cr,Math.min(cr,e)),t=Math.max(-cr,Math.min(cr,t)));if(c&&f.push([e,t]),y)d=e,h=t,p=n,y=!1,n&&(u.lineStart(),u.point(e,t));else if(n&&v)u.point(e,t);else{var r={a:{x:g,y:m},b:{x:e,y:t}};k(r)?(v||(u.lineStart(),u.point(r.a.x,r.a.y)),u.point(r.b.x,r.b.y),n||u.lineEnd(),b=!1):n&&(u.lineStart(),u.point(e,t),b=!1)}g=e,m=t,v=n}return M};function a(r,a){return k(r[0]-e)0?0:3:k(r[0]-n)0?2:1:k(r[1]-t)0?1:0:a>0?3:2}function o(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}}function dr(e){var t=0,n=Te/3,r=Or(e),a=r(t,n);return a.parallels=function(e){return arguments.length?r(t=e[0]*Te/180,n=e[1]*Te/180):[t/Te*180,n/Te*180]},a}function hr(e,t){var n=Math.sin(e),r=(n+Math.sin(t))/2,a=1+n*(2*r-n),i=Math.sqrt(a)/r;function o(e,t){var n=Math.sqrt(a-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),i-n*Math.cos(e)]}return o.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,Ie((a-(e*e+n*n)*r*r)/(2*r))]},o}i.geo.clipExtent=function(){var e,t,n,r,a,i,o={stream:function(e){return a&&(a.valid=!1),(a=i(e)).valid=!0,a},extent:function(l){return arguments.length?(i=fr(e=+l[0][0],t=+l[0][1],n=+l[1][0],r=+l[1][1]),a&&(a.valid=!1,a=null),o):[[e,t],[n,r]]}};return o.extent([[0,0],[960,500]])},(i.geo.conicEqualArea=function(){return dr(hr)}).raw=hr,i.geo.albers=function(){return i.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},i.geo.albersUsa=function(){var e,t,n,r,a=i.geo.albers(),o=i.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=i.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,n){e=[t,n]}};function s(a){var i=a[0],o=a[1];return e=null,t(i,o),e||(n(i,o),e)||r(i,o),e}return s.invert=function(e){var t=a.scale(),n=a.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?l:a).invert(e)},s.stream=function(e){var t=a.stream(e),n=o.stream(e),r=l.stream(e);return{point:function(e,a){t.point(e,a),n.point(e,a),r.point(e,a)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},s.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),l.precision(e),s):a.precision()},s.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),l.scale(e),s.translate(a.translate())):a.scale()},s.translate=function(e){if(!arguments.length)return a.translate();var i=a.scale(),c=+e[0],f=+e[1];return t=a.translate(e).clipExtent([[c-.455*i,f-.238*i],[c+.455*i,f+.238*i]]).stream(u).point,n=o.translate([c-.307*i,f+.201*i]).clipExtent([[c-.425*i+Ee,f+.12*i+Ee],[c-.214*i-Ee,f+.234*i-Ee]]).stream(u).point,r=l.translate([c-.205*i,f+.212*i]).clipExtent([[c-.214*i+Ee,f+.166*i+Ee],[c-.115*i-Ee,f+.234*i-Ee]]).stream(u).point,s},s.scale(1070)};var pr,gr,mr,vr,yr,br,wr={point:I,lineStart:I,lineEnd:I,polygonStart:function(){gr=0,wr.lineStart=xr},polygonEnd:function(){wr.lineStart=wr.lineEnd=wr.point=I,pr+=k(gr/2)}};function xr(){var e,t,n,r;function a(e,t){gr+=r*e-n*t,n=e,r=t}wr.point=function(i,o){wr.point=a,e=n=i,t=r=o},wr.lineEnd=function(){a(e,t)}}var kr={point:function(e,t){eyr&&(yr=e);tbr&&(br=t)},lineStart:I,lineEnd:I,polygonStart:I,polygonEnd:I};function Mr(){var e=Sr(4.5),t=[],n={point:r,lineStart:function(){n.point=a},lineEnd:o,polygonStart:function(){n.lineEnd=l},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(t){return e=Sr(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function r(n,r){t.push("M",n,",",r,e)}function a(e,r){t.push("M",e,",",r),n.point=i}function i(e,n){t.push("L",e,",",n)}function o(){n.point=r}function l(){t.push("Z")}return n}function Sr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var Nr,_r={point:Cr,lineStart:Er,lineEnd:jr,polygonStart:function(){_r.lineStart=Tr},polygonEnd:function(){_r.point=Cr,_r.lineStart=Er,_r.lineEnd=jr}};function Cr(e,t){Cn+=e,En+=t,++jn}function Er(){var e,t;function n(n,r){var a=n-e,i=r-t,o=Math.sqrt(a*a+i*i);Tn+=o*(e+n)/2,An+=o*(t+r)/2,Ln+=o,Cr(e=n,t=r)}_r.point=function(r,a){_r.point=n,Cr(e=r,t=a)}}function jr(){_r.point=Cr}function Tr(){var e,t,n,r;function a(e,t){var a=e-n,i=t-r,o=Math.sqrt(a*a+i*i);Tn+=o*(n+e)/2,An+=o*(r+t)/2,Ln+=o,Pn+=(o=r*e-n*t)*(n+e),Dn+=o*(r+t),zn+=3*o,Cr(n=e,r=t)}_r.point=function(i,o){_r.point=a,Cr(e=n=i,t=r=o)},_r.lineEnd=function(){a(e,t)}}function Ar(e){var t=4.5,n={point:r,lineStart:function(){n.point=a},lineEnd:o,polygonStart:function(){n.lineEnd=l},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(e){return t=e,n},result:I};function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,Ae)}function a(t,r){e.moveTo(t,r),n.point=i}function i(t,n){e.lineTo(t,n)}function o(){n.point=r}function l(){e.closePath()}return n}function Lr(e){var t=.5,n=Math.cos(30*De),r=16;function a(e){return(r?o:i)(e)}function i(t){return Dr(t,(function(n,r){n=e(n,r),t.point(n[0],n[1])}))}function o(t){var n,a,i,o,u,s,c,f,d,h,p,g,m={point:v,lineStart:y,lineEnd:w,polygonStart:function(){t.polygonStart(),m.lineStart=x},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function v(n,r){n=e(n,r),t.point(n[0],n[1])}function y(){f=NaN,m.point=b,t.lineStart()}function b(n,a){var i=In([n,a]),o=e(n,a);l(f,d,c,h,p,g,f=o[0],d=o[1],c=n,h=i[0],p=i[1],g=i[2],r,t),t.point(f,d)}function w(){m.point=v,t.lineEnd()}function x(){y(),m.point=k,m.lineEnd=M}function k(e,t){b(n=e,t),a=f,i=d,o=h,u=p,s=g,m.point=b}function M(){l(f,d,c,h,p,g,a,i,n,o,u,s,r,t),m.lineEnd=w,w()}return m}function l(r,a,i,o,u,s,c,f,d,h,p,g,m,v){var y=c-r,b=f-a,w=y*y+b*b;if(w>4*t&&m--){var x=o+h,M=u+p,S=s+g,N=Math.sqrt(x*x+M*M+S*S),_=Math.asin(S/=N),C=k(k(S)-1)t||k((y*A+b*L)/w-.5)>.3||o*h+u*p+s*g0&&16,a):Math.sqrt(t)},a}function Pr(e){this.stream=e}function Dr(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function zr(e){return Or((function(){return e}))()}function Or(e){var t,n,r,a,o,l,u=Lr((function(e,n){return[(e=t(e,n))[0]*s+a,o-e[1]*s]})),s=150,c=480,f=250,d=0,h=0,p=0,g=0,m=0,v=ur,y=z,b=null,w=null;function x(e){return[(e=r(e[0]*De,e[1]*De))[0]*s+a,o-e[1]*s]}function M(e){return(e=r.invert((e[0]-a)/s,(o-e[1])/s))&&[e[0]*ze,e[1]*ze]}function S(){r=Jn(n=Ur(p,g,m),t);var e=t(d,h);return a=c-e[0]*s,o=f+e[1]*s,N()}function N(){return l&&(l.valid=!1,l=null),x}return x.stream=function(e){return l&&(l.valid=!1),(l=Rr(v(n,u(y(e))))).valid=!0,l},x.clipAngle=function(e){return arguments.length?(v=null==e?(b=e,ur):function(e){var t=Math.cos(e),n=t>0,r=k(t)>Ee;return ar(a,(function(e){var t,l,u,s,c;return{lineStart:function(){s=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=a(f,d),m=n?g?0:o(f,d):g?o(f+(f<0?Te:-Te),d):0;if(!t&&(s=u=g)&&e.lineStart(),g!==u&&(h=i(t,p),(Zn(t,h)||Zn(p,h))&&(p[0]+=Ee,p[1]+=Ee,g=a(p[0],p[1]))),g!==u)c=0,g?(e.lineStart(),h=i(p,t),e.point(h[0],h[1])):(h=i(t,p),e.point(h[0],h[1]),e.lineEnd()),t=h;else if(r&&t&&n^g){var v;m&l||!(v=i(p,t,!0))||(c=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1])))}!g||t&&Zn(t,p)||e.point(p[0],p[1]),t=p,u=g,l=m},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return c|(s&&u)<<1}}}),qr(e,6*De),n?[0,-e]:[-Te,e-Te]);function a(e,n){return Math.cos(e)*Math.cos(n)>t}function i(e,n,r){var a=[1,0,0],i=Bn(In(e),In(n)),o=Un(i,i),l=i[0],u=o-l*l;if(!u)return!r&&e;var s=t*o/u,c=-t*l/u,f=Bn(a,i),d=Vn(a,s);Hn(d,Vn(i,c));var h=f,p=Un(d,h),g=Un(h,h),m=p*p-g*(Un(d,d)-1);if(!(m<0)){var v=Math.sqrt(m),y=Vn(h,(-p-v)/g);if(Hn(y,d),y=Wn(y),!r)return y;var b,w=e[0],x=n[0],M=e[1],S=n[1];x0^y[1]<(k(y[0]-w)Te^(w<=y[0]&&y[0]<=x)){var C=Vn(h,(-p+v)/g);return Hn(C,d),[y,Wn(C)]}}}function o(t,r){var a=n?e:Te-e,i=0;return t<-a?i|=1:t>a&&(i|=2),r<-a?i|=4:r>a&&(i|=8),i}}((b=+e)*De),N()):b},x.clipExtent=function(e){return arguments.length?(w=e,y=e?fr(e[0][0],e[0][1],e[1][0],e[1][1]):z,N()):w},x.scale=function(e){return arguments.length?(s=+e,S()):s},x.translate=function(e){return arguments.length?(c=+e[0],f=+e[1],S()):[c,f]},x.center=function(e){return arguments.length?(d=e[0]%360*De,h=e[1]%360*De,S()):[d*ze,h*ze]},x.rotate=function(e){return arguments.length?(p=e[0]%360*De,g=e[1]%360*De,m=e.length>2?e[2]%360*De:0,S()):[p*ze,g*ze,m*ze]},i.rebind(x,u,"precision"),function(){return t=e.apply(this,arguments),x.invert=t.invert&&M,S()}}function Rr(e){return Dr(e,(function(t,n){e.point(t*De,n*De)}))}function Fr(e,t){return[e,t]}function Ir(e,t){return[e>Te?e-Ae:e<-Te?e+Ae:e,t]}function Ur(e,t,n){return e?t||n?Jn(Hr(e),Vr(t,n)):Hr(e):t||n?Vr(t,n):Ir}function Br(e){return function(t,n){return[(t+=e)>Te?t-Ae:t<-Te?t+Ae:t,n]}}function Hr(e){var t=Br(e);return t.invert=Br(-e),t}function Vr(e,t){var n=Math.cos(e),r=Math.sin(e),a=Math.cos(t),i=Math.sin(t);function o(e,t){var o=Math.cos(t),l=Math.cos(e)*o,u=Math.sin(e)*o,s=Math.sin(t),c=s*n+l*r;return[Math.atan2(u*a-c*i,l*n-s*r),Ie(c*a+u*i)]}return o.invert=function(e,t){var o=Math.cos(t),l=Math.cos(e)*o,u=Math.sin(e)*o,s=Math.sin(t),c=s*a-u*i;return[Math.atan2(u*a+s*i,l*n+c*r),Ie(c*n-l*r)]},o}function qr(e,t){var n=Math.cos(e),r=Math.sin(e);return function(a,i,o,l){var u=o*t;null!=a?(a=Wr(n,a),i=Wr(n,i),(o>0?ai)&&(a+=o*Ae)):(a=e+o*Ae,i=e-.5*u);for(var s,c=a;o>0?c>i:c2?e[2]*De:0),t.invert=function(t){return(t=e.invert(t[0]*De,t[1]*De))[0]*=ze,t[1]*=ze,t},t},Ir.invert=Fr,i.geo.circle=function(){var e,t,n=[0,0],r=6;function a(){var e="function"===typeof n?n.apply(this,arguments):n,r=Ur(-e[0]*De,-e[1]*De,0).invert,a=[];return t(null,null,1,{point:function(e,t){a.push(e=r(e,t)),e[0]*=ze,e[1]*=ze}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(e){return arguments.length?(n=e,a):n},a.angle=function(n){return arguments.length?(t=qr((e=+n)*De,r*De),a):e},a.precision=function(n){return arguments.length?(t=qr(e*De,(r=+n)*De),a):r},a.angle(90)},i.geo.distance=function(e,t){var n,r=(t[0]-e[0])*De,a=e[1]*De,i=t[1]*De,o=Math.sin(r),l=Math.cos(r),u=Math.sin(a),s=Math.cos(a),c=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((n=f*o)*n+(n=s*c-u*f*l)*n),u*c+s*f*l)},i.geo.graticule=function(){var e,t,n,r,a,o,l,u,s,c,f,d,h=10,p=h,g=90,m=360,v=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return i.range(Math.ceil(r/g)*g,n,g).map(f).concat(i.range(Math.ceil(u/m)*m,l,m).map(d)).concat(i.range(Math.ceil(t/h)*h,e,h).filter((function(e){return k(e%g)>Ee})).map(s)).concat(i.range(Math.ceil(o/p)*p,a,p).filter((function(e){return k(e%m)>Ee})).map(c))}return y.lines=function(){return b().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[f(r).concat(d(l).slice(1),f(n).reverse().slice(1),d(u).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.majorExtent(e).minorExtent(e):y.minorExtent()},y.majorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],u=+e[0][1],l=+e[1][1],r>n&&(e=r,r=n,n=e),u>l&&(e=u,u=l,l=e),y.precision(v)):[[r,u],[n,l]]},y.minorExtent=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],a=+n[1][1],t>e&&(n=t,t=e,e=n),o>a&&(n=o,o=a,a=n),y.precision(v)):[[t,o],[e,a]]},y.step=function(e){return arguments.length?y.majorStep(e).minorStep(e):y.minorStep()},y.majorStep=function(e){return arguments.length?(g=+e[0],m=+e[1],y):[g,m]},y.minorStep=function(e){return arguments.length?(h=+e[0],p=+e[1],y):[h,p]},y.precision=function(i){return arguments.length?(v=+i,s=Zr(o,a,90),c=$r(t,e,v),f=Zr(u,l,90),d=$r(r,n,v),y):v},y.majorExtent([[-180,-90+Ee],[180,90-Ee]]).minorExtent([[-180,-80-Ee],[180,80+Ee]])},i.geo.greatArc=function(){var e,t,n=Yr,r=Qr;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),t||r.apply(this,arguments)]}}return a.distance=function(){return i.geo.distance(e||n.apply(this,arguments),t||r.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"===typeof t?null:t,a):n},a.target=function(e){return arguments.length?(r=e,t="function"===typeof e?null:e,a):r},a.precision=function(){return arguments.length?a:0},a},i.geo.interpolate=function(e,t){return function(e,t,n,r){var a=Math.cos(t),i=Math.sin(t),o=Math.cos(r),l=Math.sin(r),u=a*Math.cos(e),s=a*Math.sin(e),c=o*Math.cos(n),f=o*Math.sin(n),d=2*Math.asin(Math.sqrt(Be(r-t)+a*o*Be(n-e))),h=1/Math.sin(d),p=d?function(e){var t=Math.sin(e*=d)*h,n=Math.sin(d-e)*h,r=n*u+t*c,a=n*s+t*f,o=n*i+t*l;return[Math.atan2(a,r)*ze,Math.atan2(o,Math.sqrt(r*r+a*a))*ze]}:function(){return[e*ze,t*ze]};return p.distance=d,p}(e[0]*De,e[1]*De,t[0]*De,t[1]*De)},i.geo.length=function(e){return Nr=0,i.geo.stream(e,Xr),Nr};var Xr={sphere:I,point:I,lineStart:function(){var e,t,n;function r(r,a){var i=Math.sin(a*=De),o=Math.cos(a),l=k((r*=De)-e),u=Math.cos(l);Nr+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=n*i-t*o*u)*l),t*i+n*o*u),e=r,t=i,n=o}Xr.point=function(a,i){e=a*De,t=Math.sin(i*=De),n=Math.cos(i),Xr.point=r},Xr.lineEnd=function(){Xr.point=Xr.lineEnd=I}},lineEnd:I,polygonStart:I,polygonEnd:I};function Gr(e,t){function n(t,n){var r=Math.cos(t),a=Math.cos(n),i=e(r*a);return[i*a*Math.sin(t),i*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),a=t(r),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(e*i,r*o),Math.asin(r&&n*i/r)]},n}var Kr=Gr((function(e){return Math.sqrt(2/(1+e))}),(function(e){return 2*Math.asin(e/2)}));(i.geo.azimuthalEqualArea=function(){return zr(Kr)}).raw=Kr;var Jr=Gr((function(e){var t=Math.acos(e);return t&&t/Math.sin(t)}),z);function ea(e,t){var n=Math.cos(e),r=function(e){return Math.tan(Te/4+e/2)},a=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),i=n*Math.pow(r(e),a)/a;if(!a)return ra;function o(e,t){i>0?t<-Pe+Ee&&(t=-Pe+Ee):t>Pe-Ee&&(t=Pe-Ee);var n=i/Math.pow(r(t),a);return[n*Math.sin(a*e),i-n*Math.cos(a*e)]}return o.invert=function(e,t){var n=i-t,r=Oe(a)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/a,2*Math.atan(Math.pow(i/r,1/a))-Pe]},o}function ta(e,t){var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),a=n/r+e;if(k(r)1&&Re(e[n[r-2]],e[n[r-1]],e[a])<=0;)--r;n[r++]=a}return n.slice(0,r)}function fa(e,t){return e[0]-t[0]||e[1]-t[1]}(i.geo.stereographic=function(){return zr(oa)}).raw=oa,la.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Pe]},(i.geo.transverseMercator=function(){var e=aa(la),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90])}).raw=la,i.geom={},i.geom.hull=function(e){var t=ua,n=sa;if(arguments.length)return r(e);function r(e){if(e.length<3)return[];var r,a=xt(t),i=xt(n),o=e.length,l=[],u=[];for(r=0;r=0;--r)h.push(e[l[s[r]][2]]);for(r=+f;rEe)l=l.L;else{if(!((a=i-ja(l,o))>Ee)){r>-Ee?(t=l.P,n=l):a>-Ee?(t=l,n=l.N):t=n=l;break}if(!l.R){t=l;break}l=l.R}var u=Sa(e);if(ya.insert(t,u),t||n){if(t===n)return Da(t),n=Sa(t.site),ya.insert(u,n),u.edge=n.edge=Ra(t.site,u.site),Pa(t),void Pa(n);if(n){Da(t),Da(n);var s=t.site,c=s.x,f=s.y,d=e.x-c,h=e.y-f,p=n.site,g=p.x-c,m=p.y-f,v=2*(d*m-h*g),y=d*d+h*h,b=g*g+m*m,w={x:(m*y-h*b)/v+c,y:(d*b-g*y)/v+f};Ia(n.edge,s,p,w),u.edge=Ra(s,e,null,w),n.edge=Ra(e,p,null,w),Pa(t),Pa(n)}else u.edge=Ra(t.site,u.site)}}function Ea(e,t){var n=e.site,r=n.x,a=n.y,i=a-t;if(!i)return r;var o=e.P;if(!o)return-1/0;var l=(n=o.site).x,u=n.y,s=u-t;if(!s)return l;var c=l-r,f=1/i-1/s,d=c/s;return f?(-d+Math.sqrt(d*d-2*f*(c*c/(-2*s)-u+s/2+a-i/2)))/f+r:(r+l)/2}function ja(e,t){var n=e.N;if(n)return Ea(n,t);var r=e.site;return r.y===t?r.x:1/0}function Ta(e){this.site=e,this.edges=[]}function Aa(e,t){return t.angle-e.angle}function La(){Ha(this),this.x=this.y=this.arc=this.site=this.cy=null}function Pa(e){var t=e.P,n=e.N;if(t&&n){var r=t.site,a=e.site,i=n.site;if(r!==i){var o=a.x,l=a.y,u=r.x-o,s=r.y-l,c=i.x-o,f=2*(u*(m=i.y-l)-s*c);if(!(f>=-je)){var d=u*u+s*s,h=c*c+m*m,p=(m*d-s*h)/f,g=(u*h-c*d)/f,m=g+l,v=ka.pop()||new La;v.arc=e,v.site=a,v.x=p+o,v.y=m+Math.sqrt(p*p+g*g),v.cy=m,e.circle=v;for(var y=null,b=wa._;b;)if(v.y=l)return;if(d>p){if(i){if(i.y>=s)return}else i={x:m,y:u};n={x:m,y:s}}else{if(i){if(i.y1)if(d>p){if(i){if(i.y>=s)return}else i={x:(u-a)/r,y:u};n={x:(s-a)/r,y:s}}else{if(i){if(i.y=l)return}else i={x:o,y:r*o+a};n={x:l,y:r*l+a}}else{if(i){if(i.xEe||k(a-n)>Ee)&&(l.splice(o,0,new Ua(Fa(i.site,c,k(r-f)Ee?{x:f,y:k(t-f)Ee?{x:k(n-p)Ee?{x:d,y:k(t-d)Ee?{x:k(n-h)=n&&s.x<=a&&s.y>=r&&s.y<=o?[[n,o],[a,o],[a,r],[n,r]]:[]).point=e[l]})),t}function l(e){return e.map((function(e,t){return{x:Math.round(r(e,t)/Ee)*Ee,y:Math.round(a(e,t)/Ee)*Ee,i:t}}))}return o.links=function(e){return Za(l(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return Za(l(e)).cells.forEach((function(n,r){for(var a,i,o,l,u=n.site,s=n.edges.sort(Aa),c=-1,f=s.length,d=s[f-1].edge,h=d.l===u?d.r:d.l;++ci&&(a=t.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(n=n[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,u.push({i:o,x:ei(n,r)})),i=ri.lastIndex;return ig&&(g=u.x),u.y>m&&(m=u.y),s.push(u.x),c.push(u.y);else for(f=0;fg&&(g=b),w>m&&(m=w),s.push(b),c.push(w)}var x=g-h,M=m-p;function S(e,t,n,r,a,i,o,l){if(!isNaN(n)&&!isNaN(r))if(e.leaf){var u=e.x,s=e.y;if(null!=u)if(k(u-n)+k(s-r)<.01)N(e,t,n,r,a,i,o,l);else{var c=e.point;e.x=e.y=e.point=null,N(e,c,u,s,a,i,o,l),N(e,t,n,r,a,i,o,l)}else e.x=n,e.y=r,e.point=t}else N(e,t,n,r,a,i,o,l)}function N(e,t,n,r,a,i,o,l){var u=.5*(a+o),s=.5*(i+l),c=n>=u,f=r>=s,d=f<<1|c;e.leaf=!1,c?a=u:o=u,f?i=s:l=s,S(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,n,r,a,i,o,l)}x>M?m=p+x:g=h+M;var _={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){S(_,e,+v(e,++f),+y(e,f),h,p,g,m)}};if(_.visit=function(e){Ga(e,_,h,p,g,m)},_.find=function(e){return function(e,t,n,r,a,i,o){var l,u=1/0;return function e(s,c,f,d,h){if(!(c>i||f>o||d=x)<<1|t>=w,M=k+4;k=0&&!(n=i.interpolators[r](e,t)););return n}function ii(e,t){var n,r=[],a=[],i=e.length,o=t.length,l=Math.min(e.length,t.length);for(n=0;n=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function pi(e){return 1-Math.cos(e*Pe)}function gi(e){return Math.pow(2,10*(e-1))}function mi(e){return 1-Math.sqrt(1-e*e)}function vi(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function yi(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function bi(e){var t=[e.a,e.b],n=[e.c,e.d],r=xi(t),a=wi(t,n),i=xi(function(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}(n,t,-a))||0;t[0]*n[1]=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):"in";return n=li.get(n)||oi,function(e){return function(t){return t<=0?0:t>=1?1:e(t)}}((r=ui.get(r)||z)(n.apply(null,o.call(arguments,1))))},i.interpolateHcl=function(e,t){e=i.hcl(e),t=i.hcl(t);var n=e.h,r=e.c,a=e.l,o=t.h-n,l=t.c-r,u=t.l-a;isNaN(l)&&(l=0,r=isNaN(r)?t.c:r);isNaN(o)?(o=0,n=isNaN(n)?t.h:n):o>180?o-=360:o<-180&&(o+=360);return function(e){return Ke(n+o*e,r+l*e,a+u*e)+""}},i.interpolateHsl=function(e,t){e=i.hsl(e),t=i.hsl(t);var n=e.h,r=e.s,a=e.l,o=t.h-n,l=t.s-r,u=t.l-a;isNaN(l)&&(l=0,r=isNaN(r)?t.s:r);isNaN(o)?(o=0,n=isNaN(n)?t.h:n):o>180?o-=360:o<-180&&(o+=360);return function(e){return Qe(n+o*e,r+l*e,a+u*e)+""}},i.interpolateLab=function(e,t){e=i.lab(e),t=i.lab(t);var n=e.l,r=e.a,a=e.b,o=t.l-n,l=t.a-r,u=t.b-a;return function(e){return it(n+o*e,r+l*e,a+u*e)+""}},i.interpolateRound=yi,i.transform=function(e){var t=u.createElementNS(i.ns.prefix.svg,"g");return(i.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new bi(n?n.matrix:ki)})(e)},bi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ki={a:1,b:0,c:0,d:1,e:0,f:0};function Mi(e){return e.length?e.pop()+",":""}function Si(e,t){var n=[],r=[];return e=i.transform(e),t=i.transform(t),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var a=n.push("translate(",null,",",null,")");r.push({i:a-4,x:ei(e[0],t[0])},{i:a-2,x:ei(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}(e.translate,t.translate,n,r),function(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(Mi(n)+"rotate(",null,")")-2,x:ei(e,t)})):t&&n.push(Mi(n)+"rotate("+t+")")}(e.rotate,t.rotate,n,r),function(e,t,n,r){e!==t?r.push({i:n.push(Mi(n)+"skewX(",null,")")-2,x:ei(e,t)}):t&&n.push(Mi(n)+"skewX("+t+")")}(e.skew,t.skew,n,r),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var a=n.push(Mi(n)+"scale(",null,",",null,")");r.push({i:a-4,x:ei(e[0],t[0])},{i:a-2,x:ei(e[1],t[1])})}else 1===t[0]&&1===t[1]||n.push(Mi(n)+"scale("+t+")")}(e.scale,t.scale,n,r),e=t=null,function(e){for(var t,a=-1,i=r.length;++a0?n=t:(e.c=null,e.t=NaN,e=null,u.end({type:"end",alpha:n=0})):t>0&&(u.start({type:"start",alpha:n=t}),e=jt(l.tick)),l):n},l.start=function(){var e,t,n,i=v.length,u=y.length,c=s[0],p=s[1];for(e=0;e=0;)n.push(a[r])}function Ii(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(i=e.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=s[u]),c.parent=i,c.depth=i.depth+1;n&&(i.value=0),i.children=s}else n&&(i.value=+n.call(r,i,i.depth)||0),delete i.children;return Ii(a,(function(t){var r,a;e&&(r=t.children)&&r.sort(e),n&&(a=t.parent)&&(a.value+=t.value)})),l}return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&(Fi(e,(function(e){e.children&&(e.value=0)})),Ii(e,(function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},r},i.layout.partition=function(){var e=i.layout.hierarchy(),t=[1,1];function n(e,t,r,a){var i=e.children;if(e.x=t,e.y=e.depth*a,e.dx=r,e.dy=a,i&&(o=i.length)){var o,l,u,s=-1;for(r=e.value?r/e.value:0;++sl&&(l=r),o.push(r)}for(n=0;na&&(r=n,a=t);return r}function Ji(e){return e.reduce(eo,0)}function eo(e,t){return e+t[1]}function to(e,t){return no(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function no(e,t){for(var n=-1,r=+e[0],a=(e[1]-r)/t,i=[];++n<=t;)i[n]=a*n+r;return i}function ro(e){return[i.min(e),i.max(e)]}function ao(e,t){return e.value-t.value}function io(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function oo(e,t){e._pack_next=t,t._pack_prev=e}function lo(e,t){var n=t.x-e.x,r=t.y-e.y,a=e.r+t.r;return.999*a*a>n*n+r*r}function uo(e){if((t=e.children)&&(u=t.length)){var t,n,r,a,i,o,l,u,s=1/0,c=-1/0,f=1/0,d=-1/0;if(t.forEach(so),(n=t[0]).x=-n.r,n.y=0,b(n),u>1&&((r=t[1]).x=r.r,r.y=0,b(r),u>2))for(ho(n,r,a=t[2]),b(a),io(n,a),n._pack_prev=a,io(a,r),r=n._pack_next,i=3;i