(()=>{var B=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(n){let e=this._partials,r=0;for(let o=0;o0){for(f=n[--e];e>0&&(r=f,o=n[--e],f=r+o,a=o-(f-r),!a););e>0&&(a<0&&n[e-1]<0||a>0&&n[e-1]>0)&&(o=a*2,r=f+o,o==r-f&&(f=r))}return f}};function*hr(t){for(let n of t)yield*n}function ft(t){return Array.from(hr(t))}function et(t,n,e){t=+t,n=+n,e=(o=arguments.length)<2?(n=t,t=0,1):o<3?1:+e;for(var r=-1,o=Math.max(0,Math.ceil((n-t)/e))|0,a=new Array(o);++r0?1:t<0?-1:0},Y=Math.sqrt;function zn(t){return t>1?0:t<-1?q:Math.acos(t)}function J(t){return t>1?H:t<-1?-H:Math.asin(t)}function $(){}function Lt(t,n){t&&_n.hasOwnProperty(t.type)&&_n[t.type](t,n)}var Ln={Feature:function(t,n){Lt(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,o=e.length;++rq&&(t-=Math.round(t/O)*O),[t,n]}Vt.invert=Vt;function Gn(t,n,e){return(t%=O)?n||e?Rt(Dn(t),Fn(n,e)):Dn(t):n||e?Fn(n,e):Vt}function $n(t){return function(n,e){return n+=t,I(n)>q&&(n-=Math.round(n/O)*O),[n,e]}}function Dn(t){var n=$n(t);return n.invert=$n(-t),n}function Fn(t,n){var e=A(t),r=N(t),o=A(n),a=N(n);function f(u,g){var h=A(g),i=A(u)*h,l=N(u)*h,p=N(g),m=p*e+i*r;return[U(l*o-m*a,i*e-p*r),J(m*o+l*a)]}return f.invert=function(u,g){var h=A(g),i=A(u)*h,l=N(u)*h,p=N(g),m=p*o-l*a;return[U(l*o+p*a,i*e+m*r),J(m*e-i*r)]},f}function Yn(t,n,e,r,o,a){if(e){var f=A(n),u=N(n),g=r*e;o==null?(o=n+r*O,a=n-g/2):(o=Xn(f,o),a=Xn(f,a),(r>0?oa)&&(o+=r*O));for(var h,i=o;r>0?i>a:i1&&t.push(t.pop().concat(t.shift()))},result:function(){var e=t;return t=[],n=null,e}}}function pt(t,n){return I(t[0]-n[0])=0;--u)o.point((l=i[u])[0],l[1]);else r(p.x,p.p.x,-1,o);p=p.p}p=p.o,i=p.z,m=!m}while(!p.v);o.lineEnd()}}}function On(t){if(n=t.length){for(var n,e=0,r=t[0],o;++e=0?1:-1,D=L*z,M=D>q,Z=v*P;if(g.add(U(Z*L*N(D),x*_+Z*A(D))),f+=M?z+L*O:z,M^c>=e^S>=e){var G=lt(k(m),k(d));wt(G);var T=lt(a,G);wt(T);var s=(M^z>=0?-1:1)*J(T[2]);(r>s||r===s&&(G[0]||G[1]))&&(u+=M^z>=0?1:-1)}}return(f<-R||f0){for(g||(o.polygonStart(),g=!0),o.lineStart(),P=0;P1&&S&2&&y.push(y.pop().concat(y.shift())),i.push(y.filter(gr))}}return p}}function gr(t){return t.length>1}function vr(t,n){return((t=t.x)[0]<0?t[1]-H-R:H-t[1])-((n=n.x)[0]<0?n[1]-H-R:H-n[1])}var kt=Ft(function(){return!0},xr,Er,[-q,-H]);function xr(t){var n=NaN,e=NaN,r=NaN,o;return{lineStart:function(){t.lineStart(),o=1},point:function(a,f){var u=a>0?q:-q,g=I(a-n);I(g-q)0?H:-H),t.point(r,e),t.lineEnd(),t.lineStart(),t.point(u,e),t.point(a,e),o=0):r!==u&&g>=q&&(I(n-r)R?Nn((N(n)*(a=A(r))*N(e)-N(r)*(o=A(n))*N(t))/(o*a*f)):(n+r)/2}function Er(t,n,e,r){var o;if(t==null)o=e*H,r.point(-q,o),r.point(0,o),r.point(q,o),r.point(q,0),r.point(q,-o),r.point(0,-o),r.point(-q,-o),r.point(-q,0),r.point(-q,o);else if(I(t[0]-n[0])>R){var a=t[0]0,o=I(n)>R;function a(i,l,p,m){Yn(m,t,e,p,i,l)}function f(i,l){return A(i)*A(l)>n}function u(i){var l,p,m,c,w;return{lineStart:function(){c=m=!1,w=1},point:function(v,x){var E=[v,x],d,S=f(v,x),y=r?S?0:h(v,x):S?h(v+(v<0?q:-q),x):0;if(!l&&(c=m=S)&&i.lineStart(),S!==m&&(d=g(l,E),(!d||pt(l,d)||pt(E,d))&&(E[2]=1)),S!==m)w=0,S?(i.lineStart(),d=g(E,l),i.point(d[0],d[1])):(d=g(l,E),i.point(d[0],d[1],2),i.lineEnd()),l=d;else if(o&&l&&r^S){var P;!(y&p)&&(P=g(E,l,!0))&&(w=0,r?(i.lineStart(),i.point(P[0][0],P[0][1]),i.point(P[1][0],P[1][1]),i.lineEnd()):(i.point(P[1][0],P[1][1]),i.lineEnd(),i.lineStart(),i.point(P[0][0],P[0][1],3)))}S&&(!l||!pt(l,E))&&i.point(E[0],E[1]),l=E,m=S,p=y},lineEnd:function(){m&&i.lineEnd(),l=null},clean:function(){return w|(c&&m)<<1}}}function g(i,l,p){var m=k(i),c=k(l),w=[1,0,0],v=lt(m,c),x=St(v,v),E=v[0],d=x-E*E;if(!d)return!p&&i;var S=n*x/d,y=-n*E/d,P=lt(w,v),_=Et(w,S),z=Et(v,y);_t(_,z);var L=P,D=St(_,L),M=St(L,L),Z=D*D-M*(St(_,_)-1);if(!(Z<0)){var G=Y(Z),T=Et(L,(-D-G)/M);if(_t(T,_),T=xt(T),!p)return T;var s=i[0],C=l[0],X=i[1],W=l[1],K;C0^T[1]<(I(T[0]-s)q^(s<=T[0]&&T[0]<=C)){var rt=Et(L,(-D+G)/M);return _t(rt,_),[T,xt(rt)]}}}function h(i,l){var p=r?t:q-t,m=0;return i<-p?m|=1:i>p&&(m|=2),l<-p?m|=4:l>p&&(m|=8),m}return Ft(f,u,a,r?[0,-t]:[-q,t-q])}function Zn(t,n,e,r,o,a){var f=t[0],u=t[1],g=n[0],h=n[1],i=0,l=1,p=g-f,m=h-u,c;if(c=e-f,!(!p&&c>0)){if(c/=p,p<0){if(c0){if(c>l)return;c>i&&(i=c)}if(c=o-f,!(!p&&c<0)){if(c/=p,p<0){if(c>l)return;c>i&&(i=c)}else if(p>0){if(c0)){if(c/=m,m<0){if(c0){if(c>l)return;c>i&&(i=c)}if(c=a-u,!(!m&&c<0)){if(c/=m,m<0){if(c>l)return;c>i&&(i=c)}else if(m>0){if(c0&&(t[0]=f+i*p,t[1]=u+i*m),l<1&&(n[0]=f+l*p,n[1]=u+l*m),!0}}}}}var Mt=1e9,Gt=-Mt;function bt(t,n,e,r){function o(h,i){return t<=h&&h<=e&&n<=i&&i<=r}function a(h,i,l,p){var m=0,c=0;if(h==null||(m=f(h,l))!==(c=f(i,l))||g(h,i)<0^l>0)do p.point(m===0||m===3?t:e,m>1?r:n);while((m=(m+l+4)%4)!==c);else p.point(i[0],i[1])}function f(h,i){return I(h[0]-t)0?0:3:I(h[0]-e)0?2:1:I(h[1]-n)0?1:0:i>0?3:2}function u(h,i){return g(h.x,i.x)}function g(h,i){var l=f(h,1),p=f(i,1);return l!==p?l-p:l===0?i[1]-h[1]:l===1?h[0]-i[0]:l===2?h[1]-i[1]:i[0]-h[0]}return function(h){var i=h,l=Tt(),p,m,c,w,v,x,E,d,S,y,P,_={point:z,lineStart:Z,lineEnd:G,polygonStart:D,polygonEnd:M};function z(s,C){o(s,C)&&i.point(s,C)}function L(){for(var s=0,C=0,X=m.length;Cr&&(zt-it)*(r-rt)>(ut-rt)*(t-it)&&++s:ut<=r&&(zt-it)*(r-rt)<(ut-rt)*(t-it)&&--s;return s}function D(){i=l,p=[],m=[],P=!0}function M(){var s=L(),C=P&&s,X=(p=ft(p)).length;(C||X)&&(h.polygonStart(),C&&(h.lineStart(),a(null,null,1,h),h.lineEnd()),X&&Dt(p,u,s,a,h),h.polygonEnd()),i=h,p=m=c=null}function Z(){_.point=T,m&&m.push(c=[]),y=!0,S=!1,E=d=NaN}function G(){p&&(T(w,v),x&&S&&l.rejoin(),p.push(l.result())),_.point=z,S&&i.lineEnd()}function T(s,C){var X=o(s,C);if(m&&c.push([s,C]),y)w=s,v=C,x=X,y=!1,X&&(i.lineStart(),i.point(s,C));else if(X&&S)i.point(s,C);else{var W=[E=Math.max(Gt,Math.min(Mt,E)),d=Math.max(Gt,Math.min(Mt,d))],K=[s=Math.max(Gt,Math.min(Mt,s)),C=Math.max(Gt,Math.min(Mt,C))];Zn(W,K,t,n,e,r)?(S||(i.lineStart(),i.point(W[0],W[1])),i.point(K[0],K[1]),X||i.lineEnd(),P=!1):X&&(i.lineStart(),i.point(s,C),P=!1)}E=s,d=C,S=X}return _}}var tn,nn,Xt,Yt,st={sphere:$,point:$,lineStart:wr,lineEnd:$,polygonStart:$,polygonEnd:$};function wr(){st.point=Mr,st.lineEnd=Rr}function Rr(){st.point=st.lineEnd=$}function Mr(t,n){t*=F,n*=F,nn=t,Xt=N(n),Yt=A(n),st.point=yr}function yr(t,n){t*=F,n*=F;var e=N(n),r=A(n),o=I(t-nn),a=A(o),f=N(o),u=r*f,g=Yt*e-Xt*r*a,h=Xt*e+Yt*r*a;tn.add(U(Y(u*u+g*g),h)),nn=t,Xt=e,Yt=r}function Wn(t){return tn=new B,j(t,st),+tn}var rn=[null,null],Pr={type:"LineString",coordinates:rn};function en(t,n){return rn[0]=t,rn[1]=n,Wn(Pr)}function Un(t,n,e){var r=et(t,n-R,e).concat(n);return function(o){return r.map(function(a){return[o,a]})}}function Jn(t,n,e){var r=et(t,n-R,e).concat(n);return function(o){return r.map(function(a){return[a,o]})}}function on(){var t,n,e,r,o,a,f,u,g=10,h=g,i=90,l=360,p,m,c,w,v=2.5;function x(){return{type:"MultiLineString",coordinates:E()}}function E(){return et(vt(r/i)*i,e,i).map(c).concat(et(vt(u/l)*l,f,l).map(w)).concat(et(vt(n/g)*g,t,g).filter(function(d){return I(d%i)>R}).map(p)).concat(et(vt(a/h)*h,o,h).filter(function(d){return I(d%l)>R}).map(m))}return x.lines=function(){return E().map(function(d){return{type:"LineString",coordinates:d}})},x.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(w(f).slice(1),c(e).reverse().slice(1),w(u).reverse().slice(1))]}},x.extent=function(d){return arguments.length?x.extentMajor(d).extentMinor(d):x.extentMinor()},x.extentMajor=function(d){return arguments.length?(r=+d[0][0],e=+d[1][0],u=+d[0][1],f=+d[1][1],r>e&&(d=r,r=e,e=d),u>f&&(d=u,u=f,f=d),x.precision(v)):[[r,u],[e,f]]},x.extentMinor=function(d){return arguments.length?(n=+d[0][0],t=+d[1][0],a=+d[0][1],o=+d[1][1],n>t&&(d=n,n=t,t=d),a>o&&(d=a,a=o,o=d),x.precision(v)):[[n,a],[t,o]]},x.step=function(d){return arguments.length?x.stepMajor(d).stepMinor(d):x.stepMinor()},x.stepMajor=function(d){return arguments.length?(i=+d[0],l=+d[1],x):[i,l]},x.stepMinor=function(d){return arguments.length?(g=+d[0],h=+d[1],x):[g,h]},x.precision=function(d){return arguments.length?(v=+d,p=Un(a,o,90),m=Jn(n,t,v),c=Un(u,f,90),w=Jn(r,e,v),x):v},x.extentMajor([[-180,-90+R],[180,90-R]]).extentMinor([[-180,-80-R],[180,80+R]])}function an(){return on()()}var yt=t=>t;var un=new B,fn=new B,Kn,Qn,ln,pn,ot={point:$,lineStart:$,lineEnd:$,polygonStart:function(){ot.lineStart=qr,ot.lineEnd=Ir},polygonEnd:function(){ot.lineStart=ot.lineEnd=ot.point=$,un.add(I(fn)),fn=new B},result:function(){var t=un/2;return un=new B,t}};function qr(){ot.point=Ar}function Ar(t,n){ot.point=Vn,Kn=ln=t,Qn=pn=n}function Vn(t,n){fn.add(pn*t-ln*n),ln=t,pn=n}function Ir(){Vn(Kn,Qn)}var sn=ot;var ct=1/0,Ot=ct,Pt=-ct,Bt=Pt,Nr={point:Cr,lineStart:$,lineEnd:$,polygonStart:$,polygonEnd:$,result:function(){var t=[[ct,Ot],[Pt,Bt]];return Pt=Bt=-(Ot=ct=1/0),t}};function Cr(t,n){tPt&&(Pt=t),nBt&&(Bt=n)}var mt=Nr;var cn=0,mn=0,qt=0,Ht=0,Zt=0,dt=0,dn=0,hn=0,At=0,bn,tr,b,tt,V={point:at,lineStart:jn,lineEnd:kn,polygonStart:function(){V.lineStart=_r,V.lineEnd=Tr},polygonEnd:function(){V.point=at,V.lineStart=jn,V.lineEnd=kn},result:function(){var t=At?[dn/At,hn/At]:dt?[Ht/dt,Zt/dt]:qt?[cn/qt,mn/qt]:[NaN,NaN];return cn=mn=qt=Ht=Zt=dt=dn=hn=At=0,t}};function at(t,n){cn+=t,mn+=n,++qt}function jn(){V.point=zr}function zr(t,n){V.point=Lr,at(b=t,tt=n)}function Lr(t,n){var e=t-b,r=n-tt,o=Y(e*e+r*r);Ht+=o*(b+t)/2,Zt+=o*(tt+n)/2,dt+=o,at(b=t,tt=n)}function kn(){V.point=at}function _r(){V.point=$r}function Tr(){nr(bn,tr)}function $r(t,n){V.point=nr,at(bn=b=t,tr=tt=n)}function nr(t,n){var e=t-b,r=n-tt,o=Y(e*e+r*r);Ht+=o*(b+t)/2,Zt+=o*(tt+n)/2,dt+=o,o=tt*t-b*n,dn+=o*(b+t),hn+=o*(tt+n),At+=o*3,at(b=t,tt=n)}var gn=V;function Wt(t){this._context=t}Wt.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:{this._context.moveTo(t,n),this._point=1;break}case 1:{this._context.lineTo(t,n);break}default:{this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,O);break}}},result:$};var xn=new B,vn,rr,er,It,Nt,Ut={point:$,lineStart:function(){Ut.point=Dr},lineEnd:function(){vn&&or(rr,er),Ut.point=$},polygonStart:function(){vn=!0},polygonEnd:function(){vn=null},result:function(){var t=+xn;return xn=new B,t}};function Dr(t,n){Ut.point=or,rr=It=t,er=Nt=n}function or(t,n){It-=t,Nt-=n,xn.add(Y(It*It+Nt*Nt)),It=t,Nt=n}var Sn=Ut;var ir,Jt,ar,ur,ht=class{constructor(n){this._append=n==null?fr:Fr(n),this._radius=4.5,this._=""}pointRadius(n){return this._radius=+n,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(n,e){switch(this._point){case 0:{this._append`M${n},${e}`,this._point=1;break}case 1:{this._append`L${n},${e}`;break}default:{if(this._append`M${n},${e}`,this._radius!==ar||this._append!==Jt){let r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,ar=r,Jt=this._append,ur=this._,this._=o}this._+=ur;break}}}result(){let n=this._;return this._="",n.length?n:null}};function fr(t){let n=1;this._+=t[0];for(let e=t.length;n=0))throw new RangeError(`invalid digits: ${t}`);if(n>15)return fr;if(n!==ir){let e=10**n;ir=n,Jt=function(o){let a=1;this._+=o[0];for(let f=o.length;a=0))throw new RangeError(`invalid digits: ${u}`);e=g}return n===null&&(a=new ht(e)),f},f.projection(t).digits(e).context(n)}function Ct(t){return function(n){var e=new wn;for(var r in t)e[r]=t[r];return e.stream=n,e}}function wn(){}wn.prototype={constructor:wn,point:function(t,n){this.stream.point(t,n)},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()}};function Rn(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),j(e,t.stream(mt)),n(mt.result()),r!=null&&t.clipExtent(r),t}function Mn(t,n,e){return Rn(t,function(r){var o=n[1][0]-n[0][0],a=n[1][1]-n[0][1],f=Math.min(o/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),u=+n[0][0]+(o-f*(r[1][0]+r[0][0]))/2,g=+n[0][1]+(a-f*(r[1][1]+r[0][1]))/2;t.scale(150*f).translate([u,g])},e)}function lr(t,n,e){return Mn(t,[[0,0],n],e)}function pr(t,n,e){return Rn(t,function(r){var o=+n,a=o/(r[1][0]-r[0][0]),f=(o-a*(r[1][0]+r[0][0]))/2,u=-a*r[0][1];t.scale(150*a).translate([f,u])},e)}function sr(t,n,e){return Rn(t,function(r){var o=+n,a=o/(r[1][1]-r[0][1]),f=-a*r[0][0],u=(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([f,u])},e)}var cr=16,Gr=A(30*F);function yn(t,n){return+n?Yr(t,n):Xr(t)}function Xr(t){return Ct({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function Yr(t,n){function e(r,o,a,f,u,g,h,i,l,p,m,c,w,v){var x=h-r,E=i-o,d=x*x+E*E;if(d>4*n&&w--){var S=f+p,y=u+m,P=g+c,_=Y(S*S+y*y+P*P),z=J(P/=_),L=I(I(P)-1)n||I((x*G+E*T)/d-.5)>.3||f*p+u*m+g*c2?s[2]%360*F:0,G()):[u*Q,g*Q,h*Q]},M.angle=function(s){return arguments.length?(l=s%360*F,G()):l*Q},M.reflectX=function(s){return arguments.length?(p=s?-1:1,G()):p<0},M.reflectY=function(s){return arguments.length?(m=s?-1:1,G()):m<0},M.precision=function(s){return arguments.length?(P=yn(_,y=s*s),T()):Y(y)},M.fitExtent=function(s,C){return Mn(M,s,C)},M.fitSize=function(s,C){return lr(M,s,C)},M.fitWidth=function(s,C){return pr(M,s,C)},M.fitHeight=function(s,C){return sr(M,s,C)};function G(){var s=mr(e,0,0,p,m,l).apply(null,n(a,f)),C=mr(e,r-s[0],o-s[1],p,m,l);return i=Gn(u,g,h),_=Rt(n,C),z=Rt(i,_),P=yn(_,y),T()}function T(){return L=D=null,M}return function(){return n=t.apply(this,arguments),M.invert=n.invert&&Z,G()}}function dr(t){return function(n,e){var r=Y(n*n+e*e),o=t(r),a=N(o),f=A(o);return[U(n*a,r*f),J(r&&e*a/r)]}}function qn(t,n){return[A(n)*N(t),N(n)]}qn.invert=dr(J);function An(){return Pn(qn).scale(249.5).clipAngle(90+R)}window.TG={geoOrthographic:An,geoPath:En,geoGraticule10:an,geoDistance:en};})();