Comparing version 0.2.1 to 0.2.2
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.flubber=t.flubber||{})}(this,function(t){"use strict";function e(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Kt.indexOf(t)>=0}function n(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function r(t){return t>=48&&t<=57}function i(t){return t>=48&&t<=57||43===t||45===t||46===t}function a(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function o(t){for(;t.index<t.max&&e(t.path.charCodeAt(t.index));)t.index++}function s(t){var e,n=t.index,i=n,a=t.max,o=!1,s=!1,h=!1,u=!1;if(i>=a)return void(t.err="SvgPath: missed param (at pos "+i+")");if(e=t.path.charCodeAt(i),43!==e&&45!==e||(i++,e=i<a?t.path.charCodeAt(i):0),!r(e)&&46!==e)return void(t.err="SvgPath: param should start with 0..9 or `.` (at pos "+i+")");if(46!==e){if(o=48===e,i++,e=i<a?t.path.charCodeAt(i):0,o&&i<a&&e&&r(e))return void(t.err="SvgPath: numbers started with `0` such as `09` are ilegal (at pos "+n+")");for(;i<a&&r(t.path.charCodeAt(i));)i++,s=!0;e=i<a?t.path.charCodeAt(i):0}if(46===e){for(u=!0,i++;r(t.path.charCodeAt(i));)i++,h=!0;e=i<a?t.path.charCodeAt(i):0}if(101===e||69===e){if(u&&!s&&!h)return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");if(i++,e=i<a?t.path.charCodeAt(i):0,43!==e&&45!==e||i++,!(i<a&&r(t.path.charCodeAt(i))))return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");for(;i<a&&r(t.path.charCodeAt(i));)i++}t.index=i,t.param=parseFloat(t.path.slice(n,i))+0}function h(t){var e,n;e=t.path[t.segmentStart],n=e.toLowerCase();var r=t.data;if("m"===n&&r.length>2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Jt[n]&&(t.result.push([e].concat(r.splice(0,Jt[n]))),Jt[n]););}function u(t){var e,r,a,u,c=t.max;if(t.segmentStart=t.index,e=t.path.charCodeAt(t.index),!n(e))return void(t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")");if(a=Jt[t.path[t.index].toLowerCase()],t.index++,o(t),t.data=[],!a)return void h(t);for(r=!1;;){for(u=a;u>0;u--){if(s(t),t.err.length)return;t.data.push(t.param),o(t),r=!1,t.index<c&&44===t.path.charCodeAt(t.index)&&(t.index++,o(t),r=!0)}if(!r){if(t.index>=t.max)break;if(!i(t.path.charCodeAt(t.index)))break}}h(t)}function c(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function f(){if(!(this instanceof f))return new f;this.queue=[],this.cache=null}function l(t,e,n,r){var i=t*r-e*n<0?-1:1,a=Math.sqrt(t*t+e*e),o=Math.sqrt(t*t+e*e),s=t*n+e*r,h=s/(a*o);return h>1&&(h=1),h<-1&&(h=-1),i*Math.acos(h)}function p(t,e,n,r,i,a,o,s,h,u){var c=u*(t-n)/2+h*(e-r)/2,f=-h*(t-n)/2+u*(e-r)/2,p=o*o,v=s*s,g=c*c,x=f*f,y=p*v-p*x-v*g;y<0&&(y=0),y/=p*x+v*g,y=Math.sqrt(y)*(i===a?-1:1);var d=y*o/s*f,m=y*-s/o*c,M=u*d-h*m+(t+n)/2,w=h*d+u*m+(e+r)/2,b=(c-d)/o,L=(f-m)/s,A=(-c-d)/o,q=(-f-m)/s,k=l(1,0,b,L),_=l(b,L,A,q);return 0===a&&_>0&&(_-=oe),1===a&&_<0&&(_+=oe),[M,w,k,_]}function v(t,e){var n=4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[r,i,r-i*n,i+r*n,a+o*n,o-a*n,a,o]}function g(t,e,n){if(!(this instanceof g))return new g(t,e,n);this.rx=t,this.ry=e,this.ax=n}function x(t){if(!(this instanceof x))return new x(t);var e=te(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}function y(t){var e=t.match(ge);return e?e.map(Number):[]}function d(t,e,n,r,i,a,o,s){this.a={x:t,y:e},this.b={x:n,y:r},this.c={x:i,y:a},this.d={x:o,y:s},null!==o&&void 0!==o&&null!==s&&void 0!==s?(this.getArcLength=P,this.getPoint=L,this.getDerivative=M):(this.getArcLength=A,this.getPoint=b,this.getDerivative=m),this.init()}function m(t,e,n){return{x:2*(1-n)*(t[1]-t[0])+2*n*(t[2]-t[1]),y:2*(1-n)*(e[1]-e[0])+2*n*(e[2]-e[1])}}function M(t,e,n){return b([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],n)}function w(t,e,n,r,i){for(var a=1,o=t/e,s=(t-n(r,i,o))/e;a>.001;){var h=n(r,i,o+s),u=n(r,i,o-s),c=Math.abs(t-h)/e,f=Math.abs(t-u)/e;c<a?(a=c,o+=s):f<a?(a=f,o-=s):s/=2}return o}function b(t,e,n){return{x:(1-n)*(1-n)*t[0]+2*(1-n)*n*t[1]+n*n*t[2],y:(1-n)*(1-n)*e[0]+2*(1-n)*n*e[1]+n*n*e[2]}}function L(t,e,n){return{x:(1-n)*(1-n)*(1-n)*t[0]+3*(1-n)*(1-n)*n*t[1]+3*(1-n)*n*n*t[2]+n*n*n*t[3],y:(1-n)*(1-n)*(1-n)*e[0]+3*(1-n)*(1-n)*n*e[1]+3*(1-n)*n*n*e[2]+n*n*n*e[3]}}function A(t,e,n){void 0===n&&(n=1);var r=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],a=2*t[1]-2*t[0],o=2*e[1]-2*e[0],s=4*(r*r+i*i),h=4*(r*a+i*o),u=a*a+o*o;if(0===s)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));var c=h/(2*s),f=u/s,l=n+c,p=f-c*c;return Math.sqrt(s)/2*(l*Math.sqrt(l*l+p)-c*Math.sqrt(c*c+p)+p*Math.log(Math.abs((l+Math.sqrt(l*l+p))/(c+Math.sqrt(c*c+p)))))}function q(t,e){return me[t][e]}function k(t,e,n){var r,i,a,o=n.length-1;if(0===o)return 0;if(0===t){for(i=0,a=0;a<=o;a++)i+=q(o,a)*Math.pow(1-e,o-a)*Math.pow(e,a)*n[a];return i}for(r=new Array(o),a=0;a<o;a++)r[a]=o*(n[a+1]-n[a]);return k(t-1,e,r)}function _(t,e,n){var r=k(1,n,t),i=k(1,n,e),a=r*r+i*i;return Math.sqrt(a)}function P(t,e,n){var r,i,a,o;void 0===n&&(n=1);for(r=n/2,i=0,a=0;a<20;a++)o=r*ye[20][a]+r,i+=de[20][a]*_(t,e,o);return r*i}function E(t,e,n,r){var i=t*r-e*n<0?-1:1,a=t*n+e*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)}function C(t,e,n,r,i,a,o,s,h,u){var c=u*(t-n)/2+h*(e-r)/2,f=-h*(t-n)/2+u*(e-r)/2,l=o*o,p=s*s,v=c*c,g=f*f,x=l*p-l*g-p*v;x<0&&(x=0),x/=l*g+p*v,x=Math.sqrt(x)*(i===a?-1:1);var y=x*o/s*f,d=x*-s/o*c,m=u*y-h*d+(t+n)/2,M=h*y+u*d+(e+r)/2,w=(c-y)/o,b=(f-d)/s,L=(-c-y)/o,A=(-f-d)/s,q=E(1,0,w,b),k=E(w,b,L,A);return 0===a&&k>0&&(k-=Me),1===a&&k<0&&(k+=Me),[m,M,q,k]}function S(t,e){var n=4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[r,i,r-i*n,i+r*n,a+o*n,o-a*n,a,o]}function Z(t,e,n,r,i,a,o,s,h){var u=0,c=[],f=[];we(t,e,n,r,i,a,o,s,h).forEach(function(t){var e=new xe(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),n=e.getTotalLength();u+=n,c.push(n),f.push(e)}),this.length=u,this.partialLengths=c,this.curves=f}function T(t,e,n,r){this.x0=t,this.x1=e,this.y0=n,this.y1=r}function F(t){return new fe(t).abs()}function z(t){return t.toString().split("M").map(function(t,e){return t=t.trim(),e&&t?"M"+t:t}).filter(function(t){return t})}function j(t){return"M"+t.join("L")+"Z"}function I(t){return z(F(t))}function X(t,e){var n=F(t);return Y(n,e)||N(n,e)}function Y(t,e){var n=t.segments||[],r=[];if(!n.length||"M"!==n[0][0])return!1;for(var i=0;i<n.length;i++){var a=n[i],o=a[0],s=a[1],h=a[2];if("M"===o&&i||"Z"===o)break;if("M"===o||"L"===o)r.push([s,h]);else if("H"===o)r.push([s,r[r.length-1][1]]);else{if("V"!==o)return!1;r.push([r[r.length-1][0],s])}}return!!r.length&&{ring:r}}function N(t,e){var n,r,i,a=z(t)[0],o=[];if(!a)throw new TypeError(qe);r=V(a),n=r.getTotalLength(),i=Math.ceil(n/e);for(var s=0;s<i;s++){var h=r.getPointAtLength(n*s/i);o.push([h.x,h.y])}return{ring:o,skipBisect:!0}}function V(t){if("undefined"!=typeof module&&module.exports)return Ae(t);var e=(window.document.createElementNS("http://www.w3.org/2000/svg","svg"),window.document.createElementNS("http://www.w3.org/2000/svg","path"));return e.setAttributeNS(null,"d",t),e}function G(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function O(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function D(t,e){return G(t,e)<1e-9}function H(t,e,n){var r=t.map(function(t,n){return Q(t,e[n])});return function(t){var e=r.map(function(e){return e(t)});return n?j(e):e}}function Q(t,e){return function(n){return t.map(function(t,r){return t+n*(e[r]-t)})}}function R(t,e,n){void 0===n&&(n=1/0);for(var r=t.length+e,i=$t(t)/e,a=0,o=0,s=i/2;t.length<r;){var h=t[a],u=t[(a+1)%t.length],c=G(h,u);s<=o+c?(t.splice(a+1,0,c?O(h,u,(s-o)/c):h.slice(0)),s+=i):(o+=c,a++)}}function U(t,e){void 0===e&&(e=1/0);for(var n=0;n<t.length;n++)for(var r=t[n],i=n===t.length-1?t[0]:t[n+1];G(r,i)>e;)i=O(r,i,.5),t.splice(n+1,0,i)}function B(t,e){var n,r,i;if("string"==typeof t){var a=X(t,e);t=a.ring,i=a.skipBisect}else if(!Array.isArray(t))throw new TypeError(qe);if(n=t.slice(0),!W(n))throw new TypeError(qe);if(n.length>1&&D(n[0],n[n.length-1])&&n.pop(),n.length<3)throw new TypeError(qe);return r=Bt(n),r>0&&n.reverse(),!i&&e&&Number.isFinite(e)&&e>0&&U(n,e),n}function W(t){return t.every(function(t){return Array.isArray(t)&&t.length>=2&&Number.isFinite(t[0])&&Number.isFinite(t[1])})}function $(t,e,n){var r;return r=t.length-e.length,R(t,r<0?-1*r:0),R(e,r>0?r:0),ke(t,e),H(t,e,n)}function J(t,e,n){n=n||2;var r=e&&e.length,i=r?e[0]*n:t.length,a=K(t,0,i,n,!0),o=[];if(!a)return o;var s,h,u,c,f,l,p;if(r&&(a=ot(t,e,a,n)),t.length>80*n){s=u=t[0],h=c=t[1];for(var v=n;v<i;v+=n)f=t[v],l=t[v+1],f<s&&(s=f),l<h&&(h=l),f>u&&(u=f),l>c&&(c=l);p=Math.max(u-s,c-h)}return et(a,o,n,s,h,p),o}function K(t,e,n,r,i){var a,o;if(i===kt(t,e,n,r)>0)for(a=e;a<n;a+=r)o=Lt(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=Lt(a,t[a],t[a+1],o);return o&&yt(o,o.next)&&(At(o),o=o.next),o}function tt(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!yt(r,r.next)&&0!==xt(r.prev,r,r.next))r=r.next;else{if(At(r),(r=e=r.prev)===r.next)return null;n=!0}}while(n||r!==e);return e}function et(t,e,n,r,i,a,o){if(t){!o&&a&&ct(t,r,i,a);for(var s,h,u=t;t.prev!==t.next;)if(s=t.prev,h=t.next,a?rt(t,r,i,a):nt(t))e.push(s.i/n),e.push(t.i/n),e.push(h.i/n),At(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?(t=it(t,e,n),et(t,e,n,r,i,a,2)):2===o&&at(t,e,n,r,i,a):et(tt(t),e,n,r,i,a,1);break}}}function nt(t){var e=t.prev,n=t,r=t.next;if(xt(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(vt(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&xt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function rt(t,e,n,r){var i=t.prev,a=t,o=t.next;if(xt(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,h=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=lt(s,h,e,n,r),l=lt(u,c,e,n,r),p=t.nextZ;p&&p.z<=l;){if(p!==t.prev&&p!==t.next&&vt(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&vt(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xt(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function it(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!yt(i,a)&&dt(i,r,r.next,a)&&Mt(i,a)&&Mt(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),At(r),At(r.next),r=t=a),r=r.next}while(r!==t);return r}function at(t,e,n,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&>(o,s)){var h=bt(o,s);return o=tt(o,o.next),h=tt(h,h.next),et(o,e,n,r,i,a),void et(h,e,n,r,i,a)}s=s.next}o=o.next}while(o!==t)}function ot(t,e,n,r){var i,a,o,s,h,u=[];for(i=0,a=e.length;i<a;i++)o=e[i]*r,s=i<a-1?e[i+1]*r:t.length,h=K(t,o,s,r,!1),h===h.next&&(h.steiner=!0),u.push(pt(h));for(u.sort(st),i=0;i<u.length;i++)ht(u[i],n),n=tt(n,n.next);return n}function st(t,e){return t.x-e.x}function ht(t,e){if(e=ut(t,e)){var n=bt(e,t);tt(n,n.next)}}function ut(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===o)return n.prev;var h,u=n,c=n.x,f=n.y,l=1/0;for(r=n.next;r!==u;)i>=r.x&&r.x>=c&&vt(a<f?i:o,a,c,f,a<f?o:i,a,r.x,r.y)&&((h=Math.abs(a-r.y)/(i-r.x))<l||h===l&&r.x>n.x)&&Mt(r,t)&&(n=r,l=h),r=r.next;return n}function ct(t,e,n,r){var i=t;do{null===i.z&&(i.z=lt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,ft(i)}function ft(t){var e,n,r,i,a,o,s,h,u=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<u&&(s++,r=r.nextZ);e++);for(h=u;s>0||h>0&&r;)0===s?(i=r,r=r.nextZ,h--):0!==h&&r?n.z<=r.z?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,h--):(i=n,n=n.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(o>1);return t}function lt(t,e,n,r,i){return t=32767*(t-n)/i,e=32767*(e-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function pt(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function vt(t,e,n,r,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(r-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function gt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!mt(t,e)&&Mt(t,e)&&Mt(e,t)&&wt(t,e)}function xt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function yt(t,e){return t.x===e.x&&t.y===e.y}function dt(t,e,n,r){return!!(yt(t,e)&&yt(n,r)||yt(t,r)&&yt(n,e))||xt(t,e,n)>0!=xt(t,e,r)>0&&xt(n,r,t)>0!=xt(n,r,e)>0}function mt(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&dt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Mt(t,e){return xt(t.prev,t,t.next)<0?xt(t,e,t.next)>=0&&xt(t,t.prev,e)>=0:xt(t,e,t.prev)<0||xt(t,t.next,e)<0}function wt(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}function bt(t,e){var n=new qt(t.i,t.x,t.y),r=new qt(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Lt(t,e,n,r){var i=new qt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function At(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function qt(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function kt(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function _t(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,a=Pt(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:a}:null==r?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function Pt(t,e){function n(t,e){e.length&&e.pop();for(var n=u[t<0?~t:t],r=0,i=n.length;r<i;++r)e.push(h(n[r],r));t<0&&Se(e,i)}function r(t){return h(t)}function i(t){for(var e=[],r=0,i=t.length;r<i;++r)n(t[r],e);return e.length<2&&e.push(e[0]),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0]);return e}function o(t){return t.map(a)}function s(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(s)};case"Point":e=r(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(r);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=o(t.arcs);break;case"MultiPolygon":e=t.arcs.map(o);break;default:return null}return{type:n,coordinates:e}}var h=Ce(t.transform),u=t.arcs;return s(e)}function Et(t){for(var e,n=-1,r=t.length,i=t[r-1],a=0;++n<r;)e=i,i=t[n],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}function Ct(t,e){function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Polygon":r(t.arcs);break;case"MultiPolygon":t.arcs.forEach(r)}}function r(t){t.forEach(function(e){e.forEach(function(e){(a[e=e<0?~e:e]||(a[e]=[])).push(t)})}),o.push(t)}function i(e){return Et(Pt(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var a={},o=[],s=[];return e.forEach(n),o.forEach(function(t){if(!t._){var e=[],n=[t];for(t._=1,s.push(e);t=n.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){a[t<0?~t:t].forEach(function(t){t._||(t._=1,n.push(t))})})})}}),o.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:s.map(function(e){var n,r=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){a[t<0?~t:t].length<2&&r.push(t)})})}),r=Te(t,r),(n=r.length)>1)for(var o,s,h=1,u=i(r[0]);h<n;++h)(o=i(r[h]))>u&&(s=r[0],r[0]=r[h],r[h]=s,u=o);return r})}}function St(t){return function(e,n){return je(t(e),n)}}function Zt(t,e){var n={},r={type:"Topology",objects:{triangles:{type:"GeometryCollection",geometries:[]}},arcs:[]};return t.forEach(function(t){var i=[];t.forEach(function(t,a){var o=t[0]<t[1]?t.join(","):t[1]+","+t[0],s=t.map(function(t){return e[t]});o in n?i.push(~n[o]):(i.push(n[o]=r.arcs.length),r.arcs.push(s))}),r.objects.triangles.geometries.push({type:"Polygon",area:Math.abs(Bt(t.map(function(t){return e[t[0]]}))),arcs:[i]})}),r.objects.triangles.geometries.sort(function(t,e){return t.area-e.area}),r}function Tt(t,e){for(var n=t.objects.triangles.geometries,r=Ie(function(t){return t.area}).left;n.length>e;)!function(){var e=n[0],i=ze(n)[0][0],a=n[i],o=Ct(t,[e,a]);o.area=e.area+a.area,o.type="Polygon",o.arcs=o.arcs[0],n.splice(i,1),n.shift(),n.splice(r(n,o.area),0,o)}();if(e>n.length)throw new RangeError("Can't collapse topology into "+e+" pieces.");return Ze(t,t.objects.triangles).features.map(function(t){return t.geometry.coordinates[0].pop(),t.geometry.coordinates[0]})}function Ft(t){for(var e=t.reduce(function(t,e){return t.concat(e.slice(0,2))},[]),n=Pe(e),r=[],i=0,a=n.length;i<a;i+=3)r.push([[n[i],n[i+1]],[n[i+1],n[i+2]],[n[i+2],n[i]]]);return r}function zt(t,e,n){function r(t,e,o){void 0===e&&(e=[]),void 0===o&&(o=0);for(var s=0;s<t.length;s++){var h=t.splice(s,1),u=n[h[0]][e.length];o+u<i&&(t.length?r(t.slice(),e.concat(h),o+u):(i=o+u,a=e.concat(h))),t.length&&t.splice(s,0,h[0])}}var i=1/0,a=t.map(function(t,e){return e});return r(a),a}function jt(t,e){var n=G(Wt(t),Wt(e));return n*n}function It(t,e,n){void 0===n&&(n={});var r=n.maxSegmentLength;void 0===r&&(r=10);var i=n.string;void 0===i&&(i=!0);var a=n.single;void 0===a&&(a=!1);var o=B(t,r),s=Ye(o,e.length),h=e.map(function(t){return B(t,r)}),u=Ne(s,h),c=u.map(function(t,e){return $(s[t],h[e],i)});if(a){var f=j(o);return i?function(t){return t<1e-4?f:c.map(function(e){return e(t)}).join(" ")}:function(t){return c.map(function(e){return e(t)})}}return c}function Xt(t,e,n){void 0===n&&(n={});var r=n.maxSegmentLength;void 0===r&&(r=10);var i=n.string;void 0===i&&(i=!0);var a=n.single;void 0===a&&(a=!1);var o=It(e,t,{maxSegmentLength:r,string:i,single:a});return a?function(t){return o(1-t)}:o.map(function(t){return function(e){return t(1-e)}})}function Yt(t,e,n,r,i){return Ot(Dt(t,e,n),r,Rt(t,e,n),i)}function Nt(t,e,n,r,i){var a=Yt(e,n,r,t,i);return function(t){return a(1-t)}}function Vt(t,e,n,r,i,a){return Ot(Ht(t,e,n,r),i,Ut(t,e,n,r),a)}function Gt(t,e,n,r,i,a){var o=Vt(e,n,r,i,t,a);return function(t){return o(1-t)}}function Ot(t,e,n,r){void 0===r&&(r={});var i=r.maxSegmentLength;void 0===i&&(i=10);var a=r.string;void 0===a&&(a=!0);var o=B(e,i),s=t(o),h=H(s,o,a);return a?function(t){return t<1e-4?n:h(t)}:h}function Dt(t,e,n){return function(r){var i=Wt(r),a=$t(r.concat([r[0]])),o=Math.atan2(r[0][1]-i[1],r[0][0]-i[0]),s=0;return r.map(function(i,h){var u;return h&&(s+=G(i,r[h-1])),u=o+2*Math.PI*s/a,[Math.cos(u)*n+t,Math.sin(u)*n+e]})}}function Ht(t,e,n,r){return function(i){var a=Wt(i),o=$t(i.concat([i[0]])),s=Math.atan2(i[0][1]-a[1],i[0][0]-a[0]),h=0;s<0&&(s=2*Math.PI+s);var u=s/(2*Math.PI);return i.map(function(a,s){var c=Qt((u+h/o)%1);return s&&(h+=G(a,i[s-1])),[t+c[0]*n,e+c[1]*r]})}}function Qt(t){return t<=1/8?[1,.5+4*t]:t<=3/8?[1.5-4*t,1]:t<=5/8?[0,2.5-4*t]:t<=7/8?[4*t-2.5,0]:[1,4*t-3.5]}function Rt(t,e,n){var r=t-n+","+e,i=t+n+","+e,a="A"+n+","+n+",0,1,1,";return"M"+r+a+i+a+r+"Z"}function Ut(t,e,n,r){var i=t+n,a=e+r;return"M"+t+","+e+"L"+i+","+e+"L"+i+","+a+"L"+t+","+a+"Z"}var Bt=function(t){for(var e,n=-1,r=t.length,i=t[r-1],a=0;++n<r;)e=i,i=t[n],a+=e[1]*i[0]-e[0]*i[1];return a/2},Wt=function(t){for(var e,n,r=-1,i=t.length,a=0,o=0,s=t[i-1],h=0;++r<i;)e=s,s=t[r],h+=n=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*n,o+=(e[1]+s[1])*n;return h*=3,[a/h,o/h]},$t=function(t){for(var e,n,r=-1,i=t.length,a=t[i-1],o=a[0],s=a[1],h=0;++r<i;)e=o,n=s,a=t[r],o=a[0],s=a[1],e-=o,n-=s,h+=Math.sqrt(e*e+n*n);return h},Jt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Kt=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],te=function(t){var e=new a(t),n=e.max;for(o(e);e.index<n&&!e.err.length;)u(e);return e.err.length?e.result=[]:e.result.length&&("mM".indexOf(e.result[0][0])<0?(e.err="SvgPath: string should start with `M` or `m`",e.result=[]):e.result[0][0]="M"),{err:e.err,segments:e.result}};f.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]?this:(this.cache=null,this.queue.push(t),this)},f.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},f.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},f.prototype.rotate=function(t,e,n){var r,i,a;return 0!==t&&(this.translate(e,n),r=t*Math.PI/180,i=Math.cos(r),a=Math.sin(r),this.queue.push([i,a,-a,i,0,0]),this.cache=null,this.translate(-e,-n)),this},f.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},f.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},f.prototype.toArray=function(){var t=this;if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var e=1;e<this.queue.length;e++)t.cache=c(t.cache,t.queue[e]);return this.cache},f.prototype.calc=function(t,e,n){var r;return this.queue.length?(this.cache||(this.cache=this.toArray()),r=this.cache,[t*r[0]+e*r[2]+(n?0:r[4]),t*r[1]+e*r[3]+(n?0:r[5])]):[t,e]};var ee=f,ne={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},re=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,ie=/[\s,]+/,ae=function(t){var e,n,r=new ee;return t.split(re).forEach(function(t){if(t.length){if(void 0!==ne[t])return void(e=t);switch(n=t.split(ie).map(function(t){return+t||0}),e){case"matrix":return void(6===n.length&&r.matrix(n));case"scale":return void(1===n.length?r.scale(n[0],n[0]):2===n.length&&r.scale(n[0],n[1]));case"rotate":return void(1===n.length?r.rotate(n[0],0,0):3===n.length&&r.rotate(n[0],n[1],n[2]));case"translate":return void(1===n.length?r.translate(n[0],0):2===n.length&&r.translate(n[0],n[1]));case"skewX":return void(1===n.length&&r.skewX(n[0]));case"skewY":return void(1===n.length&&r.skewY(n[0]))}}}),r},oe=2*Math.PI,se=function(t,e,n,r,i,a,o,s,h){var u=Math.sin(h*oe/360),c=Math.cos(h*oe/360),f=c*(t-n)/2+u*(e-r)/2,l=-u*(t-n)/2+c*(e-r)/2;if(0===f&&0===l)return[];if(0===o||0===s)return[];o=Math.abs(o),s=Math.abs(s);var g=f*f/(o*o)+l*l/(s*s);g>1&&(o*=Math.sqrt(g),s*=Math.sqrt(g));var x=p(t,e,n,r,i,a,o,s,u,c),y=[],d=x[2],m=x[3],M=Math.max(Math.ceil(Math.abs(m)/(oe/4)),1);m/=M;for(var w=0;w<M;w++)y.push(v(d,m)),d+=m;return y.map(function(t){for(var e=0;e<t.length;e+=2){var n=t[e+0],r=t[e+1];n*=o,r*=s;var i=c*n-u*r,a=u*n+c*r;t[e+0]=i+x[0],t[e+1]=a+x[1]}return t})},he=Math.PI/180;g.prototype.transform=function(t){var e=Math.cos(this.ax*he),n=Math.sin(this.ax*he),r=[this.rx*(t[0]*e+t[2]*n),this.rx*(t[1]*e+t[3]*n),this.ry*(-t[0]*n+t[2]*e),this.ry*(-t[1]*n+t[3]*e)],i=r[0]*r[0]+r[2]*r[2],a=r[1]*r[1]+r[3]*r[3],o=((r[0]-r[3])*(r[0]-r[3])+(r[2]+r[1])*(r[2]+r[1]))*((r[0]+r[3])*(r[0]+r[3])+(r[2]-r[1])*(r[2]-r[1])),s=(i+a)/2;if(o<1e-10*s)return this.rx=this.ry=Math.sqrt(s),this.ax=0,this;var h=r[0]*r[1]+r[2]*r[3];o=Math.sqrt(o);var u=s+o/2,c=s-o/2;return this.ax=Math.abs(h)<1e-10&&Math.abs(u-a)<1e-10?90:180*Math.atan(Math.abs(h)>Math.abs(u-a)?(u-i)/h:h/(u-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(u),this.ry=Math.sqrt(c)):(this.ax+=90,this.rx=Math.sqrt(c),this.ry=Math.sqrt(u)),this},g.prototype.isDegenerate=function(){return this.rx<1e-10*this.ry||this.ry<1e-10*this.rx};var ue=g;x.prototype.__matrix=function(t){var e,n=this;t.queue.length&&this.iterate(function(r,i,a,o){var s,h,u,c;switch(r[0]){case"v":s=t.calc(0,r[1],!0),h=0===s[0]?["v",s[1]]:["l",s[0],s[1]];break;case"V":s=t.calc(a,r[1],!1),h=s[0]===t.calc(a,o,!1)[0]?["V",s[1]]:["L",s[0],s[1]];break;case"h":s=t.calc(r[1],0,!0),h=0===s[1]?["h",s[0]]:["l",s[0],s[1]];break;case"H":s=t.calc(r[1],o,!1),h=s[1]===t.calc(a,o,!1)[1]?["H",s[0]]:["L",s[0],s[1]];break;case"a":case"A":var f=t.toArray(),l=ue(r[1],r[2],r[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(r[5]=r[5]?"0":"1"),s=t.calc(r[6],r[7],"a"===r[0]),"A"===r[0]&&r[6]===a&&r[7]===o||"a"===r[0]&&0===r[6]&&0===r[7]){h=["a"===r[0]?"l":"L",s[0],s[1]];break}h=l.isDegenerate()?["a"===r[0]?"l":"L",s[0],s[1]]:[r[0],l.rx,l.ry,l.ax,r[4],r[5],s[0],s[1]];break;case"m":c=i>0,s=t.calc(r[1],r[2],c),h=["m",s[0],s[1]];break;default:for(u=r[0],h=[u],c=u.toLowerCase()===u,e=1;e<r.length;e+=2)s=t.calc(r[e],r[e+1],c),h.push(s[0],s[1])}n.segments[i]=h},!0)},x.prototype.__evaluateStack=function(){var t,e,n=this;if(this.__stack.length){if(1===this.__stack.length)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=ee(),e=this.__stack.length;--e>=0;)t.matrix(n.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},x.prototype.toString=function(){var t,e,n=this,r=[];this.__evaluateStack();for(var i=0;i<this.segments.length;i++)e=n.segments[i][0],t=i>0&&"m"!==e&&"M"!==e&&e===n.segments[i-1][0],r=r.concat(t?n.segments[i].slice(1):n.segments[i]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},x.prototype.translate=function(t,e){return this.__stack.push(ee().translate(t,e||0)),this},x.prototype.scale=function(t,e){return this.__stack.push(ee().scale(t,e||0===e?e:t)),this},x.prototype.rotate=function(t,e,n){return this.__stack.push(ee().rotate(t,e||0,n||0)),this},x.prototype.skewX=function(t){return this.__stack.push(ee().skewX(t)),this},x.prototype.skewY=function(t){return this.__stack.push(ee().skewY(t)),this},x.prototype.matrix=function(t){return this.__stack.push(ee().matrix(t)),this},x.prototype.transform=function(t){return t.trim()?(this.__stack.push(ae(t)),this):this},x.prototype.round=function(t){var e,n=0,r=0,i=0,a=0;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(o){var s=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":return s&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"V":case"v":return s&&(o[1]+=a),a=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"Z":case"z":return i=n,void(a=r);case"M":case"m":return s&&(o[1]+=i,o[2]+=a),i=o[1]-o[1].toFixed(t),a=o[2]-o[2].toFixed(t),n=i,r=a,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case"A":case"a":return s&&(o[6]+=i,o[7]+=a),i=o[6]-o[6].toFixed(t),a=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,s&&(o[e-2]+=i,o[e-1]+=a),i=o[e-2]-o[e-2].toFixed(t),a=o[e-1]-o[e-1].toFixed(t),void o.forEach(function(e,n){n&&(o[n]=+o[n].toFixed(t))})}}),this},x.prototype.iterate=function(t,e){var n,r,i,a=this.segments,o={},s=!1,h=0,u=0,c=0,f=0;if(e||this.__evaluateStack(),a.forEach(function(e,n){var r=t(e,n,h,u);Array.isArray(r)&&(o[n]=r,s=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(f=u);case"h":case"H":return void(h=e[1]+(i?h:0));case"v":case"V":return void(u=e[1]+(i?u:0));case"z":case"Z":return h=c,void(u=f);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}}),!s)return this;for(i=[],n=0;n<a.length;n++)if(void 0!==o[n])for(r=0;r<o[n].length;r++)i.push(o[n][r]);else i.push(a[n]);return this.segments=i,this},x.prototype.abs=function(){return this.iterate(function(t,e,n,r){var i,a=t[0],o=a.toUpperCase();if(a!==o)switch(t[0]=o,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i<t.length;i++)t[i]+=i%2?n:r}},!0),this},x.prototype.rel=function(){return this.iterate(function(t,e,n,r){var i,a=t[0],o=a.toLowerCase();if(a!==o&&(0!==e||"M"!==a))switch(t[0]=o,a){case"V":return void(t[1]-=r);case"A":return t[6]-=n,void(t[7]-=r);default:for(i=1;i<t.length;i++)t[i]-=i%2?n:r}},!0),this},x.prototype.unarc=function(){return this.iterate(function(t,e,n,r){var i,a,o,s=[],h=t[0];return"A"!==h&&"a"!==h?null:("a"===h?(a=n+t[6],o=r+t[7]):(a=t[6],o=t[7]),i=se(n,r,a,o,t[4],t[5],t[1],t[2],t[3]),0===i.length?[["a"===t[0]?"l":"L",t[6],t[7]]]:(i.forEach(function(t){s.push(["C",t[2],t[3],t[4],t[5],t[6],t[7]])}),s))}),this},x.prototype.unshort=function(){var t,e,n,r,i,a=this.segments;return this.iterate(function(o,s,h,u){var c,f=o[0],l=f.toUpperCase();s&&("T"===l?(c="t"===f,n=a[s-1],"Q"===n[0]?(t=n[1]-h,e=n[2]-u):"q"===n[0]?(t=n[1]-n[3],e=n[2]-n[4]):(t=0,e=0),r=-t,i=-e,c||(r+=h,i+=u),a[s]=[c?"q":"Q",r,i,o[1],o[2]]):"S"===l&&(c="s"===f,n=a[s-1],"C"===n[0]?(t=n[3]-h,e=n[4]-u):"c"===n[0]?(t=n[3]-n[5],e=n[4]-n[6]):(t=0,e=0),r=-t,i=-e,c||(r+=h,i+=u),a[s]=[c?"c":"C",r,i,o[1],o[2],o[3],o[4]]))}),this};var ce=x,fe=ce,le={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},pe=/([astvzqmhlc])([^astvzqmhlc]*)/gi,ve=function(t){var e=[];return t.replace(pe,function(t,n,r){var i=n.toLowerCase();for(r=y(r),"m"===i&&r.length>2&&(e.push([n].concat(r.splice(0,2))),i="l",n="m"===n?"l":"L");r.length>=0;){if(r.length===le[i])return r.unshift(n),e.push(r);if(r.length<le[i])throw new Error("malformed path data");e.push([n].concat(r.splice(0,le[i])))}}),e},ge=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,xe=function(t,e,n,r,i,a,o,s){return new d(t,e,n,r,i,a,o,s)};d.prototype={constructor:d,init:function(){this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y])},getTotalLength:function(){return this.length},getPointAtLength:function(t){var e=w(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]);return this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e)},getTangentAtLength:function(t){var e=w(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),n=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),r=Math.sqrt(n.x*n.x+n.y*n.y);return r>0?{x:n.x/r,y:n.y/r}:{x:0,y:0}},getPropertiesAtLength:function(t){var e,n=w(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),r=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n),i=Math.sqrt(r.x*r.x+r.y*r.y);e=i>0?{x:r.x/i,y:r.y/i}:{x:0,y:0};var a=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n);return{x:a.x,y:a.y,tangentX:e.x,tangentY:e.y}}} | ||
;var ye=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],de=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],me=[[1],[1,1],[1,2,1],[1,3,3,1]],Me=2*Math.PI,we=function(t,e,n,r,i,a,o,s,h){var u=Math.sin(i*Me/360),c=Math.cos(i*Me/360),f=c*(t-s)/2+u*(e-h)/2,l=-u*(t-s)/2+c*(e-h)/2;if(0===f&&0===l)return[];if(0===n||0===r)return[];n=Math.abs(n),r=Math.abs(r);var p=f*f/(n*n)+l*l/(r*r);p>1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var v=C(t,e,s,h,a,o,n,r,u,c),g=[],x=v[2],y=v[3],d=Math.max(Math.ceil(Math.abs(y)/(Me/4)),1);y/=d;for(var m=0;m<d;m++)g.push(S(x,y)),x+=y;return g.map(function(t){for(var e=0;e<t.length;e+=2){var i=t[e+0],a=t[e+1];i*=n,a*=r;var o=c*i-u*a,s=u*i+c*a;t[e+0]=o+v[0],t[e+1]=s+v[1]}return t})},be=function(t,e,n,r,i,a,o,s,h){return new Z(t,e,n,r,i,a,o,s,h)};Z.prototype={constructor:Z,init:function(){},getTotalLength:function(){return this.length},getPointAtLength:function(t){var e=this;t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var r=0,i=0;i<n;i++)r+=e.partialLengths[i];return this.curves[n].getPointAtLength(t-r)},getTangentAtLength:function(t){var e=this;t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var r=0,i=0;i<n;i++)r+=e.partialLengths[i];return this.curves[n].getTangentAtLength(t-r)},getPropertiesAtLength:function(t){var e=this.getTangentAtLength(t),n=this.getPointAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}}};var Le=function(t,e,n,r){return new T(t,e,n,r)};T.prototype.getTotalLength=function(){return Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2))},T.prototype.getPointAtLength=function(t){var e=t/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),n=(this.x1-this.x0)*e,r=(this.y1-this.y0)*e;return{x:this.x0+n,y:this.y0+r}},T.prototype.getTangentAtLength=function(){var t=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/t,y:(this.y1-this.y0)/t}},T.prototype.getPropertiesAtLength=function(t){var e=this.getPointAtLength(t),n=this.getTangentAtLength();return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}};var Ae=function(t){function e(t){if(!t)return null;for(var a,o=ve(t),s=[0,0],h=[0,0],u=0;u<o.length;u++)"M"===o[u][0]?(s=[o[u][1],o[u][2]],i.push(null)):"m"===o[u][0]?(s=[o[u][1]+s[0],o[u][2]+s[1]],i.push(null)):"L"===o[u][0]?(n+=Math.sqrt(Math.pow(s[0]-o[u][1],2)+Math.pow(s[1]-o[u][2],2)),i.push(new Le(s[0],o[u][1],s[1],o[u][2])),s=[o[u][1],o[u][2]]):"l"===o[u][0]?(n+=Math.sqrt(Math.pow(o[u][1],2)+Math.pow(o[u][2],2)),i.push(new Le(s[0],o[u][1]+s[0],s[1],o[u][2]+s[1])),s=[o[u][1]+s[0],o[u][2]+s[1]]):"H"===o[u][0]?(n+=Math.abs(s[0]-o[u][1]),i.push(new Le(s[0],o[u][1],s[1],s[1])),s[0]=o[u][1]):"h"===o[u][0]?(n+=Math.abs(o[u][1]),i.push(new Le(s[0],s[0]+o[u][1],s[1],s[1])),s[0]=o[u][1]+s[0]):"V"===o[u][0]?(n+=Math.abs(s[1]-o[u][1]),i.push(new Le(s[0],s[0],s[1],o[u][1])),s[1]=o[u][1]):"v"===o[u][0]?(n+=Math.abs(o[u][1]),i.push(new Le(s[0],s[0],s[1],s[1]+o[u][1])),s[1]=o[u][1]+s[1]):"z"===o[u][0]||"Z"===o[u][0]?(n+=Math.sqrt(Math.pow(o[0][1]-s[0],2)+Math.pow(o[0][2]-s[1],2)),i.push(new Le(s[0],o[0][1],s[1],o[0][2])),s=[o[0][1],o[0][2]]):"C"===o[u][0]?(a=new xe(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4],o[u][5],o[u][6]),n+=a.getTotalLength(),s=[o[u][5],o[u][6]],i.push(a)):"c"===o[u][0]?(a=new xe(s[0],s[1],s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4],s[0]+o[u][5],s[1]+o[u][6]),n+=a.getTotalLength(),s=[o[u][5]+s[0],o[u][6]+s[1]],i.push(a)):"S"===o[u][0]?(a=u>0&&["C","c","S","s"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],2*s[0]-o[u-1][o[u-1].length-4],2*s[1]-o[u-1][o[u-1].length-3],o[u][1],o[u][2],o[u][3],o[u][4]):new xe(s[0],s[1],s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4]),n+=a.getTotalLength(),s=[o[u][3],o[u][4]],i.push(a)):"s"===o[u][0]?(a=u>0&&["C","c","S","s"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],s[0]+a.d.x-a.c.x,s[1]+a.d.y-a.c.y,s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4]):new xe(s[0],s[1],s[0],s[1],s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4]),n+=a.getTotalLength(),s=[o[u][3]+s[0],o[u][4]+s[1]],i.push(a)):"Q"===o[u][0]?(a=new xe(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4]),n+=a.getTotalLength(),i.push(a),s=[o[u][3],o[u][4]],h=[o[u][1],o[u][2]]):"q"===o[u][0]?(a=new xe(s[0],s[1],s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4]),n+=a.getTotalLength(),h=[s[0]+o[u][1],s[1]+o[u][2]],s=[o[u][3]+s[0],o[u][4]+s[1]],i.push(a)):"T"===o[u][0]?(a=u>0&&["Q","q","T","t"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],2*s[0]-h[0],2*s[1]-h[1],o[u][1],o[u][2]):new Le(s[0],o[u][1],s[1],o[u][2]),i.push(a),n+=a.getTotalLength(),h=[2*s[0]-h[0],2*s[1]-h[1]],s=[o[u][1],o[u][2]]):"t"===o[u][0]?(a=u>0&&["Q","q","T","t"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],2*s[0]-h[0],2*s[1]-h[1],s[0]+o[u][1],s[1]+o[u][2]):new Le(s[0],s[0]+o[u][1],s[1],s[1]+o[u][2]),n+=a.getTotalLength(),h=[2*s[0]-h[0],2*s[1]-h[1]],s=[o[u][1]+s[0],o[u][2]+s[0]],i.push(a)):"A"===o[u][0]?(a=new be(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4],o[u][5],o[u][6],o[u][7]),n+=a.getTotalLength(),s=[o[u][6],o[u][7]],i.push(a)):"a"===o[u][0]&&(a=new be(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4],o[u][5],s[0]+o[u][6],s[1]+o[u][7]),n+=a.getTotalLength(),s=[s[0]+o[u][6],s[1]+o[u][7]],i.push(a)),r.push(n);return e}var n=0,r=[],i=[];e.getTotalLength=function(){return n},e.getPointAtLength=function(t){var e=a(t);return i[e.i].getPointAtLength(e.fraction)},e.getTangentAtLength=function(t){var e=a(t);return i[e.i].getTangentAtLength(e.fraction)},e.getPropertiesAtLength=function(t){var e=a(t);return i[e.i].getPropertiesAtLength(e.fraction)};var a=function(t){t<0?t=0:t>n&&(t=n);for(var e=r.length-1;r[e]>=t&&r[e]>0;)e--;return e++,{fraction:t-r[e-1],i:e}};return e(t)},qe='All shapes must be supplied as arrays of multiple [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).\nExample valid ways of supplying a shape would be:\n[[0, 0], [10, 0], [10, 10]]\n"M0,0 L10,0 L10,10Z"\n',ke=function(t,e){for(var n,r,i,a=t.length,o=1/0,s=0;s<a;s++)!function(i){r=0,e.forEach(function(e,n){var o=G(t[(i+n)%a],e);r+=o*o}),r<o&&(o=r,n=i)}(s);n&&(i=t.splice(0,n),t.splice.apply(t,[t.length,0].concat(i)))},_e=function(t,e,n){void 0===n&&(n={});var r=n.maxSegmentLength;void 0===r&&(r=10);var i=n.string;void 0===i&&(i=!0);var a=B(t,r),o=B(e,r),s=$(a,o,i);return!i||"string"!=typeof t&&"string"!=typeof e?s:function(n){return n<1e-4&&"string"==typeof t?t:1-n<1e-4&&"string"==typeof e?e:s(n)}},Pe=J;J.deviation=function(t,e,n,r){var i=e&&e.length,a=i?e[0]*n:t.length,o=Math.abs(kt(t,0,a,n));if(i)for(var s=0,h=e.length;s<h;s++){var u=e[s]*n,c=s<h-1?e[s+1]*n:t.length;o-=Math.abs(kt(t,u,c,n))}var f=0;for(s=0;s<r.length;s+=3){var l=r[s]*n,p=r[s+1]*n,v=r[s+2]*n;f+=Math.abs((t[l]-t[v])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[v+1]-t[l+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},J.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)n.vertices.push(t[i][a][o]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var Ee=function(t){return t},Ce=function(t){if(null==t)return Ee;var e,n,r=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=n=0);var h=2,u=t.length,c=new Array(u);for(c[0]=(e+=t[0])*r+a,c[1]=(n+=t[1])*i+o;h<u;)c[h]=t[h],++h;return c}},Se=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},Ze=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return _t(t,e)})}:_t(t,e)},Te=function(t,e){function n(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1],e<0?[n,i]:[i,n]}function r(t,e){for(var n in t){var r=t[n];delete e[r.start],delete r.start,delete r.end,r.forEach(function(t){i[t<0?~t:t]=1}),s.push(r)}}var i={},a={},o={},s=[],h=-1;return e.forEach(function(n,r){var i,a=t.arcs[n<0?~n:n];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++h],e[h]=n,e[r]=i)}),e.forEach(function(t){var e,r,i=n(t),s=i[0],h=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=h,r=a[h]){delete a[r.start];var u=r===e?e:e.concat(r);a[u.start=e.start]=o[u.end=r.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[h])if(delete a[e.start],e.unshift(t),e.start=s,r=o[s]){delete o[r.end];var c=r===e?e:r.concat(e);a[c.start=r.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=h]=e}),r(o,a),r(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},Fe=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;t[i]<e?n=i+1:r=i}return n},ze=function(t){function e(t,e){t.forEach(function(t){t<0&&(t=~t);var n=i[t];n?n.push(e):i[t]=[e]})}function n(t,n){t.forEach(function(t){e(t,n)})}function r(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){r(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:n,Polygon:n,MultiPolygon:function(t,e){t.forEach(function(t){n(t,e)})}};t.forEach(r);for(var s in i)for(var h=i[s],u=h.length,c=0;c<u;++c)for(var f=c+1;f<u;++f){var l,p=h[c],v=h[f];(l=a[p])[s=Fe(l,v)]!==v&&l.splice(s,0,v),(l=a[v])[s=Fe(l,p)]!==p&&l.splice(s,0,p)}return a},je=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Ie=function(t){return 1===t.length&&(t=St(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}},Xe=Ie(je),Ye=(Xe.right,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),function(t,e){return Tt(Zt(Ft(t),t),e)}),Ne=function(t,e){var n=t.map(function(t){return e.map(function(e){return jt(t,e)})});zt(t,e,n);return t.length>8?t.map(function(t,e){return e}):zt(t,e,n)};t.interpolate=_e,t.separate=It,t.combine=Xt,t.splitPathString=I,t.toPathString=j,t.fromCircle=Yt,t.toCircle=Nt,t.fromRect=Vt,t.toRect=Gt,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.flubber=t.flubber||{})}(this,function(t){"use strict";function e(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Kt.indexOf(t)>=0}function n(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function r(t){return t>=48&&t<=57}function i(t){return t>=48&&t<=57||43===t||45===t||46===t}function a(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function o(t){for(;t.index<t.max&&e(t.path.charCodeAt(t.index));)t.index++}function s(t){var e,n=t.index,i=n,a=t.max,o=!1,s=!1,h=!1,u=!1;if(i>=a)return void(t.err="SvgPath: missed param (at pos "+i+")");if(e=t.path.charCodeAt(i),43!==e&&45!==e||(i++,e=i<a?t.path.charCodeAt(i):0),!r(e)&&46!==e)return void(t.err="SvgPath: param should start with 0..9 or `.` (at pos "+i+")");if(46!==e){if(o=48===e,i++,e=i<a?t.path.charCodeAt(i):0,o&&i<a&&e&&r(e))return void(t.err="SvgPath: numbers started with `0` such as `09` are ilegal (at pos "+n+")");for(;i<a&&r(t.path.charCodeAt(i));)i++,s=!0;e=i<a?t.path.charCodeAt(i):0}if(46===e){for(u=!0,i++;r(t.path.charCodeAt(i));)i++,h=!0;e=i<a?t.path.charCodeAt(i):0}if(101===e||69===e){if(u&&!s&&!h)return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");if(i++,e=i<a?t.path.charCodeAt(i):0,43!==e&&45!==e||i++,!(i<a&&r(t.path.charCodeAt(i))))return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");for(;i<a&&r(t.path.charCodeAt(i));)i++}t.index=i,t.param=parseFloat(t.path.slice(n,i))+0}function h(t){var e,n;e=t.path[t.segmentStart],n=e.toLowerCase();var r=t.data;if("m"===n&&r.length>2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Jt[n]&&(t.result.push([e].concat(r.splice(0,Jt[n]))),Jt[n]););}function u(t){var e,r,a,u,c=t.max;if(t.segmentStart=t.index,e=t.path.charCodeAt(t.index),!n(e))return void(t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")");if(a=Jt[t.path[t.index].toLowerCase()],t.index++,o(t),t.data=[],!a)return void h(t);for(r=!1;;){for(u=a;u>0;u--){if(s(t),t.err.length)return;t.data.push(t.param),o(t),r=!1,t.index<c&&44===t.path.charCodeAt(t.index)&&(t.index++,o(t),r=!0)}if(!r){if(t.index>=t.max)break;if(!i(t.path.charCodeAt(t.index)))break}}h(t)}function c(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function f(){if(!(this instanceof f))return new f;this.queue=[],this.cache=null}function l(t,e,n,r){var i=t*r-e*n<0?-1:1,a=Math.sqrt(t*t+e*e),o=Math.sqrt(t*t+e*e),s=t*n+e*r,h=s/(a*o);return h>1&&(h=1),h<-1&&(h=-1),i*Math.acos(h)}function p(t,e,n,r,i,a,o,s,h,u){var c=u*(t-n)/2+h*(e-r)/2,f=-h*(t-n)/2+u*(e-r)/2,p=o*o,v=s*s,g=c*c,x=f*f,y=p*v-p*x-v*g;y<0&&(y=0),y/=p*x+v*g,y=Math.sqrt(y)*(i===a?-1:1);var d=y*o/s*f,m=y*-s/o*c,M=u*d-h*m+(t+n)/2,w=h*d+u*m+(e+r)/2,b=(c-d)/o,L=(f-m)/s,A=(-c-d)/o,q=(-f-m)/s,k=l(1,0,b,L),P=l(b,L,A,q);return 0===a&&P>0&&(P-=oe),1===a&&P<0&&(P+=oe),[M,w,k,P]}function v(t,e){var n=4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[r,i,r-i*n,i+r*n,a+o*n,o-a*n,a,o]}function g(t,e,n){if(!(this instanceof g))return new g(t,e,n);this.rx=t,this.ry=e,this.ax=n}function x(t){if(!(this instanceof x))return new x(t);var e=te(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}function y(t){var e=t.match(ge);return e?e.map(Number):[]}function d(t,e,n,r,i,a,o,s){this.a={x:t,y:e},this.b={x:n,y:r},this.c={x:i,y:a},this.d={x:o,y:s},null!==o&&void 0!==o&&null!==s&&void 0!==s?(this.getArcLength=_,this.getPoint=L,this.getDerivative=M):(this.getArcLength=A,this.getPoint=b,this.getDerivative=m),this.init()}function m(t,e,n){return{x:2*(1-n)*(t[1]-t[0])+2*n*(t[2]-t[1]),y:2*(1-n)*(e[1]-e[0])+2*n*(e[2]-e[1])}}function M(t,e,n){return b([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],n)}function w(t,e,n,r,i){for(var a=1,o=t/e,s=(t-n(r,i,o))/e;a>.001;){var h=n(r,i,o+s),u=n(r,i,o-s),c=Math.abs(t-h)/e,f=Math.abs(t-u)/e;c<a?(a=c,o+=s):f<a?(a=f,o-=s):s/=2}return o}function b(t,e,n){return{x:(1-n)*(1-n)*t[0]+2*(1-n)*n*t[1]+n*n*t[2],y:(1-n)*(1-n)*e[0]+2*(1-n)*n*e[1]+n*n*e[2]}}function L(t,e,n){return{x:(1-n)*(1-n)*(1-n)*t[0]+3*(1-n)*(1-n)*n*t[1]+3*(1-n)*n*n*t[2]+n*n*n*t[3],y:(1-n)*(1-n)*(1-n)*e[0]+3*(1-n)*(1-n)*n*e[1]+3*(1-n)*n*n*e[2]+n*n*n*e[3]}}function A(t,e,n){void 0===n&&(n=1);var r=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],a=2*t[1]-2*t[0],o=2*e[1]-2*e[0],s=4*(r*r+i*i),h=4*(r*a+i*o),u=a*a+o*o;if(0===s)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));var c=h/(2*s),f=u/s,l=n+c,p=f-c*c;return Math.sqrt(s)/2*(l*Math.sqrt(l*l+p)-c*Math.sqrt(c*c+p)+p*Math.log(Math.abs((l+Math.sqrt(l*l+p))/(c+Math.sqrt(c*c+p)))))}function q(t,e){return me[t][e]}function k(t,e,n){var r,i,a,o=n.length-1;if(0===o)return 0;if(0===t){for(i=0,a=0;a<=o;a++)i+=q(o,a)*Math.pow(1-e,o-a)*Math.pow(e,a)*n[a];return i}for(r=new Array(o),a=0;a<o;a++)r[a]=o*(n[a+1]-n[a]);return k(t-1,e,r)}function P(t,e,n){var r=k(1,n,t),i=k(1,n,e),a=r*r+i*i;return Math.sqrt(a)}function _(t,e,n){var r,i,a,o;void 0===n&&(n=1);for(r=n/2,i=0,a=0;a<20;a++)o=r*ye[20][a]+r,i+=de[20][a]*P(t,e,o);return r*i}function E(t,e,n,r){var i=t*r-e*n<0?-1:1,a=t*n+e*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)}function C(t,e,n,r,i,a,o,s,h,u){var c=u*(t-n)/2+h*(e-r)/2,f=-h*(t-n)/2+u*(e-r)/2,l=o*o,p=s*s,v=c*c,g=f*f,x=l*p-l*g-p*v;x<0&&(x=0),x/=l*g+p*v,x=Math.sqrt(x)*(i===a?-1:1);var y=x*o/s*f,d=x*-s/o*c,m=u*y-h*d+(t+n)/2,M=h*y+u*d+(e+r)/2,w=(c-y)/o,b=(f-d)/s,L=(-c-y)/o,A=(-f-d)/s,q=E(1,0,w,b),k=E(w,b,L,A);return 0===a&&k>0&&(k-=Me),1===a&&k<0&&(k+=Me),[m,M,q,k]}function S(t,e){var n=4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[r,i,r-i*n,i+r*n,a+o*n,o-a*n,a,o]}function Z(t,e,n,r,i,a,o,s,h){var u=0,c=[],f=[];we(t,e,n,r,i,a,o,s,h).forEach(function(t){var e=new xe(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),n=e.getTotalLength();u+=n,c.push(n),f.push(e)}),this.length=u,this.partialLengths=c,this.curves=f}function T(t,e,n,r){this.x0=t,this.x1=e,this.y0=n,this.y1=r}function F(t){return new fe(t).abs()}function z(t){return t.toString().split("M").map(function(t,e){return t=t.trim(),e&&t?"M"+t:t}).filter(function(t){return t})}function j(t){return"M"+t.join("L")+"Z"}function I(t){return z(F(t))}function X(t,e){var n=F(t);return Y(n,e)||N(n,e)}function Y(t,e){var n=t.segments||[],r=[];if(!n.length||"M"!==n[0][0])return!1;for(var i=0;i<n.length;i++){var a=n[i],o=a[0],s=a[1],h=a[2];if("M"===o&&i||"Z"===o)break;if("M"===o||"L"===o)r.push([s,h]);else if("H"===o)r.push([s,r[r.length-1][1]]);else{if("V"!==o)return!1;r.push([r[r.length-1][0],s])}}return!!r.length&&{ring:r}}function N(t,e){var n,r,i,a=z(t)[0],o=[];if(!a)throw new TypeError(qe);r=V(a),n=r.getTotalLength(),i=Math.ceil(n/e);for(var s=0;s<i;s++){var h=r.getPointAtLength(n*s/i);o.push([h.x,h.y])}return{ring:o,skipBisect:!0}}function V(t){if("undefined"!=typeof module&&module.exports)return Ae(t);var e=(window.document.createElementNS("http://www.w3.org/2000/svg","svg"),window.document.createElementNS("http://www.w3.org/2000/svg","path"));return e.setAttributeNS(null,"d",t),e}function G(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function O(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function D(t,e){return G(t,e)<1e-9}function H(t,e,n){var r=t.map(function(t,n){return Q(t,e[n])});return function(t){var e=r.map(function(e){return e(t)});return n?j(e):e}}function Q(t,e){return function(n){return t.map(function(t,r){return t+n*(e[r]-t)})}}function R(t,e,n){void 0===n&&(n=1/0);for(var r=t.length+e,i=$t(t)/e,a=0,o=0,s=i/2;t.length<r;){var h=t[a],u=t[(a+1)%t.length],c=G(h,u);s<=o+c?(t.splice(a+1,0,c?O(h,u,(s-o)/c):h.slice(0)),s+=i):(o+=c,a++)}}function U(t,e){void 0===e&&(e=1/0);for(var n=0;n<t.length;n++)for(var r=t[n],i=n===t.length-1?t[0]:t[n+1];G(r,i)>e;)i=O(r,i,.5),t.splice(n+1,0,i)}function B(t,e){var n,r,i;if("string"==typeof t){var a=X(t,e);t=a.ring,i=a.skipBisect}else if(!Array.isArray(t))throw new TypeError(qe);if(n=t.slice(0),!W(n))throw new TypeError(qe);if(n.length>1&&D(n[0],n[n.length-1])&&n.pop(),n.length<3)throw new TypeError(ke);return r=Bt(n),r>0&&n.reverse(),!i&&e&&Number.isFinite(e)&&e>0&&U(n,e),n}function W(t){return t.every(function(t){return Array.isArray(t)&&t.length>=2&&Number.isFinite(t[0])&&Number.isFinite(t[1])})}function $(t,e,n){var r;return r=t.length-e.length,R(t,r<0?-1*r:0),R(e,r>0?r:0),Pe(t,e),H(t,e,n)}function J(t,e,n){n=n||2;var r=e&&e.length,i=r?e[0]*n:t.length,a=K(t,0,i,n,!0),o=[];if(!a)return o;var s,h,u,c,f,l,p;if(r&&(a=ot(t,e,a,n)),t.length>80*n){s=u=t[0],h=c=t[1];for(var v=n;v<i;v+=n)f=t[v],l=t[v+1],f<s&&(s=f),l<h&&(h=l),f>u&&(u=f),l>c&&(c=l);p=Math.max(u-s,c-h)}return et(a,o,n,s,h,p),o}function K(t,e,n,r,i){var a,o;if(i===kt(t,e,n,r)>0)for(a=e;a<n;a+=r)o=Lt(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=Lt(a,t[a],t[a+1],o);return o&&yt(o,o.next)&&(At(o),o=o.next),o}function tt(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!yt(r,r.next)&&0!==xt(r.prev,r,r.next))r=r.next;else{if(At(r),(r=e=r.prev)===r.next)return null;n=!0}}while(n||r!==e);return e}function et(t,e,n,r,i,a,o){if(t){!o&&a&&ct(t,r,i,a);for(var s,h,u=t;t.prev!==t.next;)if(s=t.prev,h=t.next,a?rt(t,r,i,a):nt(t))e.push(s.i/n),e.push(t.i/n),e.push(h.i/n),At(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?(t=it(t,e,n),et(t,e,n,r,i,a,2)):2===o&&at(t,e,n,r,i,a):et(tt(t),e,n,r,i,a,1);break}}}function nt(t){var e=t.prev,n=t,r=t.next;if(xt(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(vt(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&xt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function rt(t,e,n,r){var i=t.prev,a=t,o=t.next;if(xt(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,h=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=lt(s,h,e,n,r),l=lt(u,c,e,n,r),p=t.nextZ;p&&p.z<=l;){if(p!==t.prev&&p!==t.next&&vt(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&vt(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xt(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function it(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!yt(i,a)&&dt(i,r,r.next,a)&&Mt(i,a)&&Mt(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),At(r),At(r.next),r=t=a),r=r.next}while(r!==t);return r}function at(t,e,n,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&>(o,s)){var h=bt(o,s);return o=tt(o,o.next),h=tt(h,h.next),et(o,e,n,r,i,a),void et(h,e,n,r,i,a)}s=s.next}o=o.next}while(o!==t)}function ot(t,e,n,r){var i,a,o,s,h,u=[];for(i=0,a=e.length;i<a;i++)o=e[i]*r,s=i<a-1?e[i+1]*r:t.length,h=K(t,o,s,r,!1),h===h.next&&(h.steiner=!0),u.push(pt(h));for(u.sort(st),i=0;i<u.length;i++)ht(u[i],n),n=tt(n,n.next);return n}function st(t,e){return t.x-e.x}function ht(t,e){if(e=ut(t,e)){var n=bt(e,t);tt(n,n.next)}}function ut(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===o)return n.prev;var h,u=n,c=n.x,f=n.y,l=1/0;for(r=n.next;r!==u;)i>=r.x&&r.x>=c&&vt(a<f?i:o,a,c,f,a<f?o:i,a,r.x,r.y)&&((h=Math.abs(a-r.y)/(i-r.x))<l||h===l&&r.x>n.x)&&Mt(r,t)&&(n=r,l=h),r=r.next;return n}function ct(t,e,n,r){var i=t;do{null===i.z&&(i.z=lt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,ft(i)}function ft(t){var e,n,r,i,a,o,s,h,u=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<u&&(s++,r=r.nextZ);e++);for(h=u;s>0||h>0&&r;)0===s?(i=r,r=r.nextZ,h--):0!==h&&r?n.z<=r.z?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,h--):(i=n,n=n.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(o>1);return t}function lt(t,e,n,r,i){return t=32767*(t-n)/i,e=32767*(e-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function pt(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function vt(t,e,n,r,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(r-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function gt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!mt(t,e)&&Mt(t,e)&&Mt(e,t)&&wt(t,e)}function xt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function yt(t,e){return t.x===e.x&&t.y===e.y}function dt(t,e,n,r){return!!(yt(t,e)&&yt(n,r)||yt(t,r)&&yt(n,e))||xt(t,e,n)>0!=xt(t,e,r)>0&&xt(n,r,t)>0!=xt(n,r,e)>0}function mt(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&dt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Mt(t,e){return xt(t.prev,t,t.next)<0?xt(t,e,t.next)>=0&&xt(t,t.prev,e)>=0:xt(t,e,t.prev)<0||xt(t,t.next,e)<0}function wt(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}function bt(t,e){var n=new qt(t.i,t.x,t.y),r=new qt(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Lt(t,e,n,r){var i=new qt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function At(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function qt(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function kt(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Pt(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,a=_t(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:a}:null==r?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function _t(t,e){function n(t,e){e.length&&e.pop();for(var n=u[t<0?~t:t],r=0,i=n.length;r<i;++r)e.push(h(n[r],r));t<0&&Ze(e,i)}function r(t){return h(t)}function i(t){for(var e=[],r=0,i=t.length;r<i;++r)n(t[r],e);return e.length<2&&e.push(e[0]),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0]);return e}function o(t){return t.map(a)}function s(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(s)};case"Point":e=r(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(r);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=o(t.arcs);break;case"MultiPolygon":e=t.arcs.map(o);break;default:return null}return{type:n,coordinates:e}}var h=Se(t.transform),u=t.arcs;return s(e)}function Et(t){for(var e,n=-1,r=t.length,i=t[r-1],a=0;++n<r;)e=i,i=t[n],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}function Ct(t,e){function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Polygon":r(t.arcs);break;case"MultiPolygon":t.arcs.forEach(r)}}function r(t){t.forEach(function(e){e.forEach(function(e){(a[e=e<0?~e:e]||(a[e]=[])).push(t)})}),o.push(t)}function i(e){return Et(_t(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var a={},o=[],s=[];return e.forEach(n),o.forEach(function(t){if(!t._){var e=[],n=[t];for(t._=1,s.push(e);t=n.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){a[t<0?~t:t].forEach(function(t){t._||(t._=1,n.push(t))})})})}}),o.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:s.map(function(e){var n,r=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){a[t<0?~t:t].length<2&&r.push(t)})})}),r=Fe(t,r),(n=r.length)>1)for(var o,s,h=1,u=i(r[0]);h<n;++h)(o=i(r[h]))>u&&(s=r[0],r[0]=r[h],r[h]=s,u=o);return r})}}function St(t){return function(e,n){return Ie(t(e),n)}}function Zt(t,e){var n={},r={type:"Topology",objects:{triangles:{type:"GeometryCollection",geometries:[]}},arcs:[]};return t.forEach(function(t){var i=[];t.forEach(function(t,a){var o=t[0]<t[1]?t.join(","):t[1]+","+t[0],s=t.map(function(t){return e[t]});o in n?i.push(~n[o]):(i.push(n[o]=r.arcs.length),r.arcs.push(s))}),r.objects.triangles.geometries.push({type:"Polygon",area:Math.abs(Bt(t.map(function(t){return e[t[0]]}))),arcs:[i]})}),r.objects.triangles.geometries.sort(function(t,e){return t.area-e.area}),r}function Tt(t,e){for(var n=t.objects.triangles.geometries,r=Xe(function(t){return t.area}).left;n.length>e;)!function(){var e=n[0],i=je(n)[0][0],a=n[i],o=Ct(t,[e,a]);o.area=e.area+a.area,o.type="Polygon",o.arcs=o.arcs[0],n.splice(i,1),n.shift(),n.splice(r(n,o.area),0,o)}();if(e>n.length)throw new RangeError("Can't collapse topology into "+e+" pieces.");return Te(t,t.objects.triangles).features.map(function(t){return t.geometry.coordinates[0].pop(),t.geometry.coordinates[0]})}function Ft(t){for(var e=t.reduce(function(t,e){return t.concat(e.slice(0,2))},[]),n=Ee(e),r=[],i=0,a=n.length;i<a;i+=3)r.push([[n[i],n[i+1]],[n[i+1],n[i+2]],[n[i+2],n[i]]]);return r}function zt(t,e,n){function r(t,e,o){void 0===e&&(e=[]),void 0===o&&(o=0);for(var s=0;s<t.length;s++){var h=t.splice(s,1),u=n[h[0]][e.length];o+u<i&&(t.length?r(t.slice(),e.concat(h),o+u):(i=o+u,a=e.concat(h))),t.length&&t.splice(s,0,h[0])}}var i=1/0,a=t.map(function(t,e){return e});return r(a),a}function jt(t,e){var n=G(Wt(t),Wt(e));return n*n}function It(t,e,n){void 0===n&&(n={});var r=n.maxSegmentLength;void 0===r&&(r=10);var i=n.string;void 0===i&&(i=!0);var a=n.single;void 0===a&&(a=!1);var o=B(t,r),s=Ne(o,e.length),h=e.map(function(t){return B(t,r)}),u=Ve(s,h),c=u.map(function(t,e){return $(s[t],h[e],i)});if(a){var f=j(o);return i?function(t){return t<1e-4?f:c.map(function(e){return e(t)}).join(" ")}:function(t){return c.map(function(e){return e(t)})}}return c}function Xt(t,e,n){void 0===n&&(n={});var r=n.maxSegmentLength;void 0===r&&(r=10);var i=n.string;void 0===i&&(i=!0);var a=n.single;void 0===a&&(a=!1);var o=It(e,t,{maxSegmentLength:r,string:i,single:a});return a?function(t){return o(1-t)}:o.map(function(t){return function(e){return t(1-e)}})}function Yt(t,e,n,r,i){return Ot(Dt(t,e,n),r,Rt(t,e,n),i)}function Nt(t,e,n,r,i){var a=Yt(e,n,r,t,i);return function(t){return a(1-t)}}function Vt(t,e,n,r,i,a){return Ot(Ht(t,e,n,r),i,Ut(t,e,n,r),a)}function Gt(t,e,n,r,i,a){var o=Vt(e,n,r,i,t,a);return function(t){return o(1-t)}}function Ot(t,e,n,r){void 0===r&&(r={});var i=r.maxSegmentLength;void 0===i&&(i=10);var a=r.string;void 0===a&&(a=!0);var o=B(e,i),s=t(o),h=H(s,o,a);return a?function(t){return t<1e-4?n:h(t)}:h}function Dt(t,e,n){return function(r){var i=Wt(r),a=$t(r.concat([r[0]])),o=Math.atan2(r[0][1]-i[1],r[0][0]-i[0]),s=0;return r.map(function(i,h){var u;return h&&(s+=G(i,r[h-1])),u=o+2*Math.PI*s/a,[Math.cos(u)*n+t,Math.sin(u)*n+e]})}}function Ht(t,e,n,r){return function(i){var a=Wt(i),o=$t(i.concat([i[0]])),s=Math.atan2(i[0][1]-a[1],i[0][0]-a[0]),h=0;s<0&&(s=2*Math.PI+s);var u=s/(2*Math.PI);return i.map(function(a,s){var c=Qt((u+h/o)%1);return s&&(h+=G(a,i[s-1])),[t+c[0]*n,e+c[1]*r]})}}function Qt(t){return t<=1/8?[1,.5+4*t]:t<=3/8?[1.5-4*t,1]:t<=5/8?[0,2.5-4*t]:t<=7/8?[4*t-2.5,0]:[1,4*t-3.5]}function Rt(t,e,n){var r=t-n+","+e,i=t+n+","+e,a="A"+n+","+n+",0,1,1,";return"M"+r+a+i+a+r+"Z"}function Ut(t,e,n,r){var i=t+n,a=e+r;return"M"+t+","+e+"L"+i+","+e+"L"+i+","+a+"L"+t+","+a+"Z"}var Bt=function(t){for(var e,n=-1,r=t.length,i=t[r-1],a=0;++n<r;)e=i,i=t[n],a+=e[1]*i[0]-e[0]*i[1];return a/2},Wt=function(t){for(var e,n,r=-1,i=t.length,a=0,o=0,s=t[i-1],h=0;++r<i;)e=s,s=t[r],h+=n=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*n,o+=(e[1]+s[1])*n;return h*=3,[a/h,o/h]},$t=function(t){for(var e,n,r=-1,i=t.length,a=t[i-1],o=a[0],s=a[1],h=0;++r<i;)e=o,n=s,a=t[r],o=a[0],s=a[1],e-=o,n-=s,h+=Math.sqrt(e*e+n*n);return h},Jt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Kt=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],te=function(t){var e=new a(t),n=e.max;for(o(e);e.index<n&&!e.err.length;)u(e);return e.err.length?e.result=[]:e.result.length&&("mM".indexOf(e.result[0][0])<0?(e.err="SvgPath: string should start with `M` or `m`",e.result=[]):e.result[0][0]="M"),{err:e.err,segments:e.result}};f.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]?this:(this.cache=null,this.queue.push(t),this)},f.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},f.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},f.prototype.rotate=function(t,e,n){var r,i,a;return 0!==t&&(this.translate(e,n),r=t*Math.PI/180,i=Math.cos(r),a=Math.sin(r),this.queue.push([i,a,-a,i,0,0]),this.cache=null,this.translate(-e,-n)),this},f.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},f.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},f.prototype.toArray=function(){var t=this;if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var e=1;e<this.queue.length;e++)t.cache=c(t.cache,t.queue[e]);return this.cache},f.prototype.calc=function(t,e,n){var r;return this.queue.length?(this.cache||(this.cache=this.toArray()),r=this.cache,[t*r[0]+e*r[2]+(n?0:r[4]),t*r[1]+e*r[3]+(n?0:r[5])]):[t,e]};var ee=f,ne={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},re=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,ie=/[\s,]+/,ae=function(t){var e,n,r=new ee;return t.split(re).forEach(function(t){if(t.length){if(void 0!==ne[t])return void(e=t);switch(n=t.split(ie).map(function(t){return+t||0}),e){case"matrix":return void(6===n.length&&r.matrix(n));case"scale":return void(1===n.length?r.scale(n[0],n[0]):2===n.length&&r.scale(n[0],n[1]));case"rotate":return void(1===n.length?r.rotate(n[0],0,0):3===n.length&&r.rotate(n[0],n[1],n[2]));case"translate":return void(1===n.length?r.translate(n[0],0):2===n.length&&r.translate(n[0],n[1]));case"skewX":return void(1===n.length&&r.skewX(n[0]));case"skewY":return void(1===n.length&&r.skewY(n[0]))}}}),r},oe=2*Math.PI,se=function(t,e,n,r,i,a,o,s,h){var u=Math.sin(h*oe/360),c=Math.cos(h*oe/360),f=c*(t-n)/2+u*(e-r)/2,l=-u*(t-n)/2+c*(e-r)/2;if(0===f&&0===l)return[];if(0===o||0===s)return[];o=Math.abs(o),s=Math.abs(s);var g=f*f/(o*o)+l*l/(s*s);g>1&&(o*=Math.sqrt(g),s*=Math.sqrt(g));var x=p(t,e,n,r,i,a,o,s,u,c),y=[],d=x[2],m=x[3],M=Math.max(Math.ceil(Math.abs(m)/(oe/4)),1);m/=M;for(var w=0;w<M;w++)y.push(v(d,m)),d+=m;return y.map(function(t){for(var e=0;e<t.length;e+=2){var n=t[e+0],r=t[e+1];n*=o,r*=s;var i=c*n-u*r,a=u*n+c*r;t[e+0]=i+x[0],t[e+1]=a+x[1]}return t})},he=Math.PI/180;g.prototype.transform=function(t){var e=Math.cos(this.ax*he),n=Math.sin(this.ax*he),r=[this.rx*(t[0]*e+t[2]*n),this.rx*(t[1]*e+t[3]*n),this.ry*(-t[0]*n+t[2]*e),this.ry*(-t[1]*n+t[3]*e)],i=r[0]*r[0]+r[2]*r[2],a=r[1]*r[1]+r[3]*r[3],o=((r[0]-r[3])*(r[0]-r[3])+(r[2]+r[1])*(r[2]+r[1]))*((r[0]+r[3])*(r[0]+r[3])+(r[2]-r[1])*(r[2]-r[1])),s=(i+a)/2;if(o<1e-10*s)return this.rx=this.ry=Math.sqrt(s),this.ax=0,this;var h=r[0]*r[1]+r[2]*r[3];o=Math.sqrt(o);var u=s+o/2,c=s-o/2;return this.ax=Math.abs(h)<1e-10&&Math.abs(u-a)<1e-10?90:180*Math.atan(Math.abs(h)>Math.abs(u-a)?(u-i)/h:h/(u-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(u),this.ry=Math.sqrt(c)):(this.ax+=90,this.rx=Math.sqrt(c),this.ry=Math.sqrt(u)),this},g.prototype.isDegenerate=function(){return this.rx<1e-10*this.ry||this.ry<1e-10*this.rx};var ue=g;x.prototype.__matrix=function(t){var e,n=this;t.queue.length&&this.iterate(function(r,i,a,o){var s,h,u,c;switch(r[0]){case"v":s=t.calc(0,r[1],!0),h=0===s[0]?["v",s[1]]:["l",s[0],s[1]];break;case"V":s=t.calc(a,r[1],!1),h=s[0]===t.calc(a,o,!1)[0]?["V",s[1]]:["L",s[0],s[1]];break;case"h":s=t.calc(r[1],0,!0),h=0===s[1]?["h",s[0]]:["l",s[0],s[1]];break;case"H":s=t.calc(r[1],o,!1),h=s[1]===t.calc(a,o,!1)[1]?["H",s[0]]:["L",s[0],s[1]];break;case"a":case"A":var f=t.toArray(),l=ue(r[1],r[2],r[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(r[5]=r[5]?"0":"1"),s=t.calc(r[6],r[7],"a"===r[0]),"A"===r[0]&&r[6]===a&&r[7]===o||"a"===r[0]&&0===r[6]&&0===r[7]){h=["a"===r[0]?"l":"L",s[0],s[1]];break}h=l.isDegenerate()?["a"===r[0]?"l":"L",s[0],s[1]]:[r[0],l.rx,l.ry,l.ax,r[4],r[5],s[0],s[1]];break;case"m":c=i>0,s=t.calc(r[1],r[2],c),h=["m",s[0],s[1]];break;default:for(u=r[0],h=[u],c=u.toLowerCase()===u,e=1;e<r.length;e+=2)s=t.calc(r[e],r[e+1],c),h.push(s[0],s[1])}n.segments[i]=h},!0)},x.prototype.__evaluateStack=function(){var t,e,n=this;if(this.__stack.length){if(1===this.__stack.length)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=ee(),e=this.__stack.length;--e>=0;)t.matrix(n.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},x.prototype.toString=function(){var t,e,n=this,r=[];this.__evaluateStack();for(var i=0;i<this.segments.length;i++)e=n.segments[i][0],t=i>0&&"m"!==e&&"M"!==e&&e===n.segments[i-1][0],r=r.concat(t?n.segments[i].slice(1):n.segments[i]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},x.prototype.translate=function(t,e){return this.__stack.push(ee().translate(t,e||0)),this},x.prototype.scale=function(t,e){return this.__stack.push(ee().scale(t,e||0===e?e:t)),this},x.prototype.rotate=function(t,e,n){return this.__stack.push(ee().rotate(t,e||0,n||0)),this},x.prototype.skewX=function(t){return this.__stack.push(ee().skewX(t)),this},x.prototype.skewY=function(t){return this.__stack.push(ee().skewY(t)),this},x.prototype.matrix=function(t){return this.__stack.push(ee().matrix(t)),this},x.prototype.transform=function(t){return t.trim()?(this.__stack.push(ae(t)),this):this},x.prototype.round=function(t){var e,n=0,r=0,i=0,a=0;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(o){var s=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":return s&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"V":case"v":return s&&(o[1]+=a),a=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"Z":case"z":return i=n,void(a=r);case"M":case"m":return s&&(o[1]+=i,o[2]+=a),i=o[1]-o[1].toFixed(t),a=o[2]-o[2].toFixed(t),n=i,r=a,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case"A":case"a":return s&&(o[6]+=i,o[7]+=a),i=o[6]-o[6].toFixed(t),a=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,s&&(o[e-2]+=i,o[e-1]+=a),i=o[e-2]-o[e-2].toFixed(t),a=o[e-1]-o[e-1].toFixed(t),void o.forEach(function(e,n){n&&(o[n]=+o[n].toFixed(t))})}}),this},x.prototype.iterate=function(t,e){var n,r,i,a=this.segments,o={},s=!1,h=0,u=0,c=0,f=0;if(e||this.__evaluateStack(),a.forEach(function(e,n){var r=t(e,n,h,u);Array.isArray(r)&&(o[n]=r,s=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(f=u);case"h":case"H":return void(h=e[1]+(i?h:0));case"v":case"V":return void(u=e[1]+(i?u:0));case"z":case"Z":return h=c,void(u=f);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}}),!s)return this;for(i=[],n=0;n<a.length;n++)if(void 0!==o[n])for(r=0;r<o[n].length;r++)i.push(o[n][r]);else i.push(a[n]);return this.segments=i,this},x.prototype.abs=function(){return this.iterate(function(t,e,n,r){var i,a=t[0],o=a.toUpperCase();if(a!==o)switch(t[0]=o,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i<t.length;i++)t[i]+=i%2?n:r}},!0),this},x.prototype.rel=function(){return this.iterate(function(t,e,n,r){var i,a=t[0],o=a.toLowerCase();if(a!==o&&(0!==e||"M"!==a))switch(t[0]=o,a){case"V":return void(t[1]-=r);case"A":return t[6]-=n,void(t[7]-=r);default:for(i=1;i<t.length;i++)t[i]-=i%2?n:r}},!0),this},x.prototype.unarc=function(){return this.iterate(function(t,e,n,r){var i,a,o,s=[],h=t[0];return"A"!==h&&"a"!==h?null:("a"===h?(a=n+t[6],o=r+t[7]):(a=t[6],o=t[7]),i=se(n,r,a,o,t[4],t[5],t[1],t[2],t[3]),0===i.length?[["a"===t[0]?"l":"L",t[6],t[7]]]:(i.forEach(function(t){s.push(["C",t[2],t[3],t[4],t[5],t[6],t[7]])}),s))}),this},x.prototype.unshort=function(){var t,e,n,r,i,a=this.segments;return this.iterate(function(o,s,h,u){var c,f=o[0],l=f.toUpperCase();s&&("T"===l?(c="t"===f,n=a[s-1],"Q"===n[0]?(t=n[1]-h,e=n[2]-u):"q"===n[0]?(t=n[1]-n[3],e=n[2]-n[4]):(t=0,e=0),r=-t,i=-e,c||(r+=h,i+=u),a[s]=[c?"q":"Q",r,i,o[1],o[2]]):"S"===l&&(c="s"===f,n=a[s-1],"C"===n[0]?(t=n[3]-h,e=n[4]-u):"c"===n[0]?(t=n[3]-n[5],e=n[4]-n[6]):(t=0,e=0),r=-t,i=-e,c||(r+=h,i+=u),a[s]=[c?"c":"C",r,i,o[1],o[2],o[3],o[4]]))}),this};var ce=x,fe=ce,le={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},pe=/([astvzqmhlc])([^astvzqmhlc]*)/gi,ve=function(t){var e=[];return t.replace(pe,function(t,n,r){var i=n.toLowerCase();for(r=y(r),"m"===i&&r.length>2&&(e.push([n].concat(r.splice(0,2))),i="l",n="m"===n?"l":"L");r.length>=0;){if(r.length===le[i])return r.unshift(n),e.push(r);if(r.length<le[i])throw new Error("malformed path data");e.push([n].concat(r.splice(0,le[i])))}}),e},ge=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,xe=function(t,e,n,r,i,a,o,s){return new d(t,e,n,r,i,a,o,s)};d.prototype={constructor:d,init:function(){this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y])},getTotalLength:function(){return this.length},getPointAtLength:function(t){var e=w(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]);return this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e)},getTangentAtLength:function(t){var e=w(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),n=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),r=Math.sqrt(n.x*n.x+n.y*n.y);return r>0?{x:n.x/r,y:n.y/r}:{x:0,y:0}},getPropertiesAtLength:function(t){var e,n=w(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),r=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n),i=Math.sqrt(r.x*r.x+r.y*r.y);e=i>0?{x:r.x/i,y:r.y/i}:{x:0,y:0};var a=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n);return{x:a.x,y:a.y,tangentX:e.x,tangentY:e.y}}} | ||
;var ye=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],de=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],me=[[1],[1,1],[1,2,1],[1,3,3,1]],Me=2*Math.PI,we=function(t,e,n,r,i,a,o,s,h){var u=Math.sin(i*Me/360),c=Math.cos(i*Me/360),f=c*(t-s)/2+u*(e-h)/2,l=-u*(t-s)/2+c*(e-h)/2;if(0===f&&0===l)return[];if(0===n||0===r)return[];n=Math.abs(n),r=Math.abs(r);var p=f*f/(n*n)+l*l/(r*r);p>1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var v=C(t,e,s,h,a,o,n,r,u,c),g=[],x=v[2],y=v[3],d=Math.max(Math.ceil(Math.abs(y)/(Me/4)),1);y/=d;for(var m=0;m<d;m++)g.push(S(x,y)),x+=y;return g.map(function(t){for(var e=0;e<t.length;e+=2){var i=t[e+0],a=t[e+1];i*=n,a*=r;var o=c*i-u*a,s=u*i+c*a;t[e+0]=o+v[0],t[e+1]=s+v[1]}return t})},be=function(t,e,n,r,i,a,o,s,h){return new Z(t,e,n,r,i,a,o,s,h)};Z.prototype={constructor:Z,init:function(){},getTotalLength:function(){return this.length},getPointAtLength:function(t){var e=this;t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var r=0,i=0;i<n;i++)r+=e.partialLengths[i];return this.curves[n].getPointAtLength(t-r)},getTangentAtLength:function(t){var e=this;t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var r=0,i=0;i<n;i++)r+=e.partialLengths[i];return this.curves[n].getTangentAtLength(t-r)},getPropertiesAtLength:function(t){var e=this.getTangentAtLength(t),n=this.getPointAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}}};var Le=function(t,e,n,r){return new T(t,e,n,r)};T.prototype.getTotalLength=function(){return Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2))},T.prototype.getPointAtLength=function(t){var e=t/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),n=(this.x1-this.x0)*e,r=(this.y1-this.y0)*e;return{x:this.x0+n,y:this.y0+r}},T.prototype.getTangentAtLength=function(){var t=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/t,y:(this.y1-this.y0)/t}},T.prototype.getPropertiesAtLength=function(t){var e=this.getPointAtLength(t),n=this.getTangentAtLength();return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}};var Ae=function(t){function e(t){if(!t)return null;for(var a,o=ve(t),s=[0,0],h=[0,0],u=0;u<o.length;u++)"M"===o[u][0]?(s=[o[u][1],o[u][2]],i.push(null)):"m"===o[u][0]?(s=[o[u][1]+s[0],o[u][2]+s[1]],i.push(null)):"L"===o[u][0]?(n+=Math.sqrt(Math.pow(s[0]-o[u][1],2)+Math.pow(s[1]-o[u][2],2)),i.push(new Le(s[0],o[u][1],s[1],o[u][2])),s=[o[u][1],o[u][2]]):"l"===o[u][0]?(n+=Math.sqrt(Math.pow(o[u][1],2)+Math.pow(o[u][2],2)),i.push(new Le(s[0],o[u][1]+s[0],s[1],o[u][2]+s[1])),s=[o[u][1]+s[0],o[u][2]+s[1]]):"H"===o[u][0]?(n+=Math.abs(s[0]-o[u][1]),i.push(new Le(s[0],o[u][1],s[1],s[1])),s[0]=o[u][1]):"h"===o[u][0]?(n+=Math.abs(o[u][1]),i.push(new Le(s[0],s[0]+o[u][1],s[1],s[1])),s[0]=o[u][1]+s[0]):"V"===o[u][0]?(n+=Math.abs(s[1]-o[u][1]),i.push(new Le(s[0],s[0],s[1],o[u][1])),s[1]=o[u][1]):"v"===o[u][0]?(n+=Math.abs(o[u][1]),i.push(new Le(s[0],s[0],s[1],s[1]+o[u][1])),s[1]=o[u][1]+s[1]):"z"===o[u][0]||"Z"===o[u][0]?(n+=Math.sqrt(Math.pow(o[0][1]-s[0],2)+Math.pow(o[0][2]-s[1],2)),i.push(new Le(s[0],o[0][1],s[1],o[0][2])),s=[o[0][1],o[0][2]]):"C"===o[u][0]?(a=new xe(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4],o[u][5],o[u][6]),n+=a.getTotalLength(),s=[o[u][5],o[u][6]],i.push(a)):"c"===o[u][0]?(a=new xe(s[0],s[1],s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4],s[0]+o[u][5],s[1]+o[u][6]),n+=a.getTotalLength(),s=[o[u][5]+s[0],o[u][6]+s[1]],i.push(a)):"S"===o[u][0]?(a=u>0&&["C","c","S","s"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],2*s[0]-o[u-1][o[u-1].length-4],2*s[1]-o[u-1][o[u-1].length-3],o[u][1],o[u][2],o[u][3],o[u][4]):new xe(s[0],s[1],s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4]),n+=a.getTotalLength(),s=[o[u][3],o[u][4]],i.push(a)):"s"===o[u][0]?(a=u>0&&["C","c","S","s"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],s[0]+a.d.x-a.c.x,s[1]+a.d.y-a.c.y,s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4]):new xe(s[0],s[1],s[0],s[1],s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4]),n+=a.getTotalLength(),s=[o[u][3]+s[0],o[u][4]+s[1]],i.push(a)):"Q"===o[u][0]?(a=new xe(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4]),n+=a.getTotalLength(),i.push(a),s=[o[u][3],o[u][4]],h=[o[u][1],o[u][2]]):"q"===o[u][0]?(a=new xe(s[0],s[1],s[0]+o[u][1],s[1]+o[u][2],s[0]+o[u][3],s[1]+o[u][4]),n+=a.getTotalLength(),h=[s[0]+o[u][1],s[1]+o[u][2]],s=[o[u][3]+s[0],o[u][4]+s[1]],i.push(a)):"T"===o[u][0]?(a=u>0&&["Q","q","T","t"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],2*s[0]-h[0],2*s[1]-h[1],o[u][1],o[u][2]):new Le(s[0],o[u][1],s[1],o[u][2]),i.push(a),n+=a.getTotalLength(),h=[2*s[0]-h[0],2*s[1]-h[1]],s=[o[u][1],o[u][2]]):"t"===o[u][0]?(a=u>0&&["Q","q","T","t"].indexOf(o[u-1][0])>-1?new xe(s[0],s[1],2*s[0]-h[0],2*s[1]-h[1],s[0]+o[u][1],s[1]+o[u][2]):new Le(s[0],s[0]+o[u][1],s[1],s[1]+o[u][2]),n+=a.getTotalLength(),h=[2*s[0]-h[0],2*s[1]-h[1]],s=[o[u][1]+s[0],o[u][2]+s[0]],i.push(a)):"A"===o[u][0]?(a=new be(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4],o[u][5],o[u][6],o[u][7]),n+=a.getTotalLength(),s=[o[u][6],o[u][7]],i.push(a)):"a"===o[u][0]&&(a=new be(s[0],s[1],o[u][1],o[u][2],o[u][3],o[u][4],o[u][5],s[0]+o[u][6],s[1]+o[u][7]),n+=a.getTotalLength(),s=[s[0]+o[u][6],s[1]+o[u][7]],i.push(a)),r.push(n);return e}var n=0,r=[],i=[];e.getTotalLength=function(){return n},e.getPointAtLength=function(t){var e=a(t);return i[e.i].getPointAtLength(e.fraction)},e.getTangentAtLength=function(t){var e=a(t);return i[e.i].getTangentAtLength(e.fraction)},e.getPropertiesAtLength=function(t){var e=a(t);return i[e.i].getPropertiesAtLength(e.fraction)};var a=function(t){t<0?t=0:t>n&&(t=n);for(var e=r.length-1;r[e]>=t&&r[e]>0;)e--;return e++,{fraction:t-r[e-1],i:e}};return e(t)},qe='All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).\nExample valid ways of supplying a shape would be:\n[[0, 0], [10, 0], [10, 10]]\n"M0,0 L10,0 L10,10Z"\n',ke="Polygons must have at least three points.",Pe=function(t,e){for(var n,r,i,a=t.length,o=1/0,s=0;s<a;s++)!function(i){r=0,e.forEach(function(e,n){var o=G(t[(i+n)%a],e);r+=o*o}),r<o&&(o=r,n=i)}(s);n&&(i=t.splice(0,n),t.splice.apply(t,[t.length,0].concat(i)))},_e=function(t,e,n){void 0===n&&(n={});var r=n.maxSegmentLength;void 0===r&&(r=10);var i=n.string;void 0===i&&(i=!0);var a=B(t,r),o=B(e,r),s=$(a,o,i);return!i||"string"!=typeof t&&"string"!=typeof e?s:function(n){return n<1e-4&&"string"==typeof t?t:1-n<1e-4&&"string"==typeof e?e:s(n)}},Ee=J;J.deviation=function(t,e,n,r){var i=e&&e.length,a=i?e[0]*n:t.length,o=Math.abs(kt(t,0,a,n));if(i)for(var s=0,h=e.length;s<h;s++){var u=e[s]*n,c=s<h-1?e[s+1]*n:t.length;o-=Math.abs(kt(t,u,c,n))}var f=0;for(s=0;s<r.length;s+=3){var l=r[s]*n,p=r[s+1]*n,v=r[s+2]*n;f+=Math.abs((t[l]-t[v])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[v+1]-t[l+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},J.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)n.vertices.push(t[i][a][o]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var Ce=function(t){return t},Se=function(t){if(null==t)return Ce;var e,n,r=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=n=0);var h=2,u=t.length,c=new Array(u);for(c[0]=(e+=t[0])*r+a,c[1]=(n+=t[1])*i+o;h<u;)c[h]=t[h],++h;return c}},Ze=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},Te=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return Pt(t,e)})}:Pt(t,e)},Fe=function(t,e){function n(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1],e<0?[n,i]:[i,n]}function r(t,e){for(var n in t){var r=t[n];delete e[r.start],delete r.start,delete r.end,r.forEach(function(t){i[t<0?~t:t]=1}),s.push(r)}}var i={},a={},o={},s=[],h=-1;return e.forEach(function(n,r){var i,a=t.arcs[n<0?~n:n];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++h],e[h]=n,e[r]=i)}),e.forEach(function(t){var e,r,i=n(t),s=i[0],h=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=h,r=a[h]){delete a[r.start];var u=r===e?e:e.concat(r);a[u.start=e.start]=o[u.end=r.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[h])if(delete a[e.start],e.unshift(t),e.start=s,r=o[s]){delete o[r.end];var c=r===e?e:r.concat(e);a[c.start=r.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=h]=e}),r(o,a),r(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},ze=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;t[i]<e?n=i+1:r=i}return n},je=function(t){function e(t,e){t.forEach(function(t){t<0&&(t=~t);var n=i[t];n?n.push(e):i[t]=[e]})}function n(t,n){t.forEach(function(t){e(t,n)})}function r(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){r(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:n,Polygon:n,MultiPolygon:function(t,e){t.forEach(function(t){n(t,e)})}};t.forEach(r);for(var s in i)for(var h=i[s],u=h.length,c=0;c<u;++c)for(var f=c+1;f<u;++f){var l,p=h[c],v=h[f];(l=a[p])[s=ze(l,v)]!==v&&l.splice(s,0,v),(l=a[v])[s=ze(l,p)]!==p&&l.splice(s,0,p)}return a},Ie=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Xe=function(t){return 1===t.length&&(t=St(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}},Ye=Xe(Ie),Ne=(Ye.right,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),function(t,e){return Tt(Zt(Ft(t),t),e)}),Ve=function(t,e){var n=t.map(function(t){return e.map(function(e){return jt(t,e)})});zt(t,e,n);return t.length>8?t.map(function(t,e){return e}):zt(t,e,n)};t.interpolate=_e,t.separate=It,t.combine=Xt,t.splitPathString=I,t.toPathString=j,t.fromCircle=Yt,t.toCircle=Nt,t.fromRect=Vt,t.toRect=Gt,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "flubber", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Best-guess methods for smoothly interpolating and animating between shapes.", | ||
@@ -5,0 +5,0 @@ "main": "build/flubber.min.js", |
@@ -7,2 +7,4 @@ [![Build Status](https://travis-ci.org/veltman/flubber.svg?branch=master)](https://travis-ci.org/veltman/flubber) | ||
![Flubber in action](https://user-images.githubusercontent.com/2120446/27014160-e0ce7c04-4ea7-11e7-8da4-5dde839290eb.gif) | ||
### Why? | ||
@@ -101,5 +103,5 @@ | ||
[.interpolate() in action with a ring as input](https://veltman.github.io/flubber/demos/basic-svg.html) | ||
[.interpolate() in action with SVG paths as input](https://veltman.github.io/flubber/demos/basic-svg.html) | ||
[.interpolate() in action with a path string as input](https://veltman.github.io/flubber/demos/basic-array.html) | ||
[.interpolate() in action with GeoJSON coordinates as input](https://veltman.github.io/flubber/demos/basic-array.html) | ||
@@ -214,13 +216,14 @@ #### flubber.toCircle(fromShape, x, y, r[, options]) | ||
[Vanilla JS + Canvas](https://veltman.github.io/flubber/demos/vanilla-canvas.html) (multiple elements) | ||
[Vanilla JS + Canvas](https://veltman.github.io/flubber/demos/vanilla-canvas.html) | ||
[Medley of different methods](https://veltman.github.io/flubber/demos/medley.html) | ||
### To do | ||
* Finish these docs | ||
* Maintain original vertices when polygonizing a path string | ||
* Maintain original vertices when polygonizing a path string with curves | ||
* Deal with holes | ||
* Deal with curves better | ||
* Use curves between points for `fromCircle()` and `toCircle()` | ||
* Accept SVG elements as arguments instead of just path strings? | ||
* Add pre-simplification as an option | ||
* Add `force: true` option to collapse small additional polygons onto the perimeter of the largest | ||
* Simulated annealing or random swapping for multishape matching? | ||
@@ -227,0 +230,0 @@ * Support unclosed lines |
@@ -1,2 +0,2 @@ | ||
export const INVALID_INPUT = `All shapes must be supplied as arrays of multiple [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d). | ||
export const INVALID_INPUT = `All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d). | ||
Example valid ways of supplying a shape would be: | ||
@@ -10,1 +10,3 @@ [[0, 0], [10, 0], [10, 10]] | ||
`; | ||
export const TOO_FEW_POINTS = `Polygons must have at least three points.`; |
@@ -5,3 +5,3 @@ import { polygonArea } from "d3-polygon"; | ||
import { bisect } from "./add.js"; | ||
import { INVALID_INPUT } from "./errors.js"; | ||
import { INVALID_INPUT, TOO_FEW_POINTS } from "./errors.js"; | ||
@@ -32,3 +32,3 @@ export default function normalizeRing(ring, maxSegmentLength) { | ||
if (points.length < 3) { | ||
throw new TypeError(INVALID_INPUT); | ||
throw new TypeError(TOO_FEW_POINTS); | ||
} | ||
@@ -35,0 +35,0 @@ |
import { supertape } from "./utils.js"; | ||
import * as shapes from "./shapes.js"; | ||
import normalizeRing from "../src/normalize.js"; | ||
import { INVALID_INPUT } from "../src/errors.js"; | ||
import { INVALID_INPUT, TOO_FEW_POINTS } from "../src/errors.js"; | ||
@@ -58,4 +58,4 @@ let tape = supertape(); | ||
// Too short | ||
test.throws(() => normalizeRing([[0, 0], [1, 1]]), err); | ||
test.throws(() => normalizeRing([[0, 0], [1, 1], [0, 0]]), err); | ||
test.throws(() => normalizeRing([[0, 0], [1, 1]]), new RegExp(TOO_FEW_POINTS)); | ||
test.throws(() => normalizeRing([[0, 0], [1, 1], [0, 0]]), new RegExp(TOO_FEW_POINTS)); | ||
@@ -62,0 +62,0 @@ test.doesNotThrow(() => normalizeRing([[0, 0], [1, 1], [2, 2]])); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267
402599
41
4562