diff --git a/domain-coloring-with-scaling/bundle.js b/domain-coloring-with-scaling/bundle.js index a62a754..8c2198f 100644 --- a/domain-coloring-with-scaling/bundle.js +++ b/domain-coloring-with-scaling/bundle.js @@ -1 +1 @@ -!function(){return function t(e,n,r){function i(a,u){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var s=n[a]={exports:{}};e[a][0].call(s.exports,function(t){var n=e[a][1][t];return i(n||t)},s,s.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0?c-4:c;var s=0;for(e=0;e>16&255,u[s++]=r>>8&255,u[s++]=255&r;2===a?(r=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,u[s++]=255&r):1===a&&(r=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,u[s++]=r>>8&255,u[s++]=255&r);return u},n.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o="",a=[],u=0,c=n-i;uc?c:u+16383));1===i?(e=t[n-1],o+=r[e>>2],o+=r[e<<4&63],o+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],o+=r[e>>10],o+=r[e>>4&63],o+=r[e<<2&63],o+="=");return a.push(o),a.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function s(t,e,n){for(var i,o,a=[],u=e;u>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,n){(function(e){(function(){"use strict";var e=t("base64-js"),r=t("ieee754");n.Buffer=a,n.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function o(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|h(t,e),r=o(n),i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return s(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(L(t,ArrayBuffer)||t&&L(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function h(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(t).length;default:if(i)return r?-1:B(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function p(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),I(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,u=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,n/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var s=-1;for(o=n;ou&&(n=u-c),o=n;o>=0;o--){for(var l=!0,h=0;hi&&(r=i):r=i;var o=e.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function w(t,n,r){return 0===n&&r===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(n,r))}function M(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+l<=n)switch(l){case 1:f<128&&(s=f);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&f)<<6|63&o)>127&&(s=c);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(c=(15&f)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(c=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,l=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=l}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return M(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return E(this,e,n);case"base64":return w(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},a.prototype.compare=function(t,e,n,r,i){if(L(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,u=n-e,c=Math.min(o,u),f=this.slice(r,i),s=t.slice(e,n),l=0;l>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return m(this,t,e,n);case"base64":return _(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function k(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,n,r,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,i,o){return e=+e,n>>>=0,o||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function j(t,e,n,i,o){return e=+e,n>>>=0,o||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}a.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o>>=0,e>>>=0,n||T(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||T(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),r.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),r.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),r.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),r.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e>>>=0,n>>>=0,r)||z(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,n>>>=0,r)||z(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);z(this,t,e,n,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o>0)-u&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);z(this,t,e,n,i-1,-i)}var o=n-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,r),e);return i},a.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var i=t.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function L(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function I(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":1,buffer:2,ieee754:65}],3:[function(t,e,n){!function(t){"use strict";var r={re:0,im:0},i=function(t){return.5*(Math.exp(t)+Math.exp(-t))},o=function(t){return.5*(Math.exp(t)-Math.exp(-t))},a=function(){throw SyntaxError("Invalid Param")};function u(t,e){var n=Math.abs(t),r=Math.abs(e);return 0===t?Math.log(r):0===e?Math.log(n):n<3e3&&r<3e3?.5*Math.log(t*t+e*e):Math.log(t/Math.cos(Math.atan2(e,t)))}var c=function(t,e){if(void 0===t||null===t)r.re=r.im=0;else if(void 0!==e)r.re=t,r.im=e;else switch(typeof t){case"object":"im"in t&&"re"in t?(r.re=t.re,r.im=t.im):"abs"in t&&"arg"in t?(r.re=t.abs*Math.cos(t.arg),r.im=t.abs*Math.sin(t.arg)):"r"in t&&"phi"in t?(r.re=t.r*Math.cos(t.phi),r.im=t.r*Math.sin(t.phi)):2===t.length?(r.re=t[0],r.im=t[1]):a();break;case"string":r.im=r.re=0;var n=t.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,o=0;null===n&&a();for(var u=0;u0&&a();break;case"number":r.im=0,r.re=t;break;default:a()}isNaN(r.re)||isNaN(r.im)};function f(t,e){if(!(this instanceof f))return new f(t,e);c(t,e),this.re=r.re,this.im=r.im}f.prototype={re:0,im:0,sign:function(){var t=this.abs();return new f(this.re/t,this.im/t)},add:function(t,e){return c(t,e),new f(this.re+r.re,this.im+r.im)},sub:function(t,e){return c(t,e),new f(this.re-r.re,this.im-r.im)},mul:function(t,e){return c(t,e),0===r.im&&0===this.im?new f(this.re*r.re,0):new f(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(t,e){c(t,e),t=this.re,e=this.im;var n,i,o=r.re,a=r.im;return 0===a?0===o?new f(0!==t?t/0:0,0!==e?e/0:0):new f(t/o,e/o):Math.abs(o)=0)return new f(Math.pow(t,r.re),0);if(0===t)switch((r.re%4+4)%4){case 0:return new f(Math.pow(e,r.re),0);case 1:return new f(0,Math.pow(e,r.re));case 2:return new f(-Math.pow(e,r.re),0);case 3:return new f(0,-Math.pow(e,r.re))}}var n=Math.atan2(e,t),i=u(t,e);return t=Math.exp(r.re*i-r.im*n),e=r.im*i+r.re*n,new f(t*Math.cos(e),t*Math.sin(e))},sqrt:function(){var t,e,n=this.re,r=this.im,i=this.abs();if(n>=0){if(0===r)return new f(Math.sqrt(n),0);t=.5*Math.sqrt(2*(i+n))}else t=Math.abs(r)/Math.sqrt(2*(i-n));return e=n<=0?.5*Math.sqrt(2*(i-n)):Math.abs(r)/Math.sqrt(2*(i+n)),new f(t,r<0?-e:e)},exp:function(){var t=Math.exp(this.re);return this.im,new f(t*Math.cos(this.im),t*Math.sin(this.im))},log:function(){var t=this.re,e=this.im;return new f(u(t,e),Math.atan2(e,t))},abs:function(){return t=this.re,e=this.im,n=Math.abs(t),r=Math.abs(e),n<3e3&&r<3e3?Math.sqrt(n*n+r*r):(n1&&0===e,r=1-t,i=1+t,o=r*r+e*e,a=0!==o?new f((i*r-e*e)/o,(e*r+i*e)/o):new f(-1!==t?t/0:0,0!==e?e/0:0),c=a.re;return a.re=u(a.re,a.im)/2,a.im=Math.atan2(a.im,c)/2,n&&(a.im=-a.im),a},acoth:function(){var t=this.re,e=this.im;if(0===t&&0===e)return new f(0,Math.PI/2);var n=t*t+e*e;return 0!==n?new f(t/n,-e/n).atanh():new f(0!==t?t/0:0,0!==e?-e/0:0).atanh()},acsch:function(){var t=this.re,e=this.im;if(0===e)return new f(0!==t?Math.log(t+Math.sqrt(t*t+1)):1/0,0);var n=t*t+e*e;return 0!==n?new f(t/n,-e/n).asinh():new f(0!==t?t/0:0,0!==e?-e/0:0).asinh()},asech:function(){var t=this.re,e=this.im;if(0===t&&0===e)return new f(1/0,0);var n=t*t+e*e;return 0!==n?new f(t/n,-e/n).acosh():new f(0!==t?t/0:0,0!==e?-e/0:0).acosh()},inverse:function(){var t=this.re,e=this.im,n=t*t+e*e;return new f(0!==t?t/n:0,0!==e?-e/n:0)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(t){return t=Math.pow(10,t||0),new f(Math.ceil(this.re*t)/t,Math.ceil(this.im*t)/t)},floor:function(t){return t=Math.pow(10,t||0),new f(Math.floor(this.re*t)/t,Math.floor(this.im*t)/t)},round:function(t){return t=Math.pow(10,t||0),new f(Math.round(this.re*t)/t,Math.round(this.im*t)/t)},equals:function(t,e){return c(t,e),Math.abs(r.re-this.re)<=f.EPSILON&&Math.abs(r.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var t=this.re,e=this.im,n="";return isNaN(t)||isNaN(e)?"NaN":(0!==t&&(n+=t),0!==e&&(0!==t?n+=e<0?" - ":" + ":e<0&&(n+="-"),1!==(e=Math.abs(e))&&(n+=e),n+="i"),n||"0")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)}},f.ZERO=new f(0,0),f.ONE=new f(1,0),f.I=new f(0,1),f.PI=new f(Math.PI,0),f.E=new f(Math.E,0),f.EPSILON=1e-16,"function"==typeof define&&define.amd?define([],function(){return f}):"object"==typeof n?e.exports=f:t.Complex=f}(this)},{}],4:[function(t,e,n){(function(t){(function(){var r,i;r=this,i=function(){"use strict";var e=function(){},n={},r=[],i=[];function o(t,o){var a,u,c,f,s=i;for(f=arguments.length;2 ."+t+"__sectionFields {\n margin-left: 4px;\n }\n\n ."+t+"__sectionFields {\n box-sizing: border-box;\n }\n\n ."+t+"__sectionFields ."+t+"__field {\n border-bottom: 1px solid "+e.fieldBorderColor+";\n box-sizing: border-box;\n }\n\n ."+t+"__sectionFields ."+t+"__sectionFields {\n border-right: none;\n margin-right: 0;\n }\n\n ."+t+" > ."+t+"__section:first-child > ."+t+"__sectionHeading:first-child {\n border-right: 1px solid "+e.sectionHeadingBorderColor+";\n }\n\n ."+t+"__sectionHeading {\n padding: 0;\n font-family: inherit;\n user-select: none;\n -moz-user-select: -moz-none;\n text-indent: 5px;\n cursor: pointer;\n width: 100%;\n\n color: "+e.sectionHeadingColor+";\n background-color: "+e.sectionHeadingBgColor+";\n height: "+e.sectionHeadingHeight+";\n line-height: "+e.sectionHeadingHeight+";\n }\n\n ."+t+"__sectionHeading button:focus {\n background-color: "+e.sectionHeadingHoverColor+";\n }\n\n ."+t+"__sectionHeading > button {\n height: 100%;\n vertical-align: middle;\n font-size: 1.0em;\n cursor: pointer;\n text-align: left;\n outline: none;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n background: transparent;\n border: none;\n border-radius: 0;\n display: block;\n width: 100%;\n }\n\n ."+t+"__sectionHeading:hover {\n background-color: "+e.sectionHeadingHoverColor+";\n }\n\n ."+t+"__sectionHeading > button::before {\n transform: translate(0, -1px) rotate(90deg);\n }\n\n ."+t+"__sectionHeading > button::before {\n content: '▲';\n display: inline-block;\n transform-origin: 50% 50%;\n margin-right: 0.5em;\n font-size: 0.5em;\n vertical-align: middle;\n }\n\n ."+t+"__section--expanded > ."+t+"__sectionHeading > button::before {\n transform: none;\n content: '▼';\n }\n "}},rt=G.h,it={name:"tabs",component:$({init:function(){var t=this.props.field,e=Object.keys(t.value.$displayFields);this.state={activeTab:e[0]}},getRef:function(t){this.contentsEl=t},activateTab:function(t,e){this.setState({activeTab:t}),e.preventDefault()},preventDefault:function(t){},render:function(){var t=this,e=this.props.field,n=e.$config.label||e.name,r=this.props.className;e.parentField||""!==n||(n="Controls");for(var i=Object.keys(e.value.$displayFields),o={},a=0;a button:hover {\n background-color: "+e.fieldHoverColor+";\n }\n\n ."+t+"__field--button > button:active {\n background-color: "+e.fieldActiveColor+";\n }\n\n ."+t+"__field--button > button:focus {\n "+e.focusBorder+"\n }\n\n ."+t+"__field--button > button::before {\n content: '';\n width: 3px;\n display: inline-block;\n vertical-align: middle;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n }\n "}},dt=G.h,pt={name:"color",component:$({render:function(){var t=this,e=this.props.field,n=e.$config,r=this.props.className;return dt("div",{className:r+"__field "+r+"__field--color"},dt("label",{className:r+"__label",htmlFor:r+"-"+e.path},dt("span",{className:r+"__labelText"},n.label||e.name)," ",dt("span",{className:r+"__container"},dt("input",{id:r+"-"+e.path,name:e.path,type:"color",value:e.value,onInput:function(e){t.props.field.value=e.target.value}}))))}}),css:function(t,e){return"\n ."+t+"__field--color input[type=color] {\n margin: 0;\n border: 1px solid #aaa;\n width: 50px;\n height: "+e.sliderHeight+";\n border-radius: "+e.controlBorderRadius+";\n padding: 0;\n }\n\n ."+t+"__field--color input[type=color]::-webkit-color-swatch-wrapper {\n padding: 0px;\n background-color: #888;\n }\n\n ."+t+"__field--color input[type=color]:focus {\n "+e.focusBorder+"\n }\n "}},vt=G.h,gt={name:"raw",component:$({getRef:function(t){this.el=t},getContent:function(t){return this.content=t.field.value,"function"==typeof this.content&&(this.content=this.content(vt,{field:t.field,state:t.state})),this.content},render:function(){var t=this.props.className;return vt("div",{className:t+"__field--raw "+t+"__field"},vt("div",{ref:this.getRef,className:t+"__rawContent"},this.getContent(this.props)))}}),css:function(t,e){return"\n ."+t+"__field--raw {\n height: auto;\n padding: 0 7px 0 10px;\n overflow: hidden;\n }\n\n ."+t+"__rawContent {\n max-width: 100%;\n margin: 0;\n padding: 0;\n }\n\n ."+t+"__rawContent a {\n color: inherit;\n }\n\n ."+t+"__rawContent::before {\n background-color: #aaa;\n }\n\n ."+t+"__rawContent::before {\n content: '';\n width: 3px;\n display: inline-block;\n vertical-align: middle;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n }\n\n ."+t+"__rawContent > p:first-child {\n margin-top: 5px;\n }\n\n ."+t+"__rawContent > p:last-child{\n margin-bottom: 5px;\n }\n\n ."+t+"__rawContent p {\n line-height: 1.8;\n }\n\n ."+t+"__rawContent pre {\n line-height: 1.3;\n font-size: 0.8em;\n margin: 0;\n }\n "}},yt=function(){var t={};function e(e,n){(n=W(n||{},{containerCSS:"position:fixed;top:0;right:8px",style:!0,className:"controlPanel-"+Math.random().toString(36).substring(2,15)})).root=n.root||document.body;var r=n.className,i=$({render:function(){return G.h(function(e){var n=t[e];if(!n)throw new Error('Unrecognized component, "'+e+'"');return n}(this.props.field.type).component,{ControlComponent:i,className:r,field:this.props.field,state:e,h:G.h})}}),o=$({state:{dummy:0},componentDidMount:function(){var t=this;this.props.state.$field.onChanges(function(e){t.setState({dummy:t.state.dummy+1})})},getRef:function(t){for(var e=["mousedown","mouseup","mousemove","touchstart","touchmove","touchend","wheel"],r=0;r button::before { background-color: #8ff; }\n\n "+Object.keys(n).map(function(r){var i=n[r].css;return i?i(t,e):""}).join("\n")+"\n "}(r,n.theme,t)),G.render(G.h(o,{state:e}),n.root),e}return e.registerComponent=function(n){return t[n.name]=n,e},e.registerComponents=function(t){for(var n=0;ne?1:t>=e?0:NaN}function n(t){var n;return 1===t.length&&(n=t,t=function(t,r){return e(n(t),r)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}var r=n(e),i=r.right,o=r.left;function a(t,e){return[t,e]}function u(t){return null===t?NaN:+t}function c(t,e){var n,r,i=t.length,o=0,a=-1,c=0,f=0;if(null==e)for(;++a1)return f/(o-1)}function f(t,e){var n=c(t,e);return n?Math.sqrt(n):n}function s(t,e){var n,r,i,o=t.length,a=-1;if(null==e){for(;++a=n)for(r=i=n;++an&&(r=n),i=n)for(r=i=n;++an&&(r=n),i=0?(o>=y?10:o>=b?5:o>=m?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=y?10:o>=b?5:o>=m?2:1)}function x(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=y?i*=10:o>=b?i*=5:o>=m&&(i*=2),e=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function A(t,e){var n,r,i=t.length,o=-1;if(null==e){for(;++o=n)for(r=n;++on&&(r=n)}else for(;++o=n)for(r=n;++on&&(r=n);return r}function k(t){if(!(i=t.length))return[];for(var e=-1,n=A(t,E),r=new Array(n);++et?1:e>=t?0:NaN},t.deviation=f,t.extent=s,t.histogram=function(){var t=v,e=s,n=w;function r(r){var o,a,u=r.length,c=new Array(u);for(o=0;ol;)h.pop(),--d;var p,v=new Array(d+1);for(o=0;o<=d;++o)(p=v[o]=[]).x0=o>0?h[o-1]:s,p.x1=o=n)for(r=n;++or&&(r=n)}else for(;++o=n)for(r=n;++or&&(r=n);return r},t.mean=function(t,e){var n,r=t.length,i=r,o=-1,a=0;if(null==e)for(;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n},t.min=A,t.pairs=function(t,e){null==e&&(e=a);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n0)return[t];if((r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++u0&&(n=i-T),I<0?E=S-z:I>0&&(a=x-z),R=s,K.attr("cursor",g.selection),nt());break;default:return}c()},!0).on("keyup.brush",function(){switch(e.event.keyCode){case 16:$&&(P=D=$=!1,nt());break;case 18:R===h&&(L<0?w=M:L>0&&(n=i),I<0?E=S:I>0&&(a=x),R=l,nt());break;case 32:R===s&&(e.event.altKey?(L&&(w=M-T*L,n=i+T*L),I&&(E=S-z*I,a=x+z*I),R=h):(L<0?w=M:L>0&&(n=i),I<0?E=S:I>0&&(a=x),R=l),K.attr("cursor",g[F]),nt());break;default:return}c()},!0).on("mousemove.brush",et,!0).on("mouseup.brush",rt,!0);r.dragDisable(e.event.view)}u(),o.interrupt(B),O.call(B),Z.start()}function et(){var t=e.mouse(B);!$||P||D||(Math.abs(t[0]-Q[0])>Math.abs(t[1]-Q[1])?D=!0:P=!0),Q=t,j=!0,c(),nt()}function nt(){var t;switch(T=Q[0]-X[0],z=Q[1]-X[1],R){case s:case f:L&&(T=Math.max(V-n,Math.min(W-w,T)),i=n+T,M=w+T),I&&(z=Math.max(Y-a,Math.min(G-E,z)),x=a+z,S=E+z);break;case l:L<0?(T=Math.max(V-n,Math.min(W-n,T)),i=n+T,M=w):L>0&&(T=Math.max(V-w,Math.min(W-w,T)),i=n,M=w+T),I<0?(z=Math.max(Y-a,Math.min(G-a,z)),x=a+z,S=E):I>0&&(z=Math.max(Y-E,Math.min(G-E,z)),x=a,S=E+z);break;case h:L&&(i=Math.max(V,Math.min(W,n-T*L)),M=Math.max(V,Math.min(W,w+T*L))),I&&(x=Math.max(Y,Math.min(G,a-z*I)),S=Math.max(Y,Math.min(G,E+z*I)))}M=c.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var u,f,l,h=-1,d=r.length,p=c[i++],v=n(),g=o();++hc.length)return n;var i,o=f[r-1];return null!=e&&r>=c.length?i=n.entries():(i=[],n.each(function(e,n){i.push({key:n,values:t(e,r)})})),null!=o?i.sort(function(t,e){return o(t.key,e.key)}):i}(s(t,0,o,a),0)},key:function(t){return c.push(t),u},sortKeys:function(t){return f[c.length-1]=t,u},sortValues:function(e){return t=e,u},rollup:function(t){return e=t,u}}},t.set=f,t.map=n,t.keys=function(t){var e=[];for(var n in t)e.push(n);return e},t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],17:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function n(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function r(){}var i="\\s*([+-]?\\d+)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3})$/,c=/^#([0-9a-f]{6})$/,f=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),s=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),l=new RegExp("^rgba\\("+[i,i,i,o]+"\\)$"),h=new RegExp("^rgba\\("+[a,a,a,o]+"\\)$"),d=new RegExp("^hsl\\("+[o,a,a]+"\\)$"),p=new RegExp("^hsla\\("+[o,a,a,o]+"\\)$"),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function g(t){var e;return t=(t+"").trim().toLowerCase(),(e=u.exec(t))?new x((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=c.exec(t))?y(parseInt(e[1],16)):(e=f.exec(t))?new x(e[1],e[2],e[3],1):(e=s.exec(t))?new x(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=l.exec(t))?b(e[1],e[2],e[3],e[4]):(e=h.exec(t))?b(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=d.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?y(v[t]):"transparent"===t?new x(NaN,NaN,NaN,0):null}function y(t){return new x(t>>16&255,t>>8&255,255&t,1)}function b(t,e,n,r){return r<=0&&(t=e=n=NaN),new x(t,e,n,r)}function m(t){return t instanceof r||(t=g(t)),t?new x((t=t.rgb()).r,t.g,t.b,t.opacity):new x}function _(t,e,n,r){return 1===arguments.length?m(t):new x(t,e,n,null==r?1:r)}function x(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function w(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function M(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new k(t,e,n,r)}function A(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof k)return new k(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=g(t)),!t)return new k;if(t instanceof k)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,o=Math.min(e,n,i),a=Math.max(e,n,i),u=NaN,c=a-o,f=(a+o)/2;return c?(u=e===a?(n-i)/c+6*(n0&&f<1?0:u,new k(u,c,f,t.opacity)}(t):new k(t,e,n,null==i?1:i)}function k(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function E(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}e(r,g,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),e(x,_,n(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+w(this.r)+w(this.g)+w(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),e(k,A,n(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new k(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new k(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new x(E(t>=240?t-240:t+120,i,r),E(t,i,r),E(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var C=Math.PI/180,S=180/Math.PI,T=.96422,z=1,O=.82521,N=4/29,j=6/29,P=3*j*j,D=j*j*j;function B(t){if(t instanceof R)return new R(t.l,t.a,t.b,t.opacity);if(t instanceof Y){if(isNaN(t.h))return new R(t.l,0,0,t.opacity);var e=t.h*C;return new R(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof x||(t=m(t));var n,r,i=q(t.r),o=q(t.g),a=q(t.b),u=L((.2225045*i+.7168786*o+.0606169*a)/z);return i===o&&o===a?n=r=u:(n=L((.4360747*i+.3850649*o+.1430804*a)/T),r=L((.0139322*i+.0971045*o+.7141733*a)/O)),new R(116*u-16,500*(n-u),200*(u-r),t.opacity)}function F(t,e,n,r){return 1===arguments.length?B(t):new R(t,e,n,null==r?1:r)}function R(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function L(t){return t>D?Math.pow(t,1/3):t/P+N}function I(t){return t>j?t*t*t:P*(t-N)}function U(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function q(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function H(t){if(t instanceof Y)return new Y(t.h,t.c,t.l,t.opacity);if(t instanceof R||(t=B(t)),0===t.a&&0===t.b)return new Y(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*S;return new Y(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function V(t,e,n,r){return 1===arguments.length?H(t):new Y(t,e,n,null==r?1:r)}function Y(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}e(R,F,n(r,{brighter:function(t){return new R(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new R(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new x(U(3.1338561*(e=T*I(e))-1.6168667*(t=z*I(t))-.4906146*(n=O*I(n))),U(-.9787684*e+1.9161415*t+.033454*n),U(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),e(Y,V,n(r,{brighter:function(t){return new Y(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Y(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return B(this).rgb()}}));var W=-.14861,G=1.78277,$=-.29227,X=-.90649,Q=1.97294,Z=Q*X,J=Q*G,K=G*$-X*W;function tt(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof et)return new et(t.h,t.s,t.l,t.opacity);t instanceof x||(t=m(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(K*r+Z*e-J*n)/(K+Z-J),o=r-i,a=(Q*(n-i)-$*o)/X,u=Math.sqrt(a*a+o*o)/(Q*i*(1-i)),c=u?Math.atan2(a,o)*S-120:NaN;return new et(c<0?c+360:c,u,i,t.opacity)}(t):new et(t,e,n,null==r?1:r)}function et(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}e(et,tt,n(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new et(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new et(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*C,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new x(255*(e+n*(W*r+G*i)),255*(e+n*($*r+X*i)),255*(e+n*(Q*r)),this.opacity)}})),t.color=g,t.rgb=_,t.hsl=A,t.lab=F,t.hcl=V,t.lch=function(t,e,n,r){return 1===arguments.length?H(t):new Y(n,e,t,null==r?1:r)},t.gray=function(t,e){return new R(t,0,0,null==e?1:e)},t.cubehelix=tt,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],18:[function(t,e,n){var r,i;r=this,i=function(t,e){"use strict";var n=Array.prototype.slice;function r(t,e){return t-e}function i(t){return function(){return t}}function o(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(d-s)*(r-l)/(p-l)+s&&(i=-i)}return i}function u(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function c(){}var f=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function s(){var t=1,a=1,u=e.thresholdSturges,s=p;function l(t){var n=u(t);if(Array.isArray(n))n=n.slice().sort(r);else{var i=e.extent(t),o=i[0],a=i[1];n=e.tickStep(o,a,n),n=e.range(Math.floor(o/n)*n,Math.floor(a/n)*n,n)}return n.map(function(e){return h(t,e)})}function h(e,n){var r=[],i=[];return function(e,n,r){var i,o,u,c,s,l,h=new Array,p=new Array;i=o=-1,c=e[0]>=n,f[c<<1].forEach(v);for(;++i=n,f[u|c<<1].forEach(v);f[c<<0].forEach(v);for(;++o=n,s=e[o*t]>=n,f[c<<1|s<<2].forEach(v);++i=n,l=s,s=e[o*t+i+1]>=n,f[u|c<<1|s<<2|l<<3].forEach(v);f[c|s<<3].forEach(v)}i=-1,s=e[o*t]>=n,f[s<<2].forEach(v);for(;++i=n,f[s<<2|l<<3].forEach(v);function v(t){var e,n,a=[t[0][0]+i,t[0][1]+o],u=[t[1][0]+i,t[1][1]+o],c=d(a),f=d(u);(e=p[c])?(n=h[f])?(delete p[e.end],delete h[n.start],e===n?(e.ring.push(u),r(e.ring)):h[e.start]=p[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete p[e.end],e.ring.push(u),p[e.end=f]=e):(e=h[f])?(n=p[c])?(delete h[e.start],delete p[n.end],e===n?(e.ring.push(u),r(e.ring)):h[n.start]=p[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(a),h[e.start=c]=e):h[c]=p[f]={start:c,end:f,ring:[a,u]}}f[s<<3].forEach(v)}(e,n,function(t){s(t,e,n),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?r.push([t]):i.push(t)}),i.forEach(function(t){for(var e,n=0,i=r.length;n0&&o0&&u0&&r>0))throw new Error("invalid size");return t=n,a=r,l},l.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?i(n.call(t)):i(t),l):u},l.smooth=function(t){return arguments.length?(s=t?p:c,l):s===p},l}function l(t,e,n){for(var r=t.width,i=t.height,o=1+(n<<1),a=0;a=n&&(u>=o&&(c-=t.data[u-o+a*r]),e.data[u-n+a*r]=c/Math.min(u+1,r-1+o-u,o))}function h(t,e,n){for(var r=t.width,i=t.height,o=1+(n<<1),a=0;a=n&&(u>=o&&(c-=t.data[a+(u-o)*r]),e.data[a+(u-n)*r]=c/Math.min(u+1,i-1+o-u,o))}function d(t){return t[0]}function p(t){return t[1]}function v(){return 1}t.contours=s,t.contourDensity=function(){var t=d,r=p,o=v,a=960,u=500,c=20,f=2,g=3*c,y=a+2*g>>f,b=u+2*g>>f,m=i(20);function _(n){var i=new Float32Array(y*b),a=new Float32Array(y*b);n.forEach(function(e,n,a){var u=+t(e,n,a)+g>>f,c=+r(e,n,a)+g>>f,s=+o(e,n,a);u>=0&&u=0&&c>f),h({width:y,height:b,data:a},{width:y,height:b,data:i},c>>f),l({width:y,height:b,data:i},{width:y,height:b,data:a},c>>f),h({width:y,height:b,data:a},{width:y,height:b,data:i},c>>f),l({width:y,height:b,data:i},{width:y,height:b,data:a},c>>f),h({width:y,height:b,data:a},{width:y,height:b,data:i},c>>f);var u=m(i);if(!Array.isArray(u)){var d=e.max(i);u=e.tickStep(0,d,u),(u=e.range(0,Math.floor(d/u)*u,u)).shift()}return s().thresholds(u).size([y,b])(i).map(x)}function x(t){return t.value*=Math.pow(2,-2*f),t.coordinates.forEach(w),t}function w(t){t.forEach(M)}function M(t){t.forEach(A)}function A(t){t[0]=t[0]*Math.pow(2,f)-g,t[1]=t[1]*Math.pow(2,f)-g}function k(){return y=a+2*(g=3*c)>>f,b=u+2*g>>f,_}return _.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),_):t},_.y=function(t){return arguments.length?(r="function"==typeof t?t:i(+t),_):r},_.weight=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),_):o},_.size=function(t){if(!arguments.length)return[a,u];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return a=e,u=n,k()},_.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return f=Math.floor(Math.log(t)/Math.LN2),k()},_.thresholds=function(t){return arguments.length?(m="function"==typeof t?t:Array.isArray(t)?i(n.call(t)):i(t),_):m},_.bandwidth=function(t){if(!arguments.length)return Math.sqrt(c*(c+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return c=Math.round((Math.sqrt(4*t*t+1)-1)/2),k()},_},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],i):i(r.d3=r.d3||{},r.d3)},{"d3-array":12}],19:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e={value:function(){}};function n(){for(var t,e=0,n=arguments.length,i={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),c=-1,f=u.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++c0)for(var n,r,i=new Array(n),o=0;oM}_.mouse("drag")}function C(){e.select(e.event.view).on("mousemove.drag mouseup.drag",null),a(e.event.view,p),i(),_.mouse("end")}function S(){if(g.apply(this,arguments)){var t,n,i=e.event.changedTouches,o=y.apply(this,arguments),a=i.length;for(t=0;t9999?"+"+c(e,6):c(e,4))+"-"+c(t.getUTCMonth()+1,2)+"-"+c(t.getUTCDate(),2)+(o?"T"+c(n,2)+":"+c(r,2)+":"+c(i,2)+"."+c(o,3)+"Z":i?"T"+c(n,2)+":"+c(r,2)+":"+c(i,2)+"Z":r||n?"T"+c(n,2)+":"+c(r,2)+"Z":"")}function s(t){var c=new RegExp('["'+t+"\n\r]"),s=t.charCodeAt(0);function l(t,a){var u,c=[],f=t.length,l=0,h=0,d=f<=0,p=!1;function v(){if(d)return n;if(p)return p=!1,e;var a,u,c=l;if(t.charCodeAt(c)===r){for(;l++=f?d=!0:(u=t.charCodeAt(l++))===i?p=!0:u===o&&(p=!0,t.charCodeAt(l)===i&&++l),t.slice(c+1,a-1).replace(/""/g,'"')}for(;lh+f||rd+f||os.index){var l=h-u.x-u.vx,g=d-u.y-u.vy,y=l*l+g*g;yt.r&&(t.r=t[e].r)}function h(){if(n){var e,i,o=n.length;for(r=new Array(o),e=0;e=f)){(t.data!==n||t.next)&&(0===l&&(p+=(l=a())*l),0===h&&(p+=(h=a())*h),p1?(null==n?s.remove(t):s.set(t,b(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,u,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(h.on(t,n),e):h.on(t)}}},t.forceX=function(t){var e,n,r,i=o(.1);function a(t){for(var i,o=0,a=e.length;o1?r[0]+r.slice(2):r,+t.slice(n+1)]}function n(t){return(t=e(Math.abs(t)))?t[1]:NaN}var r,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(t){return new a(t)}function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}function u(t,n){var r=e(t,n);if(!r)return t+"";var i=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}o.prototype=a.prototype,a.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var c={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return u(100*t,e)},r:u,s:function(t,n){var i=e(t,n);if(!i)return t+"";var o=i[0],a=i[1],u=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,c=o.length;return u===c?o:u>c?o+new Array(u-c+1).join("0"):u>0?o.slice(0,u)+"."+o.slice(u):"0."+new Array(1-u).join("0")+e(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function f(t){return t}var s,l=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function h(t){var e,i,a=t.grouping&&t.thousands?(e=t.grouping,i=t.thousands,function(t,n){for(var r=t.length,o=[],a=0,u=e[0],c=0;r>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),o.push(t.substring(r-=u,r+u)),!((c+=u+1)>n));)u=e[a=(a+1)%e.length];return o.reverse().join(i)}):f,u=t.currency,s=t.decimal,h=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(t.numerals):f,d=t.percent||"%";function p(t){var e=(t=o(t)).fill,n=t.align,i=t.sign,f=t.symbol,p=t.zero,v=t.width,g=t.comma,y=t.precision,b=t.trim,m=t.type;"n"===m?(g=!0,m="g"):c[m]||(null==y&&(y=12),b=!0,m="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var _="$"===f?u[0]:"#"===f&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",x="$"===f?u[1]:/[%p]/.test(m)?d:"",w=c[m],M=/[defgprs%]/.test(m);function A(t){var o,u,c,f=_,d=x;if("c"===m)d=w(t)+d,t="";else{var A=(t=+t)<0;if(t=w(Math.abs(t),y),b&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),A&&0==+t&&(A=!1),f=(A?"("===i?i:"-":"-"===i||"("===i?"":i)+f,d=("s"===m?l[8+r/3]:"")+d+(A&&"("===i?")":""),M)for(o=-1,u=t.length;++o(c=t.charCodeAt(o))||c>57){d=(46===c?s+t.slice(o+1):t.slice(o))+d,t=t.slice(0,o);break}}g&&!p&&(t=a(t,1/0));var k=f.length+t.length+d.length,E=k>1)+f+t+d+E.slice(k);break;default:t=E+f+t+d}return h(t)}return y=null==y?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),A.toString=function(){return t+""},A}return{format:p,formatPrefix:function(t,e){var r=p(((t=o(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(n(e)/3))),a=Math.pow(10,-i),u=l[8+i/3];return function(t){return r(a*t)+u}}}}function d(e){return s=h(e),t.format=s.format,t.formatPrefix=s.formatPrefix,s}d({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),t.formatDefaultLocale=d,t.formatLocale=h,t.formatSpecifier=o,t.precisionFixed=function(t){return Math.max(0,-n(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(n(e)/3)))-n(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,n(e)-n(t))+1},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],26:[function(t,e,n){var r,i;r=this,i=function(t,e){"use strict";function n(){return new r}function r(){this.reset()}r.prototype={constructor:r,reset:function(){this.s=this.t=0},add:function(t){o(i,t,this.t),o(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new r;function o(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var a=1e-6,u=1e-12,c=Math.PI,f=c/2,s=c/4,l=2*c,h=180/c,d=c/180,p=Math.abs,v=Math.atan,g=Math.atan2,y=Math.cos,b=Math.ceil,m=Math.exp,_=Math.log,x=Math.pow,w=Math.sin,M=Math.sign||function(t){return t>0?1:t<0?-1:0},A=Math.sqrt,k=Math.tan;function E(t){return t>1?0:t<-1?c:Math.acos(t)}function C(t){return t>1?f:t<-1?-f:Math.asin(t)}function S(t){return(t=w(t/2))*t}function T(){}function z(t,e){t&&N.hasOwnProperty(t.type)&&N[t.type](t,e)}var O={Feature:function(t,e){z(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=y(e),a=w(e),u=I*a,c=L*o+u*y(i),f=u*r*w(i);U.add(g(f,c)),R=t,L=o,I=a}function $(t){return[g(t[1],t[0]),C(t[2])]}function X(t){var e=t[0],n=t[1],r=y(n);return[r*y(e),r*w(e),w(n)]}function Q(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Z(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function J(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function K(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tt(t){var e=A(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var et,nt,rt,it,ot,at,ut,ct,ft,st,lt,ht,dt,pt,vt,gt,yt,bt,mt,_t,xt,wt,Mt,At,kt,Et,Ct=n(),St={point:Tt,lineStart:Ot,lineEnd:Nt,polygonStart:function(){St.point=jt,St.lineStart=Pt,St.lineEnd=Dt,Ct.reset(),H.polygonStart()},polygonEnd:function(){H.polygonEnd(),St.point=Tt,St.lineStart=Ot,St.lineEnd=Nt,U<0?(et=-(rt=180),nt=-(it=90)):Ct>a?it=90:Ct<-a&&(nt=-90),st[0]=et,st[1]=rt}};function Tt(t,e){ft.push(st=[et=t,rt=t]),eit&&(it=e)}function zt(t,e){var n=X([t*d,e*d]);if(ct){var r=Z(ct,n),i=Z([r[1],-r[0],0],r);tt(i),i=$(i);var o,a=t-ot,u=a>0?1:-1,c=i[0]*h*u,f=p(a)>180;f^(u*otit&&(it=o):f^(u*ot<(c=(c+360)%360-180)&&cit&&(it=e)),f?tBt(et,rt)&&(rt=t):Bt(t,rt)>Bt(et,rt)&&(et=t):rt>=et?(trt&&(rt=t)):t>ot?Bt(et,t)>Bt(et,rt)&&(rt=t):Bt(t,rt)>Bt(et,rt)&&(et=t)}else ft.push(st=[et=t,rt=t]);eit&&(it=e),ct=n,ot=t}function Ot(){St.point=zt}function Nt(){st[0]=et,st[1]=rt,St.point=Tt,ct=null}function jt(t,e){if(ct){var n=t-ot;Ct.add(p(n)>180?n+(n>0?360:-360):n)}else at=t,ut=e;H.point(t,e),zt(t,e)}function Pt(){H.lineStart()}function Dt(){jt(at,ut),H.lineEnd(),p(Ct)>a&&(et=-(rt=180)),st[0]=et,st[1]=rt,ct=null}function Bt(t,e){return(e-=t)<0?e+360:e}function Ft(t,e){return t[0]-e[0]}function Rt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:ec?t+Math.round(-t/l)*l:t,e]}function Kt(t,e,n){return(t%=l)?e||n?Zt(ee(t),ne(e,n)):ee(t):e||n?ne(e,n):Jt}function te(t){return function(e,n){return[(e+=t)>c?e-l:e<-c?e+l:e,n]}}function ee(t){var e=te(t);return e.invert=te(-t),e}function ne(t,e){var n=y(t),r=w(t),i=y(e),o=w(e);function a(t,e){var a=y(e),u=y(t)*a,c=w(t)*a,f=w(e),s=f*n+u*r;return[g(c*i-s*o,u*n-f*r),C(s*i+c*o)]}return a.invert=function(t,e){var a=y(e),u=y(t)*a,c=w(t)*a,f=w(e),s=f*i-c*o;return[g(c*i+f*o,u*n+s*r),C(s*n-u*r)]},a}function re(t){function e(e){return(e=t(e[0]*d,e[1]*d))[0]*=h,e[1]*=h,e}return t=Kt(t[0]*d,t[1]*d,t.length>2?t[2]*d:0),e.invert=function(e){return(e=t.invert(e[0]*d,e[1]*d))[0]*=h,e[1]*=h,e},e}function ie(t,e,n,r,i,o){if(n){var a=y(e),u=w(e),c=r*n;null==i?(i=e+r*l,o=e-c/2):(i=oe(a,i),o=oe(a,o),(r>0?io)&&(i+=r*l));for(var f,s=i;r>0?s>o:s1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ue(t,e){return p(t[0]-e[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function se(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,P=j*N,D=P>c,B=M*z;if(le.add(g(B*j*w(P),A*O+B*y(P))),u+=D?N+j*l:N,D^_>=n^S>=n){var F=Z(X(m),X(E));tt(F);var R=Z(o,F);tt(R);var L=(D^N>=0?-1:1)*C(R[2]);(r>L||r===L&&(F[0]||F[1]))&&(h+=D^N>=0?1:-1)}}return(u<-a||u0){for(h||(o.polygonStart(),h=!0),o.lineStart(),t=0;t1&&2&i&&f.push(f.pop().concat(f.shift())),u.push(f.filter(pe))}return d}}function pe(t){return t.length>1}function ve(t,e){return((t=t.x)[0]<0?t[1]-f-a:f-t[1])-((e=e.x)[0]<0?e[1]-f-a:f-e[1])}var ge=de(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,u){var s=o>0?c:-c,l=p(o-n);p(l-c)0?f:-f),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&l>=c&&(p(n-i)a?v((w(e)*(o=y(r))*w(n)-w(r)*(i=y(e))*w(t))/(i*o*u)):(e+r)/2}(n,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=u),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*f,r.point(-c,i),r.point(0,i),r.point(c,i),r.point(c,0),r.point(c,-i),r.point(0,-i),r.point(-c,-i),r.point(-c,0),r.point(-c,i);else if(p(t[0]-e[0])>a){var o=t[0]0,i=p(e)>a;function o(t,n){return y(t)*y(n)>e}function u(t,n,r){var i=[1,0,0],o=Z(X(t),X(n)),u=Q(o,o),f=o[0],s=u-f*f;if(!s)return!r&&t;var l=e*u/s,h=-e*f/s,d=Z(i,o),v=K(i,l);J(v,K(o,h));var g=d,y=Q(v,g),b=Q(g,g),m=y*y-b*(Q(v,v)-1);if(!(m<0)){var _=A(m),x=K(g,(-y-_)/b);if(J(x,v),x=$(x),!r)return x;var w,M=t[0],k=n[0],E=t[1],C=n[1];k0^x[1]<(p(x[0]-M)c^(M<=x[0]&&x[0]<=k)){var z=K(g,(-y+_)/b);return J(z,v),[x,$(z)]}}}function f(e,n){var i=r?t:c-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return de(o,function(t){var e,n,s,l,h;return{lineStart:function(){l=s=!1,h=1},point:function(d,p){var v,g=[d,p],y=o(d,p),b=r?y?0:f(d,p):y?f(d+(d<0?c:-c),p):0;if(!e&&(l=s=y)&&t.lineStart(),y!==s&&(!(v=u(e,g))||ue(e,v)||ue(g,v))&&(g[0]+=a,g[1]+=a,y=o(g[0],g[1])),y!==s)h=0,y?(t.lineStart(),v=u(g,e),t.point(v[0],v[1])):(v=u(e,g),t.point(v[0],v[1]),t.lineEnd()),e=v;else if(i&&e&&r^y){var m;b&n||!(m=u(g,e,!0))||(h=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!y||e&&ue(e,g)||t.point(g[0],g[1]),e=g,s=y,n=b},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return h|(l&&s)<<1}}},function(e,r,i,o){ie(o,t,n,i,e,r)},r?[0,-t]:[-c,t-c])}var be=1e9,me=-be;function _e(t,n,r,i){function o(e,o){return t<=e&&e<=r&&n<=o&&o<=i}function u(e,o,a,u){var f=0,l=0;if(null==e||(f=c(e,a))!==(l=c(o,a))||s(e,o)<0^a>0)do{u.point(0===f||3===f?t:r,f>1?i:n)}while((f=(f+a+4)%4)!==l);else u.point(o[0],o[1])}function c(e,i){return p(e[0]-t)0?0:3:p(e[0]-r)0?2:1:p(e[1]-n)0?1:0:i>0?3:2}function f(t,e){return s(t.x,e.x)}function s(t,e){var n=c(t,1),r=c(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,s,l,h,d,p,v,g,y,b,m,_=a,x=ae(),w={point:M,lineStart:function(){w.point=A,s&&s.push(l=[]);b=!0,y=!1,v=g=NaN},lineEnd:function(){c&&(A(h,d),p&&y&&x.rejoin(),c.push(x.result()));w.point=M,y&&_.lineEnd()},polygonStart:function(){_=x,c=[],s=[],m=!0},polygonEnd:function(){var n=function(){for(var e=0,n=0,r=s.length;ni&&(h-o)*(i-a)>(d-a)*(t-o)&&++e:d<=i&&(h-o)*(i-a)<(d-a)*(t-o)&&--e;return e}(),r=m&&n,o=(c=e.merge(c)).length;(r||o)&&(a.polygonStart(),r&&(a.lineStart(),u(null,null,1,a),a.lineEnd()),o&&fe(c,f,n,u,a),a.polygonEnd());_=a,c=s=l=null}};function M(t,e){o(t,e)&&_.point(t,e)}function A(e,a){var u=o(e,a);if(s&&l.push([e,a]),b)h=e,d=a,p=u,b=!1,u&&(_.lineStart(),_.point(e,a));else if(u&&y)_.point(e,a);else{var c=[v=Math.max(me,Math.min(be,v)),g=Math.max(me,Math.min(be,g))],f=[e=Math.max(me,Math.min(be,e)),a=Math.max(me,Math.min(be,a))];!function(t,e,n,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=e[0]-u,h=e[1]-c;if(a=n-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(e[0]=u+s*l,e[1]=c+s*h),!0}}}}}(c,f,t,n,r,i)?u&&(_.lineStart(),_.point(e,a),m=!1):(y||(_.lineStart(),_.point(c[0],c[1])),_.point(f[0],f[1]),u||_.lineEnd(),m=!1)}v=e,g=a,y=u}return w}}var xe,we,Me,Ae=n(),ke={sphere:T,point:T,lineStart:function(){ke.point=Ce,ke.lineEnd=Ee},lineEnd:T,polygonStart:T,polygonEnd:T};function Ee(){ke.point=ke.lineEnd=T}function Ce(t,e){xe=t*=d,we=w(e*=d),Me=y(e),ke.point=Se}function Se(t,e){t*=d;var n=w(e*=d),r=y(e),i=p(t-xe),o=y(i),a=r*w(i),u=Me*n-we*r*o,c=we*n+Me*r*o;Ae.add(g(A(a*a+u*u),c)),xe=t,we=n,Me=r}function Te(t){return Ae.reset(),D(t,ke),+Ae}var ze=[null,null],Oe={type:"LineString",coordinates:ze};function Ne(t,e){return ze[0]=t,ze[1]=e,Te(Oe)}var je={Feature:function(t,e){return De(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++ra}).map(s)).concat(e.range(b(u/g)*g,o,g).filter(function(t){return p(t%m)>a}).map(l))}return x.lines=function(){return w().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(d(c).slice(1),h(r).reverse().slice(1),d(f).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.extentMajor(t).extentMinor(t):x.extentMinor()},x.extentMajor=function(t){return arguments.length?(i=+t[0][0],r=+t[1][0],f=+t[0][1],c=+t[1][1],i>r&&(t=i,i=r,r=t),f>c&&(t=f,f=c,c=t),x.precision(_)):[[i,f],[r,c]]},x.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],u=+e[0][1],o=+e[1][1],n>t&&(e=n,n=t,t=e),u>o&&(e=u,u=o,o=e),x.precision(_)):[[n,u],[t,o]]},x.step=function(t){return arguments.length?x.stepMajor(t).stepMinor(t):x.stepMinor()},x.stepMajor=function(t){return arguments.length?(y=+t[0],m=+t[1],x):[y,m]},x.stepMinor=function(t){return arguments.length?(v=+t[0],g=+t[1],x):[v,g]},x.precision=function(e){return arguments.length?(_=+e,s=Ue(u,o,90),l=qe(n,t,_),h=Ue(f,c,90),d=qe(i,r,_),x):_},x.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function Ve(t){return t}var Ye,We,Ge,$e,Xe=n(),Qe=n(),Ze={point:T,lineStart:T,lineEnd:T,polygonStart:function(){Ze.lineStart=Je,Ze.lineEnd=en},polygonEnd:function(){Ze.lineStart=Ze.lineEnd=Ze.point=T,Xe.add(p(Qe)),Qe.reset()},result:function(){var t=Xe/2;return Xe.reset(),t}};function Je(){Ze.point=Ke}function Ke(t,e){Ze.point=tn,Ye=Ge=t,We=$e=e}function tn(t,e){Qe.add($e*t-Ge*e),Ge=t,$e=e}function en(){tn(Ye,We)}var nn=1/0,rn=nn,on=-nn,an=on,un={point:function(t,e){ton&&(on=t);ean&&(an=e)},lineStart:T,lineEnd:T,polygonStart:T,polygonEnd:T,result:function(){var t=[[nn,rn],[on,an]];return on=an=-(rn=nn=1/0),t}};var cn,fn,sn,ln,hn=0,dn=0,pn=0,vn=0,gn=0,yn=0,bn=0,mn=0,_n=0,xn={point:wn,lineStart:Mn,lineEnd:En,polygonStart:function(){xn.lineStart=Cn,xn.lineEnd=Sn},polygonEnd:function(){xn.point=wn,xn.lineStart=Mn,xn.lineEnd=En},result:function(){var t=_n?[bn/_n,mn/_n]:yn?[vn/yn,gn/yn]:pn?[hn/pn,dn/pn]:[NaN,NaN];return hn=dn=pn=vn=gn=yn=bn=mn=_n=0,t}};function wn(t,e){hn+=t,dn+=e,++pn}function Mn(){xn.point=An}function An(t,e){xn.point=kn,wn(sn=t,ln=e)}function kn(t,e){var n=t-sn,r=e-ln,i=A(n*n+r*r);vn+=i*(sn+t)/2,gn+=i*(ln+e)/2,yn+=i,wn(sn=t,ln=e)}function En(){xn.point=wn}function Cn(){xn.point=Tn}function Sn(){zn(cn,fn)}function Tn(t,e){xn.point=zn,wn(cn=sn=t,fn=ln=e)}function zn(t,e){var n=t-sn,r=e-ln,i=A(n*n+r*r);vn+=i*(sn+t)/2,gn+=i*(ln+e)/2,yn+=i,bn+=(i=ln*t-sn*e)*(sn+t),mn+=i*(ln+e),_n+=3*i,wn(sn=t,ln=e)}function On(t){this._context=t}On.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,l)}},result:T};var Nn,jn,Pn,Dn,Bn,Fn=n(),Rn={point:T,lineStart:function(){Rn.point=Ln},lineEnd:function(){Nn&&In(jn,Pn),Rn.point=T},polygonStart:function(){Nn=!0},polygonEnd:function(){Nn=null},result:function(){var t=+Fn;return Fn.reset(),t}};function Ln(t,e){Rn.point=In,jn=Dn=t,Pn=Bn=e}function In(t,e){Dn-=t,Bn-=e,Fn.add(A(Dn*Dn+Bn*Bn)),Dn=t,Bn=e}function Un(){this._string=[]}function qn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Hn(t){return function(e){var n=new Vn;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Vn(){}function Yn(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),D(n,t.stream(un)),e(un.result()),null!=r&&t.clipExtent(r),t}function Wn(t,e,n){return Yn(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,u])},n)}function Gn(t,e,n){return Wn(t,[[0,0],e],n)}function $n(t,e,n){return Yn(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])},n)}function Xn(t,e,n){return Yn(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])},n)}Un.prototype={_radius:4.5,_circle:qn(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=qn(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Vn.prototype={constructor:Vn,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Qn=16,Zn=y(30*d);function Jn(t,e){return+e?function(t,e){function n(r,i,o,u,c,f,s,l,h,d,v,y,b,m){var _=s-r,x=l-i,w=_*_+x*x;if(w>4*e&&b--){var M=u+d,k=c+v,E=f+y,S=A(M*M+k*k+E*E),T=C(E/=S),z=p(p(E)-1)e||p((_*P+x*D)/w-.5)>.3||u*d+c*v+f*y2?t[2]%360*d:0,z()):[b*h,m*h,_*h]},S.angle=function(t){return arguments.length?(x=t%360*d,z()):x*h},S.precision=function(t){return arguments.length?(a=Jn(u,C=t*t),O()):A(C)},S.fitExtent=function(t,e){return Wn(S,t,e)},S.fitSize=function(t,e){return Gn(S,t,e)},S.fitWidth=function(t,e){return $n(S,t,e)},S.fitHeight=function(t,e){return Xn(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&T,z()}}function rr(t){var e=0,n=c/3,r=nr(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*d,n=t[1]*d):[e*h,n*h]},i}function ir(t,e){var n=w(t),r=(n+w(e))/2;if(p(r)0?e<-f+a&&(e=-f+a):e>f-a&&(e=f-a);var n=i/x(dr(e),r);return[n*w(r*t),i-n*y(r*t)]}return o.invert=function(t,e){var n=i-e,o=M(r)*A(t*t+n*n);return[g(t,p(n))/r*M(n),2*v(x(i/o,1/r))-f]},o}function vr(t,e){return[t,e]}function gr(t,e){var n=y(t),r=t===e?w(t):(n-y(e))/(e-t),i=n/r+t;if(p(r)a&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Er.invert=cr(C),Cr.invert=cr(function(t){return 2*v(t)}),Sr.invert=function(t,e){return[-e,2*v(m(t))-f]},t.geoArea=function(t){return q.reset(),D(t,H),2*q},t.geoBounds=function(t){var e,n,r,i,o,a,u;if(it=rt=-(et=nt=1/0),ft=[],D(t,St),n=ft.length){for(ft.sort(Ft),e=1,o=[r=ft[0]];eBt(r[0],r[1])&&(r[1]=i[1]),Bt(i[0],r[1])>Bt(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(u=Bt(r[1],i[0]))>a&&(a=u,et=i[0],rt=r[1])}return ft=st=null,et===1/0||nt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,nt],[rt,it]]},t.geoCentroid=function(t){lt=ht=dt=pt=vt=gt=yt=bt=mt=_t=xt=0,D(t,Lt);var e=mt,n=_t,r=xt,i=e*e+n*n+r*r;return i=.12&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?f:u).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[u.stream(e=n),c.stream(n),f.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Sr,t.geoRotation=re,t.geoStream=D,t.geoTransform=function(t){return{stream:Hn(t)}},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],i):i(r.d3=r.d3||{},r.d3)},{"d3-array":12}],27:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t,e){return t.parent===e.parent?1:2}function n(t,e){return t+e.x}function r(t,e){return Math.max(t,e.y)}function i(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function o(t,e){var n,r,i,o,u,s=new f(t),l=+t.value&&(s.value=t.value),h=[s];for(null==e&&(e=a);n=h.pop();)if(l&&(n.value=+n.data.value),(i=e(n.data))&&(u=i.length))for(n.children=new Array(u),o=u-1;o>=0;--o)h.push(r=n.children[o]=new f(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(c)}function a(t){return t.children}function u(t){t.data=t.data.data}function c(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function f(t){this.data=t,this.depth=this.height=0,this.parent=null}f.prototype=o.prototype={constructor:f,count:function(){return this.eachAfter(i)},each:function(t){var e,n,r,i,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(r=0,i=n.length;r=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return o(this).eachBefore(u)}};var s=Array.prototype.slice;function l(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(s.call(t))).length,o=[];r0&&n*n>r*r+i*i}function v(t,e){for(var n=0;n(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),n.x=t.x-r*u-o*c,n.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),n.x=e.x+r*u-o*c,n.y=e.y+r*c+o*u)):(n.x=e.x+n.r,n.y=e.y)}function _(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function x(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function w(t){this._=t,this.next=null,this.previous=null}function M(t){if(!(i=t.length))return 0;var e,n,r,i,o,a,u,c,f,s,h;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;m(n,e,r=t[2]),e=new w(e),n=new w(n),r=new w(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(u=3;uh&&(h=u),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=u;break}p=d}y.push(a={value:s,dice:c1?e:1)},n}(Y);var $=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?e:1)},n}(Y);t.cluster=function(){var t=e,i=1,o=1,a=!1;function u(e){var u,c=0;e.eachAfter(function(e){var i=e.children;i?(e.x=function(t){return t.reduce(n,0)/t.length}(i),e.y=function(t){return 1+t.reduce(r,0)}(i)):(e.x=u?c+=t(e,u):0,e.y=0,u=e)});var f=function(t){for(var e;e=t.children;)t=e[0];return t}(e),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),l=f.x-t(f,s)/2,h=s.x+t(s,f)/2;return e.eachAfter(a?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*o}:function(t){t.x=(t.x-l)/(h-l)*i,t.y=(1-(e.y?t.y/e.y:1))*o})}return u.separation=function(e){return arguments.length?(t=e,u):t},u.size=function(t){return arguments.length?(a=!1,i=+t[0],o=+t[1],u):a?null:[i,o]},u.nodeSize=function(t){return arguments.length?(a=!0,i=+t[0],o=+t[1],u):a?[i,o]:null},u},t.hierarchy=o,t.pack=function(){var t=null,e=1,n=1,r=k;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(S(t)).eachAfter(T(r,.5)).eachBefore(z(1)):i.eachBefore(S(C)).eachAfter(T(k,1)).eachAfter(T(r,i.r/Math.min(e,n))).eachBefore(z(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(n=e)?null:A(n),i):t;var n},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:E(+t),i):r},i},t.packSiblings=function(t){return M(t),t},t.packEnclose=l,t.partition=function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&N(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,u=r.y1-n;a0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=A(e),n):t},n.parentId=function(t){return arguments.length?(e=A(t),n):e},n},t.tree=function(){var t=R,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new H(t,0),u=[a];e=u.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(n=e.children[i]=new H(r[i],i)),n.parent=e;return(a.parent=new H(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var f=i,s=i,l=i;i.eachBefore(function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)});var h=f===s?1:t(f,s)/2,d=h-f.x,p=e/(s.x+h+d),v=n/(l.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*v})}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,u=n,c=o.parent.children[0],f=o.m,s=a.m,l=u.m,h=c.m;u=I(u),o=L(o),u&&o;)c=L(c),(a=I(a)).a=e,(i=u.z+l-o.z-f+t(u._,o._))>0&&(U(q(u,e,r),e,i),f+=i,s+=i),l+=u.m,f+=o.m,h+=c.m,s+=a.m;u&&!I(a)&&(a.t=u,a.m+=l-s),o&&!L(c)&&(c.t=o,c.m+=f-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},t.treemap=function(){var t=G,e=!1,n=1,r=1,i=[0],o=k,a=k,u=k,c=k,f=k;function s(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(l),i=[0],e&&t.eachBefore(O),t}function l(e){var n=i[e.depth],r=e.x0+n,s=e.y0+n,l=e.x1-n,h=e.y1-n;l=n-1){var s=u[e];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}for(var l=f[e],h=r/2+l,d=e+1,p=n-1;d>>1;f[v]c-o){var b=(i*y+a*g)/r;t(e,d,g,i,o,b,c),t(d,n,y,b,o,a,c)}else{var m=(o*y+c*g)/r;t(e,d,g,i,o,a,m),t(d,n,y,i,m,a,c)}}(0,c,t.value,e,n,r,i)},t.treemapDice=N,t.treemapSlice=V,t.treemapSliceDice=function(t,e,n,r,i){(1&t.depth?V:N)(t,e,n,r,i)},t.treemapSquarify=G,t.treemapResquarify=$,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],28:[function(t,e,n){var r,i;r=this,i=function(t,e){"use strict";function n(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function r(t){var e=t.length-1;return function(r){var i=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[i],a=t[i+1],u=i>0?t[i-1]:2*o-a,c=i180||n<-180?n-360*Math.round(n/360):n):o(isNaN(t)?e:t)}function c(t){return 1==(t=+t)?f:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):o(isNaN(e)?n:e)}}function f(t,e){var n=e-t;return n?a(t,n):o(isNaN(t)?e:t)}var s=function t(n){var r=c(n);function i(t,n){var i=r((t=e.rgb(t)).r,(n=e.rgb(n)).r),o=r(t.g,n.g),a=r(t.b,n.b),u=f(t.opacity,n.opacity);return function(e){return t.r=i(e),t.g=o(e),t.b=a(e),t.opacity=u(e),t+""}}return i.gamma=t,i}(1);function l(t){return function(n){var r,i,o=n.length,a=new Array(o),u=new Array(o),c=new Array(o);for(r=0;ro&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:g(n,r)})),o=m.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:g(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:g(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,c),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:g(t,n)},{i:u-2,x:g(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var e,n=-1,r=c.length;++n1e-6)if(Math.abs(l*c-f*s)>1e-6&&o){var d=r-a,p=i-u,v=c*c+f*f,g=d*d+p*p,y=Math.sqrt(v),b=Math.sqrt(h),m=o*Math.tan((e-Math.acos((v+h-g)/(2*y*b)))/2),_=m/b,x=m/y;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*s)+","+(n+_*l)),this._+="A"+o+","+o+",0,0,"+ +(l*d>s*p)+","+(this._x1=t+x*c)+","+(this._y1=n+x*f)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,i,o,a,u,c){t=+t,i=+i;var f=(o=+o)*Math.cos(a),s=o*Math.sin(a),l=t+f,h=i+s,d=1^c,p=c?a-u:u-a;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+l+","+h),o&&(p<0&&(p=p%n+n),p>r?this._+="A"+o+","+o+",0,1,"+d+","+(t-f)+","+(i-s)+"A"+o+","+o+",0,1,"+d+","+(this._x1=l)+","+(this._y1=h):p>1e-6&&(this._+="A"+o+","+o+",0,"+ +(p>=e)+","+d+","+(this._x1=t+o*Math.cos(u))+","+(this._y1=i+o*Math.sin(u))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],30:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t,e){return t[0]-e[0]||t[1]-e[1]}function n(t){for(var e,n,r,i=t.length,o=[0,1],a=2,u=2;u1&&(e=t[o[a-2]],n=t[o[a-1]],r=t[u],(n[0]-e[0])*(r[1]-e[1])-(n[1]-e[1])*(r[0]-e[0])<=0);)--a;o[a++]=u}return o.slice(0,a)}t.polygonArea=function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n=0;--r)l.push(t[o[u[r]][2]]);for(r=+f;ru!=f>u&&a<(c-n)*(u-r)/(f-r)+n&&(s=!s),c=n,f=r;return s},t.polygonLength=function(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],c=0;++r=(o=(v+y)/2))?v=o:y=o,(s=n>=(a=(g+b)/2))?g=a:b=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),e===u&&n===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=e>=(o=(v+y)/2))?v=o:y=o,(s=n>=(a=(g+b)/2))?g=a:b=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function n(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function r(t){return t[0]}function i(t){return t[1]}function o(t,e,n){var o=new a(null==e?r:e,null==n?i:n,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function a(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function u(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var c=o.prototype=a.prototype;c.copy=function(){var t,e,n=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=u(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=u(e));return n},c.add=function(t){var n=+this._x.call(null,t),r=+this._y.call(null,t);return e(this.cover(n,r),n,r,t)},c.addAll=function(t){var n,r,i,o,a=t.length,u=new Array(a),c=new Array(a),f=1/0,s=1/0,l=-1/0,h=-1/0;for(r=0;rl&&(l=i),oh&&(h=o));if(f>l||s>h)return this;for(this.cover(f,s).cover(l,h),r=0;rt||t>=i||r>e||e>=o;)switch(u=(ed||(a=f.y0)>p||(u=f.x1)=b)<<1|t>=y)&&(f=v[v.length-1],v[v.length-1]=v[v.length-1-s],v[v.length-1-s]=f)}else{var m=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),x=m*m+_*_;if(x=(u=(p+g)/2))?p=u:g=u,(s=a>=(c=(v+y)/2))?v=c:y=c,e=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},c.removeAll=function(t){for(var e=0,n=t.length;e1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(e),i=function t(e){function n(){var t=r.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(e),o=function t(e){function n(t){return function(){for(var n=0,r=0;r1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return yt.h=360*t-100,yt.s=1.5-1.5*e,yt.l=.8-.9*e,yt+""},t.interpolateWarm=vt,t.interpolateCool=gt,t.interpolateSinebow=function(t){var e;return t=(.5-t)*Math.PI,bt.r=255*(e=Math.sin(t))*e,bt.g=255*(e=Math.sin(t+mt))*e,bt.b=255*(e=Math.sin(t+_t))*e,bt+""},t.interpolateViridis=wt,t.interpolateMagma=Mt,t.interpolateInferno=At,t.interpolatePlasma=kt,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-interpolate"),t("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-interpolate","d3-color"],i):i(r.d3=r.d3||{},r.d3,r.d3)},{"d3-color":17,"d3-interpolate":28}],34:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function r(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function i(t){var n=r(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(r,t)}})(n)}function o(){}function a(t){return null==t?o:function(){return this.querySelector(t)}}function u(){return[]}function c(t){return null==t?u:function(){return this.querySelectorAll(t)}}function f(t){return function(){return this.matches(t)}}function s(t){return new Array(t.length)}function l(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}l.prototype={constructor:l,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var h="$";function d(t,e,n,r,i,o){for(var a,u=0,c=e.length,f=o.length;ue?1:t>=e?0:NaN}function g(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function y(t,e){return t.style.getPropertyValue(e)||g(t).getComputedStyle(t,null).getPropertyValue(e)}function b(t){return t.trim().split(/^|\s+/)}function m(t){return t.classList||new _(t)}function _(t){this._node=t,this._names=b(t.getAttribute("class")||"")}function x(t,e){for(var n=m(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var O={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(O={mouseenter:"mouseover",mouseleave:"mouseout"}));function N(t,e,n){return t=j(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function j(e,n,r){return function(i){var o=t.event;t.event=i;try{e.call(this,this.__data__,n,r)}finally{t.event=o}}}function P(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=M&&(M=w+1);!(x=m[M])&&++M=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=v);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):y(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=b(t+"");if(arguments.length<2){for(var r=m(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),a=o.length;if(!(arguments.length<2)){for(u=e?D:P,null==n&&(n=!1),r=0;r=1?h:t<=-1?-h:Math.asin(t)}function v(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function b(t){return t.endAngle}function m(t){return t&&t.padAngle}function _(t,e,n,r,i,o,u){var c=t-n,s=e-r,l=(u?o:-o)/f(c*c+s*s),h=l*s,d=-l*c,p=t+h,v=e+d,g=n+h,y=r+d,b=(p+g)/2,m=(v+y)/2,_=g-p,x=y-v,w=_*_+x*x,M=i-o,A=p*y-g*v,k=(x<0?-1:1)*f(a(0,M*M*w-A*A)),E=(A*x-_*k)/w,C=(-A*_-x*k)/w,S=(A*x+_*k)/w,T=(-A*_+x*k)/w,z=E-b,O=C-m,N=S-b,j=T-m;return z*z+O*O>N*N+j*j&&(E=S,C=T),{cx:E,cy:C,x01:-h,y01:-d,x11:E*(i/M-1),y11:C*(i/M-1)}}function x(t){this._context=t}function w(t){return new x(t)}function M(t){return t[0]}function A(t){return t[1]}function k(){var t=M,r=A,i=n(!0),o=null,a=w,u=null;function c(n){var c,f,s,l=n.length,h=!1;for(null==o&&(u=a(s=e.path())),c=0;c<=l;++c)!(c=l;--h)f.point(y[h],b[h]);f.lineEnd(),f.areaEnd()}g&&(y[s]=+t(d,s,n),b[s]=+i(d,s,n),f.point(r?+r(d,s,n):y[s],o?+o(d,s,n):b[s]))}if(p)return f=null,p+""||null}function l(){return k().defined(a).curve(c).context(u)}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),r=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:n(+t),s):r},s.y=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),o=null,s):i},s.y0=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),s):i},s.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:n(+t),s):o},s.lineX0=s.lineY0=function(){return l().x(t).y(i)},s.lineY1=function(){return l().x(t).y(o)},s.lineX1=function(){return l().x(r).y(i)},s.defined=function(t){return arguments.length?(a="function"==typeof t?t:n(!!t),s):a},s.curve=function(t){return arguments.length?(c=t,null!=u&&(f=c(u)),s):c},s.context=function(t){return arguments.length?(null==t?u=f=null:f=c(u=t),s):u},s}function C(t,e){return et?1:e>=t?0:NaN}function S(t){return t}x.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var T=O(w);function z(t){this._curve=t}function O(t){function e(e){return new z(t(e))}return e._curve=t,e}function N(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(O(t)):e()._curve},t}function j(){return N(k().curve(T))}function P(){var t=E().curve(T),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return N(n())},delete t.lineX0,t.lineEndAngle=function(){return N(r())},delete t.lineX1,t.lineInnerRadius=function(){return N(i())},delete t.lineY0,t.lineOuterRadius=function(){return N(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(O(t)):e()._curve},t}function D(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}z.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var B=Array.prototype.slice;function F(t){return t.source}function R(t){return t.target}function L(t){var r=F,i=R,o=M,a=A,u=null;function c(){var n,c=B.call(arguments),f=r.apply(this,c),s=i.apply(this,c);if(u||(u=n=e.path()),t(u,+o.apply(this,(c[0]=f,c)),+a.apply(this,c),+o.apply(this,(c[0]=s,c)),+a.apply(this,c)),n)return u=null,n+""||null}return c.source=function(t){return arguments.length?(r=t,c):r},c.target=function(t){return arguments.length?(i=t,c):i},c.x=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),c):o},c.y=function(t){return arguments.length?(a="function"==typeof t?t:n(+t),c):a},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function I(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function U(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function q(t,e,n,r,i){var o=D(e,n),a=D(e,n=(n+i)/2),u=D(r,n),c=D(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],c[0],c[1])}var H={draw:function(t,e){var n=Math.sqrt(e/l);t.moveTo(n,0),t.arc(0,0,n,0,d)}},V={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Y=Math.sqrt(1/3),W=2*Y,G={draw:function(t,e){var n=Math.sqrt(e/W),r=n*Y;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},$=Math.sin(l/10)/Math.sin(7*l/10),X=Math.sin(d/10)*$,Q=-Math.cos(d/10)*$,Z={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=X*n,i=Q*n;t.moveTo(0,-n),t.lineTo(r,i);for(var o=1;o<5;++o){var a=d*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*n,-u*n),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},J={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},K=Math.sqrt(3),tt={draw:function(t,e){var n=-Math.sqrt(e/(3*K));t.moveTo(0,2*n),t.lineTo(-K*n,-n),t.lineTo(K*n,-n),t.closePath()}},et=-.5,nt=Math.sqrt(3)/2,rt=1/Math.sqrt(12),it=3*(rt/2+1),ot={draw:function(t,e){var n=Math.sqrt(e/it),r=n/2,i=n*rt,o=r,a=n*rt+n,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(et*r-nt*i,nt*r+et*i),t.lineTo(et*o-nt*a,nt*o+et*a),t.lineTo(et*u-nt*c,nt*u+et*c),t.lineTo(et*r+nt*i,et*i-nt*r),t.lineTo(et*o+nt*a,et*a-nt*o),t.lineTo(et*u+nt*c,et*c-nt*u),t.closePath()}},at=[H,V,G,J,Z,tt,ot];function ut(){}function ct(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ft(t){this._context=t}function st(t){this._context=t}function lt(t){this._context=t}function ht(t,e){this._basis=new ft(t),this._beta=e}ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},st.prototype={areaStart:ut,areaEnd:ut,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,c=-1;++c<=n;)r=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*e[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function n(t){return 1===e?new ft(t):new ht(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function pt(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function vt(t,e){this._context=t,this._k=(1-e)/6}vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:pt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function n(t){return new vt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:ut,areaEnd:ut,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var bt=function t(e){function n(t){return new yt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function n(t){return new mt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function xt(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>s){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>s){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*f+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:xt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mt=function t(e){function n(t){return e?new wt(t,e):new vt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function At(t,e){this._context=t,this._alpha=e}At.prototype={areaStart:ut,areaEnd:ut,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:xt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function n(t){return e?new At(t,e):new yt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Et(t,e){this._context=t,this._alpha=e}Et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:xt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ct=function t(e){function n(t){return e?new Et(t,e):new mt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function St(t){this._context=t}function Tt(t){return t<0?-1:1}function zt(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Tt(o)+Tt(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Ot(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Nt(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function jt(t){this._context=t}function Pt(t){this._context=new Dt(t)}function Dt(t){this._context=t}function Bt(t){this._context=t}function Ft(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e1)for(var n,r,i,o=1,a=t[e[0]],u=a.length;o=0;)n[e]=e;return n}function Ut(t,e){return t[e]}function qt(t){var e=t.map(Ht);return It(t).sort(function(t,n){return e[t]-e[n]})}function Ht(t){for(var e,n=-1,r=0,i=t.length,o=-1/0;++no&&(o=e,r=n);return r}function Vt(t){var e=t.map(Yt);return It(t).sort(function(t,n){return e[t]-e[n]})}function Yt(t){for(var e,n=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},t.arc=function(){var t=v,a=g,x=n(0),w=null,M=y,A=b,k=m,E=null;function C(){var n,v,g,y=+t.apply(this,arguments),b=+a.apply(this,arguments),m=M.apply(this,arguments)-h,C=A.apply(this,arguments)-h,S=r(C-m),T=C>m;if(E||(E=n=e.path()),bs)if(S>d-s)E.moveTo(b*o(m),b*c(m)),E.arc(0,0,b,m,C,!T),y>s&&(E.moveTo(y*o(C),y*c(C)),E.arc(0,0,y,C,m,T));else{var z,O,N=m,j=C,P=m,D=C,B=S,F=S,R=k.apply(this,arguments)/2,L=R>s&&(w?+w.apply(this,arguments):f(y*y+b*b)),I=u(r(b-y)/2,+x.apply(this,arguments)),U=I,q=I;if(L>s){var H=p(L/y*c(R)),V=p(L/b*c(R));(B-=2*H)>s?(P+=H*=T?1:-1,D-=H):(B=0,P=D=(m+C)/2),(F-=2*V)>s?(N+=V*=T?1:-1,j-=V):(F=0,N=j=(m+C)/2)}var Y=b*o(N),W=b*c(N),G=y*o(D),$=y*c(D);if(I>s){var X,Q=b*o(j),Z=b*c(j),J=y*o(P),K=y*c(P);if(S1?0:g<-1?l:Math.acos(g))/2),ot=f(X[0]*X[0]+X[1]*X[1]);U=u(I,(y-ot)/(it-1)),q=u(I,(b-ot)/(it+1))}}F>s?q>s?(z=_(J,K,Y,W,b,q,T),O=_(Q,Z,G,$,b,q,T),E.moveTo(z.cx+z.x01,z.cy+z.y01),qs&&B>s?U>s?(z=_(G,$,Q,Z,y,-U,T),O=_(Y,W,J,K,y,-U,T),E.lineTo(z.cx+z.x01,z.cy+z.y01),U0&&(p+=l);for(null!=e?v.sort(function(t,n){return e(g[t],g[n])}):null!=r&&v.sort(function(t,e){return r(n[t],n[e])}),u=0,f=p?(b-h*_)/p:0;u0?l*f:0)+_,g[c]={data:n[c],index:u,value:l,startAngle:y,endAngle:s,padAngle:m};return g}return u.value=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),u):t},u.sortValues=function(t){return arguments.length?(e=t,r=null,u):e},u.sort=function(t){return arguments.length?(r=t,e=null,u):r},u.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),u):i},u.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),u):o},u.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:n(+t),u):a},u},t.areaRadial=P,t.radialArea=P,t.lineRadial=j,t.radialLine=j,t.pointRadial=D,t.linkHorizontal=function(){return L(I)},t.linkVertical=function(){return L(U)},t.linkRadial=function(){var t=L(q);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=n(H),r=n(64),i=null;function o(){var n;if(i||(i=n=e.path()),t.apply(this,arguments).draw(i,+r.apply(this,arguments)),n)return i=null,n+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:n(e),o):t},o.size=function(t){return arguments.length?(r="function"==typeof t?t:n(+t),o):r},o.context=function(t){return arguments.length?(i=null==t?null:t,o):i},o},t.symbols=at,t.symbolCircle=H,t.symbolCross=V,t.symbolDiamond=G,t.symbolSquare=J,t.symbolStar=Z,t.symbolTriangle=tt,t.symbolWye=ot,t.curveBasisClosed=function(t){return new st(t)},t.curveBasisOpen=function(t){return new lt(t)},t.curveBasis=function(t){return new ft(t)},t.curveBundle=dt,t.curveCardinalClosed=bt,t.curveCardinalOpen=_t,t.curveCardinal=gt,t.curveCatmullRomClosed=kt,t.curveCatmullRomOpen=Ct,t.curveCatmullRom=Mt,t.curveLinearClosed=function(t){return new St(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new jt(t)},t.curveMonotoneY=function(t){return new Pt(t)},t.curveNatural=function(t){return new Bt(t)},t.curveStep=function(t){return new Rt(t,.5)},t.curveStepAfter=function(t){return new Rt(t,1)},t.curveStepBefore=function(t){return new Rt(t,0)},t.stack=function(){var t=n([]),e=It,r=Lt,i=Ut;function o(n){var o,a,u=t.apply(this,arguments),c=n.length,f=u.length,s=new Array(f);for(o=0;o0){for(var n,r,i,o=0,a=t[0].length;o1)for(var n,r,i,o,a,u,c=0,f=t[e[0]].length;c=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},t.stackOffsetNone=Lt,t.stackOffsetSilhouette=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;a=12)]},Q:vt,s:gt,S:q,u:H,U:V,V:Y,w:W,W:G,x:null,X:null,y:$,Y:X,Z:Q,"%":pt},Tt={a:function(t){return l[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Z,e:Z,f:nt,H:J,I:K,j:tt,L:et,m:rt,M:it,p:function(t){return f[+(t.getUTCHours()>=12)]},Q:vt,s:gt,S:ot,u:at,U:ut,V:ct,w:ft,W:st,x:null,X:null,y:lt,Y:ht,Z:dt,"%":pt},zt={a:function(t,e,n){var r=wt.exec(e.slice(n));return r?(t.w=Mt[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=_t.exec(e.slice(n));return r?(t.w=xt[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=Et.exec(e.slice(n));return r?(t.m=Ct[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=At.exec(e.slice(n));return r?(t.m=kt[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,e,n){return jt(t,o,e,n)},d:A,e:A,f:z,H:E,I:E,j:k,L:T,m:M,M:C,p:function(t,e,n){var r=bt.exec(e.slice(n));return r?(t.p=mt[r[0].toLowerCase()],n+r[0].length):-1},Q:N,s:j,S:S,u:g,U:y,V:b,w:v,W:m,x:function(t,e,n){return jt(t,a,e,n)},X:function(t,e,n){return jt(t,c,e,n)},y:x,Y:_,Z:w,"%":O};function Ot(t,e){return function(n){var r,i,o,a=[],c=-1,f=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++c53)return null;"w"in c||(c.w=1),"Z"in c?(a=(u=(a=r(i(c.y))).getUTCDay())>4||0===u?e.utcMonday.ceil(a):e.utcMonday(a),a=e.utcDay.offset(a,7*(c.V-1)),c.y=a.getUTCFullYear(),c.m=a.getUTCMonth(),c.d=a.getUTCDate()+(c.w+6)%7):(a=(u=(a=n(i(c.y))).getDay())>4||0===u?e.timeMonday.ceil(a):e.timeMonday(a),a=e.timeDay.offset(a,7*(c.V-1)),c.y=a.getFullYear(),c.m=a.getMonth(),c.d=a.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),u="Z"in c?r(i(c.y)).getUTCDay():n(i(c.y)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(u+5)%7:c.w+7*c.U-(u+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,r(c)):n(c)}}function jt(t,e,n,r){for(var i,o,a=0,c=e.length,f=n.length;a=f)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=zt[i in u?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return St.x=Ot(a,St),St.X=Ot(c,St),St.c=Ot(o,St),Tt.x=Ot(a,Tt),Tt.X=Ot(c,Tt),Tt.c=Ot(o,Tt),{format:function(t){var e=Ot(t+="",St);return e.toString=function(){return t},e},parse:function(t){var e=Nt(t+="",n);return e.toString=function(){return t},e},utcFormat:function(t){var e=Ot(t+="",Tt);return e.toString=function(){return t},e},utcParse:function(t){var e=Nt(t,r);return e.toString=function(){return t},e}}}var a,u={"-":"",_:" ",0:"0"},c=/^\s*\d+/,f=/^%/,s=/[\\^$*+?|[\]().{}]/g;function l(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function w(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function M(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function A(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function k(t,e,n){var r=c.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function E(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function C(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function S(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function T(t,e,n){var r=c.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function z(t,e,n){var r=c.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function O(t,e,n){var r=f.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function N(t,e,n){var r=c.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function j(t,e,n){var r=c.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function P(t,e){return l(t.getDate(),e,2)}function D(t,e){return l(t.getHours(),e,2)}function B(t,e){return l(t.getHours()%12||12,e,2)}function F(t,n){return l(1+e.timeDay.count(e.timeYear(t),t),n,3)}function R(t,e){return l(t.getMilliseconds(),e,3)}function L(t,e){return R(t,e)+"000"}function I(t,e){return l(t.getMonth()+1,e,2)}function U(t,e){return l(t.getMinutes(),e,2)}function q(t,e){return l(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function V(t,n){return l(e.timeSunday.count(e.timeYear(t),t),n,2)}function Y(t,n){var r=t.getDay();return t=r>=4||0===r?e.timeThursday(t):e.timeThursday.ceil(t),l(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),n,2)}function W(t){return t.getDay()}function G(t,n){return l(e.timeMonday.count(e.timeYear(t),t),n,2)}function $(t,e){return l(t.getFullYear()%100,e,2)}function X(t,e){return l(t.getFullYear()%1e4,e,4)}function Q(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+l(e/60|0,"0",2)+l(e%60,"0",2)}function Z(t,e){return l(t.getUTCDate(),e,2)}function J(t,e){return l(t.getUTCHours(),e,2)}function K(t,e){return l(t.getUTCHours()%12||12,e,2)}function tt(t,n){return l(1+e.utcDay.count(e.utcYear(t),t),n,3)}function et(t,e){return l(t.getUTCMilliseconds(),e,3)}function nt(t,e){return et(t,e)+"000"}function rt(t,e){return l(t.getUTCMonth()+1,e,2)}function it(t,e){return l(t.getUTCMinutes(),e,2)}function ot(t,e){return l(t.getUTCSeconds(),e,2)}function at(t){var e=t.getUTCDay();return 0===e?7:e}function ut(t,n){return l(e.utcSunday.count(e.utcYear(t),t),n,2)}function ct(t,n){var r=t.getUTCDay();return t=r>=4||0===r?e.utcThursday(t):e.utcThursday.ceil(t),l(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),n,2)}function ft(t){return t.getUTCDay()}function st(t,n){return l(e.utcMonday.count(e.utcYear(t),t),n,2)}function lt(t,e){return l(t.getUTCFullYear()%100,e,2)}function ht(t,e){return l(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function pt(){return"%"}function vt(t){return+t}function gt(t){return Math.floor(+t/1e3)}function yt(e){return a=o(e),t.timeFormat=a.format,t.timeParse=a.parse,t.utcFormat=a.utcFormat,t.utcParse=a.utcParse,a}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var mt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.timeFormatDefaultLocale=yt,t.timeFormatLocale=o,t.isoFormat=bt,t.isoParse=mt,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],i):i(r.d3=r.d3||{},r.d3)},{"d3-time":37}],37:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e=new Date,n=new Date;function r(t,i,o,a){function u(e){return t(e=new Date(+e)),e}return u.floor=u,u.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},u.round=function(t){var e=u(t),n=u.ceil(t);return t-e0))return a;do{a.push(o=new Date(+e)),i(e,r),t(e)}while(o=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;i(t,-1),!e(t););else for(;--n>=0;)for(;i(t,1),!e(t););})},o&&(u.count=function(r,i){return e.setTime(+r),n.setTime(+i),t(e),t(n),Math.floor(o(e,n))},u.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?u.filter(a?function(e){return a(e)%t==0}:function(e){return u.count(0,e)%t==0}):u:null}),u}var i=r(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):i:null};var o=i.range,a=6e4,u=6048e5,c=r(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3},function(t){return t.getUTCSeconds()}),f=c.range,s=r(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,e){t.setTime(+t+e*a)},function(t,e){return(e-t)/a},function(t){return t.getMinutes()}),l=s.range,h=r(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*a)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getHours()}),d=h.range,p=r(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*a)/864e5},function(t){return t.getDate()-1}),v=p.range;function g(t){return r(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*a)/u})}var y=g(0),b=g(1),m=g(2),_=g(3),x=g(4),w=g(5),M=g(6),A=y.range,k=b.range,E=m.range,C=_.range,S=x.range,T=w.range,z=M.range,O=r(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),N=O.range,j=r(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});j.every=function(t){return isFinite(t=Math.floor(t))&&t>0?r(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var P=j.range,D=r(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*a)},function(t,e){return(e-t)/a},function(t){return t.getUTCMinutes()}),B=D.range,F=r(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getUTCHours()}),R=F.range,L=r(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5},function(t){return t.getUTCDate()-1}),I=L.range;function U(t){return r(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/u})}var q=U(0),H=U(1),V=U(2),Y=U(3),W=U(4),G=U(5),$=U(6),X=q.range,Q=H.range,Z=V.range,J=Y.range,K=W.range,tt=G.range,et=$.range,nt=r(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),rt=nt.range,it=r(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});it.every=function(t){return isFinite(t=Math.floor(t))&&t>0?r(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var ot=it.range;t.timeInterval=r,t.timeMillisecond=i,t.timeMilliseconds=o,t.utcMillisecond=i,t.utcMilliseconds=o,t.timeSecond=c,t.timeSeconds=f,t.utcSecond=c,t.utcSeconds=f,t.timeMinute=s,t.timeMinutes=l,t.timeHour=h,t.timeHours=d,t.timeDay=p,t.timeDays=v,t.timeWeek=y,t.timeWeeks=A,t.timeSunday=y,t.timeSundays=A,t.timeMonday=b,t.timeMondays=k,t.timeTuesday=m,t.timeTuesdays=E,t.timeWednesday=_,t.timeWednesdays=C,t.timeThursday=x,t.timeThursdays=S,t.timeFriday=w,t.timeFridays=T,t.timeSaturday=M,t.timeSaturdays=z,t.timeMonth=O,t.timeMonths=N,t.timeYear=j,t.timeYears=P,t.utcMinute=D,t.utcMinutes=B,t.utcHour=F,t.utcHours=R,t.utcDay=L,t.utcDays=I,t.utcWeek=q,t.utcWeeks=X,t.utcSunday=q,t.utcSundays=X,t.utcMonday=H,t.utcMondays=Q,t.utcTuesday=V,t.utcTuesdays=Z,t.utcWednesday=Y,t.utcWednesdays=J,t.utcThursday=W,t.utcThursdays=K,t.utcFriday=G,t.utcFridays=tt,t.utcSaturday=$,t.utcSaturdays=et,t.utcMonth=nt,t.utcMonths=rt,t.utcYear=it,t.utcYears=ot,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],38:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e,n,r=0,i=0,o=0,a=1e3,u=0,c=0,f=0,s="object"==typeof performance&&performance.now?performance:Date,l="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return c||(l(d),c=s.now()+f)}function d(){c=0}function p(){this._call=this._time=this._next=null}function v(t,e,n){var r=new p;return r.restart(t,e,n),r}function g(){h(),++r;for(var t,n=e;n;)(t=c-n._time)>=0&&n._call.call(null,t),n=n._next;--r}function y(){c=(u=s.now())+f,r=i=0;try{g()}finally{r=0,function(){var t,r,i=e,o=1/0;for(;i;)i._call?(o>i._time&&(o=i._time),t=i,i=i._next):(r=i._next,i._next=null,i=t?t._next=r:e=r);n=t,m(o)}(),c=0}}function b(){var t=s.now(),e=t-u;e>a&&(f-=e,u=t)}function m(t){r||(i&&(i=clearTimeout(i)),t-c>24?(t<1/0&&(i=setTimeout(y,t-s.now()-f)),o&&(o=clearInterval(o))):(o||(u=s.now(),o=setInterval(b,a)),r=1,l(y)))}p.prototype=v.prototype={constructor:p,restart:function(t,r,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==r?0:+r),this._next||n===this||(n?n._next=this:e=this,n=this),this._call=t,this._time=i,m()},stop:function(){this._call&&(this._call=null,this._time=1/0,m())}},t.now=h,t.timer=v,t.timerFlush=g,t.timeout=function(t,e,n){var r=new p;return e=null==e?0:+e,r.restart(function(n){r.stop(),t(n+e)},e,n),r},t.interval=function(t,e,n){var r=new p,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?h():+n,r.restart(function o(a){a+=i,r.restart(o,i+=e,n),t(a)},e,n),r)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],39:[function(t,e,n){var r,i;r=this,i=function(t,e,n,r,i,o,a){"use strict";var u=e.dispatch("start","end","cancel","interrupt"),c=[],f=0,s=1,l=2,h=3,d=4,p=5,v=6;function g(t,e,r,i,o,a){var g=t.__transition;if(g){if(r in g)return}else t.__transition={};!function(t,e,r){var i,o=t.__transition;function a(f){var p,g,y,b;if(r.state!==s)return c();for(p in o)if((b=o[p]).name===r.name){if(b.state===h)return n.timeout(a);b.state===d?(b.state=v,b.timer.stop(),b.on.call("interrupt",t,t.__data__,b.index,b.group),delete o[p]):+pf)throw new Error("too late; already scheduled");return n}function b(t,e){var n=m(t,e);if(n.state>h)throw new Error("too late; already running");return n}function m(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function _(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>l&&n.state=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?y:b;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=o.namespace(t),r="transform"===n?i.interpolateTransformSvg:w;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,o;return function(){var a,u,c=n(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,c));this.removeAttributeNS(t.space,t.local)}}:function(t,e,n){var r,i,o;return function(){var a,u,c=n(this);if(null!=c)return(a=this.getAttribute(t))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,c));this.removeAttribute(t)}})(n,r,x(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}:function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=o.namespace(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}(t,i)),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e(n))}}(t,i)),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r="transform"==(t+="")?i.interpolateTransformCss:w;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=o.style(this,t),u=(this.style.removeProperty(t),o.style(this,t));return a===u?null:a===n&&u===r?i:i=e(n=a,r=u)}}(t,r)).on("end.style."+t,A(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var u=o.style(this,t),c=n(this),f=c+"";return null==c&&(this.style.removeProperty(t),f=c=o.style(this,t)),u===f?null:u===r&&f===i?a:(i=f,a=e(r=u,c))}}(t,r,x(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,u="end."+a;return function(){var c=b(this,t),f=c.on,s=null==c.value[a]?o||(o=A(e)):void 0;f===n&&i===s||(r=(n=f).copy()).on(u,i=s),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var u=o.style(this,t);return u===a?null:u===r?i:i=e(r=u,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e(r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(x(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=m(this.node(),n).tween,o=0,a=i.length;os&&n.name===e)return new E([[t]],N,e,+r);return null},t.interrupt=_,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-dispatch"),t("d3-timer"),t("d3-color"),t("d3-interpolate"),t("d3-selection"),t("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-timer","d3-color","d3-interpolate","d3-selection","d3-ease"],i):i(r.d3=r.d3||{},r.d3,r.d3,r.d3,r.d3,r.d3,r.d3)},{"d3-color":17,"d3-dispatch":19,"d3-ease":22,"d3-interpolate":28,"d3-selection":34,"d3-timer":38}],40:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t){return function(){return t}}function n(t){return t[0]}function r(t){return t[1]}function i(){this._=null}function o(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function a(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function u(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function c(t){for(;t.L;)t=t.L;return t}function f(t,e,n,r){var i=[null,null],o=O.push(i)-1;return i.left=t,i.right=e,n&&l(i,t,e,n),r&&l(i,e,t,r),T[t.index].halfedges.push(o),T[e.index].halfedges.push(o),i}function s(t,e,n){var r=[e,n];return r.left=t,r}function l(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function h(t,e,n,r,i){var o,a=t[0],u=t[1],c=a[0],f=a[1],s=0,l=1,h=u[0]-c,d=u[1]-f;if(o=e-c,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=i-f,d||!(o<0)){if(o/=d,d<0){if(o>l)return;o>s&&(s=o)}else if(d>0){if(o0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function d(t,e,n,r,i){var o=t[1];if(o)return!0;var a,u,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,n];o=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(n-u)/a,n];o=[(i-u)/a,i]}else{if(c){if(c[1]=r)return}else c=[e,a*e+u];o=[r,a*r+u]}else{if(c){if(c[0]=-j)){var p=f*f+s*s,v=l*l+h*h,g=(h*p-s*v)/d,m=(f*v-l*p)/d,_=b.pop()||new function(){o(this),this.x=this.y=this.arc=this.site=this.cy=null};_.arc=t,_.site=i,_.x=g+u,_.y=(_.cy=m+c)+Math.sqrt(g*g+m*m),t.circle=_;for(var x=null,w=z._;w;)if(_.yN)u=u.L;else{if(!((i=o-C(u,a))>N)){r>-N?(e=u.P,n=u):i>-N?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}!function(t){T[t.index]={site:t,halfedges:[]}}(t);var c=w(t);if(S.insert(e,c),e||n){if(e===n)return _(e),n=w(e.site),S.insert(c,n),c.edge=n.edge=f(e.site,c.site),m(e),void m(n);if(n){_(e),_(n);var s=e.site,h=s[0],d=s[1],p=t[0]-h,v=t[1]-d,g=n.site,y=g[0]-h,b=g[1]-d,x=2*(p*b-v*y),M=p*p+v*v,A=y*y+b*b,k=[(b*M-v*A)/x+h,(p*A-y*M)/x+d];l(n.edge,s,g,k),c.edge=f(s,t,null,k),n.edge=f(t,g,null,k),m(e),m(n)}else c.edge=f(e.site,c.site)}}function E(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var u=(n=a.site)[0],c=n[1],f=c-e;if(!f)return u;var s=u-r,l=1/o-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-o/2)))/l+r:(r+u)/2}function C(t,e){var n=t.N;if(n)return E(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var S,T,z,O,N=1e-6,j=1e-12;function P(t,e){return e[1]-t[1]||e[0]-t[0]}function D(t,e){var n,r,o,a=t.sort(P).pop();for(O=[],T=new Array(t.length),S=new i,z=new i;;)if(o=y,a&&(!o||a[1]N||Math.abs(i[0][1]-i[1][1])>N)||delete O[o]}(u,c,f,l),function(t,e,n,r){var i,o,a,u,c,f,l,h,d,p,y,b,m=T.length,_=!0;for(i=0;iN||Math.abs(b-d)>N)&&(c.splice(u,0,O.push(s(a,p,Math.abs(y-t)N?[t,Math.abs(h-t)N?[Math.abs(d-r)N?[n,Math.abs(h-n)N?[Math.abs(d-e)=u)return null;var c=t-i.site[0],f=e-i.site[1],s=c*c+f*f;do{i=o.cells[r=a],a=null,i.halfedges.forEach(function(n){var r=o.edges[n],u=r.left;if(u!==i.site&&u||(u=r.right)){var c=t-u[0],f=e-u[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}f.prototype=u.prototype,t.zoom=function(){var t,f,b=h,m=d,_=y,x=v,w=g,M=[0,1/0],A=[[-1/0,-1/0],[1/0,1/0]],k=250,E=i.interpolateZoom,C=[],S=n.dispatch("start","zoom","end"),T=500,z=150,O=0;function N(t){t.property("__zoom",p).on("wheel.zoom",L).on("mousedown.zoom",I).on("dblclick.zoom",U).filter(w).on("touchstart.zoom",q).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(t,e){return(e=Math.max(M[0],Math.min(M[1],e)))===t.k?t:new u(e,t.x,t.y)}function P(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new u(t.k,r,i)}function D(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function B(t,e,n){t.on("start.zoom",function(){F(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=F(this,t),i=m.apply(this,t),o=n||D(i),a=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),c=this.__zoom,f="function"==typeof e?e.apply(this,t):e,s=E(c.invert(o).concat(a/c.k),f.invert(o).concat(a/f.k));return function(t){if(1===t)t=f;else{var e=s(t),n=a/e[2];t=new u(n,o[0]-e[0]*n,o[1]-e[1]*n)}r.zoom(null,t)}})}function F(t,e){for(var n,r=0,i=C.length;rO}t.zoom("mouse",_(P(t.that.__zoom,t.mouse[0]=e.mouse(t.that),t.mouse[1]),t.extent,A))},!0).on("mouseup.zoom",function(){n.on("mousemove.zoom mouseup.zoom",null),r.dragEnable(e.event.view,t.moved),l(),t.end()},!0),i=e.mouse(this),a=e.event.clientX,u=e.event.clientY;r.dragDisable(e.event.view),s(),t.mouse=[i,this.__zoom.invert(i)],o.interrupt(this),t.start()}}function U(){if(b.apply(this,arguments)){var t=this.__zoom,n=e.mouse(this),r=t.invert(n),i=t.k*(e.event.shiftKey?.5:2),o=_(P(j(t,i),n,r),m.apply(this,arguments),A);l(),k>0?e.select(this).transition().duration(k).call(B,o,n):e.select(this).call(N.transform,o)}}function q(){if(b.apply(this,arguments)){var n,r,i,a,u=F(this,arguments),c=e.event.changedTouches,f=c.length;for(s(),r=0;rr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function _(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?x:_,o=a=null,p}function p(e){return isNaN(e=+e)?n:(o||(o=i(u.map(t),c,f)))(t(h(e)))}return p.invert=function(n){return h(e((a||(a=i(c,u.map(t),r.interpolateNumber)))(n)))},p.domain=function(t){return arguments.length?(u=s.call(t,v),h===y||(h=m(u)),d()):u.slice()},p.range=function(t){return arguments.length?(c=l.call(t),d()):c.slice()},p.rangeRound=function(t){return c=l.call(t),f=r.interpolateRound,d()},p.clamp=function(t){return arguments.length?(h=t?m(u):y,p):h!==y},p.interpolate=function(t){return arguments.length?(f=t,d()):f},p.unknown=function(t){return arguments.length?(n=t,p):n},function(n,r){return t=n,e=r,d()}}function A(t,e){return M()(t,e)}function k(t,e,r,o){var a,u=n.tickStep(t,e,r);switch((o=i.formatSpecifier(null==o?",f":o)).type){case"s":var c=Math.max(Math.abs(t),Math.abs(e));return null!=o.precision||isNaN(a=i.precisionPrefix(u,c))||(o.precision=a),i.formatPrefix(o,c);case"":case"e":case"g":case"p":case"r":null!=o.precision||isNaN(a=i.precisionRound(u,Math.max(Math.abs(t),Math.abs(e))))||(o.precision=a-("e"===o.type));break;case"f":case"%":null!=o.precision||isNaN(a=i.precisionFixed(u))||(o.precision=a-2*("%"===o.type))}return i.format(o)}function E(t){var e=t.domain;return t.ticks=function(t){var r=e();return n.ticks(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return k(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(r){null==r&&(r=10);var i,o=e(),a=0,u=o.length-1,c=o[a],f=o[u];return f0?(c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i,i=n.tickIncrement(c,f,r)):i<0&&(c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i,i=n.tickIncrement(c,f,r)),i>0?(o[a]=Math.floor(c/i)*i,o[u]=Math.ceil(f/i)*i,e(o)):i<0&&(o[a]=Math.ceil(c*i)/i,o[u]=Math.floor(f*i)/i,e(o)),t},t}function C(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;df)break;g.push(h)}}else for(;d=1;--l)if(!((h=s*l)f)break;g.push(h)}}else g=n.ticks(d,p,Math.min(p-d,v)).map(r);return i?g.reverse():g},o.tickFormat=function(t,n){if(null==n&&(n=10===u?".0e":","),"function"!=typeof n&&(n=i.format(n)),t===1/0)return n;null==t&&(t=10);var a=Math.max(1,u*t/o.ticks().length);return function(t){var i=t/r(Math.round(e(t)));return i*u0?o[e-1]:r[0],e=o?[a[o-1],i]:[a[e-1],a[e]]},f.unknown=function(t){return arguments.length?(e=t,f):f},f.thresholds=function(){return a.slice()},f.copy=function(){return t().domain([r,i]).range(c).unknown(e)},u.apply(E(f),arguments)},t.scaleThreshold=function t(){var e,r=[.5],i=[0,1],o=1;function a(t){return t<=t?i[n.bisect(r,t,0,o)]:e}return a.domain=function(t){return arguments.length?(r=l.call(t),o=Math.min(r.length,i.length-1),a):r.slice()},a.range=function(t){return arguments.length?(i=l.call(t),o=Math.min(r.length,i.length-1),a):i.slice()},a.invertExtent=function(t){var e=i.indexOf(t);return[r[e-1],r[e]]},a.unknown=function(t){return arguments.length?(e=t,a):e},a.copy=function(){return t().domain(r).range(i).unknown(e)},u.apply(a,arguments)},t.scaleTime=function(){return u.apply(J(o.timeYear,o.timeMonth,o.timeWeek,o.timeDay,o.timeHour,o.timeMinute,o.timeSecond,o.timeMillisecond,a.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return u.apply(J(o.utcYear,o.utcMonth,o.utcWeek,o.utcDay,o.utcHour,o.utcMinute,o.utcSecond,o.utcMillisecond,a.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scaleSequential=function t(){var e=E(K()(y));return e.copy=function(){return tt(e,t())},c.apply(e,arguments)},t.scaleSequentialLog=function t(){var e=P(K()).domain([1,10]);return e.copy=function(){return tt(e,t()).base(e.base())},c.apply(e,arguments)},t.scaleSequentialPow=et,t.scaleSequentialSqrt=function(){return et.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var e=F(K());return e.copy=function(){return tt(e,t()).constant(e.constant())},c.apply(e,arguments)},t.scaleSequentialQuantile=function t(){var e=[],r=y;function i(t){if(!isNaN(t=+t))return r((n.bisect(e,t)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var r,o=0,a=t.length;o-1}},{}],58:[function(t,e,n){"use strict";var r,i,o,a,u,c,f,s=t("d"),l=t("es5-ext/object/valid-callable"),h=Function.prototype.apply,d=Function.prototype.call,p=Object.create,v=Object.defineProperty,g=Object.defineProperties,y=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0};u={on:r=function(t,e){var n;return l(e),y.call(this,"__ee__")?n=this.__ee__:(n=b.value=p(null),v(this,"__ee__",b),b.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i=function(t,e){var n,i;return l(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},off:o=function(t,e){var n,r,i,o;if(l(e),!y.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:a=function(t){var e,n,r,i,o;if(y.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e>1,s=-7,l=n?i-1:0,h=n?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-s)-1,d>>=-s,s+=u;s>0;o=256*o+t[e+l],l+=h,s-=8);for(a=o&(1<<-s)-1,o>>=-s,s+=r;s>0;a=256*a+t[e+l],l+=h,s-=8);if(0===o)o=1-f;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=f}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,u,c,f=8*o-i-1,s=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=s?(u=0,a=s):a+l>=1?(u=(e*c-1)*Math.pow(2,i),a+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&u,d+=p,u/=256,i-=8);for(a=a<0;t[n+d]=255&a,d+=p,a/=256,f-=8);t[n+d-p]|=128*v}},{}],66:[function(t,e,n){var r=[],i=[],o="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function a(t,e){if(e=e||{},void 0===t)throw new Error(o);var n,a=!0===e.prepend?"prepend":"append",u=void 0!==e.container?e.container:document.querySelector("head"),c=r.indexOf(u);return-1===c&&(c=r.push(u)-1,i[c]={}),void 0!==i[c]&&void 0!==i[c][a]?n=i[c][a]:(n=i[c][a]=function(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}(),"prepend"===a?u.insertBefore(n,u.childNodes[0]):u.appendChild(n)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),n.styleSheet?n.styleSheet.cssText+=t:n.textContent+=t,n}e.exports=a,e.exports.insertCss=a},{}],67:[function(t,e,n){(function(t){(function(){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return r.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!r;i--){var a=i>=0?arguments[i]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,r="/"===a.charAt(0))}return n=e(o(n.split("/"),function(t){return!!t}),!r).join("/"),(r?"/":"")+n||"."},n.normalize=function(t){var r=n.isAbsolute(t),i="/"===a(t,-1);return(t=e(o(t.split("/"),function(t){return!!t}),!r).join("/"))||r||(t="."),t&&i&&(t+="/"),(r?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),u=a,c=0;c1)for(var n=1;n>>=e))<<3,(e|=n=(15<(t>>>=n))<<2)|(n=(3<(t>>>=n))<<1)|t>>>n>>1}function u(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=n[a(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){n[a(t.byteLength)>>2].push(t)}var n=o(8,function(){return[]});return{alloc:t,free:e,allocType:function(e,n){var r=null;switch(e){case 5120:r=new Int8Array(t(n),0,n);break;case 5121:r=new Uint8Array(t(n),0,n);break;case 5122:r=new Int16Array(t(2*n),0,n);break;case 5123:r=new Uint16Array(t(2*n),0,n);break;case 5124:r=new Int32Array(t(4*n),0,n);break;case 5125:r=new Uint32Array(t(4*n),0,n);break;case 5126:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){e(t.buffer)}}}function c(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||G(t.data))}function f(t,e,n,r,i,o){for(var a=0;a(i=u)&&(i=r.buffer.byteLength,5123===l?i>>=1:5125===l&&(i>>=2)),r.vertCount=i,i=a,0>a&&(i=4,1===(a=r.buffer.dimension)&&(i=0),2===a&&(i=1),3===a&&(i=4)),r.primType=i}function a(t){r.elementsCount--,delete u[t.id],t.buffer.destroy(),t.buffer=null}var u={},f=0,s={uint8:5121,uint16:5123};e.oes_element_index_uint&&(s.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var l=[];return{create:function(t,e){function u(t){if(t)if("number"==typeof t)f(t),l.primType=4,l.vertCount=0|t,l.type=5121;else{var e=null,n=35044,r=-1,i=-1,a=0,h=0;Array.isArray(t)||G(t)||c(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(n=J[t.usage]),"primitive"in t&&(r=nt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=s[t.type]),"length"in t?a=0|t.length:(a=i,5123===h||5122===h?a*=2:5125!==h&&5124!==h||(a*=4))),o(l,e,n,r,i,a,h)}else f(),l.primType=4,l.vertCount=0,l.type=5121;return u}var f=n.create(null,34963,!0),l=new i(f._buffer);return r.elementsCount++,u(t),u._reglType="elements",u._elements=l,u.subdata=function(t,e){return f.subdata(t,e),u},u.destroy=function(){a(l)},u},createStream:function(t){var e=l.pop();return e||(e=new i(n.create(null,34963,!0,!1)._buffer)),o(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){$(u).forEach(a)}}}function v(t){for(var e=Y.allocType(5123,t.length),n=0;n>>31<<15,i=(o<<1>>>24)-127,o=o>>13&1023;e[n]=-24>i?r:-14>i?r+(o+1024>>-14-i):15>=i,n.height>>=i,d(n,r[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function T(t){for(var e=t.images,n=0;ne){for(var n=0;n=--this.refCount&&B(this)}}),a.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach(function(e){t+=yt[e].stats.size}),t}),{create2D:function(e,n){function r(t,e){var n=i.texInfo;z.call(n);var o=S();return"number"==typeof t?k(o,0|t,"number"==typeof e?0|e:0|t):t?(O(n,t),E(o,t)):k(o,1,1),n.genMipmaps&&(o.mipmask=(o.width<<1)-1),i.mipmask=o.mipmask,f(i,o),i.internalformat=o.internalformat,r.width=o.width,r.height=o.height,P(i),C(o,3553),N(n,3553),D(),T(o),a.profile&&(i.stats.size=M(i.internalformat,i.type,o.width,o.height,n.genMipmaps,!1)),r.format=K[i.internalformat],r.type=tt[i.type],r.mag=et[n.magFilter],r.min=nt[n.minFilter],r.wrapS=rt[n.wrapS],r.wrapT=rt[n.wrapT],r}var i=new j(3553);return yt[i.id]=i,o.textureCount++,r(e,n),r.subimage=function(t,e,n,o){e|=0,n|=0,o|=0;var a=y();return f(a,i),a.width=0,a.height=0,d(a,t),a.width=a.width||(i.width>>o)-e,a.height=a.height||(i.height>>o)-n,P(i),p(a,3553,e,n,o),D(),A(a),r},r.resize=function(e,n){var o=0|e,u=0|n||o;if(o===i.width&&u===i.height)return r;r.width=i.width=o,r.height=i.height=u,P(i);for(var c=0;i.mipmask>>c;++c){var f=o>>c,s=u>>c;if(!f||!s)break;t.texImage2D(3553,c,i.format,f,s,0,i.format,i.type,null)}return D(),a.profile&&(i.stats.size=M(i.internalformat,i.type,o,u,!1,!1)),r},r._reglType="texture2d",r._texture=i,a.profile&&(r.stats=i.stats),r.destroy=function(){i.decRef()},r},createCube:function(e,n,r,i,u,c){function l(t,e,n,r,i,o){var u,c=h.texInfo;for(z.call(c),u=0;6>u;++u)v[u]=S();if("number"!=typeof t&&t){if("object"==typeof t)if(e)E(v[0],t),E(v[1],e),E(v[2],n),E(v[3],r),E(v[4],i),E(v[5],o);else if(O(c,t),s(h,t),"faces"in t)for(t=t.faces,u=0;6>u;++u)f(v[u],h),E(v[u],t[u]);else for(u=0;6>u;++u)E(v[u],t)}else for(t=0|t||1,u=0;6>u;++u)k(v[u],t,t);for(f(h,v[0]),h.mipmask=c.genMipmaps?(v[0].width<<1)-1:v[0].mipmask,h.internalformat=v[0].internalformat,l.width=v[0].width,l.height=v[0].height,P(h),u=0;6>u;++u)C(v[u],34069+u);for(N(c,34067),D(),a.profile&&(h.stats.size=M(h.internalformat,h.type,l.width,l.height,c.genMipmaps,!0)),l.format=K[h.internalformat],l.type=tt[h.type],l.mag=et[c.magFilter],l.min=nt[c.minFilter],l.wrapS=rt[c.wrapS],l.wrapT=rt[c.wrapT],u=0;6>u;++u)T(v[u]);return l}var h=new j(34067);yt[h.id]=h,o.cubeCount++;var v=Array(6);return l(e,n,r,i,u,c),l.subimage=function(t,e,n,r,i){n|=0,r|=0,i|=0;var o=y();return f(o,h),o.width=0,o.height=0,d(o,e),o.width=o.width||(h.width>>i)-n,o.height=o.height||(h.height>>i)-r,P(h),p(o,34069+t,n,r,i),D(),A(o),l},l.resize=function(e){if((e|=0)!==h.width){l.width=h.width=e,l.height=h.height=e,P(h);for(var n=0;6>n;++n)for(var r=0;h.mipmask>>r;++r)t.texImage2D(34069+n,r,h.format,e>>r,e>>r,0,h.format,h.type,null);return D(),a.profile&&(h.stats.size=M(h.internalformat,h.type,l.width,l.height,!1,!0)),l}},l._reglType="textureCube",l._texture=h,a.profile&&(l.stats=h.stats),l.destroy=function(){h.decRef()},l},clear:function(){for(var e=0;en;++n)if(0!=(e.mipmask&1<>n,e.height>>n,0,e.internalformat,e.type,null);else for(var r=0;6>r;++r)t.texImage2D(34069+r,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);N(e.texInfo,e.target)})},refresh:function(){for(var e=0;ei;++i){for(f=0;ft;++t)n[t].resize(r);return e.width=e.height=r,e},_reglType:"framebufferCube",destroy:function(){n.forEach(function(t){t.destroy()})}})},clear:function(){$(A).forEach(g)},restore:function(){m.cur=null,m.next=null,m.dirty=!0,$(A).forEach(function(e){e.framebuffer=t.createFramebuffer(),y(e)})}})}function E(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function C(t,e,n,r,i,o,a){function u(){this.id=++l,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var f=n.maxAttributes,s=Array(f);for(n=0;n=h.byteLength?f.subdata(h):(f.destroy(),n.buffers[u]=null)),n.buffers[u]||(f=n.buffers[u]=i.create(s,34962,!1,!0)),l.buffer=i.getBuffer(f),l.size=0|l.buffer.dimension,l.normalized=!1,l.type=l.buffer.dtype,l.offset=0,l.stride=0,l.divisor=0,l.state=1,t[u]=1;else i.getBuffer(s)?(l.buffer=i.getBuffer(s),l.size=0|l.buffer.dimension,l.normalized=!1,l.type=l.buffer.dtype,l.offset=0,l.stride=0,l.divisor=0,l.state=1):i.getBuffer(s.buffer)?(l.buffer=i.getBuffer(s.buffer),l.size=0|(+s.size||l.buffer.dimension),l.normalized=!!s.normalized||!1,l.type="type"in s?Z[s.type]:l.buffer.dtype,l.offset=0|(s.offset||0),l.stride=0|(s.stride||0),l.divisor=0|(s.divisor||0),l.state=1):"x"in s&&(l.x=+s.x||0,l.y=+s.y||0,l.z=+s.z||0,l.w=+s.w||0,l.state=2)}for(f=0;ft&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);$(f).forEach(e),f={},$(s).forEach(e),s={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,l={},n.shaderCount=0},program:function(e,r,i,o){var a=l[r];a||(a=l[r]={});var d=a[e];if(d&&(d.refCount++,!o))return d;var p=new u(r,e);return n.shaderCount++,c(p,i,o),d||(a[e]=p),h.push(p),I(p,{destroy:function(){if(p.refCount--,0>=p.refCount){t.deleteProgram(p.program);var e=h.indexOf(p);h.splice(e,1),n.shaderCount--}0>=a[p.vertId].refCount&&(t.deleteShader(s[p.vertId]),delete s[p.vertId],delete l[p.fragId][p.vertId]),Object.keys(l[p.fragId]).length||(t.deleteShader(f[p.fragId]),delete f[p.fragId],delete l[p.fragId])}})},restore:function(){f={},s={};for(var t=0;t"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",u,"(",i,".buffer)){",s,"=",o,".createStream(",34962,",",i,".buffer);","}else{",s,"=",o,".getBuffer(",i,".buffer);","}",l,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",s,".dtype;",c.normalized,"=!!",i,".normalized;"),r("size"),r("offset"),r("stride"),r("divisor"),n("}}"),n.exit("if(",c.isStream,"){",o,".destroyStream(",s,");","}"),c})}),a}function k(t,e,r,i,a){function u(t){var e=f[t];e&&(h[t]=e)}var c=function(t,e){if("string"==typeof(n=t.static).frag&&"string"==typeof n.vert){if(0>1)",u],");")}function e(){n(c,".drawArraysInstancedANGLE(",[p,v,g,u],");")}d&&"null"!==d?b?t():(n("if(",d,"){"),t(),n("}else{"),e(),n("}")):e()}function a(){function t(){n(s+".drawElements("+[p,g,y,v+"<<(("+y+"-5121)>>1)"]+");")}function e(){n(s+".drawArrays("+[p,v,g]+");")}d&&"null"!==d?b?t():(n("if(",d,"){"),t(),n("}else{"),e(),n("}")):e()}var u,c,f=t.shared,s=f.gl,l=f.draw,h=r.draw,d=function(){var i=h.elements,o=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(t,o),h.elementsActive&&o("if("+i+")"+s+".bindBuffer(34963,"+i+".buffer.buffer);")):o(i=o.def(),"=",l,".","elements",";","if(",i,"){",s,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",f.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+f.vao,".currentVAO.elements);",rt?"":"if("+i+")"+s+".bindBuffer(34963,"+i+".buffer.buffer);","}"),i}(),p=i("primitive"),v=i("offset"),g=function(){var i=h.count,o=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(t,o)):i=o.def(l,".","count"),i}();if("number"==typeof g){if(0===g)return}else n("if(",g,"){"),n.exit("}");tt&&(u=i("instances"),c=t.instancing);var y=d+".type",b=h.elements&&D(h.elements)&&!h.vaoActive;tt&&("number"!=typeof u||0<=u)?"string"==typeof u?(n("if(",u,">0){"),o(),n("}else if(",u,"<0){"),a(),n("}")):o():a()}function Y(t,e,n,r,i){return i=(e=_()).proc("body",i),tt&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,n,r),e.compile().body}function W(t,e,n,r){R(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),U(t,e,n,r.attributes,function(){return!0})),H(t,e,n,r.uniforms,function(){return!0},!1),V(t,e,e,n)}function G(t,e,n,r){function i(){return!0}t.batchId="a1",R(t,e),U(t,e,n,r.attributes,i),H(t,e,n,r.uniforms,i,!1),V(t,e,e,n)}function $(t,e,n,r){function i(t){return t.contextDep&&a||t.propDep}function o(t){return!i(t)}R(t,e);var a=n.contextDep,u=e.def(),c=e.def();t.shared.props=c,t.batchId=u;var f=t.scope(),s=t.scope();e(f.entry,"for(",u,"=0;",u,"<","a1",";++",u,"){",c,"=","a0","[",u,"];",s,"}",f.exit),n.needsContext&&E(t,s,n.context),n.needsFramebuffer&&C(t,s,n.framebuffer),T(t,s,n.state,i),n.profile&&i(n.profile)&&L(t,s,n,!1,!0),r?(n.useVAO?n.drawVAO?i(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):f(t.shared.vao,".setVAO(",n.drawVAO.append(t,f),");"):f(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(f(t.shared.vao,".setVAO(null);"),U(t,f,n,r.attributes,o),U(t,s,n,r.attributes,i)),H(t,f,n,r.uniforms,o,!1),H(t,s,n,r.uniforms,i,!0),V(t,f,s,n)):(e=t.global.def("{}"),r=n.shader.progVar.append(t,s),c=s.def(r,".id"),f=s.def(e,"[",c,"]"),s(t.shared.gl,".useProgram(",r,".program);","if(!",f,"){",f,"=",e,"[",c,"]=",t.link(function(e){return Y(G,t,n,e,2)}),"(",r,");}",f,".call(this,a0[",u,"],",u,");"))}function X(t,n){function r(e){var r=n.shader[e];r&&i.set(o.shader,"."+e,r.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var o=t.shared,a=o.current;E(t,i,n.context),n.framebuffer&&n.framebuffer.append(t,i),j(Object.keys(n.state)).forEach(function(e){var r=n.state[e].append(t,i);g(r)?r.forEach(function(n,r){i.set(t.next[e],"["+r+"]",n)}):i.set(o.next,"."+e,r)}),L(t,i,n,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(e){var r=n.draw[e];r&&i.set(o.draw,"."+e,""+r.append(t,i))}),Object.keys(n.uniforms).forEach(function(r){var a=n.uniforms[r].append(t,i);Array.isArray(a)&&(a="["+a.join()+"]"),i.set(o.uniforms,"["+e.id(r)+"]",a)}),Object.keys(n.attributes).forEach(function(e){var r=n.attributes[e].append(t,i),o=t.scopeAttrib(e);Object.keys(new J).forEach(function(t){i.set(o,"."+t,r[t])})}),n.scopeVAO&&i.set(o.vao,".targetVAO",n.scopeVAO.append(t,i)),r("vert"),r("frag"),0=--this.refCount&&a(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach(function(e){t+=s[e].stats.size}),t}),{create:function(e,n){function a(e,n){var r=0,o=0,s=32854;if("object"==typeof e&&e?("shape"in e?(r=0|(o=e.shape)[0],o=0|o[1]):("radius"in e&&(r=o=0|e.radius),"width"in e&&(r=0|e.width),"height"in e&&(o=0|e.height)),"format"in e&&(s=u[e.format])):"number"==typeof e?(r=0|e,o="number"==typeof n?0|n:r):e||(r=o=1),r!==f.width||o!==f.height||s!==f.format)return a.width=f.width=r,a.height=f.height=o,f.format=s,t.bindRenderbuffer(36161,f.renderbuffer),t.renderbufferStorage(36161,s,r,o),i.profile&&(f.stats.size=yt[f.format]*f.width*f.height),a.format=c[f.format],a}var f=new o(t.createRenderbuffer());return s[f.id]=f,r.renderbufferCount++,a(e,n),a.resize=function(e,n){var r=0|e,o=0|n||r;return r===f.width&&o===f.height?a:(a.width=f.width=r,a.height=f.height=o,t.bindRenderbuffer(36161,f.renderbuffer),t.renderbufferStorage(36161,f.format,r,o),i.profile&&(f.stats.size=yt[f.format]*f.width*f.height),a)},a._reglType="renderbuffer",a._renderbuffer=f,i.profile&&(a.stats=f.stats),a.destroy=function(){f.decRef()},a},clear:function(){$(s).forEach(a)},restore:function(){$(s).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}},mt=[];mt[6408]=4,mt[6407]=3;var _t=[];_t[5121]=1,_t[5126]=4,_t[36193]=2;var xt=["x","y","z","w"],wt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Mt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},At={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},kt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Et={cw:2304,ccw:2305},Ct=new P(!1,!1,!1,function(){});return function(t){function e(){if(0===Q.length)w&&w.update(),tt=null;else{tt=H.next(e),l();for(var t=Q.length-1;0<=t;--t){var n=Q[t];n&&n(O,null,0)}g.flush(),w&&w.update()}}function n(){!tt&&0=Q.length&&r()}}}}function s(){var t=$.viewport,e=$.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function l(){O.tick+=1,O.time=v(),s(),G.procs.poll()}function h(){F.refresh(),s(),G.procs.refresh(),w&&w.update()}function v(){return(V()-M)/1e3}if(!(t=i(t)))return null;var g=t.gl,y=g.getContextAttributes();g.isContextLost();var b=function(t,e){function n(e){var n;e=e.toLowerCase();try{n=r[e]=t.getExtension(e)}catch(t){}return!!n}for(var r={},i=0;ie;++e)et(I({framebuffer:t.framebuffer.faces[e]},t),c);else et(t,c);else c(0,t)},prop:q.define.bind(null,1),context:q.define.bind(null,2),this:q.define.bind(null,3),draw:u({}),buffer:function(t){return j.create(t,34962,!1,!1)},elements:function(t){return P.create(t,!1)},texture:F.create2D,cube:F.createCube,renderbuffer:U.create,framebuffer:Y.create,framebufferCube:Y.createCube,vao:D.createVAO,attributes:y,frame:f,on:function(t,e){var n;switch(t){case"frame":return f(e);case"lost":n=Z;break;case"restore":n=J;break;case"destroy":n=K}return n.push(e),{cancel:function(){for(var t=0;tt.length)&&(e=t.length);for(var n=0,r=new Array(e);n= iMagnitudeOctaves) ? 0.0 : magWeight").concat(t-1," * bias"),";")}).join("\n "),"\n \n float width1 = max(0.0, lineWidth - lineFeather);\n float width2 = lineWidth + lineFeather;\n\n float w, scaleFactor, value, gridValue;\n float totalWeight = 0.0;\n float magnitudeGrid = 0.0;\n float magnitudeShading = 0.0;\n scaleFactor = pow(steps.x, logtier) / cargGradientMag * 0.25;\n \n ").concat(r(Array(e).keys()).map(function(t){return"w = mix(magWeight".concat(t,", magWeight").concat(t+1,", 1.0 - logspacing + logtier);\n totalWeight += w;\n gridValue = complexContouringGridFunction(magOctave").concat(t,") * scaleFactor;\n magnitudeGrid += w * smoothstep(width1, width2, gridValue);\n value = fract(-magOctave").concat(t,");\n magnitudeShading += w * (0.5 + (domainColoringContrastFunction(value, contrastPower) - 0.5) * min(1.0, gridValue * 1.5));\n scaleFactor *= steps.x;\n ")}).join("\n "),"\n \n magnitudeGrid /= totalWeight;\n magnitudeShading /= totalWeight;\n\n // Phase steps\n invlog2base = 1.0 / log2(steps.y);\n logspacing = log2(cargGradientMag * ").concat(i.toFixed(1)," * res.y) * invlog2base;\n logspacing = clamp(logspacing, -50.0, 50.0);\n logtier = floor(logspacing);\n n = log2(abs(carg) + 1.0) * invlog2base - logtier;\n\n invSteps = 1.0 / steps.y;\n float phaseOctave0 = pow(steps.y, n) * sign(carg);\n\n ").concat(r(Array(n-1).keys()).map(function(t){return"float phaseOctave".concat(t+1," = phaseOctave").concat(t," * invSteps;")}).join("\n "),"\n\n int iPhaseOctaves = int(octaves.y);\n ").concat(r(Array(n+1).keys()).map(function(t){return"float phaseWeight".concat(t," = ").concat(0===t?"1e-4":"(".concat(t," == 0 || ").concat(t," >= iPhaseOctaves) ? 0.0 : phaseWeight").concat(t-1," * bias"),";")}).join("\n "),"\n \n totalWeight = 0.0;\n\n float phaseShading = 0.0;\n float phaseGrid = 0.0;\n scaleFactor = pow(steps.y, logtier) / (cargGradientMag * ").concat(i.toFixed(1),") * 2.0;\n\n ").concat(r(Array(n).keys()).map(function(t){return"w = mix(phaseWeight".concat(t,", phaseWeight").concat(t+1,", 1.0 - logspacing + logtier);\n totalWeight += w;\n gridValue = complexContouringGridFunction(phaseOctave").concat(t,") * scaleFactor;\n phaseGrid += w * smoothstep(width1, width2, gridValue);\n value = fract(phaseOctave").concat(t,");\n phaseShading += w * (0.5 + (domainColoringContrastFunction(value, contrastPower) - 0.5) * min(1.0, gridValue * 1.5));\n scaleFactor *= steps.y;\n ")}).join("\n "),"\n\n phaseGrid /= totalWeight;\n phaseShading /= totalWeight;\n\n float grid = 1.0;\n grid = min(grid, 1.0 - (1.0 - magnitudeGrid) * gridOpacity.x);\n grid = min(grid, 1.0 - (1.0 - phaseGrid) * gridOpacity.y);\n\n float shading = 1.0 - 0.5 * (mix(0.5, 1.0 - phaseShading, shadingOpacity.y) + mix(0.5, 1.0 - magnitudeShading, shadingOpacity.x));\n\n vec3 result = mix(vec3(pow(max(0.0, shading), 1./2.2)), rainbow(\n vec2(carg / ").concat(i.toFixed(1)," - 0.25, shading)\n ).rgb, saturation);\n //vec2 uv = vec2(carg / ").concat(i.toFixed(1)," - 0.25, shading);\n //vec3 result = cubehelixRainbow(0.25 - uv.x).rgb * mix(0.6, 1.0, uv.y);\n \n result = mix(gridColor, result, grid);\n\n return vec4(result, 1.0);\n }")}},{}],75:[function(t,e,n){"use strict";t("path");var r=t("./domain-coloring.js");e.exports=function(t){var e=r({maxMagnitudeOctaves:10,maxPhaseOctaves:10});return t({vert:"\n precision highp float;\n attribute vec2 xy;\n uniform mat4 inverseView;\n varying vec2 z;\n void main () {\n z = (inverseView * vec4(xy, 0, 1)).xy;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:"\n #extension GL_OES_standard_derivatives : enable\n\n #define PHI 2.39996322972865332\n #define PI 3.141592653589793238\n #define HALF_PI 1.57079632679\n #define HALF_PI_INV 0.15915494309\n #define LOG_2 0.69314718056\n #define C_ONE (vec2(1.0, 0.0))\n #define C_I (vec2(0.0, 1.0))\n #define TO_RADIANS 0.01745329251\n\n precision highp float;\n\n ".concat("#ifndef PI\n#define PI 3.141592653589793238\n#endif\n\nfloat hypot (vec2 z) {\n float x = abs(z.x);\n float y = abs(z.y);\n float t = min(x, y);\n x = max(x, y);\n t = t / x;\n return x * sqrt(1.0 + t * t);\n\n // This conditional seems unnecessary on the non-cpu version\n //return (z.x == 0.0 && z.y == 0.0) ? 0.0 : x * sqrt(1.0 + t * t);\n}\n\nvec2 cadd (vec2 a, vec2 b) {\n return a + b;\n}\n\nvec2 csub (vec2 a, vec2 b) {\n return a - b;\n}\n\nfloat cmod (vec2 z) {\n return hypot(z);\n} \n\nvec2 csqrt (vec2 z) {\n float t = sqrt(2.0 * (cmod(z) + (z.x >= 0.0 ? z.x : -z.x)));\n vec2 f = vec2(0.5 * t, abs(z.y) / t);\n\n if (z.x < 0.0) f.xy = f.yx;\n if (z.y < 0.0) f.y = -f.y;\n\n return f;\n}\n\nfloat sinh (float x) {\n return 0.5 * (exp(x) - exp(-x));\n}\n\nfloat cosh (float x) {\n return 0.5 * (exp(x) + exp(-x));\n}\n\nvec2 sinhcosh (float x) {\n vec2 ex = exp(vec2(x, -x));\n return 0.5 * (ex - vec2(ex.y, -ex.x));\n}\n\nfloat cabs (vec2 z) {\n return cmod(z);\n}\n\nvec2 clog(vec2 z) {\n return vec2(\n log(hypot(z)),\n atan(z.y, z.x)\n );\n}\n\nvec2 catan (vec2 z) {\n float a = z.x * z.x + (1.0 - z.y) * (1.0 - z.y);\n vec2 b = clog(vec2(1.0 - z.y * z.y - z.x * z.x, -2.0 * z.x) / a);\n return 0.5 * vec2(-b.y, b.x);\n} \n\nvec2 catanh (vec2 z) {\n float oneMinus = 1.0 - z.x;\n float onePlus = 1.0 + z.x;\n float d = oneMinus * oneMinus + z.y * z.y;\n\n vec2 x = vec2(onePlus * oneMinus - z.y * z.y, z.y * 2.0) / d;\n\n vec2 result = vec2(log(hypot(x)), atan(x.y, x.x)) * 0.5;\n\n return result;\n} \n\nvec2 cacos (vec2 z) {\n vec2 a = csqrt(vec2(\n z.y * z.y - z.x * z.x + 1.0,\n -2.0 * z.x * z.y\n ));\n\n vec2 b = clog(vec2(a.x - z.y, a.y + z.x));\n return vec2((PI * 0.5) - b.y, b.x);\n} \n\nvec2 cacosh (vec2 z) {\n vec2 a = cacos(z);\n\n if (a.y <= 0.0) {\n return vec2(-a.y, a.x);\n }\n\n return vec2(a.y, -a.x);\n} \n\nvec2 cacot (vec2 z) {\n return catan(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 cacoth(vec2 z) {\n return catanh(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 casin (vec2 z) {\n vec2 a = csqrt(vec2(\n z.y * z.y - z.x * z.x + 1.0,\n -2.0 * z.x * z.y\n ));\n\n vec2 b = clog(vec2(\n a.x - z.y,\n a.y + z.x\n ));\n\n return vec2(b.y, -b.x);\n} \n\nvec2 casinh (vec2 z) {\n vec2 res = casin(vec2(z.y, -z.x));\n return vec2(-res.y, res.x);\n} \n\nvec2 cacsch(vec2 z) {\n return casinh(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 casec (vec2 z) {\n float d = dot(z, z);\n return cacos(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 casech(vec2 z) {\n return cacosh(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 cconj (vec2 z) {\n return vec2(z.x, -z.y);\n} \n\nvec2 ccos (vec2 z) {\n return sinhcosh(z.y).yx * vec2(cos(z.x), -sin(z.x));\n} \n\nvec2 ccosh (vec2 z) {\n return sinhcosh(z.x).yx * vec2(cos(z.y), sin(z.y));\n} \n\nvec2 ccot (vec2 z) {\n z *= 2.0;\n vec2 sch = sinhcosh(z.y);\n return vec2(-sin(z.x), sch.x) / (cos(z.x) - sch.y);\n} \n\nvec2 ccoth(vec2 z) {\n z *= 2.0;\n vec2 sch = sinhcosh(z.x);\n return vec2(sch.x, -sin(z.y)) / (sch.y - cos(z.y));\n} \n\nvec2 ccsc (vec2 z) {\n float d = 0.25 * (exp(2.0 * z.y) + exp(-2.0 * z.y)) - 0.5 * cos(2.0 * z.x);\n\n return sinhcosh(z.y).yx * vec2(sin(z.x), -cos(z.x)) / d;\n} \n\nvec2 ccsch (vec2 z) {\n vec2 sch = sinhcosh(z.x);\n float d = cos(2.0 * z.y) - (exp(2.0 * z.x) + exp(-2.0 * z.x)) * 0.5;\n return vec2(-cos(z.y), sin(z.y)) * sch / (0.5 * d);\n} \n\nvec2 cdiv (vec2 a, vec2 b) {\n float e, f;\n float g = 1.0;\n float h = 1.0;\n\n if( abs(b.x) >= abs(b.y) ) {\n e = b.y / b.x;\n f = b.x + b.y * e;\n h = e;\n } else {\n e = b.x / b.y;\n f = b.x * e + b.y;\n g = e;\n }\n\n return (a * g + h * vec2(a.y, -a.x)) / f;\n} \n\nvec2 cexp(vec2 z) {\n return vec2(cos(z.y), sin(z.y)) * exp(z.x);\n} \n\nvec2 cinv (vec2 b) {\n float e, f;\n vec2 g = vec2(1, -1);\n\n if( abs(b.x) >= abs(b.y) ) {\n e = b.y / b.x;\n f = b.x + b.y * e;\n g.y = -e;\n } else {\n e = b.x / b.y;\n f = b.x * e + b.y;\n g.x = e;\n }\n\n return g / f;\n} \n\nvec2 cmul (vec2 a, vec2 b) {\n return vec2(\n a.x * b.x - a.y * b.y,\n a.y * b.x + a.x * b.y\n );\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c) {\n return cmul(cmul(a, b), c);\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c, vec2 d) {\n return cmul(cmul(a, b), cmul(c, d));\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c, vec2 d, vec2 e) {\n return cmul(cmul(a, b, c), cmul(d, e));\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c, vec2 d, vec2 e, vec2 f) {\n return cmul(cmul(a, b, c), cmul(d, e, f));\n} \n\nvec2 cpolar (vec2 z) {\n return vec2(\n atan(z.y, z.x),\n hypot(z)\n );\n} \n\nvec2 cpow (vec2 z, float x) {\n float r = hypot(z);\n float theta = atan(z.y, z.x) * x;\n return vec2(cos(theta), sin(theta)) * pow(r, x);\n}\n\nvec2 cpow (vec2 a, vec2 b) {\n float aarg = atan(a.y, a.x);\n float amod = hypot(a);\n\n float theta = log(amod) * b.y + aarg * b.x;\n\n return vec2(\n cos(theta),\n sin(theta)\n ) * pow(amod, b.x) * exp(-aarg * b.y);\n} \n\nvec2 csec (vec2 z) {\n float d = 0.25 * (exp(2.0 * z.y) + exp(-2.0 * z.y)) + 0.5 * cos(2.0 * z.x);\n return sinhcosh(z.y).yx * vec2(cos(z.x), sin(z.x)) / d;\n} \n\nvec2 csech(vec2 z) {\n float d = cos(2.0 * z.y) + 0.5 * (exp(2.0 * z.x) + exp(-2.0 * z.x));\n vec2 sch = sinhcosh(z.x);\n\n return vec2(cos(z.y), -sin(z.y)) * sch.yx / (0.5 * d);\n} \n\nvec2 csin (vec2 z) {\n return sinhcosh(z.y).yx * vec2(sin(z.x), cos(z.x));\n} \n\nvec4 csincos (vec2 z) {\n float c = cos(z.x);\n float s = sin(z.x);\n return sinhcosh(z.y).yxyx * vec4(s, c, c, -s);\n} \n\nvec2 csinh (vec2 z) {\n return sinhcosh(z.x) * vec2(cos(z.y), sin(z.y));\n} \n\nvec2 csqr (vec2 z) {\n return vec2(\n z.x * z.x - z.y * z.y,\n 2.0 * z.x * z.y\n );\n} \n\nvec2 ctan (vec2 z) {\n vec2 e2iz = cexp(2.0 * vec2(-z.y, z.x));\n\n return cdiv(\n e2iz - vec2(1, 0),\n vec2(-e2iz.y, 1.0 + e2iz.x)\n );\n} \n\nvec2 ctanh (vec2 z) {\n z *= 2.0;\n vec2 sch = sinhcosh(z.x);\n return vec2(sch.x, sin(z.y)) / (sch.y + cos(z.y));\n}\n","\n ").concat(e,"\n\n uniform mat4 mViewInv;\n uniform float w, lineWidth;\n varying vec2 z;\n uniform vec4 w2c2;\n\n uniform float ramp, saturation, bias;\n uniform vec2 divisions, octaves, scale, shading, grid;\n\n vec4 computePQ (vec2 k2) {\n vec4 pq2 = w2c2 - k2.xyxy;\n vec2 mag2 = pq2.xz * pq2.xz + pq2.yw * pq2.yw;\n float pmag = sqrt(sqrt(mag2.x));\n float qmag = sqrt(sqrt(mag2.y));\n float parg = 0.5 * atan(pq2.y, pq2.x);\n float qarg = 0.5 * atan(pq2.w, pq2.z);\n return vec4(\n pmag * vec2(cos(parg), sin(parg)),\n qmag * vec2(cos(qarg), sin(qarg))\n );\n }\n\n vec2 f(vec2 z) {\n vec2 k2 = csqr(z.xy);\n vec4 p2_q2 = w2c2 - k2.xyxy;\n vec4 halfPq = computePQ(k2) * 0.5;\n\n // (k^2 - q^2)^2:\n vec2 k2q22 = csqr(k2 - p2_q2.zw);\n\n // 4 * k^2 * q * p:\n vec2 k24pq = 16.0 * cmul(k2, cmul(halfPq.xy, halfPq.zw));\n vec4 scHalfP = csincos(halfPq.xy);\n vec4 scHalfQ = csincos(halfPq.zw);\n vec2 cospsinq = cmul(scHalfP.zw, scHalfQ.xy);\n vec2 cosqsinp = cmul(scHalfQ.zw, scHalfP.xy);\n\n return cmul(k2q22, cospsinq) + cmul(k24pq, cosqsinp);\n }\n\n float gridFactor (vec2 parameter, float width, float feather) {\n float w1 = width - feather * 0.5;\n vec2 d = fwidth(parameter);\n vec2 looped = 0.5 - abs(mod(parameter, 1.0) - 0.5);\n vec2 a2 = smoothstep(d * (w1 + feather), d * w1, looped);\n return max(a2.x, a2.y);\n }\n\n void main () {\n vec2 fz = f(z);\n\n gl_FragColor = vec4(domainColoring(\n vec4(fz, fwidth(fz) * 0.5),\n octaves,\n divisions,\n scale,\n grid,\n shading,\n lineWidth, // line width\n 1.0, // line feather\n vec3(0), // line color\n ramp,\n saturation,\n bias\n ));\n\n float grid = gridFactor(z / 10.0, 1.0, 1.0);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0), grid * 0.2);\n }\n "),attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{w2c2:t.prop("w2c2"),w:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){return w}),lineWidth:function(t,e){return(e.oRes?.1:.5)*t.pixelRatio},divisions:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.divisions,i.divisions]},octaves:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.octaves,i.octaves]},scale:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.scale,i.scale]},shading:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.shading,i.shading]},grid:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.grid,i.grid]},ramp:t.prop("t.dc.contrastRamp"),saturation:t.prop("t.dc.saturation"),bias:t.prop("t.dc.bias")},depth:{enable:!1},count:3})}},{"./domain-coloring.js":74,path:67}],76:[function(t,e,n){"use strict";function r(t){"@babel/helpers - typeof";return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e0?c-4:c;var s=0;for(e=0;e>16&255,u[s++]=r>>8&255,u[s++]=255&r;2===a?(r=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,u[s++]=255&r):1===a&&(r=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,u[s++]=r>>8&255,u[s++]=255&r);return u},n.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o="",a=[],u=0,c=n-i;uc?c:u+16383));1===i?(e=t[n-1],o+=r[e>>2],o+=r[e<<4&63],o+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],o+=r[e>>10],o+=r[e>>4&63],o+=r[e<<2&63],o+="=");return a.push(o),a.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function s(t,e,n){for(var i,o,a=[],u=e;u>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,n){(function(e){(function(){"use strict";var e=t("base64-js"),r=t("ieee754");n.Buffer=a,n.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function o(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|h(t,e),r=o(n),i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return s(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(L(t,ArrayBuffer)||t&&L(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function h(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(t).length;default:if(i)return r?-1:B(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function p(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),I(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,u=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,n/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var s=-1;for(o=n;ou&&(n=u-c),o=n;o>=0;o--){for(var l=!0,h=0;hi&&(r=i):r=i;var o=e.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function w(t,n,r){return 0===n&&r===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(n,r))}function M(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+l<=n)switch(l){case 1:f<128&&(s=f);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&f)<<6|63&o)>127&&(s=c);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(c=(15&f)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(c=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,l=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=l}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return M(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return E(this,e,n);case"base64":return w(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},a.prototype.compare=function(t,e,n,r,i){if(L(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,u=n-e,c=Math.min(o,u),f=this.slice(r,i),s=t.slice(e,n),l=0;l>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return m(this,t,e,n);case"base64":return _(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function k(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,n,r,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,i,o){return e=+e,n>>>=0,o||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function j(t,e,n,i,o){return e=+e,n>>>=0,o||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}a.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o>>=0,e>>>=0,n||T(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||T(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),r.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),r.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),r.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),r.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e>>>=0,n>>>=0,r)||z(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,n>>>=0,r)||z(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);z(this,t,e,n,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o>0)-u&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);z(this,t,e,n,i-1,-i)}var o=n-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||z(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,r),e);return i},a.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var i=t.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function L(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function I(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":1,buffer:2,ieee754:65}],3:[function(t,e,n){!function(t){"use strict";var r={re:0,im:0},i=function(t){return.5*(Math.exp(t)+Math.exp(-t))},o=function(t){return.5*(Math.exp(t)-Math.exp(-t))},a=function(){throw SyntaxError("Invalid Param")};function u(t,e){var n=Math.abs(t),r=Math.abs(e);return 0===t?Math.log(r):0===e?Math.log(n):n<3e3&&r<3e3?.5*Math.log(t*t+e*e):Math.log(t/Math.cos(Math.atan2(e,t)))}var c=function(t,e){if(void 0===t||null===t)r.re=r.im=0;else if(void 0!==e)r.re=t,r.im=e;else switch(typeof t){case"object":"im"in t&&"re"in t?(r.re=t.re,r.im=t.im):"abs"in t&&"arg"in t?(r.re=t.abs*Math.cos(t.arg),r.im=t.abs*Math.sin(t.arg)):"r"in t&&"phi"in t?(r.re=t.r*Math.cos(t.phi),r.im=t.r*Math.sin(t.phi)):2===t.length?(r.re=t[0],r.im=t[1]):a();break;case"string":r.im=r.re=0;var n=t.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,o=0;null===n&&a();for(var u=0;u0&&a();break;case"number":r.im=0,r.re=t;break;default:a()}isNaN(r.re)||isNaN(r.im)};function f(t,e){if(!(this instanceof f))return new f(t,e);c(t,e),this.re=r.re,this.im=r.im}f.prototype={re:0,im:0,sign:function(){var t=this.abs();return new f(this.re/t,this.im/t)},add:function(t,e){return c(t,e),new f(this.re+r.re,this.im+r.im)},sub:function(t,e){return c(t,e),new f(this.re-r.re,this.im-r.im)},mul:function(t,e){return c(t,e),0===r.im&&0===this.im?new f(this.re*r.re,0):new f(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(t,e){c(t,e),t=this.re,e=this.im;var n,i,o=r.re,a=r.im;return 0===a?0===o?new f(0!==t?t/0:0,0!==e?e/0:0):new f(t/o,e/o):Math.abs(o)=0)return new f(Math.pow(t,r.re),0);if(0===t)switch((r.re%4+4)%4){case 0:return new f(Math.pow(e,r.re),0);case 1:return new f(0,Math.pow(e,r.re));case 2:return new f(-Math.pow(e,r.re),0);case 3:return new f(0,-Math.pow(e,r.re))}}var n=Math.atan2(e,t),i=u(t,e);return t=Math.exp(r.re*i-r.im*n),e=r.im*i+r.re*n,new f(t*Math.cos(e),t*Math.sin(e))},sqrt:function(){var t,e,n=this.re,r=this.im,i=this.abs();if(n>=0){if(0===r)return new f(Math.sqrt(n),0);t=.5*Math.sqrt(2*(i+n))}else t=Math.abs(r)/Math.sqrt(2*(i-n));return e=n<=0?.5*Math.sqrt(2*(i-n)):Math.abs(r)/Math.sqrt(2*(i+n)),new f(t,r<0?-e:e)},exp:function(){var t=Math.exp(this.re);return this.im,new f(t*Math.cos(this.im),t*Math.sin(this.im))},log:function(){var t=this.re,e=this.im;return new f(u(t,e),Math.atan2(e,t))},abs:function(){return t=this.re,e=this.im,n=Math.abs(t),r=Math.abs(e),n<3e3&&r<3e3?Math.sqrt(n*n+r*r):(n1&&0===e,r=1-t,i=1+t,o=r*r+e*e,a=0!==o?new f((i*r-e*e)/o,(e*r+i*e)/o):new f(-1!==t?t/0:0,0!==e?e/0:0),c=a.re;return a.re=u(a.re,a.im)/2,a.im=Math.atan2(a.im,c)/2,n&&(a.im=-a.im),a},acoth:function(){var t=this.re,e=this.im;if(0===t&&0===e)return new f(0,Math.PI/2);var n=t*t+e*e;return 0!==n?new f(t/n,-e/n).atanh():new f(0!==t?t/0:0,0!==e?-e/0:0).atanh()},acsch:function(){var t=this.re,e=this.im;if(0===e)return new f(0!==t?Math.log(t+Math.sqrt(t*t+1)):1/0,0);var n=t*t+e*e;return 0!==n?new f(t/n,-e/n).asinh():new f(0!==t?t/0:0,0!==e?-e/0:0).asinh()},asech:function(){var t=this.re,e=this.im;if(0===t&&0===e)return new f(1/0,0);var n=t*t+e*e;return 0!==n?new f(t/n,-e/n).acosh():new f(0!==t?t/0:0,0!==e?-e/0:0).acosh()},inverse:function(){var t=this.re,e=this.im,n=t*t+e*e;return new f(0!==t?t/n:0,0!==e?-e/n:0)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(t){return t=Math.pow(10,t||0),new f(Math.ceil(this.re*t)/t,Math.ceil(this.im*t)/t)},floor:function(t){return t=Math.pow(10,t||0),new f(Math.floor(this.re*t)/t,Math.floor(this.im*t)/t)},round:function(t){return t=Math.pow(10,t||0),new f(Math.round(this.re*t)/t,Math.round(this.im*t)/t)},equals:function(t,e){return c(t,e),Math.abs(r.re-this.re)<=f.EPSILON&&Math.abs(r.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var t=this.re,e=this.im,n="";return isNaN(t)||isNaN(e)?"NaN":(0!==t&&(n+=t),0!==e&&(0!==t?n+=e<0?" - ":" + ":e<0&&(n+="-"),1!==(e=Math.abs(e))&&(n+=e),n+="i"),n||"0")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)}},f.ZERO=new f(0,0),f.ONE=new f(1,0),f.I=new f(0,1),f.PI=new f(Math.PI,0),f.E=new f(Math.E,0),f.EPSILON=1e-16,"function"==typeof define&&define.amd?define([],function(){return f}):"object"==typeof n?e.exports=f:t.Complex=f}(this)},{}],4:[function(t,e,n){(function(t){(function(){var r,i;r=this,i=function(){"use strict";var e=function(){},n={},r=[],i=[];function o(t,o){var a,u,c,f,s=i;for(f=arguments.length;2 ."+t+"__sectionFields {\n margin-left: 4px;\n }\n\n ."+t+"__sectionFields {\n box-sizing: border-box;\n }\n\n ."+t+"__sectionFields ."+t+"__field {\n border-bottom: 1px solid "+e.fieldBorderColor+";\n box-sizing: border-box;\n }\n\n ."+t+"__sectionFields ."+t+"__sectionFields {\n border-right: none;\n margin-right: 0;\n }\n\n ."+t+" > ."+t+"__section:first-child > ."+t+"__sectionHeading:first-child {\n border-right: 1px solid "+e.sectionHeadingBorderColor+";\n }\n\n ."+t+"__sectionHeading {\n padding: 0;\n font-family: inherit;\n user-select: none;\n -moz-user-select: -moz-none;\n text-indent: 5px;\n cursor: pointer;\n width: 100%;\n\n color: "+e.sectionHeadingColor+";\n background-color: "+e.sectionHeadingBgColor+";\n height: "+e.sectionHeadingHeight+";\n line-height: "+e.sectionHeadingHeight+";\n }\n\n ."+t+"__sectionHeading button:focus {\n background-color: "+e.sectionHeadingHoverColor+";\n }\n\n ."+t+"__sectionHeading > button {\n height: 100%;\n vertical-align: middle;\n font-size: 1.0em;\n cursor: pointer;\n text-align: left;\n outline: none;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n background: transparent;\n border: none;\n border-radius: 0;\n display: block;\n width: 100%;\n }\n\n ."+t+"__sectionHeading:hover {\n background-color: "+e.sectionHeadingHoverColor+";\n }\n\n ."+t+"__sectionHeading > button::before {\n transform: translate(0, -1px) rotate(90deg);\n }\n\n ."+t+"__sectionHeading > button::before {\n content: '▲';\n display: inline-block;\n transform-origin: 50% 50%;\n margin-right: 0.5em;\n font-size: 0.5em;\n vertical-align: middle;\n }\n\n ."+t+"__section--expanded > ."+t+"__sectionHeading > button::before {\n transform: none;\n content: '▼';\n }\n "}},rt=G.h,it={name:"tabs",component:$({init:function(){var t=this.props.field,e=Object.keys(t.value.$displayFields);this.state={activeTab:e[0]}},getRef:function(t){this.contentsEl=t},activateTab:function(t,e){this.setState({activeTab:t}),e.preventDefault()},preventDefault:function(t){},render:function(){var t=this,e=this.props.field,n=e.$config.label||e.name,r=this.props.className;e.parentField||""!==n||(n="Controls");for(var i=Object.keys(e.value.$displayFields),o={},a=0;a button:hover {\n background-color: "+e.fieldHoverColor+";\n }\n\n ."+t+"__field--button > button:active {\n background-color: "+e.fieldActiveColor+";\n }\n\n ."+t+"__field--button > button:focus {\n "+e.focusBorder+"\n }\n\n ."+t+"__field--button > button::before {\n content: '';\n width: 3px;\n display: inline-block;\n vertical-align: middle;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n }\n "}},dt=G.h,pt={name:"color",component:$({render:function(){var t=this,e=this.props.field,n=e.$config,r=this.props.className;return dt("div",{className:r+"__field "+r+"__field--color"},dt("label",{className:r+"__label",htmlFor:r+"-"+e.path},dt("span",{className:r+"__labelText"},n.label||e.name)," ",dt("span",{className:r+"__container"},dt("input",{id:r+"-"+e.path,name:e.path,type:"color",value:e.value,onInput:function(e){t.props.field.value=e.target.value}}))))}}),css:function(t,e){return"\n ."+t+"__field--color input[type=color] {\n margin: 0;\n border: 1px solid #aaa;\n width: 50px;\n height: "+e.sliderHeight+";\n border-radius: "+e.controlBorderRadius+";\n padding: 0;\n }\n\n ."+t+"__field--color input[type=color]::-webkit-color-swatch-wrapper {\n padding: 0px;\n background-color: #888;\n }\n\n ."+t+"__field--color input[type=color]:focus {\n "+e.focusBorder+"\n }\n "}},vt=G.h,gt={name:"raw",component:$({getRef:function(t){this.el=t},getContent:function(t){return this.content=t.field.value,"function"==typeof this.content&&(this.content=this.content(vt,{field:t.field,state:t.state})),this.content},render:function(){var t=this.props.className;return vt("div",{className:t+"__field--raw "+t+"__field"},vt("div",{ref:this.getRef,className:t+"__rawContent"},this.getContent(this.props)))}}),css:function(t,e){return"\n ."+t+"__field--raw {\n height: auto;\n padding: 0 7px 0 10px;\n overflow: hidden;\n }\n\n ."+t+"__rawContent {\n max-width: 100%;\n margin: 0;\n padding: 0;\n }\n\n ."+t+"__rawContent a {\n color: inherit;\n }\n\n ."+t+"__rawContent::before {\n background-color: #aaa;\n }\n\n ."+t+"__rawContent::before {\n content: '';\n width: 3px;\n display: inline-block;\n vertical-align: middle;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n }\n\n ."+t+"__rawContent > p:first-child {\n margin-top: 5px;\n }\n\n ."+t+"__rawContent > p:last-child{\n margin-bottom: 5px;\n }\n\n ."+t+"__rawContent p {\n line-height: 1.8;\n }\n\n ."+t+"__rawContent pre {\n line-height: 1.3;\n font-size: 0.8em;\n margin: 0;\n }\n "}},yt=function(){var t={};function e(e,n){(n=W(n||{},{containerCSS:"position:fixed;top:0;right:8px",style:!0,className:"controlPanel-"+Math.random().toString(36).substring(2,15)})).root=n.root||document.body;var r=n.className,i=$({render:function(){return G.h(function(e){var n=t[e];if(!n)throw new Error('Unrecognized component, "'+e+'"');return n}(this.props.field.type).component,{ControlComponent:i,className:r,field:this.props.field,state:e,h:G.h})}}),o=$({state:{dummy:0},componentDidMount:function(){var t=this;this.props.state.$field.onChanges(function(e){t.setState({dummy:t.state.dummy+1})})},getRef:function(t){for(var e=["mousedown","mouseup","mousemove","touchstart","touchmove","touchend","wheel"],r=0;r button::before { background-color: #8ff; }\n\n "+Object.keys(n).map(function(r){var i=n[r].css;return i?i(t,e):""}).join("\n")+"\n "}(r,n.theme,t)),G.render(G.h(o,{state:e}),n.root),e}return e.registerComponent=function(n){return t[n.name]=n,e},e.registerComponents=function(t){for(var n=0;ne?1:t>=e?0:NaN}function n(t){var n;return 1===t.length&&(n=t,t=function(t,r){return e(n(t),r)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}var r=n(e),i=r.right,o=r.left;function a(t,e){return[t,e]}function u(t){return null===t?NaN:+t}function c(t,e){var n,r,i=t.length,o=0,a=-1,c=0,f=0;if(null==e)for(;++a1)return f/(o-1)}function f(t,e){var n=c(t,e);return n?Math.sqrt(n):n}function s(t,e){var n,r,i,o=t.length,a=-1;if(null==e){for(;++a=n)for(r=i=n;++an&&(r=n),i=n)for(r=i=n;++an&&(r=n),i=0?(o>=y?10:o>=b?5:o>=m?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=y?10:o>=b?5:o>=m?2:1)}function x(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=y?i*=10:o>=b?i*=5:o>=m&&(i*=2),e=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function A(t,e){var n,r,i=t.length,o=-1;if(null==e){for(;++o=n)for(r=n;++on&&(r=n)}else for(;++o=n)for(r=n;++on&&(r=n);return r}function k(t){if(!(i=t.length))return[];for(var e=-1,n=A(t,E),r=new Array(n);++et?1:e>=t?0:NaN},t.deviation=f,t.extent=s,t.histogram=function(){var t=v,e=s,n=w;function r(r){var o,a,u=r.length,c=new Array(u);for(o=0;ol;)h.pop(),--d;var p,v=new Array(d+1);for(o=0;o<=d;++o)(p=v[o]=[]).x0=o>0?h[o-1]:s,p.x1=o=n)for(r=n;++or&&(r=n)}else for(;++o=n)for(r=n;++or&&(r=n);return r},t.mean=function(t,e){var n,r=t.length,i=r,o=-1,a=0;if(null==e)for(;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n},t.min=A,t.pairs=function(t,e){null==e&&(e=a);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n0)return[t];if((r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++u0&&(n=i-T),I<0?E=S-z:I>0&&(a=x-z),R=s,K.attr("cursor",g.selection),nt());break;default:return}c()},!0).on("keyup.brush",function(){switch(e.event.keyCode){case 16:$&&(P=D=$=!1,nt());break;case 18:R===h&&(L<0?w=M:L>0&&(n=i),I<0?E=S:I>0&&(a=x),R=l,nt());break;case 32:R===s&&(e.event.altKey?(L&&(w=M-T*L,n=i+T*L),I&&(E=S-z*I,a=x+z*I),R=h):(L<0?w=M:L>0&&(n=i),I<0?E=S:I>0&&(a=x),R=l),K.attr("cursor",g[F]),nt());break;default:return}c()},!0).on("mousemove.brush",et,!0).on("mouseup.brush",rt,!0);r.dragDisable(e.event.view)}u(),o.interrupt(B),O.call(B),Z.start()}function et(){var t=e.mouse(B);!$||P||D||(Math.abs(t[0]-Q[0])>Math.abs(t[1]-Q[1])?D=!0:P=!0),Q=t,j=!0,c(),nt()}function nt(){var t;switch(T=Q[0]-X[0],z=Q[1]-X[1],R){case s:case f:L&&(T=Math.max(V-n,Math.min(W-w,T)),i=n+T,M=w+T),I&&(z=Math.max(Y-a,Math.min(G-E,z)),x=a+z,S=E+z);break;case l:L<0?(T=Math.max(V-n,Math.min(W-n,T)),i=n+T,M=w):L>0&&(T=Math.max(V-w,Math.min(W-w,T)),i=n,M=w+T),I<0?(z=Math.max(Y-a,Math.min(G-a,z)),x=a+z,S=E):I>0&&(z=Math.max(Y-E,Math.min(G-E,z)),x=a,S=E+z);break;case h:L&&(i=Math.max(V,Math.min(W,n-T*L)),M=Math.max(V,Math.min(W,w+T*L))),I&&(x=Math.max(Y,Math.min(G,a-z*I)),S=Math.max(Y,Math.min(G,E+z*I)))}M=c.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var u,f,l,h=-1,d=r.length,p=c[i++],v=n(),g=o();++hc.length)return n;var i,o=f[r-1];return null!=e&&r>=c.length?i=n.entries():(i=[],n.each(function(e,n){i.push({key:n,values:t(e,r)})})),null!=o?i.sort(function(t,e){return o(t.key,e.key)}):i}(s(t,0,o,a),0)},key:function(t){return c.push(t),u},sortKeys:function(t){return f[c.length-1]=t,u},sortValues:function(e){return t=e,u},rollup:function(t){return e=t,u}}},t.set=f,t.map=n,t.keys=function(t){var e=[];for(var n in t)e.push(n);return e},t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],17:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function n(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function r(){}var i="\\s*([+-]?\\d+)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3})$/,c=/^#([0-9a-f]{6})$/,f=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),s=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),l=new RegExp("^rgba\\("+[i,i,i,o]+"\\)$"),h=new RegExp("^rgba\\("+[a,a,a,o]+"\\)$"),d=new RegExp("^hsl\\("+[o,a,a]+"\\)$"),p=new RegExp("^hsla\\("+[o,a,a,o]+"\\)$"),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function g(t){var e;return t=(t+"").trim().toLowerCase(),(e=u.exec(t))?new x((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=c.exec(t))?y(parseInt(e[1],16)):(e=f.exec(t))?new x(e[1],e[2],e[3],1):(e=s.exec(t))?new x(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=l.exec(t))?b(e[1],e[2],e[3],e[4]):(e=h.exec(t))?b(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=d.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?y(v[t]):"transparent"===t?new x(NaN,NaN,NaN,0):null}function y(t){return new x(t>>16&255,t>>8&255,255&t,1)}function b(t,e,n,r){return r<=0&&(t=e=n=NaN),new x(t,e,n,r)}function m(t){return t instanceof r||(t=g(t)),t?new x((t=t.rgb()).r,t.g,t.b,t.opacity):new x}function _(t,e,n,r){return 1===arguments.length?m(t):new x(t,e,n,null==r?1:r)}function x(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function w(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function M(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new k(t,e,n,r)}function A(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof k)return new k(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=g(t)),!t)return new k;if(t instanceof k)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,o=Math.min(e,n,i),a=Math.max(e,n,i),u=NaN,c=a-o,f=(a+o)/2;return c?(u=e===a?(n-i)/c+6*(n0&&f<1?0:u,new k(u,c,f,t.opacity)}(t):new k(t,e,n,null==i?1:i)}function k(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function E(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}e(r,g,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),e(x,_,n(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+w(this.r)+w(this.g)+w(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),e(k,A,n(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new k(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new k(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new x(E(t>=240?t-240:t+120,i,r),E(t,i,r),E(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var C=Math.PI/180,S=180/Math.PI,T=.96422,z=1,O=.82521,N=4/29,j=6/29,P=3*j*j,D=j*j*j;function B(t){if(t instanceof R)return new R(t.l,t.a,t.b,t.opacity);if(t instanceof Y){if(isNaN(t.h))return new R(t.l,0,0,t.opacity);var e=t.h*C;return new R(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof x||(t=m(t));var n,r,i=q(t.r),o=q(t.g),a=q(t.b),u=L((.2225045*i+.7168786*o+.0606169*a)/z);return i===o&&o===a?n=r=u:(n=L((.4360747*i+.3850649*o+.1430804*a)/T),r=L((.0139322*i+.0971045*o+.7141733*a)/O)),new R(116*u-16,500*(n-u),200*(u-r),t.opacity)}function F(t,e,n,r){return 1===arguments.length?B(t):new R(t,e,n,null==r?1:r)}function R(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function L(t){return t>D?Math.pow(t,1/3):t/P+N}function I(t){return t>j?t*t*t:P*(t-N)}function U(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function q(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function H(t){if(t instanceof Y)return new Y(t.h,t.c,t.l,t.opacity);if(t instanceof R||(t=B(t)),0===t.a&&0===t.b)return new Y(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*S;return new Y(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function V(t,e,n,r){return 1===arguments.length?H(t):new Y(t,e,n,null==r?1:r)}function Y(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}e(R,F,n(r,{brighter:function(t){return new R(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new R(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new x(U(3.1338561*(e=T*I(e))-1.6168667*(t=z*I(t))-.4906146*(n=O*I(n))),U(-.9787684*e+1.9161415*t+.033454*n),U(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),e(Y,V,n(r,{brighter:function(t){return new Y(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Y(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return B(this).rgb()}}));var W=-.14861,G=1.78277,$=-.29227,X=-.90649,Q=1.97294,Z=Q*X,J=Q*G,K=G*$-X*W;function tt(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof et)return new et(t.h,t.s,t.l,t.opacity);t instanceof x||(t=m(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(K*r+Z*e-J*n)/(K+Z-J),o=r-i,a=(Q*(n-i)-$*o)/X,u=Math.sqrt(a*a+o*o)/(Q*i*(1-i)),c=u?Math.atan2(a,o)*S-120:NaN;return new et(c<0?c+360:c,u,i,t.opacity)}(t):new et(t,e,n,null==r?1:r)}function et(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}e(et,tt,n(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new et(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new et(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*C,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new x(255*(e+n*(W*r+G*i)),255*(e+n*($*r+X*i)),255*(e+n*(Q*r)),this.opacity)}})),t.color=g,t.rgb=_,t.hsl=A,t.lab=F,t.hcl=V,t.lch=function(t,e,n,r){return 1===arguments.length?H(t):new Y(n,e,t,null==r?1:r)},t.gray=function(t,e){return new R(t,0,0,null==e?1:e)},t.cubehelix=tt,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],18:[function(t,e,n){var r,i;r=this,i=function(t,e){"use strict";var n=Array.prototype.slice;function r(t,e){return t-e}function i(t){return function(){return t}}function o(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(d-s)*(r-l)/(p-l)+s&&(i=-i)}return i}function u(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function c(){}var f=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function s(){var t=1,a=1,u=e.thresholdSturges,s=p;function l(t){var n=u(t);if(Array.isArray(n))n=n.slice().sort(r);else{var i=e.extent(t),o=i[0],a=i[1];n=e.tickStep(o,a,n),n=e.range(Math.floor(o/n)*n,Math.floor(a/n)*n,n)}return n.map(function(e){return h(t,e)})}function h(e,n){var r=[],i=[];return function(e,n,r){var i,o,u,c,s,l,h=new Array,p=new Array;i=o=-1,c=e[0]>=n,f[c<<1].forEach(v);for(;++i=n,f[u|c<<1].forEach(v);f[c<<0].forEach(v);for(;++o=n,s=e[o*t]>=n,f[c<<1|s<<2].forEach(v);++i=n,l=s,s=e[o*t+i+1]>=n,f[u|c<<1|s<<2|l<<3].forEach(v);f[c|s<<3].forEach(v)}i=-1,s=e[o*t]>=n,f[s<<2].forEach(v);for(;++i=n,f[s<<2|l<<3].forEach(v);function v(t){var e,n,a=[t[0][0]+i,t[0][1]+o],u=[t[1][0]+i,t[1][1]+o],c=d(a),f=d(u);(e=p[c])?(n=h[f])?(delete p[e.end],delete h[n.start],e===n?(e.ring.push(u),r(e.ring)):h[e.start]=p[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete p[e.end],e.ring.push(u),p[e.end=f]=e):(e=h[f])?(n=p[c])?(delete h[e.start],delete p[n.end],e===n?(e.ring.push(u),r(e.ring)):h[n.start]=p[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(a),h[e.start=c]=e):h[c]=p[f]={start:c,end:f,ring:[a,u]}}f[s<<3].forEach(v)}(e,n,function(t){s(t,e,n),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?r.push([t]):i.push(t)}),i.forEach(function(t){for(var e,n=0,i=r.length;n0&&o0&&u0&&r>0))throw new Error("invalid size");return t=n,a=r,l},l.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?i(n.call(t)):i(t),l):u},l.smooth=function(t){return arguments.length?(s=t?p:c,l):s===p},l}function l(t,e,n){for(var r=t.width,i=t.height,o=1+(n<<1),a=0;a=n&&(u>=o&&(c-=t.data[u-o+a*r]),e.data[u-n+a*r]=c/Math.min(u+1,r-1+o-u,o))}function h(t,e,n){for(var r=t.width,i=t.height,o=1+(n<<1),a=0;a=n&&(u>=o&&(c-=t.data[a+(u-o)*r]),e.data[a+(u-n)*r]=c/Math.min(u+1,i-1+o-u,o))}function d(t){return t[0]}function p(t){return t[1]}function v(){return 1}t.contours=s,t.contourDensity=function(){var t=d,r=p,o=v,a=960,u=500,c=20,f=2,g=3*c,y=a+2*g>>f,b=u+2*g>>f,m=i(20);function _(n){var i=new Float32Array(y*b),a=new Float32Array(y*b);n.forEach(function(e,n,a){var u=+t(e,n,a)+g>>f,c=+r(e,n,a)+g>>f,s=+o(e,n,a);u>=0&&u=0&&c>f),h({width:y,height:b,data:a},{width:y,height:b,data:i},c>>f),l({width:y,height:b,data:i},{width:y,height:b,data:a},c>>f),h({width:y,height:b,data:a},{width:y,height:b,data:i},c>>f),l({width:y,height:b,data:i},{width:y,height:b,data:a},c>>f),h({width:y,height:b,data:a},{width:y,height:b,data:i},c>>f);var u=m(i);if(!Array.isArray(u)){var d=e.max(i);u=e.tickStep(0,d,u),(u=e.range(0,Math.floor(d/u)*u,u)).shift()}return s().thresholds(u).size([y,b])(i).map(x)}function x(t){return t.value*=Math.pow(2,-2*f),t.coordinates.forEach(w),t}function w(t){t.forEach(M)}function M(t){t.forEach(A)}function A(t){t[0]=t[0]*Math.pow(2,f)-g,t[1]=t[1]*Math.pow(2,f)-g}function k(){return y=a+2*(g=3*c)>>f,b=u+2*g>>f,_}return _.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),_):t},_.y=function(t){return arguments.length?(r="function"==typeof t?t:i(+t),_):r},_.weight=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),_):o},_.size=function(t){if(!arguments.length)return[a,u];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return a=e,u=n,k()},_.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return f=Math.floor(Math.log(t)/Math.LN2),k()},_.thresholds=function(t){return arguments.length?(m="function"==typeof t?t:Array.isArray(t)?i(n.call(t)):i(t),_):m},_.bandwidth=function(t){if(!arguments.length)return Math.sqrt(c*(c+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return c=Math.round((Math.sqrt(4*t*t+1)-1)/2),k()},_},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],i):i(r.d3=r.d3||{},r.d3)},{"d3-array":12}],19:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e={value:function(){}};function n(){for(var t,e=0,n=arguments.length,i={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),c=-1,f=u.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++c0)for(var n,r,i=new Array(n),o=0;oM}_.mouse("drag")}function C(){e.select(e.event.view).on("mousemove.drag mouseup.drag",null),a(e.event.view,p),i(),_.mouse("end")}function S(){if(g.apply(this,arguments)){var t,n,i=e.event.changedTouches,o=y.apply(this,arguments),a=i.length;for(t=0;t9999?"+"+c(e,6):c(e,4))+"-"+c(t.getUTCMonth()+1,2)+"-"+c(t.getUTCDate(),2)+(o?"T"+c(n,2)+":"+c(r,2)+":"+c(i,2)+"."+c(o,3)+"Z":i?"T"+c(n,2)+":"+c(r,2)+":"+c(i,2)+"Z":r||n?"T"+c(n,2)+":"+c(r,2)+"Z":"")}function s(t){var c=new RegExp('["'+t+"\n\r]"),s=t.charCodeAt(0);function l(t,a){var u,c=[],f=t.length,l=0,h=0,d=f<=0,p=!1;function v(){if(d)return n;if(p)return p=!1,e;var a,u,c=l;if(t.charCodeAt(c)===r){for(;l++=f?d=!0:(u=t.charCodeAt(l++))===i?p=!0:u===o&&(p=!0,t.charCodeAt(l)===i&&++l),t.slice(c+1,a-1).replace(/""/g,'"')}for(;lh+f||rd+f||os.index){var l=h-u.x-u.vx,g=d-u.y-u.vy,y=l*l+g*g;yt.r&&(t.r=t[e].r)}function h(){if(n){var e,i,o=n.length;for(r=new Array(o),e=0;e=f)){(t.data!==n||t.next)&&(0===l&&(p+=(l=a())*l),0===h&&(p+=(h=a())*h),p1?(null==n?s.remove(t):s.set(t,b(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,u,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(h.on(t,n),e):h.on(t)}}},t.forceX=function(t){var e,n,r,i=o(.1);function a(t){for(var i,o=0,a=e.length;o1?r[0]+r.slice(2):r,+t.slice(n+1)]}function n(t){return(t=e(Math.abs(t)))?t[1]:NaN}var r,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(t){return new a(t)}function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}function u(t,n){var r=e(t,n);if(!r)return t+"";var i=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}o.prototype=a.prototype,a.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var c={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return u(100*t,e)},r:u,s:function(t,n){var i=e(t,n);if(!i)return t+"";var o=i[0],a=i[1],u=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,c=o.length;return u===c?o:u>c?o+new Array(u-c+1).join("0"):u>0?o.slice(0,u)+"."+o.slice(u):"0."+new Array(1-u).join("0")+e(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function f(t){return t}var s,l=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function h(t){var e,i,a=t.grouping&&t.thousands?(e=t.grouping,i=t.thousands,function(t,n){for(var r=t.length,o=[],a=0,u=e[0],c=0;r>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),o.push(t.substring(r-=u,r+u)),!((c+=u+1)>n));)u=e[a=(a+1)%e.length];return o.reverse().join(i)}):f,u=t.currency,s=t.decimal,h=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(t.numerals):f,d=t.percent||"%";function p(t){var e=(t=o(t)).fill,n=t.align,i=t.sign,f=t.symbol,p=t.zero,v=t.width,g=t.comma,y=t.precision,b=t.trim,m=t.type;"n"===m?(g=!0,m="g"):c[m]||(null==y&&(y=12),b=!0,m="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var _="$"===f?u[0]:"#"===f&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",x="$"===f?u[1]:/[%p]/.test(m)?d:"",w=c[m],M=/[defgprs%]/.test(m);function A(t){var o,u,c,f=_,d=x;if("c"===m)d=w(t)+d,t="";else{var A=(t=+t)<0;if(t=w(Math.abs(t),y),b&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),A&&0==+t&&(A=!1),f=(A?"("===i?i:"-":"-"===i||"("===i?"":i)+f,d=("s"===m?l[8+r/3]:"")+d+(A&&"("===i?")":""),M)for(o=-1,u=t.length;++o(c=t.charCodeAt(o))||c>57){d=(46===c?s+t.slice(o+1):t.slice(o))+d,t=t.slice(0,o);break}}g&&!p&&(t=a(t,1/0));var k=f.length+t.length+d.length,E=k>1)+f+t+d+E.slice(k);break;default:t=E+f+t+d}return h(t)}return y=null==y?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),A.toString=function(){return t+""},A}return{format:p,formatPrefix:function(t,e){var r=p(((t=o(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(n(e)/3))),a=Math.pow(10,-i),u=l[8+i/3];return function(t){return r(a*t)+u}}}}function d(e){return s=h(e),t.format=s.format,t.formatPrefix=s.formatPrefix,s}d({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),t.formatDefaultLocale=d,t.formatLocale=h,t.formatSpecifier=o,t.precisionFixed=function(t){return Math.max(0,-n(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(n(e)/3)))-n(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,n(e)-n(t))+1},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],26:[function(t,e,n){var r,i;r=this,i=function(t,e){"use strict";function n(){return new r}function r(){this.reset()}r.prototype={constructor:r,reset:function(){this.s=this.t=0},add:function(t){o(i,t,this.t),o(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new r;function o(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var a=1e-6,u=1e-12,c=Math.PI,f=c/2,s=c/4,l=2*c,h=180/c,d=c/180,p=Math.abs,v=Math.atan,g=Math.atan2,y=Math.cos,b=Math.ceil,m=Math.exp,_=Math.log,x=Math.pow,w=Math.sin,M=Math.sign||function(t){return t>0?1:t<0?-1:0},A=Math.sqrt,k=Math.tan;function E(t){return t>1?0:t<-1?c:Math.acos(t)}function C(t){return t>1?f:t<-1?-f:Math.asin(t)}function S(t){return(t=w(t/2))*t}function T(){}function z(t,e){t&&N.hasOwnProperty(t.type)&&N[t.type](t,e)}var O={Feature:function(t,e){z(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=y(e),a=w(e),u=I*a,c=L*o+u*y(i),f=u*r*w(i);U.add(g(f,c)),R=t,L=o,I=a}function $(t){return[g(t[1],t[0]),C(t[2])]}function X(t){var e=t[0],n=t[1],r=y(n);return[r*y(e),r*w(e),w(n)]}function Q(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Z(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function J(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function K(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tt(t){var e=A(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var et,nt,rt,it,ot,at,ut,ct,ft,st,lt,ht,dt,pt,vt,gt,yt,bt,mt,_t,xt,wt,Mt,At,kt,Et,Ct=n(),St={point:Tt,lineStart:Ot,lineEnd:Nt,polygonStart:function(){St.point=jt,St.lineStart=Pt,St.lineEnd=Dt,Ct.reset(),H.polygonStart()},polygonEnd:function(){H.polygonEnd(),St.point=Tt,St.lineStart=Ot,St.lineEnd=Nt,U<0?(et=-(rt=180),nt=-(it=90)):Ct>a?it=90:Ct<-a&&(nt=-90),st[0]=et,st[1]=rt}};function Tt(t,e){ft.push(st=[et=t,rt=t]),eit&&(it=e)}function zt(t,e){var n=X([t*d,e*d]);if(ct){var r=Z(ct,n),i=Z([r[1],-r[0],0],r);tt(i),i=$(i);var o,a=t-ot,u=a>0?1:-1,c=i[0]*h*u,f=p(a)>180;f^(u*otit&&(it=o):f^(u*ot<(c=(c+360)%360-180)&&cit&&(it=e)),f?tBt(et,rt)&&(rt=t):Bt(t,rt)>Bt(et,rt)&&(et=t):rt>=et?(trt&&(rt=t)):t>ot?Bt(et,t)>Bt(et,rt)&&(rt=t):Bt(t,rt)>Bt(et,rt)&&(et=t)}else ft.push(st=[et=t,rt=t]);eit&&(it=e),ct=n,ot=t}function Ot(){St.point=zt}function Nt(){st[0]=et,st[1]=rt,St.point=Tt,ct=null}function jt(t,e){if(ct){var n=t-ot;Ct.add(p(n)>180?n+(n>0?360:-360):n)}else at=t,ut=e;H.point(t,e),zt(t,e)}function Pt(){H.lineStart()}function Dt(){jt(at,ut),H.lineEnd(),p(Ct)>a&&(et=-(rt=180)),st[0]=et,st[1]=rt,ct=null}function Bt(t,e){return(e-=t)<0?e+360:e}function Ft(t,e){return t[0]-e[0]}function Rt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:ec?t+Math.round(-t/l)*l:t,e]}function Kt(t,e,n){return(t%=l)?e||n?Zt(ee(t),ne(e,n)):ee(t):e||n?ne(e,n):Jt}function te(t){return function(e,n){return[(e+=t)>c?e-l:e<-c?e+l:e,n]}}function ee(t){var e=te(t);return e.invert=te(-t),e}function ne(t,e){var n=y(t),r=w(t),i=y(e),o=w(e);function a(t,e){var a=y(e),u=y(t)*a,c=w(t)*a,f=w(e),s=f*n+u*r;return[g(c*i-s*o,u*n-f*r),C(s*i+c*o)]}return a.invert=function(t,e){var a=y(e),u=y(t)*a,c=w(t)*a,f=w(e),s=f*i-c*o;return[g(c*i+f*o,u*n+s*r),C(s*n-u*r)]},a}function re(t){function e(e){return(e=t(e[0]*d,e[1]*d))[0]*=h,e[1]*=h,e}return t=Kt(t[0]*d,t[1]*d,t.length>2?t[2]*d:0),e.invert=function(e){return(e=t.invert(e[0]*d,e[1]*d))[0]*=h,e[1]*=h,e},e}function ie(t,e,n,r,i,o){if(n){var a=y(e),u=w(e),c=r*n;null==i?(i=e+r*l,o=e-c/2):(i=oe(a,i),o=oe(a,o),(r>0?io)&&(i+=r*l));for(var f,s=i;r>0?s>o:s1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ue(t,e){return p(t[0]-e[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function se(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,P=j*N,D=P>c,B=M*z;if(le.add(g(B*j*w(P),A*O+B*y(P))),u+=D?N+j*l:N,D^_>=n^S>=n){var F=Z(X(m),X(E));tt(F);var R=Z(o,F);tt(R);var L=(D^N>=0?-1:1)*C(R[2]);(r>L||r===L&&(F[0]||F[1]))&&(h+=D^N>=0?1:-1)}}return(u<-a||u0){for(h||(o.polygonStart(),h=!0),o.lineStart(),t=0;t1&&2&i&&f.push(f.pop().concat(f.shift())),u.push(f.filter(pe))}return d}}function pe(t){return t.length>1}function ve(t,e){return((t=t.x)[0]<0?t[1]-f-a:f-t[1])-((e=e.x)[0]<0?e[1]-f-a:f-e[1])}var ge=de(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,u){var s=o>0?c:-c,l=p(o-n);p(l-c)0?f:-f),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&l>=c&&(p(n-i)a?v((w(e)*(o=y(r))*w(n)-w(r)*(i=y(e))*w(t))/(i*o*u)):(e+r)/2}(n,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=u),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*f,r.point(-c,i),r.point(0,i),r.point(c,i),r.point(c,0),r.point(c,-i),r.point(0,-i),r.point(-c,-i),r.point(-c,0),r.point(-c,i);else if(p(t[0]-e[0])>a){var o=t[0]0,i=p(e)>a;function o(t,n){return y(t)*y(n)>e}function u(t,n,r){var i=[1,0,0],o=Z(X(t),X(n)),u=Q(o,o),f=o[0],s=u-f*f;if(!s)return!r&&t;var l=e*u/s,h=-e*f/s,d=Z(i,o),v=K(i,l);J(v,K(o,h));var g=d,y=Q(v,g),b=Q(g,g),m=y*y-b*(Q(v,v)-1);if(!(m<0)){var _=A(m),x=K(g,(-y-_)/b);if(J(x,v),x=$(x),!r)return x;var w,M=t[0],k=n[0],E=t[1],C=n[1];k0^x[1]<(p(x[0]-M)c^(M<=x[0]&&x[0]<=k)){var z=K(g,(-y+_)/b);return J(z,v),[x,$(z)]}}}function f(e,n){var i=r?t:c-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return de(o,function(t){var e,n,s,l,h;return{lineStart:function(){l=s=!1,h=1},point:function(d,p){var v,g=[d,p],y=o(d,p),b=r?y?0:f(d,p):y?f(d+(d<0?c:-c),p):0;if(!e&&(l=s=y)&&t.lineStart(),y!==s&&(!(v=u(e,g))||ue(e,v)||ue(g,v))&&(g[0]+=a,g[1]+=a,y=o(g[0],g[1])),y!==s)h=0,y?(t.lineStart(),v=u(g,e),t.point(v[0],v[1])):(v=u(e,g),t.point(v[0],v[1]),t.lineEnd()),e=v;else if(i&&e&&r^y){var m;b&n||!(m=u(g,e,!0))||(h=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!y||e&&ue(e,g)||t.point(g[0],g[1]),e=g,s=y,n=b},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return h|(l&&s)<<1}}},function(e,r,i,o){ie(o,t,n,i,e,r)},r?[0,-t]:[-c,t-c])}var be=1e9,me=-be;function _e(t,n,r,i){function o(e,o){return t<=e&&e<=r&&n<=o&&o<=i}function u(e,o,a,u){var f=0,l=0;if(null==e||(f=c(e,a))!==(l=c(o,a))||s(e,o)<0^a>0)do{u.point(0===f||3===f?t:r,f>1?i:n)}while((f=(f+a+4)%4)!==l);else u.point(o[0],o[1])}function c(e,i){return p(e[0]-t)0?0:3:p(e[0]-r)0?2:1:p(e[1]-n)0?1:0:i>0?3:2}function f(t,e){return s(t.x,e.x)}function s(t,e){var n=c(t,1),r=c(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,s,l,h,d,p,v,g,y,b,m,_=a,x=ae(),w={point:M,lineStart:function(){w.point=A,s&&s.push(l=[]);b=!0,y=!1,v=g=NaN},lineEnd:function(){c&&(A(h,d),p&&y&&x.rejoin(),c.push(x.result()));w.point=M,y&&_.lineEnd()},polygonStart:function(){_=x,c=[],s=[],m=!0},polygonEnd:function(){var n=function(){for(var e=0,n=0,r=s.length;ni&&(h-o)*(i-a)>(d-a)*(t-o)&&++e:d<=i&&(h-o)*(i-a)<(d-a)*(t-o)&&--e;return e}(),r=m&&n,o=(c=e.merge(c)).length;(r||o)&&(a.polygonStart(),r&&(a.lineStart(),u(null,null,1,a),a.lineEnd()),o&&fe(c,f,n,u,a),a.polygonEnd());_=a,c=s=l=null}};function M(t,e){o(t,e)&&_.point(t,e)}function A(e,a){var u=o(e,a);if(s&&l.push([e,a]),b)h=e,d=a,p=u,b=!1,u&&(_.lineStart(),_.point(e,a));else if(u&&y)_.point(e,a);else{var c=[v=Math.max(me,Math.min(be,v)),g=Math.max(me,Math.min(be,g))],f=[e=Math.max(me,Math.min(be,e)),a=Math.max(me,Math.min(be,a))];!function(t,e,n,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=e[0]-u,h=e[1]-c;if(a=n-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(e[0]=u+s*l,e[1]=c+s*h),!0}}}}}(c,f,t,n,r,i)?u&&(_.lineStart(),_.point(e,a),m=!1):(y||(_.lineStart(),_.point(c[0],c[1])),_.point(f[0],f[1]),u||_.lineEnd(),m=!1)}v=e,g=a,y=u}return w}}var xe,we,Me,Ae=n(),ke={sphere:T,point:T,lineStart:function(){ke.point=Ce,ke.lineEnd=Ee},lineEnd:T,polygonStart:T,polygonEnd:T};function Ee(){ke.point=ke.lineEnd=T}function Ce(t,e){xe=t*=d,we=w(e*=d),Me=y(e),ke.point=Se}function Se(t,e){t*=d;var n=w(e*=d),r=y(e),i=p(t-xe),o=y(i),a=r*w(i),u=Me*n-we*r*o,c=we*n+Me*r*o;Ae.add(g(A(a*a+u*u),c)),xe=t,we=n,Me=r}function Te(t){return Ae.reset(),D(t,ke),+Ae}var ze=[null,null],Oe={type:"LineString",coordinates:ze};function Ne(t,e){return ze[0]=t,ze[1]=e,Te(Oe)}var je={Feature:function(t,e){return De(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++ra}).map(s)).concat(e.range(b(u/g)*g,o,g).filter(function(t){return p(t%m)>a}).map(l))}return x.lines=function(){return w().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(d(c).slice(1),h(r).reverse().slice(1),d(f).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.extentMajor(t).extentMinor(t):x.extentMinor()},x.extentMajor=function(t){return arguments.length?(i=+t[0][0],r=+t[1][0],f=+t[0][1],c=+t[1][1],i>r&&(t=i,i=r,r=t),f>c&&(t=f,f=c,c=t),x.precision(_)):[[i,f],[r,c]]},x.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],u=+e[0][1],o=+e[1][1],n>t&&(e=n,n=t,t=e),u>o&&(e=u,u=o,o=e),x.precision(_)):[[n,u],[t,o]]},x.step=function(t){return arguments.length?x.stepMajor(t).stepMinor(t):x.stepMinor()},x.stepMajor=function(t){return arguments.length?(y=+t[0],m=+t[1],x):[y,m]},x.stepMinor=function(t){return arguments.length?(v=+t[0],g=+t[1],x):[v,g]},x.precision=function(e){return arguments.length?(_=+e,s=Ue(u,o,90),l=qe(n,t,_),h=Ue(f,c,90),d=qe(i,r,_),x):_},x.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function Ve(t){return t}var Ye,We,Ge,$e,Xe=n(),Qe=n(),Ze={point:T,lineStart:T,lineEnd:T,polygonStart:function(){Ze.lineStart=Je,Ze.lineEnd=en},polygonEnd:function(){Ze.lineStart=Ze.lineEnd=Ze.point=T,Xe.add(p(Qe)),Qe.reset()},result:function(){var t=Xe/2;return Xe.reset(),t}};function Je(){Ze.point=Ke}function Ke(t,e){Ze.point=tn,Ye=Ge=t,We=$e=e}function tn(t,e){Qe.add($e*t-Ge*e),Ge=t,$e=e}function en(){tn(Ye,We)}var nn=1/0,rn=nn,on=-nn,an=on,un={point:function(t,e){ton&&(on=t);ean&&(an=e)},lineStart:T,lineEnd:T,polygonStart:T,polygonEnd:T,result:function(){var t=[[nn,rn],[on,an]];return on=an=-(rn=nn=1/0),t}};var cn,fn,sn,ln,hn=0,dn=0,pn=0,vn=0,gn=0,yn=0,bn=0,mn=0,_n=0,xn={point:wn,lineStart:Mn,lineEnd:En,polygonStart:function(){xn.lineStart=Cn,xn.lineEnd=Sn},polygonEnd:function(){xn.point=wn,xn.lineStart=Mn,xn.lineEnd=En},result:function(){var t=_n?[bn/_n,mn/_n]:yn?[vn/yn,gn/yn]:pn?[hn/pn,dn/pn]:[NaN,NaN];return hn=dn=pn=vn=gn=yn=bn=mn=_n=0,t}};function wn(t,e){hn+=t,dn+=e,++pn}function Mn(){xn.point=An}function An(t,e){xn.point=kn,wn(sn=t,ln=e)}function kn(t,e){var n=t-sn,r=e-ln,i=A(n*n+r*r);vn+=i*(sn+t)/2,gn+=i*(ln+e)/2,yn+=i,wn(sn=t,ln=e)}function En(){xn.point=wn}function Cn(){xn.point=Tn}function Sn(){zn(cn,fn)}function Tn(t,e){xn.point=zn,wn(cn=sn=t,fn=ln=e)}function zn(t,e){var n=t-sn,r=e-ln,i=A(n*n+r*r);vn+=i*(sn+t)/2,gn+=i*(ln+e)/2,yn+=i,bn+=(i=ln*t-sn*e)*(sn+t),mn+=i*(ln+e),_n+=3*i,wn(sn=t,ln=e)}function On(t){this._context=t}On.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,l)}},result:T};var Nn,jn,Pn,Dn,Bn,Fn=n(),Rn={point:T,lineStart:function(){Rn.point=Ln},lineEnd:function(){Nn&&In(jn,Pn),Rn.point=T},polygonStart:function(){Nn=!0},polygonEnd:function(){Nn=null},result:function(){var t=+Fn;return Fn.reset(),t}};function Ln(t,e){Rn.point=In,jn=Dn=t,Pn=Bn=e}function In(t,e){Dn-=t,Bn-=e,Fn.add(A(Dn*Dn+Bn*Bn)),Dn=t,Bn=e}function Un(){this._string=[]}function qn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Hn(t){return function(e){var n=new Vn;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Vn(){}function Yn(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),D(n,t.stream(un)),e(un.result()),null!=r&&t.clipExtent(r),t}function Wn(t,e,n){return Yn(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,u])},n)}function Gn(t,e,n){return Wn(t,[[0,0],e],n)}function $n(t,e,n){return Yn(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])},n)}function Xn(t,e,n){return Yn(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])},n)}Un.prototype={_radius:4.5,_circle:qn(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=qn(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Vn.prototype={constructor:Vn,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Qn=16,Zn=y(30*d);function Jn(t,e){return+e?function(t,e){function n(r,i,o,u,c,f,s,l,h,d,v,y,b,m){var _=s-r,x=l-i,w=_*_+x*x;if(w>4*e&&b--){var M=u+d,k=c+v,E=f+y,S=A(M*M+k*k+E*E),T=C(E/=S),z=p(p(E)-1)e||p((_*P+x*D)/w-.5)>.3||u*d+c*v+f*y2?t[2]%360*d:0,z()):[b*h,m*h,_*h]},S.angle=function(t){return arguments.length?(x=t%360*d,z()):x*h},S.precision=function(t){return arguments.length?(a=Jn(u,C=t*t),O()):A(C)},S.fitExtent=function(t,e){return Wn(S,t,e)},S.fitSize=function(t,e){return Gn(S,t,e)},S.fitWidth=function(t,e){return $n(S,t,e)},S.fitHeight=function(t,e){return Xn(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&T,z()}}function rr(t){var e=0,n=c/3,r=nr(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*d,n=t[1]*d):[e*h,n*h]},i}function ir(t,e){var n=w(t),r=(n+w(e))/2;if(p(r)0?e<-f+a&&(e=-f+a):e>f-a&&(e=f-a);var n=i/x(dr(e),r);return[n*w(r*t),i-n*y(r*t)]}return o.invert=function(t,e){var n=i-e,o=M(r)*A(t*t+n*n);return[g(t,p(n))/r*M(n),2*v(x(i/o,1/r))-f]},o}function vr(t,e){return[t,e]}function gr(t,e){var n=y(t),r=t===e?w(t):(n-y(e))/(e-t),i=n/r+t;if(p(r)a&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Er.invert=cr(C),Cr.invert=cr(function(t){return 2*v(t)}),Sr.invert=function(t,e){return[-e,2*v(m(t))-f]},t.geoArea=function(t){return q.reset(),D(t,H),2*q},t.geoBounds=function(t){var e,n,r,i,o,a,u;if(it=rt=-(et=nt=1/0),ft=[],D(t,St),n=ft.length){for(ft.sort(Ft),e=1,o=[r=ft[0]];eBt(r[0],r[1])&&(r[1]=i[1]),Bt(i[0],r[1])>Bt(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(u=Bt(r[1],i[0]))>a&&(a=u,et=i[0],rt=r[1])}return ft=st=null,et===1/0||nt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,nt],[rt,it]]},t.geoCentroid=function(t){lt=ht=dt=pt=vt=gt=yt=bt=mt=_t=xt=0,D(t,Lt);var e=mt,n=_t,r=xt,i=e*e+n*n+r*r;return i=.12&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?f:u).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[u.stream(e=n),c.stream(n),f.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Sr,t.geoRotation=re,t.geoStream=D,t.geoTransform=function(t){return{stream:Hn(t)}},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],i):i(r.d3=r.d3||{},r.d3)},{"d3-array":12}],27:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t,e){return t.parent===e.parent?1:2}function n(t,e){return t+e.x}function r(t,e){return Math.max(t,e.y)}function i(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function o(t,e){var n,r,i,o,u,s=new f(t),l=+t.value&&(s.value=t.value),h=[s];for(null==e&&(e=a);n=h.pop();)if(l&&(n.value=+n.data.value),(i=e(n.data))&&(u=i.length))for(n.children=new Array(u),o=u-1;o>=0;--o)h.push(r=n.children[o]=new f(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(c)}function a(t){return t.children}function u(t){t.data=t.data.data}function c(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function f(t){this.data=t,this.depth=this.height=0,this.parent=null}f.prototype=o.prototype={constructor:f,count:function(){return this.eachAfter(i)},each:function(t){var e,n,r,i,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(r=0,i=n.length;r=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return o(this).eachBefore(u)}};var s=Array.prototype.slice;function l(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(s.call(t))).length,o=[];r0&&n*n>r*r+i*i}function v(t,e){for(var n=0;n(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),n.x=t.x-r*u-o*c,n.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),n.x=e.x+r*u-o*c,n.y=e.y+r*c+o*u)):(n.x=e.x+n.r,n.y=e.y)}function _(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function x(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function w(t){this._=t,this.next=null,this.previous=null}function M(t){if(!(i=t.length))return 0;var e,n,r,i,o,a,u,c,f,s,h;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;m(n,e,r=t[2]),e=new w(e),n=new w(n),r=new w(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(u=3;uh&&(h=u),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=u;break}p=d}y.push(a={value:s,dice:c1?e:1)},n}(Y);var $=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?e:1)},n}(Y);t.cluster=function(){var t=e,i=1,o=1,a=!1;function u(e){var u,c=0;e.eachAfter(function(e){var i=e.children;i?(e.x=function(t){return t.reduce(n,0)/t.length}(i),e.y=function(t){return 1+t.reduce(r,0)}(i)):(e.x=u?c+=t(e,u):0,e.y=0,u=e)});var f=function(t){for(var e;e=t.children;)t=e[0];return t}(e),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),l=f.x-t(f,s)/2,h=s.x+t(s,f)/2;return e.eachAfter(a?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*o}:function(t){t.x=(t.x-l)/(h-l)*i,t.y=(1-(e.y?t.y/e.y:1))*o})}return u.separation=function(e){return arguments.length?(t=e,u):t},u.size=function(t){return arguments.length?(a=!1,i=+t[0],o=+t[1],u):a?null:[i,o]},u.nodeSize=function(t){return arguments.length?(a=!0,i=+t[0],o=+t[1],u):a?[i,o]:null},u},t.hierarchy=o,t.pack=function(){var t=null,e=1,n=1,r=k;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(S(t)).eachAfter(T(r,.5)).eachBefore(z(1)):i.eachBefore(S(C)).eachAfter(T(k,1)).eachAfter(T(r,i.r/Math.min(e,n))).eachBefore(z(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(n=e)?null:A(n),i):t;var n},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:E(+t),i):r},i},t.packSiblings=function(t){return M(t),t},t.packEnclose=l,t.partition=function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&N(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,u=r.y1-n;a0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=A(e),n):t},n.parentId=function(t){return arguments.length?(e=A(t),n):e},n},t.tree=function(){var t=R,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new H(t,0),u=[a];e=u.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(n=e.children[i]=new H(r[i],i)),n.parent=e;return(a.parent=new H(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var f=i,s=i,l=i;i.eachBefore(function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)});var h=f===s?1:t(f,s)/2,d=h-f.x,p=e/(s.x+h+d),v=n/(l.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*v})}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,u=n,c=o.parent.children[0],f=o.m,s=a.m,l=u.m,h=c.m;u=I(u),o=L(o),u&&o;)c=L(c),(a=I(a)).a=e,(i=u.z+l-o.z-f+t(u._,o._))>0&&(U(q(u,e,r),e,i),f+=i,s+=i),l+=u.m,f+=o.m,h+=c.m,s+=a.m;u&&!I(a)&&(a.t=u,a.m+=l-s),o&&!L(c)&&(c.t=o,c.m+=f-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},t.treemap=function(){var t=G,e=!1,n=1,r=1,i=[0],o=k,a=k,u=k,c=k,f=k;function s(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(l),i=[0],e&&t.eachBefore(O),t}function l(e){var n=i[e.depth],r=e.x0+n,s=e.y0+n,l=e.x1-n,h=e.y1-n;l=n-1){var s=u[e];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}for(var l=f[e],h=r/2+l,d=e+1,p=n-1;d>>1;f[v]c-o){var b=(i*y+a*g)/r;t(e,d,g,i,o,b,c),t(d,n,y,b,o,a,c)}else{var m=(o*y+c*g)/r;t(e,d,g,i,o,a,m),t(d,n,y,i,m,a,c)}}(0,c,t.value,e,n,r,i)},t.treemapDice=N,t.treemapSlice=V,t.treemapSliceDice=function(t,e,n,r,i){(1&t.depth?V:N)(t,e,n,r,i)},t.treemapSquarify=G,t.treemapResquarify=$,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],28:[function(t,e,n){var r,i;r=this,i=function(t,e){"use strict";function n(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function r(t){var e=t.length-1;return function(r){var i=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[i],a=t[i+1],u=i>0?t[i-1]:2*o-a,c=i180||n<-180?n-360*Math.round(n/360):n):o(isNaN(t)?e:t)}function c(t){return 1==(t=+t)?f:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):o(isNaN(e)?n:e)}}function f(t,e){var n=e-t;return n?a(t,n):o(isNaN(t)?e:t)}var s=function t(n){var r=c(n);function i(t,n){var i=r((t=e.rgb(t)).r,(n=e.rgb(n)).r),o=r(t.g,n.g),a=r(t.b,n.b),u=f(t.opacity,n.opacity);return function(e){return t.r=i(e),t.g=o(e),t.b=a(e),t.opacity=u(e),t+""}}return i.gamma=t,i}(1);function l(t){return function(n){var r,i,o=n.length,a=new Array(o),u=new Array(o),c=new Array(o);for(r=0;ro&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:g(n,r)})),o=m.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:g(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:g(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,c),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:g(t,n)},{i:u-2,x:g(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var e,n=-1,r=c.length;++n1e-6)if(Math.abs(l*c-f*s)>1e-6&&o){var d=r-a,p=i-u,v=c*c+f*f,g=d*d+p*p,y=Math.sqrt(v),b=Math.sqrt(h),m=o*Math.tan((e-Math.acos((v+h-g)/(2*y*b)))/2),_=m/b,x=m/y;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*s)+","+(n+_*l)),this._+="A"+o+","+o+",0,0,"+ +(l*d>s*p)+","+(this._x1=t+x*c)+","+(this._y1=n+x*f)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,i,o,a,u,c){t=+t,i=+i;var f=(o=+o)*Math.cos(a),s=o*Math.sin(a),l=t+f,h=i+s,d=1^c,p=c?a-u:u-a;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+l+","+h),o&&(p<0&&(p=p%n+n),p>r?this._+="A"+o+","+o+",0,1,"+d+","+(t-f)+","+(i-s)+"A"+o+","+o+",0,1,"+d+","+(this._x1=l)+","+(this._y1=h):p>1e-6&&(this._+="A"+o+","+o+",0,"+ +(p>=e)+","+d+","+(this._x1=t+o*Math.cos(u))+","+(this._y1=i+o*Math.sin(u))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],30:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t,e){return t[0]-e[0]||t[1]-e[1]}function n(t){for(var e,n,r,i=t.length,o=[0,1],a=2,u=2;u1&&(e=t[o[a-2]],n=t[o[a-1]],r=t[u],(n[0]-e[0])*(r[1]-e[1])-(n[1]-e[1])*(r[0]-e[0])<=0);)--a;o[a++]=u}return o.slice(0,a)}t.polygonArea=function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n=0;--r)l.push(t[o[u[r]][2]]);for(r=+f;ru!=f>u&&a<(c-n)*(u-r)/(f-r)+n&&(s=!s),c=n,f=r;return s},t.polygonLength=function(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],c=0;++r=(o=(v+y)/2))?v=o:y=o,(s=n>=(a=(g+b)/2))?g=a:b=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),e===u&&n===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=e>=(o=(v+y)/2))?v=o:y=o,(s=n>=(a=(g+b)/2))?g=a:b=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function n(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function r(t){return t[0]}function i(t){return t[1]}function o(t,e,n){var o=new a(null==e?r:e,null==n?i:n,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function a(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function u(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var c=o.prototype=a.prototype;c.copy=function(){var t,e,n=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=u(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=u(e));return n},c.add=function(t){var n=+this._x.call(null,t),r=+this._y.call(null,t);return e(this.cover(n,r),n,r,t)},c.addAll=function(t){var n,r,i,o,a=t.length,u=new Array(a),c=new Array(a),f=1/0,s=1/0,l=-1/0,h=-1/0;for(r=0;rl&&(l=i),oh&&(h=o));if(f>l||s>h)return this;for(this.cover(f,s).cover(l,h),r=0;rt||t>=i||r>e||e>=o;)switch(u=(ed||(a=f.y0)>p||(u=f.x1)=b)<<1|t>=y)&&(f=v[v.length-1],v[v.length-1]=v[v.length-1-s],v[v.length-1-s]=f)}else{var m=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),x=m*m+_*_;if(x=(u=(p+g)/2))?p=u:g=u,(s=a>=(c=(v+y)/2))?v=c:y=c,e=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},c.removeAll=function(t){for(var e=0,n=t.length;e1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(e),i=function t(e){function n(){var t=r.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(e),o=function t(e){function n(t){return function(){for(var n=0,r=0;r1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return yt.h=360*t-100,yt.s=1.5-1.5*e,yt.l=.8-.9*e,yt+""},t.interpolateWarm=vt,t.interpolateCool=gt,t.interpolateSinebow=function(t){var e;return t=(.5-t)*Math.PI,bt.r=255*(e=Math.sin(t))*e,bt.g=255*(e=Math.sin(t+mt))*e,bt.b=255*(e=Math.sin(t+_t))*e,bt+""},t.interpolateViridis=wt,t.interpolateMagma=Mt,t.interpolateInferno=At,t.interpolatePlasma=kt,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-interpolate"),t("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-interpolate","d3-color"],i):i(r.d3=r.d3||{},r.d3,r.d3)},{"d3-color":17,"d3-interpolate":28}],34:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function r(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function i(t){var n=r(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(r,t)}})(n)}function o(){}function a(t){return null==t?o:function(){return this.querySelector(t)}}function u(){return[]}function c(t){return null==t?u:function(){return this.querySelectorAll(t)}}function f(t){return function(){return this.matches(t)}}function s(t){return new Array(t.length)}function l(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}l.prototype={constructor:l,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var h="$";function d(t,e,n,r,i,o){for(var a,u=0,c=e.length,f=o.length;ue?1:t>=e?0:NaN}function g(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function y(t,e){return t.style.getPropertyValue(e)||g(t).getComputedStyle(t,null).getPropertyValue(e)}function b(t){return t.trim().split(/^|\s+/)}function m(t){return t.classList||new _(t)}function _(t){this._node=t,this._names=b(t.getAttribute("class")||"")}function x(t,e){for(var n=m(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var O={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(O={mouseenter:"mouseover",mouseleave:"mouseout"}));function N(t,e,n){return t=j(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function j(e,n,r){return function(i){var o=t.event;t.event=i;try{e.call(this,this.__data__,n,r)}finally{t.event=o}}}function P(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=M&&(M=w+1);!(x=m[M])&&++M=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=v);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):y(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=b(t+"");if(arguments.length<2){for(var r=m(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),a=o.length;if(!(arguments.length<2)){for(u=e?D:P,null==n&&(n=!1),r=0;r=1?h:t<=-1?-h:Math.asin(t)}function v(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function b(t){return t.endAngle}function m(t){return t&&t.padAngle}function _(t,e,n,r,i,o,u){var c=t-n,s=e-r,l=(u?o:-o)/f(c*c+s*s),h=l*s,d=-l*c,p=t+h,v=e+d,g=n+h,y=r+d,b=(p+g)/2,m=(v+y)/2,_=g-p,x=y-v,w=_*_+x*x,M=i-o,A=p*y-g*v,k=(x<0?-1:1)*f(a(0,M*M*w-A*A)),E=(A*x-_*k)/w,C=(-A*_-x*k)/w,S=(A*x+_*k)/w,T=(-A*_+x*k)/w,z=E-b,O=C-m,N=S-b,j=T-m;return z*z+O*O>N*N+j*j&&(E=S,C=T),{cx:E,cy:C,x01:-h,y01:-d,x11:E*(i/M-1),y11:C*(i/M-1)}}function x(t){this._context=t}function w(t){return new x(t)}function M(t){return t[0]}function A(t){return t[1]}function k(){var t=M,r=A,i=n(!0),o=null,a=w,u=null;function c(n){var c,f,s,l=n.length,h=!1;for(null==o&&(u=a(s=e.path())),c=0;c<=l;++c)!(c=l;--h)f.point(y[h],b[h]);f.lineEnd(),f.areaEnd()}g&&(y[s]=+t(d,s,n),b[s]=+i(d,s,n),f.point(r?+r(d,s,n):y[s],o?+o(d,s,n):b[s]))}if(p)return f=null,p+""||null}function l(){return k().defined(a).curve(c).context(u)}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),r=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:n(+t),s):r},s.y=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),o=null,s):i},s.y0=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),s):i},s.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:n(+t),s):o},s.lineX0=s.lineY0=function(){return l().x(t).y(i)},s.lineY1=function(){return l().x(t).y(o)},s.lineX1=function(){return l().x(r).y(i)},s.defined=function(t){return arguments.length?(a="function"==typeof t?t:n(!!t),s):a},s.curve=function(t){return arguments.length?(c=t,null!=u&&(f=c(u)),s):c},s.context=function(t){return arguments.length?(null==t?u=f=null:f=c(u=t),s):u},s}function C(t,e){return et?1:e>=t?0:NaN}function S(t){return t}x.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var T=O(w);function z(t){this._curve=t}function O(t){function e(e){return new z(t(e))}return e._curve=t,e}function N(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(O(t)):e()._curve},t}function j(){return N(k().curve(T))}function P(){var t=E().curve(T),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return N(n())},delete t.lineX0,t.lineEndAngle=function(){return N(r())},delete t.lineX1,t.lineInnerRadius=function(){return N(i())},delete t.lineY0,t.lineOuterRadius=function(){return N(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(O(t)):e()._curve},t}function D(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}z.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var B=Array.prototype.slice;function F(t){return t.source}function R(t){return t.target}function L(t){var r=F,i=R,o=M,a=A,u=null;function c(){var n,c=B.call(arguments),f=r.apply(this,c),s=i.apply(this,c);if(u||(u=n=e.path()),t(u,+o.apply(this,(c[0]=f,c)),+a.apply(this,c),+o.apply(this,(c[0]=s,c)),+a.apply(this,c)),n)return u=null,n+""||null}return c.source=function(t){return arguments.length?(r=t,c):r},c.target=function(t){return arguments.length?(i=t,c):i},c.x=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),c):o},c.y=function(t){return arguments.length?(a="function"==typeof t?t:n(+t),c):a},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function I(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function U(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function q(t,e,n,r,i){var o=D(e,n),a=D(e,n=(n+i)/2),u=D(r,n),c=D(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],c[0],c[1])}var H={draw:function(t,e){var n=Math.sqrt(e/l);t.moveTo(n,0),t.arc(0,0,n,0,d)}},V={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Y=Math.sqrt(1/3),W=2*Y,G={draw:function(t,e){var n=Math.sqrt(e/W),r=n*Y;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},$=Math.sin(l/10)/Math.sin(7*l/10),X=Math.sin(d/10)*$,Q=-Math.cos(d/10)*$,Z={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=X*n,i=Q*n;t.moveTo(0,-n),t.lineTo(r,i);for(var o=1;o<5;++o){var a=d*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*n,-u*n),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},J={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},K=Math.sqrt(3),tt={draw:function(t,e){var n=-Math.sqrt(e/(3*K));t.moveTo(0,2*n),t.lineTo(-K*n,-n),t.lineTo(K*n,-n),t.closePath()}},et=-.5,nt=Math.sqrt(3)/2,rt=1/Math.sqrt(12),it=3*(rt/2+1),ot={draw:function(t,e){var n=Math.sqrt(e/it),r=n/2,i=n*rt,o=r,a=n*rt+n,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(et*r-nt*i,nt*r+et*i),t.lineTo(et*o-nt*a,nt*o+et*a),t.lineTo(et*u-nt*c,nt*u+et*c),t.lineTo(et*r+nt*i,et*i-nt*r),t.lineTo(et*o+nt*a,et*a-nt*o),t.lineTo(et*u+nt*c,et*c-nt*u),t.closePath()}},at=[H,V,G,J,Z,tt,ot];function ut(){}function ct(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ft(t){this._context=t}function st(t){this._context=t}function lt(t){this._context=t}function ht(t,e){this._basis=new ft(t),this._beta=e}ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},st.prototype={areaStart:ut,areaEnd:ut,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,c=-1;++c<=n;)r=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*e[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function n(t){return 1===e?new ft(t):new ht(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function pt(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function vt(t,e){this._context=t,this._k=(1-e)/6}vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:pt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function n(t){return new vt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:ut,areaEnd:ut,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var bt=function t(e){function n(t){return new yt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function n(t){return new mt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function xt(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>s){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>s){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*f+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:xt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mt=function t(e){function n(t){return e?new wt(t,e):new vt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function At(t,e){this._context=t,this._alpha=e}At.prototype={areaStart:ut,areaEnd:ut,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:xt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function n(t){return e?new At(t,e):new yt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Et(t,e){this._context=t,this._alpha=e}Et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:xt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ct=function t(e){function n(t){return e?new Et(t,e):new mt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function St(t){this._context=t}function Tt(t){return t<0?-1:1}function zt(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Tt(o)+Tt(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Ot(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Nt(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function jt(t){this._context=t}function Pt(t){this._context=new Dt(t)}function Dt(t){this._context=t}function Bt(t){this._context=t}function Ft(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e1)for(var n,r,i,o=1,a=t[e[0]],u=a.length;o=0;)n[e]=e;return n}function Ut(t,e){return t[e]}function qt(t){var e=t.map(Ht);return It(t).sort(function(t,n){return e[t]-e[n]})}function Ht(t){for(var e,n=-1,r=0,i=t.length,o=-1/0;++no&&(o=e,r=n);return r}function Vt(t){var e=t.map(Yt);return It(t).sort(function(t,n){return e[t]-e[n]})}function Yt(t){for(var e,n=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},t.arc=function(){var t=v,a=g,x=n(0),w=null,M=y,A=b,k=m,E=null;function C(){var n,v,g,y=+t.apply(this,arguments),b=+a.apply(this,arguments),m=M.apply(this,arguments)-h,C=A.apply(this,arguments)-h,S=r(C-m),T=C>m;if(E||(E=n=e.path()),bs)if(S>d-s)E.moveTo(b*o(m),b*c(m)),E.arc(0,0,b,m,C,!T),y>s&&(E.moveTo(y*o(C),y*c(C)),E.arc(0,0,y,C,m,T));else{var z,O,N=m,j=C,P=m,D=C,B=S,F=S,R=k.apply(this,arguments)/2,L=R>s&&(w?+w.apply(this,arguments):f(y*y+b*b)),I=u(r(b-y)/2,+x.apply(this,arguments)),U=I,q=I;if(L>s){var H=p(L/y*c(R)),V=p(L/b*c(R));(B-=2*H)>s?(P+=H*=T?1:-1,D-=H):(B=0,P=D=(m+C)/2),(F-=2*V)>s?(N+=V*=T?1:-1,j-=V):(F=0,N=j=(m+C)/2)}var Y=b*o(N),W=b*c(N),G=y*o(D),$=y*c(D);if(I>s){var X,Q=b*o(j),Z=b*c(j),J=y*o(P),K=y*c(P);if(S1?0:g<-1?l:Math.acos(g))/2),ot=f(X[0]*X[0]+X[1]*X[1]);U=u(I,(y-ot)/(it-1)),q=u(I,(b-ot)/(it+1))}}F>s?q>s?(z=_(J,K,Y,W,b,q,T),O=_(Q,Z,G,$,b,q,T),E.moveTo(z.cx+z.x01,z.cy+z.y01),qs&&B>s?U>s?(z=_(G,$,Q,Z,y,-U,T),O=_(Y,W,J,K,y,-U,T),E.lineTo(z.cx+z.x01,z.cy+z.y01),U0&&(p+=l);for(null!=e?v.sort(function(t,n){return e(g[t],g[n])}):null!=r&&v.sort(function(t,e){return r(n[t],n[e])}),u=0,f=p?(b-h*_)/p:0;u0?l*f:0)+_,g[c]={data:n[c],index:u,value:l,startAngle:y,endAngle:s,padAngle:m};return g}return u.value=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),u):t},u.sortValues=function(t){return arguments.length?(e=t,r=null,u):e},u.sort=function(t){return arguments.length?(r=t,e=null,u):r},u.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),u):i},u.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),u):o},u.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:n(+t),u):a},u},t.areaRadial=P,t.radialArea=P,t.lineRadial=j,t.radialLine=j,t.pointRadial=D,t.linkHorizontal=function(){return L(I)},t.linkVertical=function(){return L(U)},t.linkRadial=function(){var t=L(q);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=n(H),r=n(64),i=null;function o(){var n;if(i||(i=n=e.path()),t.apply(this,arguments).draw(i,+r.apply(this,arguments)),n)return i=null,n+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:n(e),o):t},o.size=function(t){return arguments.length?(r="function"==typeof t?t:n(+t),o):r},o.context=function(t){return arguments.length?(i=null==t?null:t,o):i},o},t.symbols=at,t.symbolCircle=H,t.symbolCross=V,t.symbolDiamond=G,t.symbolSquare=J,t.symbolStar=Z,t.symbolTriangle=tt,t.symbolWye=ot,t.curveBasisClosed=function(t){return new st(t)},t.curveBasisOpen=function(t){return new lt(t)},t.curveBasis=function(t){return new ft(t)},t.curveBundle=dt,t.curveCardinalClosed=bt,t.curveCardinalOpen=_t,t.curveCardinal=gt,t.curveCatmullRomClosed=kt,t.curveCatmullRomOpen=Ct,t.curveCatmullRom=Mt,t.curveLinearClosed=function(t){return new St(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new jt(t)},t.curveMonotoneY=function(t){return new Pt(t)},t.curveNatural=function(t){return new Bt(t)},t.curveStep=function(t){return new Rt(t,.5)},t.curveStepAfter=function(t){return new Rt(t,1)},t.curveStepBefore=function(t){return new Rt(t,0)},t.stack=function(){var t=n([]),e=It,r=Lt,i=Ut;function o(n){var o,a,u=t.apply(this,arguments),c=n.length,f=u.length,s=new Array(f);for(o=0;o0){for(var n,r,i,o=0,a=t[0].length;o1)for(var n,r,i,o,a,u,c=0,f=t[e[0]].length;c=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},t.stackOffsetNone=Lt,t.stackOffsetSilhouette=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;a=12)]},Q:vt,s:gt,S:q,u:H,U:V,V:Y,w:W,W:G,x:null,X:null,y:$,Y:X,Z:Q,"%":pt},Tt={a:function(t){return l[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Z,e:Z,f:nt,H:J,I:K,j:tt,L:et,m:rt,M:it,p:function(t){return f[+(t.getUTCHours()>=12)]},Q:vt,s:gt,S:ot,u:at,U:ut,V:ct,w:ft,W:st,x:null,X:null,y:lt,Y:ht,Z:dt,"%":pt},zt={a:function(t,e,n){var r=wt.exec(e.slice(n));return r?(t.w=Mt[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=_t.exec(e.slice(n));return r?(t.w=xt[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=Et.exec(e.slice(n));return r?(t.m=Ct[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=At.exec(e.slice(n));return r?(t.m=kt[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,e,n){return jt(t,o,e,n)},d:A,e:A,f:z,H:E,I:E,j:k,L:T,m:M,M:C,p:function(t,e,n){var r=bt.exec(e.slice(n));return r?(t.p=mt[r[0].toLowerCase()],n+r[0].length):-1},Q:N,s:j,S:S,u:g,U:y,V:b,w:v,W:m,x:function(t,e,n){return jt(t,a,e,n)},X:function(t,e,n){return jt(t,c,e,n)},y:x,Y:_,Z:w,"%":O};function Ot(t,e){return function(n){var r,i,o,a=[],c=-1,f=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++c53)return null;"w"in c||(c.w=1),"Z"in c?(a=(u=(a=r(i(c.y))).getUTCDay())>4||0===u?e.utcMonday.ceil(a):e.utcMonday(a),a=e.utcDay.offset(a,7*(c.V-1)),c.y=a.getUTCFullYear(),c.m=a.getUTCMonth(),c.d=a.getUTCDate()+(c.w+6)%7):(a=(u=(a=n(i(c.y))).getDay())>4||0===u?e.timeMonday.ceil(a):e.timeMonday(a),a=e.timeDay.offset(a,7*(c.V-1)),c.y=a.getFullYear(),c.m=a.getMonth(),c.d=a.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),u="Z"in c?r(i(c.y)).getUTCDay():n(i(c.y)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(u+5)%7:c.w+7*c.U-(u+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,r(c)):n(c)}}function jt(t,e,n,r){for(var i,o,a=0,c=e.length,f=n.length;a=f)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=zt[i in u?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return St.x=Ot(a,St),St.X=Ot(c,St),St.c=Ot(o,St),Tt.x=Ot(a,Tt),Tt.X=Ot(c,Tt),Tt.c=Ot(o,Tt),{format:function(t){var e=Ot(t+="",St);return e.toString=function(){return t},e},parse:function(t){var e=Nt(t+="",n);return e.toString=function(){return t},e},utcFormat:function(t){var e=Ot(t+="",Tt);return e.toString=function(){return t},e},utcParse:function(t){var e=Nt(t,r);return e.toString=function(){return t},e}}}var a,u={"-":"",_:" ",0:"0"},c=/^\s*\d+/,f=/^%/,s=/[\\^$*+?|[\]().{}]/g;function l(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function w(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function M(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function A(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function k(t,e,n){var r=c.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function E(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function C(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function S(t,e,n){var r=c.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function T(t,e,n){var r=c.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function z(t,e,n){var r=c.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function O(t,e,n){var r=f.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function N(t,e,n){var r=c.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function j(t,e,n){var r=c.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function P(t,e){return l(t.getDate(),e,2)}function D(t,e){return l(t.getHours(),e,2)}function B(t,e){return l(t.getHours()%12||12,e,2)}function F(t,n){return l(1+e.timeDay.count(e.timeYear(t),t),n,3)}function R(t,e){return l(t.getMilliseconds(),e,3)}function L(t,e){return R(t,e)+"000"}function I(t,e){return l(t.getMonth()+1,e,2)}function U(t,e){return l(t.getMinutes(),e,2)}function q(t,e){return l(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function V(t,n){return l(e.timeSunday.count(e.timeYear(t),t),n,2)}function Y(t,n){var r=t.getDay();return t=r>=4||0===r?e.timeThursday(t):e.timeThursday.ceil(t),l(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),n,2)}function W(t){return t.getDay()}function G(t,n){return l(e.timeMonday.count(e.timeYear(t),t),n,2)}function $(t,e){return l(t.getFullYear()%100,e,2)}function X(t,e){return l(t.getFullYear()%1e4,e,4)}function Q(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+l(e/60|0,"0",2)+l(e%60,"0",2)}function Z(t,e){return l(t.getUTCDate(),e,2)}function J(t,e){return l(t.getUTCHours(),e,2)}function K(t,e){return l(t.getUTCHours()%12||12,e,2)}function tt(t,n){return l(1+e.utcDay.count(e.utcYear(t),t),n,3)}function et(t,e){return l(t.getUTCMilliseconds(),e,3)}function nt(t,e){return et(t,e)+"000"}function rt(t,e){return l(t.getUTCMonth()+1,e,2)}function it(t,e){return l(t.getUTCMinutes(),e,2)}function ot(t,e){return l(t.getUTCSeconds(),e,2)}function at(t){var e=t.getUTCDay();return 0===e?7:e}function ut(t,n){return l(e.utcSunday.count(e.utcYear(t),t),n,2)}function ct(t,n){var r=t.getUTCDay();return t=r>=4||0===r?e.utcThursday(t):e.utcThursday.ceil(t),l(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),n,2)}function ft(t){return t.getUTCDay()}function st(t,n){return l(e.utcMonday.count(e.utcYear(t),t),n,2)}function lt(t,e){return l(t.getUTCFullYear()%100,e,2)}function ht(t,e){return l(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function pt(){return"%"}function vt(t){return+t}function gt(t){return Math.floor(+t/1e3)}function yt(e){return a=o(e),t.timeFormat=a.format,t.timeParse=a.parse,t.utcFormat=a.utcFormat,t.utcParse=a.utcParse,a}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var mt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.timeFormatDefaultLocale=yt,t.timeFormatLocale=o,t.isoFormat=bt,t.isoParse=mt,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],i):i(r.d3=r.d3||{},r.d3)},{"d3-time":37}],37:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e=new Date,n=new Date;function r(t,i,o,a){function u(e){return t(e=new Date(+e)),e}return u.floor=u,u.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},u.round=function(t){var e=u(t),n=u.ceil(t);return t-e0))return a;do{a.push(o=new Date(+e)),i(e,r),t(e)}while(o=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;i(t,-1),!e(t););else for(;--n>=0;)for(;i(t,1),!e(t););})},o&&(u.count=function(r,i){return e.setTime(+r),n.setTime(+i),t(e),t(n),Math.floor(o(e,n))},u.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?u.filter(a?function(e){return a(e)%t==0}:function(e){return u.count(0,e)%t==0}):u:null}),u}var i=r(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):i:null};var o=i.range,a=6e4,u=6048e5,c=r(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3},function(t){return t.getUTCSeconds()}),f=c.range,s=r(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,e){t.setTime(+t+e*a)},function(t,e){return(e-t)/a},function(t){return t.getMinutes()}),l=s.range,h=r(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*a)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getHours()}),d=h.range,p=r(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*a)/864e5},function(t){return t.getDate()-1}),v=p.range;function g(t){return r(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*a)/u})}var y=g(0),b=g(1),m=g(2),_=g(3),x=g(4),w=g(5),M=g(6),A=y.range,k=b.range,E=m.range,C=_.range,S=x.range,T=w.range,z=M.range,O=r(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),N=O.range,j=r(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});j.every=function(t){return isFinite(t=Math.floor(t))&&t>0?r(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var P=j.range,D=r(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*a)},function(t,e){return(e-t)/a},function(t){return t.getUTCMinutes()}),B=D.range,F=r(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getUTCHours()}),R=F.range,L=r(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5},function(t){return t.getUTCDate()-1}),I=L.range;function U(t){return r(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/u})}var q=U(0),H=U(1),V=U(2),Y=U(3),W=U(4),G=U(5),$=U(6),X=q.range,Q=H.range,Z=V.range,J=Y.range,K=W.range,tt=G.range,et=$.range,nt=r(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),rt=nt.range,it=r(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});it.every=function(t){return isFinite(t=Math.floor(t))&&t>0?r(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var ot=it.range;t.timeInterval=r,t.timeMillisecond=i,t.timeMilliseconds=o,t.utcMillisecond=i,t.utcMilliseconds=o,t.timeSecond=c,t.timeSeconds=f,t.utcSecond=c,t.utcSeconds=f,t.timeMinute=s,t.timeMinutes=l,t.timeHour=h,t.timeHours=d,t.timeDay=p,t.timeDays=v,t.timeWeek=y,t.timeWeeks=A,t.timeSunday=y,t.timeSundays=A,t.timeMonday=b,t.timeMondays=k,t.timeTuesday=m,t.timeTuesdays=E,t.timeWednesday=_,t.timeWednesdays=C,t.timeThursday=x,t.timeThursdays=S,t.timeFriday=w,t.timeFridays=T,t.timeSaturday=M,t.timeSaturdays=z,t.timeMonth=O,t.timeMonths=N,t.timeYear=j,t.timeYears=P,t.utcMinute=D,t.utcMinutes=B,t.utcHour=F,t.utcHours=R,t.utcDay=L,t.utcDays=I,t.utcWeek=q,t.utcWeeks=X,t.utcSunday=q,t.utcSundays=X,t.utcMonday=H,t.utcMondays=Q,t.utcTuesday=V,t.utcTuesdays=Z,t.utcWednesday=Y,t.utcWednesdays=J,t.utcThursday=W,t.utcThursdays=K,t.utcFriday=G,t.utcFridays=tt,t.utcSaturday=$,t.utcSaturdays=et,t.utcMonth=nt,t.utcMonths=rt,t.utcYear=it,t.utcYears=ot,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],38:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";var e,n,r=0,i=0,o=0,a=1e3,u=0,c=0,f=0,s="object"==typeof performance&&performance.now?performance:Date,l="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return c||(l(d),c=s.now()+f)}function d(){c=0}function p(){this._call=this._time=this._next=null}function v(t,e,n){var r=new p;return r.restart(t,e,n),r}function g(){h(),++r;for(var t,n=e;n;)(t=c-n._time)>=0&&n._call.call(null,t),n=n._next;--r}function y(){c=(u=s.now())+f,r=i=0;try{g()}finally{r=0,function(){var t,r,i=e,o=1/0;for(;i;)i._call?(o>i._time&&(o=i._time),t=i,i=i._next):(r=i._next,i._next=null,i=t?t._next=r:e=r);n=t,m(o)}(),c=0}}function b(){var t=s.now(),e=t-u;e>a&&(f-=e,u=t)}function m(t){r||(i&&(i=clearTimeout(i)),t-c>24?(t<1/0&&(i=setTimeout(y,t-s.now()-f)),o&&(o=clearInterval(o))):(o||(u=s.now(),o=setInterval(b,a)),r=1,l(y)))}p.prototype=v.prototype={constructor:p,restart:function(t,r,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==r?0:+r),this._next||n===this||(n?n._next=this:e=this,n=this),this._call=t,this._time=i,m()},stop:function(){this._call&&(this._call=null,this._time=1/0,m())}},t.now=h,t.timer=v,t.timerFlush=g,t.timeout=function(t,e,n){var r=new p;return e=null==e?0:+e,r.restart(function(n){r.stop(),t(n+e)},e,n),r},t.interval=function(t,e,n){var r=new p,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?h():+n,r.restart(function o(a){a+=i,r.restart(o,i+=e,n),t(a)},e,n),r)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(r.d3=r.d3||{})},{}],39:[function(t,e,n){var r,i;r=this,i=function(t,e,n,r,i,o,a){"use strict";var u=e.dispatch("start","end","cancel","interrupt"),c=[],f=0,s=1,l=2,h=3,d=4,p=5,v=6;function g(t,e,r,i,o,a){var g=t.__transition;if(g){if(r in g)return}else t.__transition={};!function(t,e,r){var i,o=t.__transition;function a(f){var p,g,y,b;if(r.state!==s)return c();for(p in o)if((b=o[p]).name===r.name){if(b.state===h)return n.timeout(a);b.state===d?(b.state=v,b.timer.stop(),b.on.call("interrupt",t,t.__data__,b.index,b.group),delete o[p]):+pf)throw new Error("too late; already scheduled");return n}function b(t,e){var n=m(t,e);if(n.state>h)throw new Error("too late; already running");return n}function m(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function _(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>l&&n.state=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?y:b;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=o.namespace(t),r="transform"===n?i.interpolateTransformSvg:w;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,o;return function(){var a,u,c=n(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,c));this.removeAttributeNS(t.space,t.local)}}:function(t,e,n){var r,i,o;return function(){var a,u,c=n(this);if(null!=c)return(a=this.getAttribute(t))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,c));this.removeAttribute(t)}})(n,r,x(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}:function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=o.namespace(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}(t,i)),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e(n))}}(t,i)),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r="transform"==(t+="")?i.interpolateTransformCss:w;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=o.style(this,t),u=(this.style.removeProperty(t),o.style(this,t));return a===u?null:a===n&&u===r?i:i=e(n=a,r=u)}}(t,r)).on("end.style."+t,A(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var u=o.style(this,t),c=n(this),f=c+"";return null==c&&(this.style.removeProperty(t),f=c=o.style(this,t)),u===f?null:u===r&&f===i?a:(i=f,a=e(r=u,c))}}(t,r,x(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,u="end."+a;return function(){var c=b(this,t),f=c.on,s=null==c.value[a]?o||(o=A(e)):void 0;f===n&&i===s||(r=(n=f).copy()).on(u,i=s),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var u=o.style(this,t);return u===a?null:u===r?i:i=e(r=u,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e(r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(x(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=m(this.node(),n).tween,o=0,a=i.length;os&&n.name===e)return new E([[t]],N,e,+r);return null},t.interrupt=_,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n,t("d3-dispatch"),t("d3-timer"),t("d3-color"),t("d3-interpolate"),t("d3-selection"),t("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-timer","d3-color","d3-interpolate","d3-selection","d3-ease"],i):i(r.d3=r.d3||{},r.d3,r.d3,r.d3,r.d3,r.d3,r.d3)},{"d3-color":17,"d3-dispatch":19,"d3-ease":22,"d3-interpolate":28,"d3-selection":34,"d3-timer":38}],40:[function(t,e,n){var r,i;r=this,i=function(t){"use strict";function e(t){return function(){return t}}function n(t){return t[0]}function r(t){return t[1]}function i(){this._=null}function o(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function a(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function u(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function c(t){for(;t.L;)t=t.L;return t}function f(t,e,n,r){var i=[null,null],o=O.push(i)-1;return i.left=t,i.right=e,n&&l(i,t,e,n),r&&l(i,e,t,r),T[t.index].halfedges.push(o),T[e.index].halfedges.push(o),i}function s(t,e,n){var r=[e,n];return r.left=t,r}function l(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function h(t,e,n,r,i){var o,a=t[0],u=t[1],c=a[0],f=a[1],s=0,l=1,h=u[0]-c,d=u[1]-f;if(o=e-c,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=i-f,d||!(o<0)){if(o/=d,d<0){if(o>l)return;o>s&&(s=o)}else if(d>0){if(o0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function d(t,e,n,r,i){var o=t[1];if(o)return!0;var a,u,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,n];o=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(n-u)/a,n];o=[(i-u)/a,i]}else{if(c){if(c[1]=r)return}else c=[e,a*e+u];o=[r,a*r+u]}else{if(c){if(c[0]=-j)){var p=f*f+s*s,v=l*l+h*h,g=(h*p-s*v)/d,m=(f*v-l*p)/d,_=b.pop()||new function(){o(this),this.x=this.y=this.arc=this.site=this.cy=null};_.arc=t,_.site=i,_.x=g+u,_.y=(_.cy=m+c)+Math.sqrt(g*g+m*m),t.circle=_;for(var x=null,w=z._;w;)if(_.yN)u=u.L;else{if(!((i=o-C(u,a))>N)){r>-N?(e=u.P,n=u):i>-N?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}!function(t){T[t.index]={site:t,halfedges:[]}}(t);var c=w(t);if(S.insert(e,c),e||n){if(e===n)return _(e),n=w(e.site),S.insert(c,n),c.edge=n.edge=f(e.site,c.site),m(e),void m(n);if(n){_(e),_(n);var s=e.site,h=s[0],d=s[1],p=t[0]-h,v=t[1]-d,g=n.site,y=g[0]-h,b=g[1]-d,x=2*(p*b-v*y),M=p*p+v*v,A=y*y+b*b,k=[(b*M-v*A)/x+h,(p*A-y*M)/x+d];l(n.edge,s,g,k),c.edge=f(s,t,null,k),n.edge=f(t,g,null,k),m(e),m(n)}else c.edge=f(e.site,c.site)}}function E(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var u=(n=a.site)[0],c=n[1],f=c-e;if(!f)return u;var s=u-r,l=1/o-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-o/2)))/l+r:(r+u)/2}function C(t,e){var n=t.N;if(n)return E(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var S,T,z,O,N=1e-6,j=1e-12;function P(t,e){return e[1]-t[1]||e[0]-t[0]}function D(t,e){var n,r,o,a=t.sort(P).pop();for(O=[],T=new Array(t.length),S=new i,z=new i;;)if(o=y,a&&(!o||a[1]N||Math.abs(i[0][1]-i[1][1])>N)||delete O[o]}(u,c,f,l),function(t,e,n,r){var i,o,a,u,c,f,l,h,d,p,y,b,m=T.length,_=!0;for(i=0;iN||Math.abs(b-d)>N)&&(c.splice(u,0,O.push(s(a,p,Math.abs(y-t)N?[t,Math.abs(h-t)N?[Math.abs(d-r)N?[n,Math.abs(h-n)N?[Math.abs(d-e)=u)return null;var c=t-i.site[0],f=e-i.site[1],s=c*c+f*f;do{i=o.cells[r=a],a=null,i.halfedges.forEach(function(n){var r=o.edges[n],u=r.left;if(u!==i.site&&u||(u=r.right)){var c=t-u[0],f=e-u[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}f.prototype=u.prototype,t.zoom=function(){var t,f,b=h,m=d,_=y,x=v,w=g,M=[0,1/0],A=[[-1/0,-1/0],[1/0,1/0]],k=250,E=i.interpolateZoom,C=[],S=n.dispatch("start","zoom","end"),T=500,z=150,O=0;function N(t){t.property("__zoom",p).on("wheel.zoom",L).on("mousedown.zoom",I).on("dblclick.zoom",U).filter(w).on("touchstart.zoom",q).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(t,e){return(e=Math.max(M[0],Math.min(M[1],e)))===t.k?t:new u(e,t.x,t.y)}function P(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new u(t.k,r,i)}function D(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function B(t,e,n){t.on("start.zoom",function(){F(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=F(this,t),i=m.apply(this,t),o=n||D(i),a=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),c=this.__zoom,f="function"==typeof e?e.apply(this,t):e,s=E(c.invert(o).concat(a/c.k),f.invert(o).concat(a/f.k));return function(t){if(1===t)t=f;else{var e=s(t),n=a/e[2];t=new u(n,o[0]-e[0]*n,o[1]-e[1]*n)}r.zoom(null,t)}})}function F(t,e){for(var n,r=0,i=C.length;rO}t.zoom("mouse",_(P(t.that.__zoom,t.mouse[0]=e.mouse(t.that),t.mouse[1]),t.extent,A))},!0).on("mouseup.zoom",function(){n.on("mousemove.zoom mouseup.zoom",null),r.dragEnable(e.event.view,t.moved),l(),t.end()},!0),i=e.mouse(this),a=e.event.clientX,u=e.event.clientY;r.dragDisable(e.event.view),s(),t.mouse=[i,this.__zoom.invert(i)],o.interrupt(this),t.start()}}function U(){if(b.apply(this,arguments)){var t=this.__zoom,n=e.mouse(this),r=t.invert(n),i=t.k*(e.event.shiftKey?.5:2),o=_(P(j(t,i),n,r),m.apply(this,arguments),A);l(),k>0?e.select(this).transition().duration(k).call(B,o,n):e.select(this).call(N.transform,o)}}function q(){if(b.apply(this,arguments)){var n,r,i,a,u=F(this,arguments),c=e.event.changedTouches,f=c.length;for(s(),r=0;rr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function _(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?x:_,o=a=null,p}function p(e){return isNaN(e=+e)?n:(o||(o=i(u.map(t),c,f)))(t(h(e)))}return p.invert=function(n){return h(e((a||(a=i(c,u.map(t),r.interpolateNumber)))(n)))},p.domain=function(t){return arguments.length?(u=s.call(t,v),h===y||(h=m(u)),d()):u.slice()},p.range=function(t){return arguments.length?(c=l.call(t),d()):c.slice()},p.rangeRound=function(t){return c=l.call(t),f=r.interpolateRound,d()},p.clamp=function(t){return arguments.length?(h=t?m(u):y,p):h!==y},p.interpolate=function(t){return arguments.length?(f=t,d()):f},p.unknown=function(t){return arguments.length?(n=t,p):n},function(n,r){return t=n,e=r,d()}}function A(t,e){return M()(t,e)}function k(t,e,r,o){var a,u=n.tickStep(t,e,r);switch((o=i.formatSpecifier(null==o?",f":o)).type){case"s":var c=Math.max(Math.abs(t),Math.abs(e));return null!=o.precision||isNaN(a=i.precisionPrefix(u,c))||(o.precision=a),i.formatPrefix(o,c);case"":case"e":case"g":case"p":case"r":null!=o.precision||isNaN(a=i.precisionRound(u,Math.max(Math.abs(t),Math.abs(e))))||(o.precision=a-("e"===o.type));break;case"f":case"%":null!=o.precision||isNaN(a=i.precisionFixed(u))||(o.precision=a-2*("%"===o.type))}return i.format(o)}function E(t){var e=t.domain;return t.ticks=function(t){var r=e();return n.ticks(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return k(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(r){null==r&&(r=10);var i,o=e(),a=0,u=o.length-1,c=o[a],f=o[u];return f0?(c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i,i=n.tickIncrement(c,f,r)):i<0&&(c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i,i=n.tickIncrement(c,f,r)),i>0?(o[a]=Math.floor(c/i)*i,o[u]=Math.ceil(f/i)*i,e(o)):i<0&&(o[a]=Math.ceil(c*i)/i,o[u]=Math.floor(f*i)/i,e(o)),t},t}function C(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;df)break;g.push(h)}}else for(;d=1;--l)if(!((h=s*l)f)break;g.push(h)}}else g=n.ticks(d,p,Math.min(p-d,v)).map(r);return i?g.reverse():g},o.tickFormat=function(t,n){if(null==n&&(n=10===u?".0e":","),"function"!=typeof n&&(n=i.format(n)),t===1/0)return n;null==t&&(t=10);var a=Math.max(1,u*t/o.ticks().length);return function(t){var i=t/r(Math.round(e(t)));return i*u0?o[e-1]:r[0],e=o?[a[o-1],i]:[a[e-1],a[e]]},f.unknown=function(t){return arguments.length?(e=t,f):f},f.thresholds=function(){return a.slice()},f.copy=function(){return t().domain([r,i]).range(c).unknown(e)},u.apply(E(f),arguments)},t.scaleThreshold=function t(){var e,r=[.5],i=[0,1],o=1;function a(t){return t<=t?i[n.bisect(r,t,0,o)]:e}return a.domain=function(t){return arguments.length?(r=l.call(t),o=Math.min(r.length,i.length-1),a):r.slice()},a.range=function(t){return arguments.length?(i=l.call(t),o=Math.min(r.length,i.length-1),a):i.slice()},a.invertExtent=function(t){var e=i.indexOf(t);return[r[e-1],r[e]]},a.unknown=function(t){return arguments.length?(e=t,a):e},a.copy=function(){return t().domain(r).range(i).unknown(e)},u.apply(a,arguments)},t.scaleTime=function(){return u.apply(J(o.timeYear,o.timeMonth,o.timeWeek,o.timeDay,o.timeHour,o.timeMinute,o.timeSecond,o.timeMillisecond,a.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return u.apply(J(o.utcYear,o.utcMonth,o.utcWeek,o.utcDay,o.utcHour,o.utcMinute,o.utcSecond,o.utcMillisecond,a.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scaleSequential=function t(){var e=E(K()(y));return e.copy=function(){return tt(e,t())},c.apply(e,arguments)},t.scaleSequentialLog=function t(){var e=P(K()).domain([1,10]);return e.copy=function(){return tt(e,t()).base(e.base())},c.apply(e,arguments)},t.scaleSequentialPow=et,t.scaleSequentialSqrt=function(){return et.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var e=F(K());return e.copy=function(){return tt(e,t()).constant(e.constant())},c.apply(e,arguments)},t.scaleSequentialQuantile=function t(){var e=[],r=y;function i(t){if(!isNaN(t=+t))return r((n.bisect(e,t)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var r,o=0,a=t.length;o-1}},{}],58:[function(t,e,n){"use strict";var r,i,o,a,u,c,f,s=t("d"),l=t("es5-ext/object/valid-callable"),h=Function.prototype.apply,d=Function.prototype.call,p=Object.create,v=Object.defineProperty,g=Object.defineProperties,y=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0};u={on:r=function(t,e){var n;return l(e),y.call(this,"__ee__")?n=this.__ee__:(n=b.value=p(null),v(this,"__ee__",b),b.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i=function(t,e){var n,i;return l(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},off:o=function(t,e){var n,r,i,o;if(l(e),!y.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:a=function(t){var e,n,r,i,o;if(y.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e>1,s=-7,l=n?i-1:0,h=n?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-s)-1,d>>=-s,s+=u;s>0;o=256*o+t[e+l],l+=h,s-=8);for(a=o&(1<<-s)-1,o>>=-s,s+=r;s>0;a=256*a+t[e+l],l+=h,s-=8);if(0===o)o=1-f;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=f}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,u,c,f=8*o-i-1,s=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=s?(u=0,a=s):a+l>=1?(u=(e*c-1)*Math.pow(2,i),a+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&u,d+=p,u/=256,i-=8);for(a=a<0;t[n+d]=255&a,d+=p,a/=256,f-=8);t[n+d-p]|=128*v}},{}],66:[function(t,e,n){var r=[],i=[],o="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function a(t,e){if(e=e||{},void 0===t)throw new Error(o);var n,a=!0===e.prepend?"prepend":"append",u=void 0!==e.container?e.container:document.querySelector("head"),c=r.indexOf(u);return-1===c&&(c=r.push(u)-1,i[c]={}),void 0!==i[c]&&void 0!==i[c][a]?n=i[c][a]:(n=i[c][a]=function(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}(),"prepend"===a?u.insertBefore(n,u.childNodes[0]):u.appendChild(n)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),n.styleSheet?n.styleSheet.cssText+=t:n.textContent+=t,n}e.exports=a,e.exports.insertCss=a},{}],67:[function(t,e,n){(function(t){(function(){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return r.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!r;i--){var a=i>=0?arguments[i]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,r="/"===a.charAt(0))}return n=e(o(n.split("/"),function(t){return!!t}),!r).join("/"),(r?"/":"")+n||"."},n.normalize=function(t){var r=n.isAbsolute(t),i="/"===a(t,-1);return(t=e(o(t.split("/"),function(t){return!!t}),!r).join("/"))||r||(t="."),t&&i&&(t+="/"),(r?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),u=a,c=0;c1)for(var n=1;n>>=e))<<3,(e|=n=(15<(t>>>=n))<<2)|(n=(3<(t>>>=n))<<1)|t>>>n>>1}function u(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=n[a(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){n[a(t.byteLength)>>2].push(t)}var n=o(8,function(){return[]});return{alloc:t,free:e,allocType:function(e,n){var r=null;switch(e){case 5120:r=new Int8Array(t(n),0,n);break;case 5121:r=new Uint8Array(t(n),0,n);break;case 5122:r=new Int16Array(t(2*n),0,n);break;case 5123:r=new Uint16Array(t(2*n),0,n);break;case 5124:r=new Int32Array(t(4*n),0,n);break;case 5125:r=new Uint32Array(t(4*n),0,n);break;case 5126:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){e(t.buffer)}}}function c(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||G(t.data))}function f(t,e,n,r,i,o){for(var a=0;a(i=u)&&(i=r.buffer.byteLength,5123===l?i>>=1:5125===l&&(i>>=2)),r.vertCount=i,i=a,0>a&&(i=4,1===(a=r.buffer.dimension)&&(i=0),2===a&&(i=1),3===a&&(i=4)),r.primType=i}function a(t){r.elementsCount--,delete u[t.id],t.buffer.destroy(),t.buffer=null}var u={},f=0,s={uint8:5121,uint16:5123};e.oes_element_index_uint&&(s.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var l=[];return{create:function(t,e){function u(t){if(t)if("number"==typeof t)f(t),l.primType=4,l.vertCount=0|t,l.type=5121;else{var e=null,n=35044,r=-1,i=-1,a=0,h=0;Array.isArray(t)||G(t)||c(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(n=J[t.usage]),"primitive"in t&&(r=nt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=s[t.type]),"length"in t?a=0|t.length:(a=i,5123===h||5122===h?a*=2:5125!==h&&5124!==h||(a*=4))),o(l,e,n,r,i,a,h)}else f(),l.primType=4,l.vertCount=0,l.type=5121;return u}var f=n.create(null,34963,!0),l=new i(f._buffer);return r.elementsCount++,u(t),u._reglType="elements",u._elements=l,u.subdata=function(t,e){return f.subdata(t,e),u},u.destroy=function(){a(l)},u},createStream:function(t){var e=l.pop();return e||(e=new i(n.create(null,34963,!0,!1)._buffer)),o(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){$(u).forEach(a)}}}function v(t){for(var e=Y.allocType(5123,t.length),n=0;n>>31<<15,i=(o<<1>>>24)-127,o=o>>13&1023;e[n]=-24>i?r:-14>i?r+(o+1024>>-14-i):15>=i,n.height>>=i,d(n,r[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function T(t){for(var e=t.images,n=0;ne){for(var n=0;n=--this.refCount&&B(this)}}),a.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach(function(e){t+=yt[e].stats.size}),t}),{create2D:function(e,n){function r(t,e){var n=i.texInfo;z.call(n);var o=S();return"number"==typeof t?k(o,0|t,"number"==typeof e?0|e:0|t):t?(O(n,t),E(o,t)):k(o,1,1),n.genMipmaps&&(o.mipmask=(o.width<<1)-1),i.mipmask=o.mipmask,f(i,o),i.internalformat=o.internalformat,r.width=o.width,r.height=o.height,P(i),C(o,3553),N(n,3553),D(),T(o),a.profile&&(i.stats.size=M(i.internalformat,i.type,o.width,o.height,n.genMipmaps,!1)),r.format=K[i.internalformat],r.type=tt[i.type],r.mag=et[n.magFilter],r.min=nt[n.minFilter],r.wrapS=rt[n.wrapS],r.wrapT=rt[n.wrapT],r}var i=new j(3553);return yt[i.id]=i,o.textureCount++,r(e,n),r.subimage=function(t,e,n,o){e|=0,n|=0,o|=0;var a=y();return f(a,i),a.width=0,a.height=0,d(a,t),a.width=a.width||(i.width>>o)-e,a.height=a.height||(i.height>>o)-n,P(i),p(a,3553,e,n,o),D(),A(a),r},r.resize=function(e,n){var o=0|e,u=0|n||o;if(o===i.width&&u===i.height)return r;r.width=i.width=o,r.height=i.height=u,P(i);for(var c=0;i.mipmask>>c;++c){var f=o>>c,s=u>>c;if(!f||!s)break;t.texImage2D(3553,c,i.format,f,s,0,i.format,i.type,null)}return D(),a.profile&&(i.stats.size=M(i.internalformat,i.type,o,u,!1,!1)),r},r._reglType="texture2d",r._texture=i,a.profile&&(r.stats=i.stats),r.destroy=function(){i.decRef()},r},createCube:function(e,n,r,i,u,c){function l(t,e,n,r,i,o){var u,c=h.texInfo;for(z.call(c),u=0;6>u;++u)v[u]=S();if("number"!=typeof t&&t){if("object"==typeof t)if(e)E(v[0],t),E(v[1],e),E(v[2],n),E(v[3],r),E(v[4],i),E(v[5],o);else if(O(c,t),s(h,t),"faces"in t)for(t=t.faces,u=0;6>u;++u)f(v[u],h),E(v[u],t[u]);else for(u=0;6>u;++u)E(v[u],t)}else for(t=0|t||1,u=0;6>u;++u)k(v[u],t,t);for(f(h,v[0]),h.mipmask=c.genMipmaps?(v[0].width<<1)-1:v[0].mipmask,h.internalformat=v[0].internalformat,l.width=v[0].width,l.height=v[0].height,P(h),u=0;6>u;++u)C(v[u],34069+u);for(N(c,34067),D(),a.profile&&(h.stats.size=M(h.internalformat,h.type,l.width,l.height,c.genMipmaps,!0)),l.format=K[h.internalformat],l.type=tt[h.type],l.mag=et[c.magFilter],l.min=nt[c.minFilter],l.wrapS=rt[c.wrapS],l.wrapT=rt[c.wrapT],u=0;6>u;++u)T(v[u]);return l}var h=new j(34067);yt[h.id]=h,o.cubeCount++;var v=Array(6);return l(e,n,r,i,u,c),l.subimage=function(t,e,n,r,i){n|=0,r|=0,i|=0;var o=y();return f(o,h),o.width=0,o.height=0,d(o,e),o.width=o.width||(h.width>>i)-n,o.height=o.height||(h.height>>i)-r,P(h),p(o,34069+t,n,r,i),D(),A(o),l},l.resize=function(e){if((e|=0)!==h.width){l.width=h.width=e,l.height=h.height=e,P(h);for(var n=0;6>n;++n)for(var r=0;h.mipmask>>r;++r)t.texImage2D(34069+n,r,h.format,e>>r,e>>r,0,h.format,h.type,null);return D(),a.profile&&(h.stats.size=M(h.internalformat,h.type,l.width,l.height,!1,!0)),l}},l._reglType="textureCube",l._texture=h,a.profile&&(l.stats=h.stats),l.destroy=function(){h.decRef()},l},clear:function(){for(var e=0;en;++n)if(0!=(e.mipmask&1<>n,e.height>>n,0,e.internalformat,e.type,null);else for(var r=0;6>r;++r)t.texImage2D(34069+r,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);N(e.texInfo,e.target)})},refresh:function(){for(var e=0;ei;++i){for(f=0;ft;++t)n[t].resize(r);return e.width=e.height=r,e},_reglType:"framebufferCube",destroy:function(){n.forEach(function(t){t.destroy()})}})},clear:function(){$(A).forEach(g)},restore:function(){m.cur=null,m.next=null,m.dirty=!0,$(A).forEach(function(e){e.framebuffer=t.createFramebuffer(),y(e)})}})}function E(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function C(t,e,n,r,i,o,a){function u(){this.id=++l,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var f=n.maxAttributes,s=Array(f);for(n=0;n=h.byteLength?f.subdata(h):(f.destroy(),n.buffers[u]=null)),n.buffers[u]||(f=n.buffers[u]=i.create(s,34962,!1,!0)),l.buffer=i.getBuffer(f),l.size=0|l.buffer.dimension,l.normalized=!1,l.type=l.buffer.dtype,l.offset=0,l.stride=0,l.divisor=0,l.state=1,t[u]=1;else i.getBuffer(s)?(l.buffer=i.getBuffer(s),l.size=0|l.buffer.dimension,l.normalized=!1,l.type=l.buffer.dtype,l.offset=0,l.stride=0,l.divisor=0,l.state=1):i.getBuffer(s.buffer)?(l.buffer=i.getBuffer(s.buffer),l.size=0|(+s.size||l.buffer.dimension),l.normalized=!!s.normalized||!1,l.type="type"in s?Z[s.type]:l.buffer.dtype,l.offset=0|(s.offset||0),l.stride=0|(s.stride||0),l.divisor=0|(s.divisor||0),l.state=1):"x"in s&&(l.x=+s.x||0,l.y=+s.y||0,l.z=+s.z||0,l.w=+s.w||0,l.state=2)}for(f=0;ft&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);$(f).forEach(e),f={},$(s).forEach(e),s={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,l={},n.shaderCount=0},program:function(e,r,i,o){var a=l[r];a||(a=l[r]={});var d=a[e];if(d&&(d.refCount++,!o))return d;var p=new u(r,e);return n.shaderCount++,c(p,i,o),d||(a[e]=p),h.push(p),I(p,{destroy:function(){if(p.refCount--,0>=p.refCount){t.deleteProgram(p.program);var e=h.indexOf(p);h.splice(e,1),n.shaderCount--}0>=a[p.vertId].refCount&&(t.deleteShader(s[p.vertId]),delete s[p.vertId],delete l[p.fragId][p.vertId]),Object.keys(l[p.fragId]).length||(t.deleteShader(f[p.fragId]),delete f[p.fragId],delete l[p.fragId])}})},restore:function(){f={},s={};for(var t=0;t"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",u,"(",i,".buffer)){",s,"=",o,".createStream(",34962,",",i,".buffer);","}else{",s,"=",o,".getBuffer(",i,".buffer);","}",l,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",s,".dtype;",c.normalized,"=!!",i,".normalized;"),r("size"),r("offset"),r("stride"),r("divisor"),n("}}"),n.exit("if(",c.isStream,"){",o,".destroyStream(",s,");","}"),c})}),a}function k(t,e,r,i,a){function u(t){var e=f[t];e&&(h[t]=e)}var c=function(t,e){if("string"==typeof(n=t.static).frag&&"string"==typeof n.vert){if(0>1)",u],");")}function e(){n(c,".drawArraysInstancedANGLE(",[p,v,g,u],");")}d&&"null"!==d?b?t():(n("if(",d,"){"),t(),n("}else{"),e(),n("}")):e()}function a(){function t(){n(s+".drawElements("+[p,g,y,v+"<<(("+y+"-5121)>>1)"]+");")}function e(){n(s+".drawArrays("+[p,v,g]+");")}d&&"null"!==d?b?t():(n("if(",d,"){"),t(),n("}else{"),e(),n("}")):e()}var u,c,f=t.shared,s=f.gl,l=f.draw,h=r.draw,d=function(){var i=h.elements,o=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(t,o),h.elementsActive&&o("if("+i+")"+s+".bindBuffer(34963,"+i+".buffer.buffer);")):o(i=o.def(),"=",l,".","elements",";","if(",i,"){",s,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",f.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+f.vao,".currentVAO.elements);",rt?"":"if("+i+")"+s+".bindBuffer(34963,"+i+".buffer.buffer);","}"),i}(),p=i("primitive"),v=i("offset"),g=function(){var i=h.count,o=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(t,o)):i=o.def(l,".","count"),i}();if("number"==typeof g){if(0===g)return}else n("if(",g,"){"),n.exit("}");tt&&(u=i("instances"),c=t.instancing);var y=d+".type",b=h.elements&&D(h.elements)&&!h.vaoActive;tt&&("number"!=typeof u||0<=u)?"string"==typeof u?(n("if(",u,">0){"),o(),n("}else if(",u,"<0){"),a(),n("}")):o():a()}function Y(t,e,n,r,i){return i=(e=_()).proc("body",i),tt&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,n,r),e.compile().body}function W(t,e,n,r){R(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),U(t,e,n,r.attributes,function(){return!0})),H(t,e,n,r.uniforms,function(){return!0},!1),V(t,e,e,n)}function G(t,e,n,r){function i(){return!0}t.batchId="a1",R(t,e),U(t,e,n,r.attributes,i),H(t,e,n,r.uniforms,i,!1),V(t,e,e,n)}function $(t,e,n,r){function i(t){return t.contextDep&&a||t.propDep}function o(t){return!i(t)}R(t,e);var a=n.contextDep,u=e.def(),c=e.def();t.shared.props=c,t.batchId=u;var f=t.scope(),s=t.scope();e(f.entry,"for(",u,"=0;",u,"<","a1",";++",u,"){",c,"=","a0","[",u,"];",s,"}",f.exit),n.needsContext&&E(t,s,n.context),n.needsFramebuffer&&C(t,s,n.framebuffer),T(t,s,n.state,i),n.profile&&i(n.profile)&&L(t,s,n,!1,!0),r?(n.useVAO?n.drawVAO?i(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):f(t.shared.vao,".setVAO(",n.drawVAO.append(t,f),");"):f(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(f(t.shared.vao,".setVAO(null);"),U(t,f,n,r.attributes,o),U(t,s,n,r.attributes,i)),H(t,f,n,r.uniforms,o,!1),H(t,s,n,r.uniforms,i,!0),V(t,f,s,n)):(e=t.global.def("{}"),r=n.shader.progVar.append(t,s),c=s.def(r,".id"),f=s.def(e,"[",c,"]"),s(t.shared.gl,".useProgram(",r,".program);","if(!",f,"){",f,"=",e,"[",c,"]=",t.link(function(e){return Y(G,t,n,e,2)}),"(",r,");}",f,".call(this,a0[",u,"],",u,");"))}function X(t,n){function r(e){var r=n.shader[e];r&&i.set(o.shader,"."+e,r.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var o=t.shared,a=o.current;E(t,i,n.context),n.framebuffer&&n.framebuffer.append(t,i),j(Object.keys(n.state)).forEach(function(e){var r=n.state[e].append(t,i);g(r)?r.forEach(function(n,r){i.set(t.next[e],"["+r+"]",n)}):i.set(o.next,"."+e,r)}),L(t,i,n,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(e){var r=n.draw[e];r&&i.set(o.draw,"."+e,""+r.append(t,i))}),Object.keys(n.uniforms).forEach(function(r){var a=n.uniforms[r].append(t,i);Array.isArray(a)&&(a="["+a.join()+"]"),i.set(o.uniforms,"["+e.id(r)+"]",a)}),Object.keys(n.attributes).forEach(function(e){var r=n.attributes[e].append(t,i),o=t.scopeAttrib(e);Object.keys(new J).forEach(function(t){i.set(o,"."+t,r[t])})}),n.scopeVAO&&i.set(o.vao,".targetVAO",n.scopeVAO.append(t,i)),r("vert"),r("frag"),0=--this.refCount&&a(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach(function(e){t+=s[e].stats.size}),t}),{create:function(e,n){function a(e,n){var r=0,o=0,s=32854;if("object"==typeof e&&e?("shape"in e?(r=0|(o=e.shape)[0],o=0|o[1]):("radius"in e&&(r=o=0|e.radius),"width"in e&&(r=0|e.width),"height"in e&&(o=0|e.height)),"format"in e&&(s=u[e.format])):"number"==typeof e?(r=0|e,o="number"==typeof n?0|n:r):e||(r=o=1),r!==f.width||o!==f.height||s!==f.format)return a.width=f.width=r,a.height=f.height=o,f.format=s,t.bindRenderbuffer(36161,f.renderbuffer),t.renderbufferStorage(36161,s,r,o),i.profile&&(f.stats.size=yt[f.format]*f.width*f.height),a.format=c[f.format],a}var f=new o(t.createRenderbuffer());return s[f.id]=f,r.renderbufferCount++,a(e,n),a.resize=function(e,n){var r=0|e,o=0|n||r;return r===f.width&&o===f.height?a:(a.width=f.width=r,a.height=f.height=o,t.bindRenderbuffer(36161,f.renderbuffer),t.renderbufferStorage(36161,f.format,r,o),i.profile&&(f.stats.size=yt[f.format]*f.width*f.height),a)},a._reglType="renderbuffer",a._renderbuffer=f,i.profile&&(a.stats=f.stats),a.destroy=function(){f.decRef()},a},clear:function(){$(s).forEach(a)},restore:function(){$(s).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}},mt=[];mt[6408]=4,mt[6407]=3;var _t=[];_t[5121]=1,_t[5126]=4,_t[36193]=2;var xt=["x","y","z","w"],wt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Mt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},At={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},kt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Et={cw:2304,ccw:2305},Ct=new P(!1,!1,!1,function(){});return function(t){function e(){if(0===Q.length)w&&w.update(),tt=null;else{tt=H.next(e),l();for(var t=Q.length-1;0<=t;--t){var n=Q[t];n&&n(O,null,0)}g.flush(),w&&w.update()}}function n(){!tt&&0=Q.length&&r()}}}}function s(){var t=$.viewport,e=$.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function l(){O.tick+=1,O.time=v(),s(),G.procs.poll()}function h(){F.refresh(),s(),G.procs.refresh(),w&&w.update()}function v(){return(V()-M)/1e3}if(!(t=i(t)))return null;var g=t.gl,y=g.getContextAttributes();g.isContextLost();var b=function(t,e){function n(e){var n;e=e.toLowerCase();try{n=r[e]=t.getExtension(e)}catch(t){}return!!n}for(var r={},i=0;ie;++e)et(I({framebuffer:t.framebuffer.faces[e]},t),c);else et(t,c);else c(0,t)},prop:q.define.bind(null,1),context:q.define.bind(null,2),this:q.define.bind(null,3),draw:u({}),buffer:function(t){return j.create(t,34962,!1,!1)},elements:function(t){return P.create(t,!1)},texture:F.create2D,cube:F.createCube,renderbuffer:U.create,framebuffer:Y.create,framebufferCube:Y.createCube,vao:D.createVAO,attributes:y,frame:f,on:function(t,e){var n;switch(t){case"frame":return f(e);case"lost":n=Z;break;case"restore":n=J;break;case"destroy":n=K}return n.push(e),{cancel:function(){for(var t=0;tt.length)&&(e=t.length);for(var n=0,r=new Array(e);n= iMagnitudeOctaves) ? 0.0 : magWeight").concat(t-1," * bias"),";")}).join("\n "),"\n \n float width1 = max(0.0, lineWidth - lineFeather);\n float width2 = lineWidth + lineFeather;\n\n float w, scaleFactor, value, gridValue;\n float totalWeight = 0.0;\n float magnitudeGrid = 0.0;\n float magnitudeShading = 0.0;\n scaleFactor = pow(steps.x, logtier) / cargGradientMag * 0.25;\n \n ").concat(r(Array(e).keys()).map(function(t){return"w = mix(magWeight".concat(t,", magWeight").concat(t+1,", 1.0 - logspacing + logtier);\n totalWeight += w;\n gridValue = complexContouringGridFunction(magOctave").concat(t,") * scaleFactor;\n magnitudeGrid += w * smoothstep(width1, width2, gridValue);\n value = fract(-magOctave").concat(t,");\n magnitudeShading += w * (0.5 + (domainColoringContrastFunction(value, contrastPower) - 0.5) * min(1.0, gridValue * 1.5));\n scaleFactor *= steps.x;\n ")}).join("\n "),"\n \n magnitudeGrid /= totalWeight;\n magnitudeShading /= totalWeight;\n\n // Phase steps\n invlog2base = 1.0 / log2(steps.y);\n logspacing = log2(cargGradientMag * ").concat(i.toFixed(1)," * res.y) * invlog2base;\n logspacing = clamp(logspacing, -50.0, 50.0);\n logtier = floor(logspacing);\n n = log2(abs(carg) + 1.0) * invlog2base - logtier;\n\n invSteps = 1.0 / steps.y;\n float phaseOctave0 = pow(steps.y, n) * sign(carg);\n\n ").concat(r(Array(n-1).keys()).map(function(t){return"float phaseOctave".concat(t+1," = phaseOctave").concat(t," * invSteps;")}).join("\n "),"\n\n int iPhaseOctaves = int(octaves.y);\n ").concat(r(Array(n+1).keys()).map(function(t){return"float phaseWeight".concat(t," = ").concat(0===t?"1e-4":"(".concat(t," == 0 || ").concat(t," >= iPhaseOctaves) ? 0.0 : phaseWeight").concat(t-1," * bias"),";")}).join("\n "),"\n \n totalWeight = 0.0;\n\n float phaseShading = 0.0;\n float phaseGrid = 0.0;\n scaleFactor = pow(steps.y, logtier) / (cargGradientMag * ").concat(i.toFixed(1),") * 2.0;\n\n ").concat(r(Array(n).keys()).map(function(t){return"w = mix(phaseWeight".concat(t,", phaseWeight").concat(t+1,", 1.0 - logspacing + logtier);\n totalWeight += w;\n gridValue = complexContouringGridFunction(phaseOctave").concat(t,") * scaleFactor;\n phaseGrid += w * smoothstep(width1, width2, gridValue);\n value = fract(phaseOctave").concat(t,");\n phaseShading += w * (0.5 + (domainColoringContrastFunction(value, contrastPower) - 0.5) * min(1.0, gridValue * 1.5));\n scaleFactor *= steps.y;\n ")}).join("\n "),"\n\n phaseGrid /= totalWeight;\n phaseShading /= totalWeight;\n\n float grid = 1.0;\n grid = min(grid, 1.0 - (1.0 - magnitudeGrid) * gridOpacity.x);\n grid = min(grid, 1.0 - (1.0 - phaseGrid) * gridOpacity.y);\n\n float shading = 1.0 - 0.5 * (mix(0.5, 1.0 - phaseShading, shadingOpacity.y) + mix(0.5, 1.0 - magnitudeShading, shadingOpacity.x));\n\n vec3 result = mix(vec3(pow(max(0.0, shading), 1./2.2)), rainbow(\n vec2(carg / ").concat(i.toFixed(1)," - 0.25, shading)\n ).rgb, saturation);\n //vec2 uv = vec2(carg / ").concat(i.toFixed(1)," - 0.25, shading);\n //vec3 result = cubehelixRainbow(0.25 - uv.x).rgb * mix(0.6, 1.0, uv.y);\n \n result = mix(gridColor, result, grid);\n\n return vec4(result, 1.0);\n }")}},{}],75:[function(t,e,n){"use strict";t("path");var r=t("./domain-coloring.js");e.exports=function(t){var e=r({maxMagnitudeOctaves:10,maxPhaseOctaves:10});return t({vert:"\n precision highp float;\n attribute vec2 xy;\n uniform mat4 inverseView;\n varying vec2 z;\n void main () {\n z = (inverseView * vec4(xy, 0, 1)).xy;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:"\n #extension GL_OES_standard_derivatives : enable\n\n #define PHI 2.39996322972865332\n #define PI 3.141592653589793238\n #define HALF_PI 1.57079632679\n #define HALF_PI_INV 0.15915494309\n #define LOG_2 0.69314718056\n #define C_ONE (vec2(1.0, 0.0))\n #define C_I (vec2(0.0, 1.0))\n #define TO_RADIANS 0.01745329251\n\n precision highp float;\n\n ".concat("#ifndef PI\n#define PI 3.141592653589793238\n#endif\n\nfloat hypot (vec2 z) {\n float x = abs(z.x);\n float y = abs(z.y);\n float t = min(x, y);\n x = max(x, y);\n t = t / x;\n return x * sqrt(1.0 + t * t);\n\n // This conditional seems unnecessary on the non-cpu version\n //return (z.x == 0.0 && z.y == 0.0) ? 0.0 : x * sqrt(1.0 + t * t);\n}\n\nvec2 cadd (vec2 a, vec2 b) {\n return a + b;\n}\n\nvec2 csub (vec2 a, vec2 b) {\n return a - b;\n}\n\nfloat cmod (vec2 z) {\n return hypot(z);\n} \n\nvec2 csqrt (vec2 z) {\n float t = sqrt(2.0 * (cmod(z) + (z.x >= 0.0 ? z.x : -z.x)));\n vec2 f = vec2(0.5 * t, abs(z.y) / t);\n\n if (z.x < 0.0) f.xy = f.yx;\n if (z.y < 0.0) f.y = -f.y;\n\n return f;\n}\n\nfloat sinh (float x) {\n return 0.5 * (exp(x) - exp(-x));\n}\n\nfloat cosh (float x) {\n return 0.5 * (exp(x) + exp(-x));\n}\n\nvec2 sinhcosh (float x) {\n vec2 ex = exp(vec2(x, -x));\n return 0.5 * (ex - vec2(ex.y, -ex.x));\n}\n\nfloat cabs (vec2 z) {\n return cmod(z);\n}\n\nvec2 clog(vec2 z) {\n return vec2(\n log(hypot(z)),\n atan(z.y, z.x)\n );\n}\n\nvec2 catan (vec2 z) {\n float a = z.x * z.x + (1.0 - z.y) * (1.0 - z.y);\n vec2 b = clog(vec2(1.0 - z.y * z.y - z.x * z.x, -2.0 * z.x) / a);\n return 0.5 * vec2(-b.y, b.x);\n} \n\nvec2 catanh (vec2 z) {\n float oneMinus = 1.0 - z.x;\n float onePlus = 1.0 + z.x;\n float d = oneMinus * oneMinus + z.y * z.y;\n\n vec2 x = vec2(onePlus * oneMinus - z.y * z.y, z.y * 2.0) / d;\n\n vec2 result = vec2(log(hypot(x)), atan(x.y, x.x)) * 0.5;\n\n return result;\n} \n\nvec2 cacos (vec2 z) {\n vec2 a = csqrt(vec2(\n z.y * z.y - z.x * z.x + 1.0,\n -2.0 * z.x * z.y\n ));\n\n vec2 b = clog(vec2(a.x - z.y, a.y + z.x));\n return vec2((PI * 0.5) - b.y, b.x);\n} \n\nvec2 cacosh (vec2 z) {\n vec2 a = cacos(z);\n\n if (a.y <= 0.0) {\n return vec2(-a.y, a.x);\n }\n\n return vec2(a.y, -a.x);\n} \n\nvec2 cacot (vec2 z) {\n return catan(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 cacoth(vec2 z) {\n return catanh(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 casin (vec2 z) {\n vec2 a = csqrt(vec2(\n z.y * z.y - z.x * z.x + 1.0,\n -2.0 * z.x * z.y\n ));\n\n vec2 b = clog(vec2(\n a.x - z.y,\n a.y + z.x\n ));\n\n return vec2(b.y, -b.x);\n} \n\nvec2 casinh (vec2 z) {\n vec2 res = casin(vec2(z.y, -z.x));\n return vec2(-res.y, res.x);\n} \n\nvec2 cacsch(vec2 z) {\n return casinh(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 casec (vec2 z) {\n float d = dot(z, z);\n return cacos(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 casech(vec2 z) {\n return cacosh(vec2(z.x, -z.y) / dot(z, z));\n} \n\nvec2 cconj (vec2 z) {\n return vec2(z.x, -z.y);\n} \n\nvec2 ccos (vec2 z) {\n return sinhcosh(z.y).yx * vec2(cos(z.x), -sin(z.x));\n} \n\nvec2 ccosh (vec2 z) {\n return sinhcosh(z.x).yx * vec2(cos(z.y), sin(z.y));\n} \n\nvec2 ccot (vec2 z) {\n z *= 2.0;\n vec2 sch = sinhcosh(z.y);\n return vec2(-sin(z.x), sch.x) / (cos(z.x) - sch.y);\n} \n\nvec2 ccoth(vec2 z) {\n z *= 2.0;\n vec2 sch = sinhcosh(z.x);\n return vec2(sch.x, -sin(z.y)) / (sch.y - cos(z.y));\n} \n\nvec2 ccsc (vec2 z) {\n float d = 0.25 * (exp(2.0 * z.y) + exp(-2.0 * z.y)) - 0.5 * cos(2.0 * z.x);\n\n return sinhcosh(z.y).yx * vec2(sin(z.x), -cos(z.x)) / d;\n} \n\nvec2 ccsch (vec2 z) {\n vec2 sch = sinhcosh(z.x);\n float d = cos(2.0 * z.y) - (exp(2.0 * z.x) + exp(-2.0 * z.x)) * 0.5;\n return vec2(-cos(z.y), sin(z.y)) * sch / (0.5 * d);\n} \n\nvec2 cdiv (vec2 a, vec2 b) {\n float e, f;\n float g = 1.0;\n float h = 1.0;\n\n if( abs(b.x) >= abs(b.y) ) {\n e = b.y / b.x;\n f = b.x + b.y * e;\n h = e;\n } else {\n e = b.x / b.y;\n f = b.x * e + b.y;\n g = e;\n }\n\n return (a * g + h * vec2(a.y, -a.x)) / f;\n} \n\nvec2 cexp(vec2 z) {\n return vec2(cos(z.y), sin(z.y)) * exp(z.x);\n} \n\nvec2 cinv (vec2 b) {\n float e, f;\n vec2 g = vec2(1, -1);\n\n if( abs(b.x) >= abs(b.y) ) {\n e = b.y / b.x;\n f = b.x + b.y * e;\n g.y = -e;\n } else {\n e = b.x / b.y;\n f = b.x * e + b.y;\n g.x = e;\n }\n\n return g / f;\n} \n\nvec2 cmul (vec2 a, vec2 b) {\n return vec2(\n a.x * b.x - a.y * b.y,\n a.y * b.x + a.x * b.y\n );\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c) {\n return cmul(cmul(a, b), c);\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c, vec2 d) {\n return cmul(cmul(a, b), cmul(c, d));\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c, vec2 d, vec2 e) {\n return cmul(cmul(a, b, c), cmul(d, e));\n}\n\nvec2 cmul (vec2 a, vec2 b, vec2 c, vec2 d, vec2 e, vec2 f) {\n return cmul(cmul(a, b, c), cmul(d, e, f));\n} \n\nvec2 cpolar (vec2 z) {\n return vec2(\n atan(z.y, z.x),\n hypot(z)\n );\n} \n\nvec2 cpow (vec2 z, float x) {\n float r = hypot(z);\n float theta = atan(z.y, z.x) * x;\n return vec2(cos(theta), sin(theta)) * pow(r, x);\n}\n\nvec2 cpow (vec2 a, vec2 b) {\n float aarg = atan(a.y, a.x);\n float amod = hypot(a);\n\n float theta = log(amod) * b.y + aarg * b.x;\n\n return vec2(\n cos(theta),\n sin(theta)\n ) * pow(amod, b.x) * exp(-aarg * b.y);\n} \n\nvec2 csec (vec2 z) {\n float d = 0.25 * (exp(2.0 * z.y) + exp(-2.0 * z.y)) + 0.5 * cos(2.0 * z.x);\n return sinhcosh(z.y).yx * vec2(cos(z.x), sin(z.x)) / d;\n} \n\nvec2 csech(vec2 z) {\n float d = cos(2.0 * z.y) + 0.5 * (exp(2.0 * z.x) + exp(-2.0 * z.x));\n vec2 sch = sinhcosh(z.x);\n\n return vec2(cos(z.y), -sin(z.y)) * sch.yx / (0.5 * d);\n} \n\nvec2 csin (vec2 z) {\n return sinhcosh(z.y).yx * vec2(sin(z.x), cos(z.x));\n} \n\nvec4 csincos (vec2 z) {\n float c = cos(z.x);\n float s = sin(z.x);\n return sinhcosh(z.y).yxyx * vec4(s, c, c, -s);\n} \n\nvec2 csinh (vec2 z) {\n return sinhcosh(z.x) * vec2(cos(z.y), sin(z.y));\n} \n\nvec2 csqr (vec2 z) {\n return vec2(\n z.x * z.x - z.y * z.y,\n 2.0 * z.x * z.y\n );\n} \n\nvec2 ctan (vec2 z) {\n vec2 e2iz = cexp(2.0 * vec2(-z.y, z.x));\n\n return cdiv(\n e2iz - vec2(1, 0),\n vec2(-e2iz.y, 1.0 + e2iz.x)\n );\n} \n\nvec2 ctanh (vec2 z) {\n z *= 2.0;\n vec2 sch = sinhcosh(z.x);\n return vec2(sch.x, sin(z.y)) / (sch.y + cos(z.y));\n}\n","\n ").concat(e,"\n\n uniform mat4 mViewInv;\n uniform float w, lineWidth;\n varying vec2 z;\n uniform vec4 w2c2;\n\n uniform float ramp, saturation, bias;\n uniform vec2 divisions, octaves, scale, shading, grid;\n\n vec4 computePQ (vec2 k2) {\n vec4 pq2 = w2c2 - k2.xyxy;\n vec2 mag2 = pq2.xz * pq2.xz + pq2.yw * pq2.yw;\n float pmag = sqrt(sqrt(mag2.x));\n float qmag = sqrt(sqrt(mag2.y));\n float parg = 0.5 * atan(pq2.y, pq2.x);\n float qarg = 0.5 * atan(pq2.w, pq2.z);\n return vec4(\n pmag * vec2(cos(parg), sin(parg)),\n qmag * vec2(cos(qarg), sin(qarg))\n );\n }\n\n vec2 f(vec2 z) {\n vec2 k2 = csqr(z.xy);\n vec4 p2_q2 = w2c2 - k2.xyxy;\n vec4 halfPq = computePQ(k2) * 0.5;\n\n // (k^2 - q^2)^2:\n vec2 k2q22 = csqr(k2 - p2_q2.zw);\n\n // 4 * k^2 * q * p:\n vec2 k24pq = 16.0 * cmul(k2, cmul(halfPq.xy, halfPq.zw));\n vec4 scHalfP = csincos(halfPq.xy);\n vec4 scHalfQ = csincos(halfPq.zw);\n vec2 cospsinq = cmul(scHalfP.zw, scHalfQ.xy);\n vec2 cosqsinp = cmul(scHalfQ.zw, scHalfP.xy);\n\n return cmul(k2q22, cospsinq) + cmul(k24pq, cosqsinp);\n }\n\n float gridFactor (vec2 parameter, float width, float feather) {\n float w1 = width - feather * 0.5;\n vec2 d = fwidth(parameter);\n vec2 looped = 0.5 - abs(mod(parameter, 1.0) - 0.5);\n vec2 a2 = smoothstep(d * (w1 + feather), d * w1, looped);\n return max(a2.x, a2.y);\n }\n\n void main () {\n vec2 fz = f(z);\n\n gl_FragColor = vec4(domainColoring(\n vec4(fz, fwidth(fz) * 0.5),\n octaves,\n divisions,\n scale,\n grid,\n shading,\n lineWidth, // line width\n 1.0, // line feather\n vec3(0), // line color\n ramp,\n saturation,\n bias\n ));\n\n float grid = gridFactor(z / 10.0, 1.0, 1.0);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0), grid * 0.2);\n }\n "),attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{w2c2:t.prop("w2c2"),w:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){return w}),lineWidth:function(t,e){return(e.oRes?.1:.5)*t.pixelRatio},divisions:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.divisions,i.divisions]},octaves:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.octaves,i.octaves]},scale:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.scale,i.scale]},shading:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.shading,i.shading]},grid:function(t,e){var n=e.t.dc,r=n.magnitude,i=n.phase;return[r.grid,i.grid]},ramp:t.prop("t.dc.contrastRamp"),saturation:t.prop("t.dc.saturation"),bias:t.prop("t.dc.bias")},depth:{enable:!1},count:3})}},{"./domain-coloring.js":74,path:67}],76:[function(t,e,n){"use strict";function r(t){"@babel/helpers - typeof";return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e