// https://d3js.org/d3-geo/ v1.12.1 Copyright 2020 Mike Bostock !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],t):t((n=n||self).d3=n.d3||{},n.d3)}(this,(function(n,t){"use strict";function r(){return new i}function i(){this.reset()}i.prototype={constructor:i,reset:function(){this.s=this.t=0},add:function(n){o(e,n,this.t),o(this,e.s,this.s),this.s?this.t+=e.t:this.s=e.t},valueOf:function(){return this.s}};var e=new i;function o(n,t,r){var i=n.s=t+r,e=i-t,o=i-e;n.t=t-o+(r-e)}var u=1e-6,c=1e-12,a=Math.PI,l=a/2,f=a/4,s=2*a,p=180/a,h=a/180,g=Math.abs,v=Math.atan,d=Math.atan2,E=Math.cos,y=Math.ceil,S=Math.exp,m=Math.log,M=Math.pow,x=Math.sin,_=Math.sign||function(n){return n>0?1:n<0?-1:0},N=Math.sqrt,w=Math.tan;function R(n){return n>1?0:n<-1?a:Math.acos(n)}function C(n){return n>1?l:n<-1?-l:Math.asin(n)}function P(n){return(n=x(n/2))*n}function A(){}function j(n,t){n&&z.hasOwnProperty(n.type)&&z[n.type](n,t)}var q={Feature:function(n,t){j(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i=0?1:-1,e=i*r,o=E(t=(t*=h)/2+f),u=x(t),c=H*u,a=F*o+c*E(e),l=c*i*x(e);I.add(d(l,a)),k=n,F=o,H=u}function Z(n){return[d(n[1],n[0]),C(n[2])]}function J(n){var t=n[0],r=n[1],i=E(r);return[i*E(t),i*x(t),x(r)]}function K(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function Q(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 V(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function $(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function nn(n){var t=N(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var tn,rn,en,on,un,cn,an,ln,fn,sn,pn,hn,gn,vn,dn,En,yn,Sn,mn,Mn,xn,_n,Nn,wn,Rn,Cn,Pn=r(),An={point:jn,lineStart:zn,lineEnd:bn,polygonStart:function(){An.point=Ln,An.lineStart=On,An.lineEnd=Gn,Pn.reset(),X.polygonStart()},polygonEnd:function(){X.polygonEnd(),An.point=jn,An.lineStart=zn,An.lineEnd=bn,I<0?(tn=-(en=180),rn=-(on=90)):Pn>u?on=90:Pn<-u&&(rn=-90),sn[0]=tn,sn[1]=en},sphere:function(){tn=-(en=180),rn=-(on=90)}};function jn(n,t){fn.push(sn=[tn=n,en=n]),ton&&(on=t)}function qn(n,t){var r=J([n*h,t*h]);if(ln){var i=Q(ln,r),e=Q([i[1],-i[0],0],i);nn(e),e=Z(e);var o,u=n-un,c=u>0?1:-1,a=e[0]*p*c,l=g(u)>180;l^(c*unon&&(on=o):l^(c*un<(a=(a+360)%360-180)&&aon&&(on=t)),l?nTn(tn,en)&&(en=n):Tn(n,en)>Tn(tn,en)&&(tn=n):en>=tn?(nen&&(en=n)):n>un?Tn(tn,n)>Tn(tn,en)&&(en=n):Tn(n,en)>Tn(tn,en)&&(tn=n)}else fn.push(sn=[tn=n,en=n]);ton&&(on=t),ln=r,un=n}function zn(){An.point=qn}function bn(){sn[0]=tn,sn[1]=en,An.point=jn,ln=null}function Ln(n,t){if(ln){var r=n-un;Pn.add(g(r)>180?r+(r>0?360:-360):r)}else cn=n,an=t;X.point(n,t),qn(n,t)}function On(){X.lineStart()}function Gn(){Ln(cn,an),X.lineEnd(),g(Pn)>u&&(tn=-(en=180)),sn[0]=tn,sn[1]=en,ln=null}function Tn(n,t){return(t-=n)<0?t+360:t}function kn(n,t){return n[0]-t[0]}function Fn(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:ta?n+Math.round(-n/s)*s:n,t]}function nt(n,t,r){return(n%=s)?t||r?Vn(rt(n),it(t,r)):rt(n):t||r?it(t,r):$n}function tt(n){return function(t,r){return[(t+=n)>a?t-s:t<-a?t+s:t,r]}}function rt(n){var t=tt(n);return t.invert=tt(-n),t}function it(n,t){var r=E(n),i=x(n),e=E(t),o=x(t);function u(n,t){var u=E(t),c=E(n)*u,a=x(n)*u,l=x(t),f=l*r+c*i;return[d(a*e-f*o,c*r-l*i),C(f*e+a*o)]}return u.invert=function(n,t){var u=E(t),c=E(n)*u,a=x(n)*u,l=x(t),f=l*e-a*o;return[d(a*e+l*o,c*r+f*i),C(f*r-c*i)]},u}function et(n){function t(t){return(t=n(t[0]*h,t[1]*h))[0]*=p,t[1]*=p,t}return n=nt(n[0]*h,n[1]*h,n.length>2?n[2]*h:0),t.invert=function(t){return(t=n.invert(t[0]*h,t[1]*h))[0]*=p,t[1]*=p,t},t}function ot(n,t,r,i,e,o){if(r){var u=E(t),c=x(t),a=i*r;null==e?(e=t+i*s,o=t-a/2):(e=ut(u,e),o=ut(u,o),(i>0?eo)&&(e+=i*s));for(var l,f=e;i>0?f>o:f1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}}function at(n,t){return g(n[0]-t[0])=0;--o)e.point((s=f[o])[0],s[1]);else i(h.x,h.p.x,-1,e);h=h.p}f=(h=h.o).z,g=!g}while(!h.v);e.lineEnd()}}}function st(n){if(t=n.length){for(var t,r,i=0,e=n[0];++i=0?1:-1,L=b*z,O=L>a,G=_*j;if(pt.add(d(G*b*x(L),N*q+G*E(L))),c+=O?z+b*s:z,O^m>=r^P>=r){var T=Q(J(S),J(R));nn(T);var k=Q(o,T);nn(k);var F=(O^z>=0?-1:1)*C(k[2]);(i>F||i===F&&(T[0]||T[1]))&&(p+=O^z>=0?1:-1)}}return(c<-u||c0){for(p||(o.polygonStart(),p=!0),o.lineStart(),n=0;n1&&2&e&&l.push(l.pop().concat(l.shift())),c.push(l.filter(dt))}return h}}function dt(n){return n.length>1}function Et(n,t){return((n=n.x)[0]<0?n[1]-l-u:l-n[1])-((t=t.x)[0]<0?t[1]-l-u:l-t[1])}var yt=vt((function(){return!0}),(function(n){var t,r=NaN,i=NaN,e=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(o,c){var f=o>0?a:-a,s=g(o-r);g(s-a)0?l:-l),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(f,i),n.point(o,i),t=0):e!==f&&s>=a&&(g(r-e)u?v((x(t)*(o=E(i))*x(r)-x(i)*(e=E(t))*x(n))/(e*o*c)):(t+i)/2}(r,i,o,c),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(f,i),t=0),n.point(r=o,i=c),e=f},lineEnd:function(){n.lineEnd(),r=i=NaN},clean:function(){return 2-t}}}),(function(n,t,r,i){var e;if(null==n)e=r*l,i.point(-a,e),i.point(0,e),i.point(a,e),i.point(a,0),i.point(a,-e),i.point(0,-e),i.point(-a,-e),i.point(-a,0),i.point(-a,e);else if(g(n[0]-t[0])>u){var o=n[0]0,e=g(t)>u;function o(n,r){return E(n)*E(r)>t}function c(n,r,i){var e=[1,0,0],o=Q(J(n),J(r)),c=K(o,o),l=o[0],f=c-l*l;if(!f)return!i&&n;var s=t*c/f,p=-t*l/f,h=Q(e,o),v=$(e,s);V(v,$(o,p));var d=h,E=K(v,d),y=K(d,d),S=E*E-y*(K(v,v)-1);if(!(S<0)){var m=N(S),M=$(d,(-E-m)/y);if(V(M,v),M=Z(M),!i)return M;var x,_=n[0],w=r[0],R=n[1],C=r[1];w<_&&(x=_,_=w,w=x);var P=w-_,A=g(P-a)0^M[1]<(g(M[0]-_)a^(_<=M[0]&&M[0]<=w)){var j=$(d,(-E+m)/y);return V(j,v),[M,Z(j)]}}}function l(t,r){var e=i?n:a-n,o=0;return t<-e?o|=1:t>e&&(o|=2),r<-e?o|=4:r>e&&(o|=8),o}return vt(o,(function(n){var t,r,u,f,s;return{lineStart:function(){f=u=!1,s=1},point:function(p,h){var g,v=[p,h],d=o(p,h),E=i?d?0:l(p,h):d?l(p+(p<0?a:-a),h):0;if(!t&&(f=u=d)&&n.lineStart(),d!==u&&(!(g=c(t,v))||at(t,g)||at(v,g))&&(v[2]=1),d!==u)s=0,d?(n.lineStart(),g=c(v,t),n.point(g[0],g[1])):(g=c(t,v),n.point(g[0],g[1],2),n.lineEnd()),t=g;else if(e&&t&&i^d){var y;E&r||!(y=c(v,t,!0))||(s=0,i?(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],3)))}!d||t&&at(t,v)||n.point(v[0],v[1]),t=v,u=d,r=E},lineEnd:function(){u&&n.lineEnd(),t=null},clean:function(){return s|(f&&u)<<1}}}),(function(t,i,e,o){ot(o,n,r,e,t,i)}),i?[0,-n]:[-a,n-a])}var mt=1e9,Mt=-mt;function xt(n,r,i,e){function o(t,o){return n<=t&&t<=i&&r<=o&&o<=e}function c(t,o,u,c){var l=0,s=0;if(null==t||(l=a(t,u))!==(s=a(o,u))||f(t,o)<0^u>0)do{c.point(0===l||3===l?n:i,l>1?e:r)}while((l=(l+u+4)%4)!==s);else c.point(o[0],o[1])}function a(t,e){return g(t[0]-n)0?0:3:g(t[0]-i)0?2:1:g(t[1]-r)0?1:0:e>0?3:2}function l(n,t){return f(n.x,t.x)}function f(n,t){var r=a(n,1),i=a(t,1);return r!==i?r-i:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}return function(u){var a,f,s,p,h,g,v,d,E,y,S,m=u,M=ct(),x={point:_,lineStart:function(){x.point=N,f&&f.push(s=[]);y=!0,E=!1,v=d=NaN},lineEnd:function(){a&&(N(p,h),g&&E&&M.rejoin(),a.push(M.result()));x.point=_,E&&m.lineEnd()},polygonStart:function(){m=M,a=[],f=[],S=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,i=f.length;re&&(p-o)*(e-u)>(h-u)*(n-o)&&++t:h<=e&&(p-o)*(e-u)<(h-u)*(n-o)&&--t;return t}(),i=S&&r,o=(a=t.merge(a)).length;(i||o)&&(u.polygonStart(),i&&(u.lineStart(),c(null,null,1,u),u.lineEnd()),o&&ft(a,l,r,c,u),u.polygonEnd());m=u,a=f=s=null}};function _(n,t){o(n,t)&&m.point(n,t)}function N(t,u){var c=o(t,u);if(f&&s.push([t,u]),y)p=t,h=u,g=c,y=!1,c&&(m.lineStart(),m.point(t,u));else if(c&&E)m.point(t,u);else{var a=[v=Math.max(Mt,Math.min(mt,v)),d=Math.max(Mt,Math.min(mt,d))],l=[t=Math.max(Mt,Math.min(mt,t)),u=Math.max(Mt,Math.min(mt,u))];!function(n,t,r,i,e,o){var u,c=n[0],a=n[1],l=0,f=1,s=t[0]-c,p=t[1]-a;if(u=r-c,s||!(u>0)){if(u/=s,s<0){if(u0){if(u>f)return;u>l&&(l=u)}if(u=e-c,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>l&&(l=u)}else if(s>0){if(u0)){if(u/=p,p<0){if(u0){if(u>f)return;u>l&&(l=u)}if(u=o-a,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>l&&(l=u)}else if(p>0){if(u0&&(n[0]=c+l*s,n[1]=a+l*p),f<1&&(t[0]=c+f*s,t[1]=a+f*p),!0}}}}}(a,l,n,r,i,e)?c&&(m.lineStart(),m.point(t,u),S=!1):(E||(m.lineStart(),m.point(a[0],a[1])),m.point(l[0],l[1]),c||m.lineEnd(),S=!1)}v=t,d=u,E=c}return x}}var _t,Nt,wt,Rt=r(),Ct={sphere:A,point:A,lineStart:function(){Ct.point=At,Ct.lineEnd=Pt},lineEnd:A,polygonStart:A,polygonEnd:A};function Pt(){Ct.point=Ct.lineEnd=A}function At(n,t){_t=n*=h,Nt=x(t*=h),wt=E(t),Ct.point=jt}function jt(n,t){n*=h;var r=x(t*=h),i=E(t),e=g(n-_t),o=E(e),u=i*x(e),c=wt*r-Nt*i*o,a=Nt*r+wt*i*o;Rt.add(d(N(u*u+c*c),a)),_t=n,Nt=r,wt=i}function qt(n){return Rt.reset(),O(n,Ct),+Rt}var zt=[null,null],bt={type:"LineString",coordinates:zt};function Lt(n,t){return zt[0]=n,zt[1]=t,qt(bt)}var Ot={Feature:function(n,t){return Tt(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i0&&(e=Lt(n[o],n[o-1]))>0&&r<=e&&i<=e&&(r+i-e)*(1-Math.pow((r-i)/e,2))u})).map(f)).concat(t.range(y(c/d)*d,o,d).filter((function(n){return g(n%S)>u})).map(s))}return M.lines=function(){return x().map((function(n){return{type:"LineString",coordinates:n}}))},M.outline=function(){return{type:"Polygon",coordinates:[p(e).concat(h(a).slice(1),p(i).reverse().slice(1),h(l).reverse().slice(1))]}},M.extent=function(n){return arguments.length?M.extentMajor(n).extentMinor(n):M.extentMinor()},M.extentMajor=function(n){return arguments.length?(e=+n[0][0],i=+n[1][0],l=+n[0][1],a=+n[1][1],e>i&&(n=e,e=i,i=n),l>a&&(n=l,l=a,a=n),M.precision(m)):[[e,l],[i,a]]},M.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],c=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),c>o&&(t=c,c=o,o=t),M.precision(m)):[[r,c],[n,o]]},M.step=function(n){return arguments.length?M.stepMajor(n).stepMinor(n):M.stepMinor()},M.stepMajor=function(n){return arguments.length?(E=+n[0],S=+n[1],M):[E,S]},M.stepMinor=function(n){return arguments.length?(v=+n[0],d=+n[1],M):[v,d]},M.precision=function(t){return arguments.length?(m=+t,f=Xt(c,o,90),s=Yt(r,n,m),p=Xt(l,a,90),h=Yt(e,i,m),M):m},M.extentMajor([[-180,-90+u],[180,90-u]]).extentMinor([[-180,-80-u],[180,80+u]])}function Dt(n){return n}var Ut,Zt,Jt,Kt,Qt=r(),Vt=r(),$t={point:A,lineStart:A,lineEnd:A,polygonStart:function(){$t.lineStart=nr,$t.lineEnd=ir},polygonEnd:function(){$t.lineStart=$t.lineEnd=$t.point=A,Qt.add(g(Vt)),Vt.reset()},result:function(){var n=Qt/2;return Qt.reset(),n}};function nr(){$t.point=tr}function tr(n,t){$t.point=rr,Ut=Jt=n,Zt=Kt=t}function rr(n,t){Vt.add(Kt*n-Jt*t),Jt=n,Kt=t}function ir(){rr(Ut,Zt)}var er=1/0,or=er,ur=-er,cr=ur,ar={point:function(n,t){nur&&(ur=n);tcr&&(cr=t)},lineStart:A,lineEnd:A,polygonStart:A,polygonEnd:A,result:function(){var n=[[er,or],[ur,cr]];return ur=cr=-(or=er=1/0),n}};var lr,fr,sr,pr,hr=0,gr=0,vr=0,dr=0,Er=0,yr=0,Sr=0,mr=0,Mr=0,xr={point:_r,lineStart:Nr,lineEnd:Cr,polygonStart:function(){xr.lineStart=Pr,xr.lineEnd=Ar},polygonEnd:function(){xr.point=_r,xr.lineStart=Nr,xr.lineEnd=Cr},result:function(){var n=Mr?[Sr/Mr,mr/Mr]:yr?[dr/yr,Er/yr]:vr?[hr/vr,gr/vr]:[NaN,NaN];return hr=gr=vr=dr=Er=yr=Sr=mr=Mr=0,n}};function _r(n,t){hr+=n,gr+=t,++vr}function Nr(){xr.point=wr}function wr(n,t){xr.point=Rr,_r(sr=n,pr=t)}function Rr(n,t){var r=n-sr,i=t-pr,e=N(r*r+i*i);dr+=e*(sr+n)/2,Er+=e*(pr+t)/2,yr+=e,_r(sr=n,pr=t)}function Cr(){xr.point=_r}function Pr(){xr.point=jr}function Ar(){qr(lr,fr)}function jr(n,t){xr.point=qr,_r(lr=sr=n,fr=pr=t)}function qr(n,t){var r=n-sr,i=t-pr,e=N(r*r+i*i);dr+=e*(sr+n)/2,Er+=e*(pr+t)/2,yr+=e,Sr+=(e=pr*n-sr*t)*(sr+n),mr+=e*(pr+t),Mr+=3*e,_r(sr=n,pr=t)}function zr(n){this._context=n}zr.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._context.moveTo(n,t),this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,s)}},result:A};var br,Lr,Or,Gr,Tr,kr=r(),Fr={point:A,lineStart:function(){Fr.point=Hr},lineEnd:function(){br&&Ir(Lr,Or),Fr.point=A},polygonStart:function(){br=!0},polygonEnd:function(){br=null},result:function(){var n=+kr;return kr.reset(),n}};function Hr(n,t){Fr.point=Ir,Lr=Gr=n,Or=Tr=t}function Ir(n,t){Gr-=n,Tr-=t,kr.add(N(Gr*Gr+Tr*Tr)),Gr=n,Tr=t}function Wr(){this._string=[]}function Xr(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Yr(n){return function(t){var r=new Br;for(var i in n)r[i]=n[i];return r.stream=t,r}}function Br(){}function Dr(n,t,r){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),O(r,n.stream(ar)),t(ar.result()),null!=i&&n.clipExtent(i),n}function Ur(n,t,r){return Dr(n,(function(r){var i=t[1][0]-t[0][0],e=t[1][1]-t[0][1],o=Math.min(i/(r[1][0]-r[0][0]),e/(r[1][1]-r[0][1])),u=+t[0][0]+(i-o*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(e-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([u,c])}),r)}function Zr(n,t,r){return Ur(n,[[0,0],t],r)}function Jr(n,t,r){return Dr(n,(function(r){var i=+t,e=i/(r[1][0]-r[0][0]),o=(i-e*(r[1][0]+r[0][0]))/2,u=-e*r[0][1];n.scale(150*e).translate([o,u])}),r)}function Kr(n,t,r){return Dr(n,(function(r){var i=+t,e=i/(r[1][1]-r[0][1]),o=-e*r[0][0],u=(i-e*(r[1][1]+r[0][1]))/2;n.scale(150*e).translate([o,u])}),r)}Wr.prototype={_radius:4.5,_circle:Xr(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._string.push("M",n,",",t),this._point=1;break;case 1:this._string.push("L",n,",",t);break;default:null==this._circle&&(this._circle=Xr(this._radius)),this._string.push("M",n,",",t,this._circle)}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}return null}},Br.prototype={constructor:Br,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()}};var Qr=16,Vr=E(30*h);function $r(n,t){return+t?function(n,t){function r(i,e,o,c,a,l,f,s,p,h,v,E,y,S){var m=f-i,M=s-e,x=m*m+M*M;if(x>4*t&&y--){var _=c+h,w=a+v,R=l+E,P=N(_*_+w*w+R*R),A=C(R/=P),j=g(g(R)-1)t||g((m*L+M*O)/x-.5)>.3||c*h+a*v+l*E2?n[2]%360*h:0,z()):[y*p,S*p,m*p]},j.angle=function(n){return arguments.length?(M=n%360*h,z()):M*p},j.reflectX=function(n){return arguments.length?(x=n?-1:1,z()):x<0},j.reflectY=function(n){return arguments.length?(_=n?-1:1,z()):_<0},j.precision=function(n){return arguments.length?(u=$r(c,A=n*n),b()):N(A)},j.fitExtent=function(n,t){return Ur(j,n,t)},j.fitSize=function(n,t){return Zr(j,n,t)},j.fitWidth=function(n,t){return Jr(j,n,t)},j.fitHeight=function(n,t){return Kr(j,n,t)},function(){return t=n.apply(this,arguments),j.invert=t.invert&&q,z()}}function oi(n){var t=0,r=a/3,i=ei(n),e=i(t,r);return e.parallels=function(n){return arguments.length?i(t=n[0]*h,r=n[1]*h):[t*p,r*p]},e}function ui(n,t){var r=x(n),i=(r+x(t))/2;if(g(i)0?t<-l+u&&(t=-l+u):t>l-u&&(t=l-u);var r=e/M(vi(t),i);return[r*x(i*n),e-r*E(i*n)]}return o.invert=function(n,t){var r=e-t,o=_(i)*N(n*n+r*r),u=d(n,g(r))*_(r);return r*i<0&&(u-=a*_(n)*_(r)),[u/i,2*v(M(e/o,1/i))-l]},o}function Ei(n,t){return[n,t]}function yi(n,t){var r=E(n),i=n===t?x(n):(r-E(t))/(t-n),e=r/i+n;if(g(i)u&&--e>0);return[n/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},Ci.invert=fi(C),Pi.invert=fi((function(n){return 2*v(n)})),Ai.invert=function(n,t){return[-t,2*v(S(n))-l]},n.geoAlbers=ai,n.geoAlbersUsa=function(){var n,t,r,i,e,o,c=ai(),a=ci().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=ci().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f={point:function(n,t){o=[n,t]}};function s(n){var t=n[0],u=n[1];return o=null,r.point(t,u),o||(i.point(t,u),o)||(e.point(t,u),o)}function p(){return n=t=null,s}return s.invert=function(n){var t=c.scale(),r=c.translate(),i=(n[0]-r[0])/t,e=(n[1]-r[1])/t;return(e>=.12&&e<.234&&i>=-.425&&i<-.214?a:e>=.166&&e<.234&&i>=-.214&&i<-.115?l:c).invert(n)},s.stream=function(r){return n&&t===r?n:(i=[c.stream(t=r),a.stream(r),l.stream(r)],e=i.length,n={point:function(n,t){for(var r=-1;++rTn(i[0],i[1])&&(i[1]=e[1]),Tn(e[0],i[1])>Tn(i[0],i[1])&&(i[0]=e[0])):o.push(i=e);for(u=-1/0,t=0,i=o[r=o.length-1];t<=r;i=e,++t)e=o[t],(c=Tn(i[1],e[0]))>u&&(u=c,tn=e[0],en=i[1])}return fn=sn=null,tn===1/0||rn===1/0?[[NaN,NaN],[NaN,NaN]]:[[tn,rn],[en,on]]},n.geoCentroid=function(n){pn=hn=gn=vn=dn=En=yn=Sn=mn=Mn=xn=0,O(n,Hn);var t=mn,r=Mn,i=xn,e=t*t+r*r+i*i;return e2?n[2]+90:90]):[(n=r())[0],n[1],n[2]-90]},r([0,0,90]).scale(159.155)},n.geoTransverseMercatorRaw=Ai,Object.defineProperty(n,"__esModule",{value:!0})}));