function P(n){return n}function w(n){if(n==null)return P;var u,s,c=n.scale[0],i=n.scale[1],l=n.translate[0],y=n.translate[1];return function(b,f){f||(u=s=0);var t=2,r=b.length,e=new Array(r);for(e[0]=(u+=b[0])*c+l,e[1]=(s+=b[1])*i+y;tl&&(l=t[0]),t[1]y&&(y=t[1])}function f(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(f);break;case"Point":b(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(b);break}}n.arcs.forEach(function(t){for(var r=-1,e=t.length,a;++rl&&(l=a[0]),a[1]y&&(y=a[1])});for(s in n.objects)f(n.objects[s]);return[c,i,l,y]}function q(n,u){for(var s,c=n.length,i=c-u;i<--c;)s=n[i],n[i++]=n[c],n[c]=s}function z(n,u){return typeof u=="string"&&(u=n.objects[u]),u.type==="GeometryCollection"?{type:"FeatureCollection",features:u.geometries.map(function(s){return k(n,s)})}:k(n,u)}function k(n,u){var s=u.id,c=u.bbox,i=u.properties==null?{}:u.properties,l=E(n,u);return s==null&&c==null?{type:"Feature",properties:i,geometry:l}:c==null?{type:"Feature",id:s,properties:i,geometry:l}:{type:"Feature",id:s,bbox:c,properties:i,geometry:l}}function E(n,u){var s=w(n.transform),c=n.arcs;function i(r,e){e.length&&e.pop();for(var a=c[r<0?~r:r],o=0,p=a.length;o1)c=j(n,u,s);else for(i=0,c=new Array(l=n.arcs.length);i1)for(var e=1,a=b(t[0]),o,p;ea&&(p=t[0],t[0]=t[e],t[e]=p,a=o);return t}).filter(function(f){return f.length>0})}}function S(n,u){for(var s=0,c=n.length;s>>1;n[i]=2))throw new Error("n must be \u22652");f=n.bbox||M(n);var s=f[0],c=f[1],i=f[2],l=f[3],y;u={scale:[i-s?(i-s)/(y-1):1,l-c?(l-c)/(y-1):1],translate:[s,c]}}else f=n.bbox;var b=L(u),f,t,r=n.objects,e={};function a(h){return b(h)}function o(h){var d;switch(h.type){case"GeometryCollection":d={type:"GeometryCollection",geometries:h.geometries.map(o)};break;case"Point":d={type:"Point",coordinates:a(h.coordinates)};break;case"MultiPoint":d={type:"MultiPoint",coordinates:h.coordinates.map(a)};break;default:return h}return h.id!=null&&(d.id=h.id),h.bbox!=null&&(d.bbox=h.bbox),h.properties!=null&&(d.properties=h.properties),d}function p(h){var d=0,g=1,v=h.length,x,m=new Array(v);for(m[0]=b(h[0],0);++d