forked from d3plus/d3plus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
d3plus.min.js
17 lines (17 loc) · 536 KB
/
d3plus.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
!function t(e,r,n){function a(i,s){if(!r[i]){if(!e[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[i]={exports:{}};e[i][0].call(c.exports,function(t){var r=e[i][1][t];return a(r?r:t)},c,c.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e,t,r){(function(t){"use strict";function n(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function a(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e){return this instanceof o?(o.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof e?i(this,e):"string"==typeof e?s(this,e,arguments.length>1?arguments[1]:"utf8"):l(this,e)):arguments.length>1?new o(e,arguments[1]):new o(e)}function i(e,t){if(e=v(e,0>t?0:0|g(t)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;t>r;r++)e[r]=0;return e}function s(e,t,r){("string"!=typeof r||""===r)&&(r="utf8");var n=0|y(t,r);return e=v(e,n),e.write(t,r),e}function l(e,t){if(o.isBuffer(t))return u(e,t);if(J(t))return c(e,t);if(null==t)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(t.buffer instanceof ArrayBuffer)return d(e,t);if(t instanceof ArrayBuffer)return f(e,t)}return t.length?p(e,t):h(e,t)}function u(e,t){var r=0|g(t.length);return e=v(e,r),t.copy(e,0,0,r),e}function c(e,t){var r=0|g(t.length);e=v(e,r);for(var n=0;r>n;n+=1)e[n]=255&t[n];return e}function d(e,t){var r=0|g(t.length);e=v(e,r);for(var n=0;r>n;n+=1)e[n]=255&t[n];return e}function f(e,t){return t.byteLength,o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):e=d(e,new Uint8Array(t)),e}function p(e,t){var r=0|g(t.length);e=v(e,r);for(var n=0;r>n;n+=1)e[n]=255&t[n];return e}function h(e,t){var r,n=0;"Buffer"===t.type&&J(t.data)&&(r=t.data,n=0|g(r.length)),e=v(e,n);for(var a=0;n>a;a+=1)e[a]=255&r[a];return e}function v(e,t){o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):e.length=t;var r=0!==t&&t<=o.poolSize>>>1;return r&&(e.parent=K),e}function g(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function m(e,t){if(!(this instanceof m))return new m(e,t);var r=new o(e,t);return delete r.parent,r}function y(e,t){"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(n)return L(e).length;t=(""+t).toLowerCase(),n=!0}}function x(e,t,r){var n=!1;if(t=0|t,r=void 0===r||r===1/0?this.length:0|r,e||(e="utf8"),0>t&&(t=0),r>this.length&&(r=this.length),t>=r)return"";for(;;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return E(this,t,r);case"binary":return F(this,t,r);case"base64":return j(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n),n>a&&(n=a)):n=a;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var i=0;n>i;i++){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[r+i]=s}return i}function w(e,t,r,n){return G(L(t,e.length-r),e,r,n)}function _(e,t,r,n){return G(Y(t),e,r,n)}function k(e,t,r,n){return _(e,t,r,n)}function z(e,t,r,n){return G(X(t),e,r,n)}function A(e,t,r,n){return G(H(t,e.length-r),e,r,n)}function j(e,t,r){return 0===t&&r===e.length?W.fromByteArray(e):W.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;r>a;){var o=e[a],i=null,s=o>239?4:o>223?3:o>191?2:1;if(r>=a+s){var l,u,c,d;switch(s){case 1:128>o&&(i=o);break;case 2:l=e[a+1],128===(192&l)&&(d=(31&o)<<6|63&l,d>127&&(i=d));break;case 3:l=e[a+1],u=e[a+2],128===(192&l)&&128===(192&u)&&(d=(15&o)<<12|(63&l)<<6|63&u,d>2047&&(55296>d||d>57343)&&(i=d));break;case 4:l=e[a+1],u=e[a+2],c=e[a+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(d=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c,d>65535&&1114112>d&&(i=d))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),a+=s}return O(n)}function O(e){var t=e.length;if(Z>=t)return String.fromCharCode.apply(String,e);for(var r="",n=0;t>n;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Z));return r}function E(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;r>a;a++)n+=String.fromCharCode(127&e[a]);return n}function F(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;r>a;a++)n+=String.fromCharCode(e[a]);return n}function S(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var a="",o=t;r>o;o++)a+=U(e[o]);return a}function T(e,t,r){for(var n=e.slice(t,r),a="",o=0;o<n.length;o+=2)a+=String.fromCharCode(n[o]+256*n[o+1]);return a}function C(e,t,r){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,a,i){if(!o.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>a||i>t)throw new RangeError("value is out of bounds");if(r+n>e.length)throw new RangeError("index out of range")}function N(e,t,r,n){0>t&&(t=65535+t+1);for(var a=0,o=Math.min(e.length-r,2);o>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function P(e,t,r,n){0>t&&(t=4294967295+t+1);for(var a=0,o=Math.min(e.length-r,4);o>a;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function I(e,t,r,n,a,o){if(r+n>e.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function q(e,t,r,n,a){return a||I(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function V(e,t,r,n,a){return a||I(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function R(e){if(e=D(e).replace($,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function D(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function U(e){return 16>e?"0"+e.toString(16):e.toString(16)}function L(e,t){t=t||1/0;for(var r,n=e.length,a=null,o=[],i=0;n>i;i++){if(r=e.charCodeAt(i),r>55295&&57344>r){if(!a){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&o.push(239,191,189);continue}a=r;continue}if(56320>r){(t-=3)>-1&&o.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,128>r){if((t-=1)<0)break;o.push(r)}else if(2048>r){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(65536>r){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Y(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}function H(e,t){for(var r,n,a,o=[],i=0;i<e.length&&!((t-=2)<0);i++)r=e.charCodeAt(i),n=r>>8,a=r%256,o.push(a),o.push(n);return o}function X(e){return W.toByteArray(R(e))}function G(e,t,r,n){for(var a=0;n>a&&!(a+r>=t.length||a>=e.length);a++)t[a+r]=e[a];return a}var W=e("base64-js"),Q=e("ieee754"),J=e("isarray");r.Buffer=o,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50,o.poolSize=8192;var K={};o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),o._augment=function(e){return e.__proto__=o.prototype,e},o.TYPED_ARRAY_SUPPORT?(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array):(o.prototype.length=void 0,o.prototype.parent=void 0),o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);i>a&&e[a]===t[a];)++a;return a!==i&&(r=e[a],n=t[a]),n>r?-1:r>n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!J(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new o(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;r++)t+=e[r].length;var n=new o(t),a=0;for(r=0;r<e.length;r++){var i=e[r];i.copy(n,a),a+=i.length}return n},o.byteLength=y,o.prototype._isBuffer=!0,o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?M(this,0,e):x.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:o.compare(this,e)},o.prototype.indexOf=function(e,t){function r(e,t,r){for(var n=-1,a=0;r+a<e.length;a++)if(e[r+a]===t[-1===n?0:a-n]){if(-1===n&&(n=a),a-n+1===t.length)return r+n}else n=-1;return-1}if(t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,t);if(o.isBuffer(e))return r(this,e,t);if("number"==typeof e)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):r(this,[e],t);throw new TypeError("val must be string, number or Buffer")},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t=0|t,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var a=n;n=t,t=0|r,r=a}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(0>r||0>t)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return _(this,e,t,r);case"binary":return k(this,e,t,r);case"base64":return z(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),e>t&&(t=e);var n;if(o.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=o.prototype;else{var a=t-e;n=new o(a,void 0);for(var i=0;a>i;i++)n[i]=this[i+e]}return n.length&&(n.parent=this.parent||this),n},o.prototype.readUIntLE=function(e,t,r){e=0|e,t=0|t,r||C(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n},o.prototype.readUIntBE=function(e,t,r){e=0|e,t=0|t,r||C(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},o.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e=0|e,t=0|t,r||C(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e=0|e,t=0|t,r||C(e,t,this.length);for(var n=t,a=1,o=this[e+--n];n>0&&(a*=256);)o+=this[e+--n]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),Q.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),Q.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),Q.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),Q.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t=0|t,r=0|r,n||B(this,e,t,r,Math.pow(2,8*r),0);var a=1,o=0;for(this[t]=255&e;++o<r&&(a*=256);)this[t+o]=e/a&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){e=+e,t=0|t,r=0|r,n||B(this,e,t,r,Math.pow(2,8*r),0);var a=r-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=0|t,!n){var a=Math.pow(2,8*r-1);B(this,e,t,r,a-1,-a)}var o=0,i=1,s=0>e?1:0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=(e/i>>0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=0|t,!n){var a=Math.pow(2,8*r-1);B(this,e,t,r,a-1,-a)}var o=r-1,i=1,s=0>e?1:0;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=(e/i>>0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t=0|t,r||B(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return V(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return V(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a,i=n-r;if(this===e&&t>r&&n>t)for(a=i-1;a>=0;a--)e[a+t]=this[a+r];else if(1e3>i||!o.TYPED_ARRAY_SUPPORT)for(a=0;i>a;a++)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},o.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),t>r)throw new RangeError("end < start");if(r!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof e)for(n=t;r>n;n++)this[n]=e;else{var a=L(e.toString()),o=a.length;for(n=t;r>n;n++)this[n]=a[n%o]}return this}};var $=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":2,ieee754:3,isarray:4}],2:[function(e,t,r){!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===i||t===d?62:t===s||t===f?63:l>t?-1:l+10>t?t-l+26+26:c+26>t?t-c:u+26>t?t-u+26:void 0}function r(e){function r(e){u[d++]=e}var n,a,i,s,l,u;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.length;l="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,u=new o(3*e.length/4-l),i=l>0?e.length-4:e.length;var d=0;for(n=0,a=0;i>n;n+=4,a+=3)s=t(e.charAt(n))<<18|t(e.charAt(n+1))<<12|t(e.charAt(n+2))<<6|t(e.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===l?(s=t(e.charAt(n))<<2|t(e.charAt(n+1))>>4,r(255&s)):1===l&&(s=t(e.charAt(n))<<10|t(e.charAt(n+1))<<4|t(e.charAt(n+2))>>2,r(s>>8&255),r(255&s)),u}function n(e){function t(e){return a.charAt(e)}function r(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var n,o,i,s=e.length%3,l="";for(n=0,i=e.length-s;i>n;n+=3)o=(e[n]<<16)+(e[n+1]<<8)+e[n+2],l+=r(o);switch(s){case 1:o=e[e.length-1],l+=t(o>>2),l+=t(o<<4&63),l+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],l+=t(o>>10),l+=t(o>>4&63),l+=t(o<<2&63),l+="="}return l}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="+".charCodeAt(0),s="/".charCodeAt(0),l="0".charCodeAt(0),u="a".charCodeAt(0),c="A".charCodeAt(0),d="-".charCodeAt(0),f="_".charCodeAt(0);e.toByteArray=r,e.fromByteArray=n}("undefined"==typeof r?this.base64js={}:r)},{}],3:[function(e,t,r){r.read=function(e,t,r,n,a){var o,i,s=8*a-n-1,l=(1<<s)-1,u=l>>1,c=-7,d=r?a-1:0,f=r?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=f,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=n;c>0;i=256*i+e[t+d],d+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return i?NaN:(p?-1:1)*(1/0);i+=Math.pow(2,n),o-=u}return(p?-1:1)*i*Math.pow(2,o-n)},r.write=function(e,t,r,n,a,o){var i,s,l,u=8*o-a-1,c=(1<<u)-1,d=c>>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,h=n?1:-1,v=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),t+=i+d>=1?f/l:f*Math.pow(2,1-d),t*l>=2&&(i++,l/=2),i+d>=c?(s=0,i=c):i+d>=1?(s=(t*l-1)*Math.pow(2,a),i+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),i=0));a>=8;e[r+p]=255&s,p+=h,s/=256,a-=8);for(i=i<<a|s,u+=a;u>0;e[r+p]=255&i,p+=h,i/=256,u-=8);e[r+p-h]|=128*v}},{}],4:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],5:[function(e,t,r){t.exports=e("./lib/heap")},{"./lib/heap":6}],6:[function(e,t,r){(function(){var e,n,a,o,i,s,l,u,c,d,f,p,h,v,g;a=Math.floor,d=Math.min,n=function(e,t){return t>e?-1:e>t?1:0},c=function(e,t,r,o,i){var s;if(null==r&&(r=0),null==i&&(i=n),0>r)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);o>r;)s=a((r+o)/2),i(t,e[s])<0?o=s:r=s+1;return[].splice.apply(e,[r,r-r].concat(t)),t},s=function(e,t,r){return null==r&&(r=n),e.push(t),v(e,0,e.length-1,r)},i=function(e,t){var r,a;return null==t&&(t=n),r=e.pop(),e.length?(a=e[0],e[0]=r,g(e,0,t)):a=r,a},u=function(e,t,r){var a;return null==r&&(r=n),a=e[0],e[0]=t,g(e,0,r),a},l=function(e,t,r){var a;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(a=[e[0],t],t=a[0],e[0]=a[1],g(e,0,r)),t},o=function(e,t){var r,o,i,s,l,u;for(null==t&&(t=n),s=function(){u=[];for(var t=0,r=a(e.length/2);r>=0?r>t:t>r;r>=0?t++:t--)u.push(t);return u}.apply(this).reverse(),l=[],o=0,i=s.length;i>o;o++)r=s[o],l.push(g(e,r,t));return l},h=function(e,t,r){var a;return null==r&&(r=n),a=e.indexOf(t),-1!==a?(v(e,0,a,r),g(e,a,r)):void 0},f=function(e,t,r){var a,i,s,u,c;if(null==r&&(r=n),i=e.slice(0,t),!i.length)return i;for(o(i,r),c=e.slice(t),s=0,u=c.length;u>s;s++)a=c[s],l(i,a,r);return i.sort(r).reverse()},p=function(e,t,r){var a,s,l,u,f,p,h,v,g,m;if(null==r&&(r=n),10*t<=e.length){if(u=e.slice(0,t).sort(r),!u.length)return u;for(l=u[u.length-1],v=e.slice(t),f=0,h=v.length;h>f;f++)a=v[f],r(a,l)<0&&(c(u,a,0,null,r),u.pop(),l=u[u.length-1]);return u}for(o(e,r),m=[],s=p=0,g=d(t,e.length);g>=0?g>p:p>g;s=g>=0?++p:--p)m.push(i(e,r));return m},v=function(e,t,r,a){var o,i,s;for(null==a&&(a=n),o=e[r];r>t&&(s=r-1>>1,i=e[s],a(o,i)<0);)e[r]=i,r=s;return e[r]=o},g=function(e,t,r){var a,o,i,s,l;for(null==r&&(r=n),o=e.length,l=t,i=e[t],a=2*t+1;o>a;)s=a+1,o>s&&!(r(e[a],e[s])<0)&&(a=s),e[t]=e[a],t=a,a=2*t+1;return e[t]=i,v(e,l,t,r)},e=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=s,e.pop=i,e.replace=u,e.pushpop=l,e.heapify=o,e.updateItem=h,e.nlargest=f,e.nsmallest=p,e.prototype.push=function(e){return s(this.nodes,e,this.cmp)},e.prototype.pop=function(){return i(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return u(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return l(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return o(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return h(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return t=new e,t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),function(e,n){return"function"==typeof define&&define.amd?define([],n):"object"==typeof r?t.exports=n():e.Heap=n()}(this,function(){return e})}).call(this)},{}],7:[function(require,module,exports){(function(global){"use strict";var numeric="undefined"==typeof exports?function(){}:exports;"undefined"!=typeof global&&(global.numeric=numeric),numeric.version="1.2.6",numeric.bench=function(e,t){var r,n,a,o;for("undefined"==typeof t&&(t=15),a=.5,r=new Date;;){for(a*=2,o=a;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;if(n=new Date,n-r>t)break}for(o=a;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;return n=new Date,1e3*(3*a-1)/(n-r)},numeric._myIndexOf=function(e){var t,r=this.length;for(t=0;r>t;++t)if(this[t]===e)return t;return-1},numeric.myIndexOf=Array.prototype.indexOf?Array.prototype.indexOf:numeric._myIndexOf,numeric.Function=Function,numeric.precision=4,numeric.largeArray=50,numeric.prettyPrint=function(e){function t(e){if(0===e)return"0";if(isNaN(e))return"NaN";if(0>e)return"-"+t(-e);if(isFinite(e)){var r=Math.floor(Math.log(e)/Math.log(10)),n=e/Math.pow(10,r),a=n.toPrecision(numeric.precision);return 10===parseFloat(a)&&(r++,n=1,a=n.toPrecision(numeric.precision)),parseFloat(a).toString()+"e"+r.toString()}return"Infinity"}function r(e){var a;if("undefined"==typeof e)return n.push(Array(numeric.precision+8).join(" ")),!1;if("string"==typeof e)return n.push('"'+e+'"'),!1;if("boolean"==typeof e)return n.push(e.toString()),!1;if("number"==typeof e){var o=t(e),i=e.toPrecision(numeric.precision),s=parseFloat(e.toString()).toString(),l=[o,i,s,parseFloat(i).toString(),parseFloat(s).toString()];for(a=1;a<l.length;a++)l[a].length<o.length&&(o=l[a]);return n.push(Array(numeric.precision+8-o.length).join(" ")+o),!1}if(null===e)return n.push("null"),!1;if("function"==typeof e){n.push(e.toString());var u=!1;for(a in e)e.hasOwnProperty(a)&&(u?n.push(",\n"):n.push("\n{"),u=!0,n.push(a),n.push(": \n"),r(e[a]));return u&&n.push("}\n"),!0}if(e instanceof Array){if(e.length>numeric.largeArray)return n.push("...Large Array..."),!0;var u=!1;for(n.push("["),a=0;a<e.length;a++)a>0&&(n.push(","),u&&n.push("\n ")),u=r(e[a]);return n.push("]"),!0}n.push("{");var u=!1;for(a in e)e.hasOwnProperty(a)&&(u&&n.push(",\n"),u=!0,n.push(a),n.push(": \n"),r(e[a]));return n.push("}"),!0}var n=[];return r(e),n.join("")},numeric.parseDate=function(e){function t(e){if("string"==typeof e)return Date.parse(e.replace(/-/g,"/"));if(!(e instanceof Array))throw new Error("parseDate: parameter must be arrays of strings");var r,n=[];for(r=0;r<e.length;r++)n[r]=t(e[r]);return n}return t(e)},numeric.parseFloat=function(e){function t(e){if("string"==typeof e)return parseFloat(e);if(!(e instanceof Array))throw new Error("parseFloat: parameter must be arrays of strings");var r,n=[];for(r=0;r<e.length;r++)n[r]=t(e[r]);return n}return t(e)},numeric.parseCSV=function(e){var t,r,n=e.split("\n"),a=[],o=/(([^'",]*)|('[^']*')|("[^"]*")),/g,i=/^\s*(([+-]?[0-9]+(\.[0-9]*)?(e[+-]?[0-9]+)?)|([+-]?[0-9]*(\.[0-9]+)?(e[+-]?[0-9]+)?))\s*$/,s=function(e){return e.substr(0,e.length-1)},l=0;for(r=0;r<n.length;r++){var u,c=(n[r]+",").match(o);if(c.length>0){for(a[l]=[],t=0;t<c.length;t++)u=s(c[t]),i.test(u)?a[l][t]=parseFloat(u):a[l][t]=u;l++}}return a},numeric.toCSV=function(e){var t,r,n,a,o,i,s=numeric.dim(e);for(n=s[0],a=s[1],i=[],t=0;n>t;t++){for(o=[],r=0;n>r;r++)o[r]=e[t][r].toString();i[t]=o.join(", ")}return i.join("\n")+"\n"},numeric.getURL=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(),t},numeric.imageURL=function(e){function t(e){var t,r,n,a,o,i,s,l,u=e.length,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="";for(t=0;u>t;t+=3)r=e[t],n=e[t+1],a=e[t+2],o=r>>2,i=((3&r)<<4)+(n>>4),s=((15&n)<<2)+(a>>6),l=63&a,t+1>=u?s=l=64:t+2>=u&&(l=64),d+=c.charAt(o)+c.charAt(i)+c.charAt(s)+c.charAt(l);return d}function r(e,t,r){"undefined"==typeof t&&(t=0),"undefined"==typeof r&&(r=e.length);var n,a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],o=-1,i=0;e.length;for(n=t;r>n;n++)i=255&(o^e[n]),o=o>>>8^a[i];return-1^o}var n,a,o,i,s,l,u,c,d,f,p=e[0].length,h=e[0][0].length,v=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,h>>24&255,h>>16&255,h>>8&255,255&h,p>>24&255,p>>16&255,p>>8&255,255&p,8,2,0,0,0,-1,-2,-3,-4,-5,-6,-7,-8,73,68,65,84,8,29];for(f=r(v,12,29),v[29]=f>>24&255,v[30]=f>>16&255,v[31]=f>>8&255,v[32]=255&f,n=1,a=0,u=0;p>u;u++){for(p-1>u?v.push(0):v.push(1),s=3*h+1+(0===u)&255,l=3*h+1+(0===u)>>8&255,v.push(s),v.push(l),v.push(255&~s),v.push(255&~l),0===u&&v.push(0),c=0;h>c;c++)for(o=0;3>o;o++)s=e[o][u][c],s=s>255?255:0>s?0:Math.round(s),n=(n+s)%65521,a=(a+n)%65521,v.push(s);v.push(0)}return d=(a<<16)+n,v.push(d>>24&255),v.push(d>>16&255),v.push(d>>8&255),v.push(255&d),i=v.length-41,v[33]=i>>24&255,v[34]=i>>16&255,v[35]=i>>8&255,v[36]=255&i,f=r(v,37),v.push(f>>24&255),v.push(f>>16&255),v.push(f>>8&255),v.push(255&f),v.push(0),v.push(0),v.push(0),v.push(0),v.push(73),v.push(69),v.push(78),v.push(68),v.push(174),v.push(66),v.push(96),v.push(130),"data:image/png;base64,"+t(v)},numeric._dim=function(e){for(var t=[];"object"==typeof e;)t.push(e.length),e=e[0];return t},numeric.dim=function(e){var t,r;return"object"==typeof e?(t=e[0],"object"==typeof t?(r=t[0],"object"==typeof r?numeric._dim(e):[e.length,t.length]):[e.length]):[]},numeric.mapreduce=function(e,t){return Function("x","accum","_s","_k",'if(typeof accum === "undefined") accum = '+t+';\nif(typeof x === "number") { var xi = x; '+e+'; return accum; }\nif(typeof _s === "undefined") _s = numeric.dim(x);\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i,xi;\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) {\n accum = arguments.callee(x[i],accum,_s,_k+1);\n } return accum;\n}\nfor(i=_n-1;i>=1;i-=2) { \n xi = x[i];\n '+e+";\n xi = x[i-1];\n "+e+";\n}\nif(i === 0) {\n xi = x[i];\n "+e+"\n}\nreturn accum;")},numeric.mapreduce2=function(e,t){return Function("x","var n = x.length;\nvar i,xi;\n"+t+";\nfor(i=n-1;i!==-1;--i) { \n xi = x[i];\n "+e+";\n}\nreturn accum;")},numeric.same=function e(t,r){var n,a;if(!(t instanceof Array&&r instanceof Array))return!1;if(a=t.length,a!==r.length)return!1;for(n=0;a>n;n++)if(t[n]!==r[n]){if("object"!=typeof t[n])return!1;if(!e(t[n],r[n]))return!1}return!0},numeric.rep=function(e,t,r){"undefined"==typeof r&&(r=0);var n,a=e[r],o=Array(a);if(r===e.length-1){for(n=a-2;n>=0;n-=2)o[n+1]=t,o[n]=t;return-1===n&&(o[0]=t),o}for(n=a-1;n>=0;n--)o[n]=numeric.rep(e,t,r+1);return o},numeric.dotMMsmall=function(e,t){var r,n,a,o,i,s,l,u,c,d,f;for(o=e.length,i=t.length,s=t[0].length,
l=Array(o),r=o-1;r>=0;r--){for(u=Array(s),c=e[r],a=s-1;a>=0;a--){for(d=c[i-1]*t[i-1][a],n=i-2;n>=1;n-=2)f=n-1,d+=c[n]*t[n][a]+c[f]*t[f][a];0===n&&(d+=c[0]*t[0][a]),u[a]=d}l[r]=u}return l},numeric._getCol=function(e,t,r){var n,a=e.length;for(n=a-1;n>0;--n)r[n]=e[n][t],--n,r[n]=e[n][t];0===n&&(r[0]=e[0][t])},numeric.dotMMbig=function(e,t){var r,n,a,o,i=numeric._getCol,s=t.length,l=Array(s),u=e.length,c=t[0].length,d=new Array(u),f=numeric.dotVV;for(--s,--u,n=u;-1!==n;--n)d[n]=Array(c);for(--c,n=c;-1!==n;--n)for(i(t,n,l),a=u;-1!==a;--a)o=0,r=e[a],d[a][n]=f(r,l);return d},numeric.dotMV=function(e,t){var r,n=e.length,a=(t.length,Array(n)),o=numeric.dotVV;for(r=n-1;r>=0;r--)a[r]=o(e[r],t);return a},numeric.dotVM=function(e,t){var r,n,a,o,i,s,l;for(a=e.length,o=t[0].length,i=Array(o),n=o-1;n>=0;n--){for(s=e[a-1]*t[a-1][n],r=a-2;r>=1;r-=2)l=r-1,s+=e[r]*t[r][n]+e[l]*t[l][n];0===r&&(s+=e[0]*t[0][n]),i[n]=s}return i},numeric.dotVV=function(e,t){var r,n,a=e.length,o=e[a-1]*t[a-1];for(r=a-2;r>=1;r-=2)n=r-1,o+=e[r]*t[r]+e[n]*t[n];return 0===r&&(o+=e[0]*t[0]),o},numeric.dot=function(e,t){var r=numeric.dim;switch(1e3*r(e).length+r(t).length){case 2002:return t.length<10?numeric.dotMMsmall(e,t):numeric.dotMMbig(e,t);case 2001:return numeric.dotMV(e,t);case 1002:return numeric.dotVM(e,t);case 1001:return numeric.dotVV(e,t);case 1e3:return numeric.mulVS(e,t);case 1:return numeric.mulSV(e,t);case 0:return e*t;default:throw new Error("numeric.dot only works on vectors and matrices")}},numeric.diag=function(e){var t,r,n,a,o=e.length,i=Array(o);for(t=o-1;t>=0;t--){for(a=Array(o),r=t+2,n=o-1;n>=r;n-=2)a[n]=0,a[n-1]=0;for(n>t&&(a[n]=0),a[t]=e[t],n=t-1;n>=1;n-=2)a[n]=0,a[n-1]=0;0===n&&(a[0]=0),i[t]=a}return i},numeric.getDiag=function(e){var t,r=Math.min(e.length,e[0].length),n=Array(r);for(t=r-1;t>=1;--t)n[t]=e[t][t],--t,n[t]=e[t][t];return 0===t&&(n[0]=e[0][0]),n},numeric.identity=function(e){return numeric.diag(numeric.rep([e],1))},numeric.pointwise=function(e,t,r){"undefined"==typeof r&&(r="");var n,a,o=[],i=/\[i\]$/,s="",l=!1;for(n=0;n<e.length;n++)i.test(e[n])?(a=e[n].substring(0,e[n].length-3),s=a):a=e[n],"ret"===a&&(l=!0),o.push(a);return o[e.length]="_s",o[e.length+1]="_k",o[e.length+2]='if(typeof _s === "undefined") _s = numeric.dim('+s+');\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i'+(l?"":", ret = Array(_n)")+";\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) ret[i] = arguments.callee("+e.join(",")+",_s,_k+1);\n return ret;\n}\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n "+t+"\n}\nreturn ret;",Function.apply(null,o)},numeric.pointwise2=function(e,t,r){"undefined"==typeof r&&(r="");var n,a,o=[],i=/\[i\]$/,s="",l=!1;for(n=0;n<e.length;n++)i.test(e[n])?(a=e[n].substring(0,e[n].length-3),s=a):a=e[n],"ret"===a&&(l=!0),o.push(a);return o[e.length]="var _n = "+s+".length;\nvar i"+(l?"":", ret = Array(_n)")+";\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n"+t+"\n}\nreturn ret;",Function.apply(null,o)},numeric._biforeach=function t(e,r,n,a,o){if(a===n.length-1)return void o(e,r);var i,s=n[a];for(i=s-1;i>=0;i--)t("object"==typeof e?e[i]:e,"object"==typeof r?r[i]:r,n,a+1,o)},numeric._biforeach2=function r(e,t,n,a,o){if(a===n.length-1)return o(e,t);var i,s=n[a],l=Array(s);for(i=s-1;i>=0;--i)l[i]=r("object"==typeof e?e[i]:e,"object"==typeof t?t[i]:t,n,a+1,o);return l},numeric._foreach=function n(e,t,r,a){if(r===t.length-1)return void a(e);var o,i=t[r];for(o=i-1;o>=0;o--)n(e[o],t,r+1,a)},numeric._foreach2=function a(e,t,r,n){if(r===t.length-1)return n(e);var o,i=t[r],s=Array(i);for(o=i-1;o>=0;o--)s[o]=a(e[o],t,r+1,n);return s},numeric.ops2={add:"+",sub:"-",mul:"*",div:"/",mod:"%",and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">=",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"},numeric.opseq={addeq:"+=",subeq:"-=",muleq:"*=",diveq:"/=",modeq:"%=",lshifteq:"<<=",rshifteq:">>=",rrshifteq:">>>=",bandeq:"&=",boreq:"|=",bxoreq:"^="},numeric.mathfuns=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","isNaN","isFinite"],numeric.mathfuns2=["atan2","pow","max","min"],numeric.ops1={neg:"-",not:"!",bnot:"~",clone:""},numeric.mapreducers={any:["if(xi) return true;","var accum = false;"],all:["if(!xi) return false;","var accum = true;"],sum:["accum += xi;","var accum = 0;"],prod:["accum *= xi;","var accum = 1;"],norm2Squared:["accum += xi*xi;","var accum = 0;"],norminf:["accum = max(accum,abs(xi));","var accum = 0, max = Math.max, abs = Math.abs;"],norm1:["accum += abs(xi)","var accum = 0, abs = Math.abs;"],sup:["accum = max(accum,xi);","var accum = -Infinity, max = Math.max;"],inf:["accum = min(accum,xi);","var accum = Infinity, min = Math.min;"]},function(){var e,t;for(e=0;e<numeric.mathfuns2.length;++e)t=numeric.mathfuns2[e],numeric.ops2[t]=t;for(e in numeric.ops2)if(numeric.ops2.hasOwnProperty(e)){t=numeric.ops2[e];var r,n,a="";-1!==numeric.myIndexOf.call(numeric.mathfuns2,e)?(a="var "+t+" = Math."+t+";\n",r=function(e,r,n){return e+" = "+t+"("+r+","+n+")"},n=function(e,r){return e+" = "+t+"("+e+","+r+")"}):(r=function(e,r,n){return e+" = "+r+" "+t+" "+n},n=numeric.opseq.hasOwnProperty(e+"eq")?function(e,r){return e+" "+t+"= "+r}:function(e,r){return e+" = "+e+" "+t+" "+r}),numeric[e+"VV"]=numeric.pointwise2(["x[i]","y[i]"],r("ret[i]","x[i]","y[i]"),a),numeric[e+"SV"]=numeric.pointwise2(["x","y[i]"],r("ret[i]","x","y[i]"),a),numeric[e+"VS"]=numeric.pointwise2(["x[i]","y"],r("ret[i]","x[i]","y"),a),numeric[e]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar VV = numeric."+e+"VV, VS = numeric."+e+"VS, SV = numeric."+e+'SV;\nvar dim = numeric.dim;\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof x === "object") {\n if(typeof y === "object") x = numeric._biforeach2(x,y,dim(x),0,VV);\n else x = numeric._biforeach2(x,y,dim(x),0,VS);\n } else if(typeof y === "object") x = numeric._biforeach2(x,y,dim(y),0,SV);\n else '+n("x","y")+"\n}\nreturn x;\n"),numeric[t]=numeric[e],numeric[e+"eqV"]=numeric.pointwise2(["ret[i]","x[i]"],n("ret[i]","x[i]"),a),numeric[e+"eqS"]=numeric.pointwise2(["ret[i]","x"],n("ret[i]","x"),a),numeric[e+"eq"]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar V = numeric."+e+"eqV, S = numeric."+e+'eqS\nvar s = numeric.dim(x);\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof y === "object") numeric._biforeach(x,y,s,0,V);\n else numeric._biforeach(x,y,s,0,S);\n}\nreturn x;\n')}for(e=0;e<numeric.mathfuns2.length;++e)t=numeric.mathfuns2[e],delete numeric.ops2[t];for(e=0;e<numeric.mathfuns.length;++e)t=numeric.mathfuns[e],numeric.ops1[t]=t;for(e in numeric.ops1)numeric.ops1.hasOwnProperty(e)&&(a="",t=numeric.ops1[e],-1!==numeric.myIndexOf.call(numeric.mathfuns,e)&&Math.hasOwnProperty(t)&&(a="var "+t+" = Math."+t+";\n"),numeric[e+"eqV"]=numeric.pointwise2(["ret[i]"],"ret[i] = "+t+"(ret[i]);",a),numeric[e+"eq"]=Function("x",'if(typeof x !== "object") return '+t+"x\nvar i;\nvar V = numeric."+e+"eqV;\nvar s = numeric.dim(x);\nnumeric._foreach(x,s,0,V);\nreturn x;\n"),numeric[e+"V"]=numeric.pointwise2(["x[i]"],"ret[i] = "+t+"(x[i]);",a),numeric[e]=Function("x",'if(typeof x !== "object") return '+t+"(x)\nvar i;\nvar V = numeric."+e+"V;\nvar s = numeric.dim(x);\nreturn numeric._foreach2(x,s,0,V);\n"));for(e=0;e<numeric.mathfuns.length;++e)t=numeric.mathfuns[e],delete numeric.ops1[t];for(e in numeric.mapreducers)numeric.mapreducers.hasOwnProperty(e)&&(t=numeric.mapreducers[e],numeric[e+"V"]=numeric.mapreduce2(t[0],t[1]),numeric[e]=Function("x","s","k",t[1]+'if(typeof x !== "object") { xi = x;\n'+t[0]+';\n return accum;\n}if(typeof s === "undefined") s = numeric.dim(x);\nif(typeof k === "undefined") k = 0;\nif(k === s.length-1) return numeric.'+e+"V(x);\nvar xi;\nvar n = x.length, i;\nfor(i=n-1;i!==-1;--i) {\n xi = arguments.callee(x[i]);\n"+t[0]+";\n}\nreturn accum;\n"))}(),numeric.truncVV=numeric.pointwise(["x[i]","y[i]"],"ret[i] = round(x[i]/y[i])*y[i];","var round = Math.round;"),numeric.truncVS=numeric.pointwise(["x[i]","y"],"ret[i] = round(x[i]/y)*y;","var round = Math.round;"),numeric.truncSV=numeric.pointwise(["x","y[i]"],"ret[i] = round(x/y[i])*y[i];","var round = Math.round;"),numeric.trunc=function(e,t){return"object"==typeof e?"object"==typeof t?numeric.truncVV(e,t):numeric.truncVS(e,t):"object"==typeof t?numeric.truncSV(e,t):Math.round(e/t)*t},numeric.inv=function(e){var t,r,n,a,o,i,s,e,l=numeric.dim(e),u=Math.abs,c=l[0],d=l[1],f=numeric.clone(e),p=numeric.identity(c);for(i=0;d>i;++i){var h=-1,v=-1;for(o=i;o!==c;++o)s=u(f[o][i]),s>v&&(h=o,v=s);for(r=f[h],f[h]=f[i],f[i]=r,a=p[h],p[h]=p[i],p[i]=a,e=r[i],s=i;s!==d;++s)r[s]/=e;for(s=d-1;-1!==s;--s)a[s]/=e;for(o=c-1;-1!==o;--o)if(o!==i){for(t=f[o],n=p[o],e=t[i],s=i+1;s!==d;++s)t[s]-=r[s]*e;for(s=d-1;s>0;--s)n[s]-=a[s]*e,--s,n[s]-=a[s]*e;0===s&&(n[0]-=a[0]*e)}}return p},numeric.det=function(e){var t=numeric.dim(e);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: det() only works on square matrices");var r,n,a,o,i,s,l,u,c=t[0],d=1,f=numeric.clone(e);for(n=0;c-1>n;n++){for(a=n,r=n+1;c>r;r++)Math.abs(f[r][n])>Math.abs(f[a][n])&&(a=r);for(a!==n&&(l=f[a],f[a]=f[n],f[n]=l,d*=-1),o=f[n],r=n+1;c>r;r++){for(i=f[r],s=i[n]/o[n],a=n+1;c-1>a;a+=2)u=a+1,i[a]-=o[a]*s,i[u]-=o[u]*s;a!==c&&(i[a]-=o[a]*s)}if(0===o[n])return 0;d*=o[n]}return d*f[n][n]},numeric.transpose=function(e){var t,r,n,a,o,i=e.length,s=e[0].length,l=Array(s);for(r=0;s>r;r++)l[r]=Array(i);for(t=i-1;t>=1;t-=2){for(a=e[t],n=e[t-1],r=s-1;r>=1;--r)o=l[r],o[t]=a[r],o[t-1]=n[r],--r,o=l[r],o[t]=a[r],o[t-1]=n[r];0===r&&(o=l[0],o[t]=a[0],o[t-1]=n[0])}if(0===t){for(n=e[0],r=s-1;r>=1;--r)l[r][0]=n[r],--r,l[r][0]=n[r];0===r&&(l[0][0]=n[0])}return l},numeric.negtranspose=function(e){var t,r,n,a,o,i=e.length,s=e[0].length,l=Array(s);for(r=0;s>r;r++)l[r]=Array(i);for(t=i-1;t>=1;t-=2){for(a=e[t],n=e[t-1],r=s-1;r>=1;--r)o=l[r],o[t]=-a[r],o[t-1]=-n[r],--r,o=l[r],o[t]=-a[r],o[t-1]=-n[r];0===r&&(o=l[0],o[t]=-a[0],o[t-1]=-n[0])}if(0===t){for(n=e[0],r=s-1;r>=1;--r)l[r][0]=-n[r],--r,l[r][0]=-n[r];0===r&&(l[0][0]=-n[0])}return l},numeric._random=function o(e,t){var r,n,a=e[t],i=Array(a);if(t===e.length-1){for(n=Math.random,r=a-1;r>=1;r-=2)i[r]=n(),i[r-1]=n();return 0===r&&(i[0]=n()),i}for(r=a-1;r>=0;r--)i[r]=o(e,t+1);return i},numeric.random=function(e){return numeric._random(e,0)},numeric.norm2=function(e){return Math.sqrt(numeric.norm2Squared(e))},numeric.linspace=function(e,t,r){if("undefined"==typeof r&&(r=Math.max(Math.round(t-e)+1,1)),2>r)return 1===r?[e]:[];var n,a=Array(r);for(r--,n=r;n>=0;n--)a[n]=(n*t+(r-n)*e)/r;return a},numeric.getBlock=function(e,t,r){function n(e,o){var i,s=t[o],l=r[o]-s,u=Array(l);if(o===a.length-1){for(i=l;i>=0;i--)u[i]=e[i+s];return u}for(i=l;i>=0;i--)u[i]=n(e[i+s],o+1);return u}var a=numeric.dim(e);return n(e,0)},numeric.setBlock=function(e,t,r,n){function a(e,n,i){var s,l=t[i],u=r[i]-l;if(i===o.length-1)for(s=u;s>=0;s--)e[s+l]=n[s];for(s=u;s>=0;s--)a(e[s+l],n[s],i+1)}var o=numeric.dim(e);return a(e,n,0),e},numeric.getRange=function(e,t,r){var n,a,o,i,s=t.length,l=r.length,u=Array(s);for(n=s-1;-1!==n;--n)for(u[n]=Array(l),o=u[n],i=e[t[n]],a=l-1;-1!==a;--a)o[a]=i[r[a]];return u},numeric.blockMatrix=function(e){var t=numeric.dim(e);if(t.length<4)return numeric.blockMatrix([e]);var r,n,a,o,i,s=t[0],l=t[1];for(r=0,n=0,a=0;s>a;++a)r+=e[a][0].length;for(o=0;l>o;++o)n+=e[0][o][0].length;var u=Array(r);for(a=0;r>a;++a)u[a]=Array(n);var c,d,f,p,h,v=0;for(a=0;s>a;++a){for(c=n,o=l-1;-1!==o;--o)for(i=e[a][o],c-=i[0].length,f=i.length-1;-1!==f;--f)for(h=i[f],d=u[v+f],p=h.length-1;-1!==p;--p)d[c+p]=h[p];v+=e[a][0].length}return u},numeric.tensor=function(e,t){if("number"==typeof e||"number"==typeof t)return numeric.mul(e,t);var r=numeric.dim(e),n=numeric.dim(t);if(1!==r.length||1!==n.length)throw new Error("numeric: tensor product is only defined for vectors");var a,o,i,s,l=r[0],u=n[0],c=Array(l);for(o=l-1;o>=0;o--){for(a=Array(u),s=e[o],i=u-1;i>=3;--i)a[i]=s*t[i],--i,a[i]=s*t[i],--i,a[i]=s*t[i],--i,a[i]=s*t[i];for(;i>=0;)a[i]=s*t[i],--i;c[o]=a}return c},numeric.T=function(e,t){this.x=e,this.y=t},numeric.t=function(e,t){return new numeric.T(e,t)},numeric.Tbinop=function(e,t,r,n,a){numeric.indexOf;if("string"!=typeof a){var o;a="";for(o in numeric)numeric.hasOwnProperty(o)&&(e.indexOf(o)>=0||t.indexOf(o)>=0||r.indexOf(o)>=0||n.indexOf(o)>=0)&&o.length>1&&(a+="var "+o+" = numeric."+o+";\n")}return Function(["y"],"var x = this;\nif(!(y instanceof numeric.T)) { y = new numeric.T(y); }\n"+a+"\nif(x.y) { if(y.y) { return new numeric.T("+n+");\n }\n return new numeric.T("+r+");\n}\nif(y.y) {\n return new numeric.T("+t+");\n}\nreturn new numeric.T("+e+");\n")},numeric.T.prototype.add=numeric.Tbinop("add(x.x,y.x)","add(x.x,y.x),y.y","add(x.x,y.x),x.y","add(x.x,y.x),add(x.y,y.y)"),numeric.T.prototype.sub=numeric.Tbinop("sub(x.x,y.x)","sub(x.x,y.x),neg(y.y)","sub(x.x,y.x),x.y","sub(x.x,y.x),sub(x.y,y.y)"),numeric.T.prototype.mul=numeric.Tbinop("mul(x.x,y.x)","mul(x.x,y.x),mul(x.x,y.y)","mul(x.x,y.x),mul(x.y,y.x)","sub(mul(x.x,y.x),mul(x.y,y.y)),add(mul(x.x,y.y),mul(x.y,y.x))"),numeric.T.prototype.reciprocal=function(){var e=numeric.mul,t=numeric.div;if(this.y){var r=numeric.add(e(this.x,this.x),e(this.y,this.y));return new numeric.T(t(this.x,r),t(numeric.neg(this.y),r))}return new T(t(1,this.x))},numeric.T.prototype.div=function i(e){if(e instanceof numeric.T||(e=new numeric.T(e)),e.y)return this.mul(e.reciprocal());var i=numeric.div;return this.y?new numeric.T(i(this.x,e.x),i(this.y,e.x)):new numeric.T(i(this.x,e.x))},numeric.T.prototype.dot=numeric.Tbinop("dot(x.x,y.x)","dot(x.x,y.x),dot(x.x,y.y)","dot(x.x,y.x),dot(x.y,y.x)","sub(dot(x.x,y.x),dot(x.y,y.y)),add(dot(x.x,y.y),dot(x.y,y.x))"),numeric.T.prototype.transpose=function(){var e=numeric.transpose,t=this.x,r=this.y;return r?new numeric.T(e(t),e(r)):new numeric.T(e(t))},numeric.T.prototype.transjugate=function(){var e=numeric.transpose,t=this.x,r=this.y;return r?new numeric.T(e(t),numeric.negtranspose(r)):new numeric.T(e(t))},numeric.Tunop=function(e,t,r){return"string"!=typeof r&&(r=""),Function("var x = this;\n"+r+"\nif(x.y) { "+t+";\n}\n"+e+";\n")},numeric.T.prototype.exp=numeric.Tunop("return new numeric.T(ex)","return new numeric.T(mul(cos(x.y),ex),mul(sin(x.y),ex))","var ex = numeric.exp(x.x), cos = numeric.cos, sin = numeric.sin, mul = numeric.mul;"),numeric.T.prototype.conj=numeric.Tunop("return new numeric.T(x.x);","return new numeric.T(x.x,numeric.neg(x.y));"),numeric.T.prototype.neg=numeric.Tunop("return new numeric.T(neg(x.x));","return new numeric.T(neg(x.x),neg(x.y));","var neg = numeric.neg;"),numeric.T.prototype.sin=numeric.Tunop("return new numeric.T(numeric.sin(x.x))","return x.exp().sub(x.neg().exp()).div(new numeric.T(0,2));"),numeric.T.prototype.cos=numeric.Tunop("return new numeric.T(numeric.cos(x.x))","return x.exp().add(x.neg().exp()).div(2);"),numeric.T.prototype.abs=numeric.Tunop("return new numeric.T(numeric.abs(x.x));","return new numeric.T(numeric.sqrt(numeric.add(mul(x.x,x.x),mul(x.y,x.y))));","var mul = numeric.mul;"),numeric.T.prototype.log=numeric.Tunop("return new numeric.T(numeric.log(x.x));","var theta = new numeric.T(numeric.atan2(x.y,x.x)), r = x.abs();\nreturn new numeric.T(numeric.log(r.x),theta.x);"),numeric.T.prototype.norm2=numeric.Tunop("return numeric.norm2(x.x);","var f = numeric.norm2Squared;\nreturn Math.sqrt(f(x.x)+f(x.y));"),numeric.T.prototype.inv=function(){var e=this;if("undefined"==typeof e.y)return new numeric.T(numeric.inv(e.x));var t,r,n,a,o,i,s,l,u,c,d,t,r,n,f,p,h,v,g,m,y,x=e.x.length,b=numeric.identity(x),w=numeric.rep([x,x],0),_=numeric.clone(e.x),k=numeric.clone(e.y);for(t=0;x>t;t++){for(h=_[t][t],v=k[t][t],f=h*h+v*v,n=t,r=t+1;x>r;r++)h=_[r][t],v=k[r][t],p=h*h+v*v,p>f&&(n=r,f=p);for(n!==t&&(y=_[t],_[t]=_[n],_[n]=y,y=k[t],k[t]=k[n],k[n]=y,y=b[t],b[t]=b[n],b[n]=y,y=w[t],w[t]=w[n],w[n]=y),a=_[t],o=k[t],l=b[t],u=w[t],h=a[t],v=o[t],r=t+1;x>r;r++)g=a[r],m=o[r],a[r]=(g*h+m*v)/f,o[r]=(m*h-g*v)/f;for(r=0;x>r;r++)g=l[r],m=u[r],l[r]=(g*h+m*v)/f,u[r]=(m*h-g*v)/f;for(r=t+1;x>r;r++){for(i=_[r],s=k[r],c=b[r],d=w[r],h=i[t],v=s[t],n=t+1;x>n;n++)g=a[n],m=o[n],i[n]-=g*h-m*v,s[n]-=m*h+g*v;for(n=0;x>n;n++)g=l[n],m=u[n],c[n]-=g*h-m*v,d[n]-=m*h+g*v}}for(t=x-1;t>0;t--)for(l=b[t],u=w[t],r=t-1;r>=0;r--)for(c=b[r],d=w[r],h=_[r][t],v=k[r][t],n=x-1;n>=0;n--)g=l[n],m=u[n],c[n]-=h*g-v*m,d[n]-=h*m+v*g;return new numeric.T(b,w)},numeric.T.prototype.get=function(e){var t,r=this.x,n=this.y,a=0,o=e.length;if(n){for(;o>a;)t=e[a],r=r[t],n=n[t],a++;return new numeric.T(r,n)}for(;o>a;)t=e[a],r=r[t],a++;return new numeric.T(r)},numeric.T.prototype.set=function(e,t){var r,n=this.x,a=this.y,o=0,i=e.length,s=t.x,l=t.y;if(0===i)return l?this.y=l:a&&(this.y=void 0),this.x=n,this;if(l){for(a||(a=numeric.rep(numeric.dim(n),0),this.y=a);i-1>o;)r=e[o],n=n[r],a=a[r],o++;return r=e[o],n[r]=s,a[r]=l,this}if(a){for(;i-1>o;)r=e[o],n=n[r],a=a[r],o++;return r=e[o],n[r]=s,s instanceof Array?a[r]=numeric.rep(numeric.dim(s),0):a[r]=0,this}for(;i-1>o;)r=e[o],n=n[r],o++;return r=e[o],n[r]=s,this},numeric.T.prototype.getRows=function(e,t){var r,n,a=t-e+1,o=Array(a),i=this.x,s=this.y;for(r=e;t>=r;r++)o[r-e]=i[r];if(s){for(n=Array(a),r=e;t>=r;r++)n[r-e]=s[r];return new numeric.T(o,n)}return new numeric.T(o)},numeric.T.prototype.setRows=function(e,t,r){var n,a=this.x,o=this.y,i=r.x,s=r.y;for(n=e;t>=n;n++)a[n]=i[n-e];if(s)for(o||(o=numeric.rep(numeric.dim(a),0),this.y=o),n=e;t>=n;n++)o[n]=s[n-e];else if(o)for(n=e;t>=n;n++)o[n]=numeric.rep([i[n-e].length],0);return this},numeric.T.prototype.getRow=function(e){var t=this.x,r=this.y;return r?new numeric.T(t[e],r[e]):new numeric.T(t[e])},numeric.T.prototype.setRow=function(e,t){var r=this.x,n=this.y,a=t.x,o=t.y;return r[e]=a,o?(n||(n=numeric.rep(numeric.dim(r),0),this.y=n),n[e]=o):n&&(n=numeric.rep([a.length],0)),this},numeric.T.prototype.getBlock=function(e,t){var r=this.x,n=this.y,a=numeric.getBlock;return n?new numeric.T(a(r,e,t),a(n,e,t)):new numeric.T(a(r,e,t))},numeric.T.prototype.setBlock=function(e,t,r){r instanceof numeric.T||(r=new numeric.T(r));var n=this.x,a=this.y,o=numeric.setBlock,i=r.x,s=r.y;return s?(a||(this.y=numeric.rep(numeric.dim(this),0),a=this.y),o(n,e,t,i),o(a,e,t,s),this):(o(n,e,t,i),void(a&&o(a,e,t,numeric.rep(numeric.dim(i),0))))},numeric.T.rep=function(e,t){var r=numeric.T;t instanceof r||(t=new r(t));var n=t.x,a=t.y,o=numeric.rep;return a?new r(o(e,n),o(e,a)):new r(o(e,n))},numeric.T.diag=function s(e){e instanceof numeric.T||(e=new numeric.T(e));var t=e.x,r=e.y,s=numeric.diag;return r?new numeric.T(s(t),s(r)):new numeric.T(s(t))},numeric.T.eig=function(){if(this.y)throw new Error("eig: not implemented for complex matrices.");return numeric.eig(this.x)},numeric.T.identity=function(e){return new numeric.T(numeric.identity(e))},numeric.T.prototype.getDiag=function(){var e=numeric,t=this.x,r=this.y;return r?new e.T(e.getDiag(t),e.getDiag(r)):new e.T(e.getDiag(t))},numeric.house=function(e){var t=numeric.clone(e),r=e[0]>=0?1:-1,n=r*numeric.norm2(e);t[0]+=n;var a=numeric.norm2(t);if(0===a)throw new Error("eig: internal error");return numeric.div(t,a)},numeric.toUpperHessenberg=function(e){var t=numeric.dim(e);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: toUpperHessenberg() only works on square matrices");var r,n,a,o,i,s,l,u,c,d,f=t[0],p=numeric.clone(e),h=numeric.identity(f);for(n=0;f-2>n;n++){for(o=Array(f-n-1),r=n+1;f>r;r++)o[r-n-1]=p[r][n];if(numeric.norm2(o)>0){for(i=numeric.house(o),s=numeric.getBlock(p,[n+1,n],[f-1,f-1]),l=numeric.tensor(i,numeric.dot(i,s)),r=n+1;f>r;r++)for(u=p[r],c=l[r-n-1],a=n;f>a;a++)u[a]-=2*c[a-n];for(s=numeric.getBlock(p,[0,n+1],[f-1,f-1]),l=numeric.tensor(numeric.dot(s,i),i),r=0;f>r;r++)for(u=p[r],c=l[r],a=n+1;f>a;a++)u[a]-=2*c[a-n-1];for(s=Array(f-n-1),r=n+1;f>r;r++)s[r-n-1]=h[r];for(l=numeric.tensor(i,numeric.dot(i,s)),r=n+1;f>r;r++)for(d=h[r],c=l[r-n-1],a=0;f>a;a++)d[a]-=2*c[a]}}return{H:p,Q:h}},numeric.epsilon=2.220446049250313e-16,numeric.QRFrancis=function(e,t){"undefined"==typeof t&&(t=1e4),e=numeric.clone(e);var r,n,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b=(numeric.clone(e),numeric.dim(e)),w=b[0],_=numeric.identity(w);if(3>w)return{Q:_,B:[[0,w-1]]};var k=numeric.epsilon;for(x=0;t>x;x++){for(m=0;w-1>m;m++)if(Math.abs(e[m+1][m])<k*(Math.abs(e[m][m])+Math.abs(e[m+1][m+1]))){var z=numeric.QRFrancis(numeric.getBlock(e,[0,0],[m,m]),t),A=numeric.QRFrancis(numeric.getBlock(e,[m+1,m+1],[w-1,w-1]),t);for(p=Array(m+1),g=0;m>=g;g++)p[g]=_[g];for(h=numeric.dot(z.Q,p),g=0;m>=g;g++)_[g]=h[g];for(p=Array(w-m-1),g=m+1;w>g;g++)p[g-m-1]=_[g];for(h=numeric.dot(A.Q,p),g=m+1;w>g;g++)_[g]=h[g-m-1];return{Q:_,B:z.B.concat(numeric.add(A.B,m+1))}}if(a=e[w-2][w-2],o=e[w-2][w-1],i=e[w-1][w-2],s=e[w-1][w-1],u=a+s,l=a*s-o*i,c=numeric.getBlock(e,[0,0],[2,2]),u*u>=4*l){var j,M;j=.5*(u+Math.sqrt(u*u-4*l)),M=.5*(u-Math.sqrt(u*u-4*l)),c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,j+M)),numeric.diag(numeric.rep([3],j*M)))}else c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,u)),numeric.diag(numeric.rep([3],l)));for(r=[c[0][0],c[1][0],c[2][0]],n=numeric.house(r),p=[e[0],e[1],e[2]],h=numeric.tensor(n,numeric.dot(n,p)),g=0;3>g;g++)for(f=e[g],v=h[g],y=0;w>y;y++)f[y]-=2*v[y];for(p=numeric.getBlock(e,[0,0],[w-1,2]),h=numeric.tensor(numeric.dot(p,n),n),g=0;w>g;g++)for(f=e[g],v=h[g],y=0;3>y;y++)f[y]-=2*v[y];for(p=[_[0],_[1],_[2]],h=numeric.tensor(n,numeric.dot(n,p)),g=0;3>g;g++)for(d=_[g],v=h[g],y=0;w>y;y++)d[y]-=2*v[y];var O;for(m=0;w-2>m;m++){for(y=m;m+1>=y;y++)if(Math.abs(e[y+1][y])<k*(Math.abs(e[y][y])+Math.abs(e[y+1][y+1]))){var z=numeric.QRFrancis(numeric.getBlock(e,[0,0],[y,y]),t),A=numeric.QRFrancis(numeric.getBlock(e,[y+1,y+1],[w-1,w-1]),t);for(p=Array(y+1),g=0;y>=g;g++)p[g]=_[g];for(h=numeric.dot(z.Q,p),g=0;y>=g;g++)_[g]=h[g];for(p=Array(w-y-1),g=y+1;w>g;g++)p[g-y-1]=_[g];for(h=numeric.dot(A.Q,p),g=y+1;w>g;g++)_[g]=h[g-y-1];return{Q:_,B:z.B.concat(numeric.add(A.B,y+1))}}for(O=Math.min(w-1,m+3),r=Array(O-m),g=m+1;O>=g;g++)r[g-m-1]=e[g][m];for(n=numeric.house(r),p=numeric.getBlock(e,[m+1,m],[O,w-1]),h=numeric.tensor(n,numeric.dot(n,p)),g=m+1;O>=g;g++)for(f=e[g],v=h[g-m-1],y=m;w>y;y++)f[y]-=2*v[y-m];for(p=numeric.getBlock(e,[0,m+1],[w-1,O]),h=numeric.tensor(numeric.dot(p,n),n),g=0;w>g;g++)for(f=e[g],v=h[g],y=m+1;O>=y;y++)f[y]-=2*v[y-m-1];for(p=Array(O-m),g=m+1;O>=g;g++)p[g-m-1]=_[g];for(h=numeric.tensor(n,numeric.dot(n,p)),g=m+1;O>=g;g++)for(d=_[g],v=h[g-m-1],y=0;w>y;y++)d[y]-=2*v[y]}}throw new Error("numeric: eigenvalue iteration does not converge -- increase maxiter?")},numeric.eig=function(e,t){var r,n,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x=numeric.toUpperHessenberg(e),b=numeric.QRFrancis(x.H,t),w=numeric.T,_=e.length,k=b.B,z=numeric.dot(b.Q,numeric.dot(x.H,numeric.transpose(b.Q))),A=new w(numeric.dot(b.Q,x.Q)),j=k.length,M=Math.sqrt;for(n=0;j>n;n++)if(r=k[n][0],r===k[n][1]);else{if(o=r+1,i=z[r][r],s=z[r][o],l=z[o][r],u=z[o][o],0===s&&0===l)continue;c=-i-u,d=i*u-s*l,f=c*c-4*d,f>=0?(p=0>c?-.5*(c-M(f)):-.5*(c+M(f)),m=(i-p)*(i-p)+s*s,y=l*l+(u-p)*(u-p),m>y?(m=M(m),v=(i-p)/m,g=s/m):(y=M(y),v=l/y,g=(u-p)/y),a=new w([[g,-v],[v,g]]),A.setRows(r,o,a.dot(A.getRows(r,o)))):(p=-.5*c,h=.5*M(-f),m=(i-p)*(i-p)+s*s,y=l*l+(u-p)*(u-p),m>y?(m=M(m+h*h),v=(i-p)/m,g=s/m,p=0,h/=m):(y=M(y+h*h),v=l/y,g=(u-p)/y,p=h/y,h=0),a=new w([[g,-v],[v,g]],[[p,h],[h,-p]]),A.setRows(r,o,a.dot(A.getRows(r,o))))}var O=A.dot(e).dot(A.transjugate()),_=e.length,E=numeric.T.identity(_);for(o=0;_>o;o++)if(o>0)for(n=o-1;n>=0;n--){var F=O.get([n,n]),S=O.get([o,o]);numeric.neq(F.x,S.x)||numeric.neq(F.y,S.y)?(p=O.getRow(n).getBlock([n],[o-1]),h=E.getRow(o).getBlock([n],[o-1]),E.set([o,n],O.get([n,o]).neg().sub(p.dot(h)).div(F.sub(S)))):E.setRow(o,E.getRow(n))}for(o=0;_>o;o++)p=E.getRow(o),E.setRow(o,p.div(p.norm2()));return E=E.transpose(),E=A.transjugate().dot(E),{lambda:O.getDiag(),E:E}},numeric.ccsSparse=function(e){var t,r,n,a,o=e.length,i=[];for(n=o-1;-1!==n;--n){r=e[n];for(a in r){for(a=parseInt(a);a>=i.length;)i[i.length]=0;0!==r[a]&&i[a]++}}var t=i.length,s=Array(t+1);for(s[0]=0,n=0;t>n;++n)s[n+1]=s[n]+i[n];var l=Array(s[t]),u=Array(s[t]);for(n=o-1;-1!==n;--n){r=e[n];for(a in r)0!==r[a]&&(i[a]--,l[s[a]+i[a]]=n,u[s[a]+i[a]]=r[a])}return[s,l,u]},numeric.ccsFull=function(e){var t,r,n,a,o=e[0],i=e[1],s=e[2],l=numeric.ccsDim(e),u=l[0],c=l[1],d=numeric.rep([u,c],0);for(t=0;c>t;t++)for(n=o[t],a=o[t+1],r=n;a>r;++r)d[i[r]][t]=s[r];return d},numeric.ccsTSolve=function(e,t,r,n,a){function o(e){var t;if(0===r[e]){for(r[e]=1,t=i[e];t<i[e+1];++t)o(s[t]);a[d]=e,++d}}var i=e[0],s=e[1],l=e[2],u=i.length-1,c=Math.max,d=0;"undefined"==typeof n&&(r=numeric.rep([u],0)),"undefined"==typeof n&&(n=numeric.linspace(0,r.length-1)),"undefined"==typeof a&&(a=[]);var f,p,h,v,g,m,y;for(f=n.length-1;-1!==f;--f)o(n[f]);for(a.length=d,f=a.length-1;-1!==f;--f)r[a[f]]=0;for(f=n.length-1;-1!==f;--f)p=n[f],r[p]=t[p];for(f=a.length-1;-1!==f;--f){for(p=a[f],h=i[p],v=c(i[p+1],h),g=h;g!==v;++g)if(s[g]===p){r[p]/=l[g];break}for(y=r[p],g=h;g!==v;++g)m=s[g],m!==p&&(r[m]-=y*l[g])}return r},numeric.ccsDFS=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS.prototype.dfs=function(e,t,r,n,a,o){var i,s,l,u=0,c=a.length,d=this.k,f=this.k1,p=this.j;if(0===n[e])for(n[e]=1,p[0]=e,d[0]=s=t[e],f[0]=l=t[e+1];;)if(s>=l){if(a[c]=p[u],0===u)return;++c,--u,s=d[u],l=f[u]}else i=o[r[s]],0===n[i]?(n[i]=1,d[u]=s,++u,p[u]=i,s=t[i],f[u]=l=t[i+1]):++s},numeric.ccsLPSolve=function(e,t,r,n,a,o,i){var s,l,u,c,d,f,p,h,v,g=e[0],m=e[1],y=e[2],x=(g.length-1,t[0]),b=t[1],w=t[2];for(l=x[a],u=x[a+1],n.length=0,s=l;u>s;++s)i.dfs(o[b[s]],g,m,r,n,o);for(s=n.length-1;-1!==s;--s)r[n[s]]=0;for(s=l;s!==u;++s)c=o[b[s]],r[c]=w[s];for(s=n.length-1;-1!==s;--s){for(c=n[s],d=g[c],f=g[c+1],p=d;f>p;++p)if(o[m[p]]===c){r[c]/=y[p];break}for(v=r[c],p=d;f>p;++p)h=o[m[p]],h!==c&&(r[h]-=v*y[p])}return r},numeric.ccsLUP1=function(e,t){var r,n,a,o,i,s,l,u=e[0].length-1,c=[numeric.rep([u+1],0),[],[]],d=[numeric.rep([u+1],0),[],[]],f=c[0],p=c[1],h=c[2],v=d[0],g=d[1],m=d[2],y=numeric.rep([u],0),x=numeric.rep([u],0),b=numeric.ccsLPSolve,w=(Math.max,Math.abs),_=numeric.linspace(0,u-1),k=numeric.linspace(0,u-1),z=new numeric.ccsDFS(u);for("undefined"==typeof t&&(t=1),r=0;u>r;++r){for(b(c,e,y,x,r,k,z),o=-1,i=-1,n=x.length-1;-1!==n;--n)a=x[n],r>=a||(s=w(y[a]),s>o&&(i=a,o=s));for(w(y[r])<t*o&&(n=_[r],o=_[i],_[r]=o,k[o]=r,_[i]=n,k[n]=i,o=y[r],y[r]=y[i],y[i]=o),o=f[r],i=v[r],l=y[r],p[o]=_[r],h[o]=1,++o,n=x.length-1;-1!==n;--n)a=x[n],s=y[a],x[n]=0,y[a]=0,r>=a?(g[i]=a,m[i]=s,++i):(p[o]=_[a],h[o]=s/l,++o);f[r+1]=o,v[r+1]=i}for(n=p.length-1;-1!==n;--n)p[n]=k[p[n]];return{L:c,U:d,P:_,Pinv:k}},numeric.ccsDFS0=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS0.prototype.dfs=function(e,t,r,n,a,o,i){var s,l,u,c=0,d=a.length,f=this.k,p=this.k1,h=this.j;if(0===n[e])for(n[e]=1,h[0]=e,f[0]=l=t[o[e]],p[0]=u=t[o[e]+1];;){if(isNaN(l))throw new Error("Ow!");if(l>=u){if(a[d]=o[h[c]],0===c)return;++d,--c,l=f[c],u=p[c]}else s=r[l],0===n[s]?(n[s]=1,f[c]=l,++c,h[c]=s,s=o[s],l=t[s],p[c]=u=t[s+1]):++l}},numeric.ccsLPSolve0=function(e,t,r,n,a,o,i,s){var l,u,c,d,f,p,h,v,g,m=e[0],y=e[1],x=e[2],b=(m.length-1,t[0]),w=t[1],_=t[2];for(u=b[a],c=b[a+1],n.length=0,l=u;c>l;++l)s.dfs(w[l],m,y,r,n,o,i);for(l=n.length-1;-1!==l;--l)d=n[l],r[i[d]]=0;for(l=u;l!==c;++l)d=w[l],r[d]=_[l];for(l=n.length-1;-1!==l;--l){for(d=n[l],v=i[d],f=m[d],p=m[d+1],h=f;p>h;++h)if(y[h]===v){r[v]/=x[h];break}for(g=r[v],h=f;p>h;++h)r[y[h]]-=g*x[h];r[v]=g}},numeric.ccsLUP0=function(e,t){var r,n,a,o,i,s,l,u=e[0].length-1,c=[numeric.rep([u+1],0),[],[]],d=[numeric.rep([u+1],0),[],[]],f=c[0],p=c[1],h=c[2],v=d[0],g=d[1],m=d[2],y=numeric.rep([u],0),x=numeric.rep([u],0),b=numeric.ccsLPSolve0,w=(Math.max,Math.abs),_=numeric.linspace(0,u-1),k=numeric.linspace(0,u-1),z=new numeric.ccsDFS0(u);for("undefined"==typeof t&&(t=1),r=0;u>r;++r){for(b(c,e,y,x,r,k,_,z),o=-1,i=-1,n=x.length-1;-1!==n;--n)a=x[n],r>=a||(s=w(y[_[a]]),s>o&&(i=a,o=s));for(w(y[_[r]])<t*o&&(n=_[r],o=_[i],_[r]=o,k[o]=r,_[i]=n,k[n]=i),o=f[r],i=v[r],l=y[_[r]],p[o]=_[r],h[o]=1,++o,n=x.length-1;-1!==n;--n)a=x[n],s=y[_[a]],x[n]=0,y[_[a]]=0,r>=a?(g[i]=a,m[i]=s,++i):(p[o]=_[a],h[o]=s/l,++o);f[r+1]=o,v[r+1]=i}for(n=p.length-1;-1!==n;--n)p[n]=k[p[n]];return{L:c,U:d,P:_,Pinv:k}},numeric.ccsLUP=numeric.ccsLUP0,numeric.ccsDim=function(e){return[numeric.sup(e[1])+1,e[0].length-1]},numeric.ccsGetBlock=function(e,t,r){var n=numeric.ccsDim(e),a=n[0],o=n[1];"undefined"==typeof t?t=numeric.linspace(0,a-1):"number"==typeof t&&(t=[t]),"undefined"==typeof r?r=numeric.linspace(0,o-1):"number"==typeof r&&(r=[r]);var i,s,l,u,c,d=t.length,f=r.length,p=numeric.rep([o],0),h=[],v=[],g=[p,h,v],m=e[0],y=e[1],x=e[2],b=numeric.rep([a],0),w=0,_=numeric.rep([a],0);for(s=0;f>s;++s){u=r[s];var k=m[u],z=m[u+1];for(i=k;z>i;++i)l=y[i],_[l]=1,b[l]=x[i];for(i=0;d>i;++i)c=t[i],_[c]&&(h[w]=i,v[w]=b[t[i]],++w);for(i=k;z>i;++i)l=y[i],_[l]=0;p[s+1]=w}return g},numeric.ccsDot=function(e,t){var r,n,a,o,i,s,l,u,c,d,f,p=e[0],h=e[1],v=e[2],g=t[0],m=t[1],y=t[2],x=numeric.ccsDim(e),b=numeric.ccsDim(t),w=x[0],_=(x[1],b[1]),k=numeric.rep([w],0),z=numeric.rep([w],0),A=Array(w),j=numeric.rep([_],0),M=[],O=[],E=[j,M,O];for(a=0;a!==_;++a){for(o=g[a],i=g[a+1],c=0,n=o;i>n;++n)for(d=m[n],f=y[n],s=p[d],l=p[d+1],r=s;l>r;++r)u=h[r],0===z[u]&&(A[c]=u,z[u]=1,c+=1),k[u]=k[u]+v[r]*f;for(o=j[a],i=o+c,j[a+1]=i,n=c-1;-1!==n;--n)f=o+n,r=A[n],M[f]=r,O[f]=k[r],z[r]=0,k[r]=0;j[a+1]=j[a]+c}return E},numeric.ccsLUPSolve=function(e,t){var r=e.L,n=e.U,a=(e.P,t[0]),o=!1;"object"!=typeof a&&(t=[[0,t.length],numeric.linspace(0,t.length-1),t],a=t[0],o=!0);var i,s,l,u,c,d,f=t[1],p=t[2],h=r[0].length-1,v=a.length-1,g=numeric.rep([h],0),m=Array(h),y=numeric.rep([h],0),x=Array(h),b=numeric.rep([v+1],0),w=[],_=[],k=numeric.ccsTSolve,z=0;for(i=0;v>i;++i){for(c=0,l=a[i],u=a[i+1],s=l;u>s;++s)d=e.Pinv[f[s]],x[c]=d,y[d]=p[s],++c;for(x.length=c,k(r,y,g,x,m),s=x.length-1;-1!==s;--s)y[x[s]]=0;if(k(n,g,y,m,x),o)return y;for(s=m.length-1;-1!==s;--s)g[m[s]]=0;for(s=x.length-1;-1!==s;--s)d=x[s],w[z]=d,_[z]=y[d],y[d]=0,++z;b[i+1]=z}return[b,w,_]},numeric.ccsbinop=function(e,t){return"undefined"==typeof t&&(t=""),Function("X","Y","var Xi = X[0], Xj = X[1], Xv = X[2];\nvar Yi = Y[0], Yj = Y[1], Yv = Y[2];\nvar n = Xi.length-1,m = Math.max(numeric.sup(Xj),numeric.sup(Yj))+1;\nvar Zi = numeric.rep([n+1],0), Zj = [], Zv = [];\nvar x = numeric.rep([m],0),y = numeric.rep([m],0);\nvar xk,yk,zk;\nvar i,j,j0,j1,k,p=0;\n"+t+"for(i=0;i<n;++i) {\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Xj[j];\n x[k] = 1;\n Zj[p] = k;\n ++p;\n }\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Yj[j];\n y[k] = Yv[j];\n if(x[k] === 0) {\n Zj[p] = k;\n ++p;\n }\n }\n Zi[i+1] = p;\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = Xv[j];\n j0 = Zi[i]; j1 = Zi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Zj[j];\n xk = x[k];\n yk = y[k];\n"+e+"\n Zv[j] = zk;\n }\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = 0;\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) y[Yj[j]] = 0;\n}\nreturn [Zi,Zj,Zv];")},function(){var k,A,B,C;for(k in numeric.ops2)A=isFinite(eval("1"+numeric.ops2[k]+"0"))?"[Y[0],Y[1],numeric."+k+"(X,Y[2])]":"NaN",B=isFinite(eval("0"+numeric.ops2[k]+"1"))?"[X[0],X[1],numeric."+k+"(X[2],Y)]":"NaN",C=isFinite(eval("1"+numeric.ops2[k]+"0"))&&isFinite(eval("0"+numeric.ops2[k]+"1"))?"numeric.ccs"+k+"MM(X,Y)":"NaN",numeric["ccs"+k+"MM"]=numeric.ccsbinop("zk = xk "+numeric.ops2[k]+"yk;"),numeric["ccs"+k]=Function("X","Y",'if(typeof X === "number") return '+A+';\nif(typeof Y === "number") return '+B+";\nreturn "+C+";\n")}(),numeric.ccsScatter=function(e){var t,r=e[0],n=e[1],a=e[2],o=numeric.sup(n)+1,i=r.length,s=numeric.rep([o],0),l=Array(i),u=Array(i),c=numeric.rep([o],0);for(t=0;i>t;++t)c[n[t]]++;for(t=0;o>t;++t)s[t+1]=s[t]+c[t];var d,f,p=s.slice(0);for(t=0;i>t;++t)f=n[t],d=p[f],l[d]=r[t],u[d]=a[t],p[f]=p[f]+1;return[s,l,u]},numeric.ccsGather=function(e){var t,r,n,a,o,i=e[0],s=e[1],l=e[2],u=i.length-1,c=s.length,d=Array(c),f=Array(c),p=Array(c);for(o=0,t=0;u>t;++t)for(n=i[t],
a=i[t+1],r=n;r!==a;++r)f[o]=t,d[o]=s[r],p[o]=l[r],++o;return[d,f,p]},numeric.sdim=function l(e,t,r){if("undefined"==typeof t&&(t=[]),"object"!=typeof e)return t;"undefined"==typeof r&&(r=0),r in t||(t[r]=0),e.length>t[r]&&(t[r]=e.length);var n;for(n in e)e.hasOwnProperty(n)&&l(e[n],t,r+1);return t},numeric.sclone=function u(e,t,r){"undefined"==typeof t&&(t=0),"undefined"==typeof r&&(r=numeric.sdim(e).length);var n,a=Array(e.length);if(t===r-1){for(n in e)e.hasOwnProperty(n)&&(a[n]=e[n]);return a}for(n in e)e.hasOwnProperty(n)&&(a[n]=u(e[n],t+1,r));return a},numeric.sdiag=function(e){var t,r,n=e.length,a=Array(n);for(t=n-1;t>=1;t-=2)r=t-1,a[t]=[],a[t][t]=e[t],a[r]=[],a[r][r]=e[r];return 0===t&&(a[0]=[],a[0][0]=e[t]),a},numeric.sidentity=function(e){return numeric.sdiag(numeric.rep([e],1))},numeric.stranspose=function(e){var t,r,n,a=[];e.length;for(t in e)if(e.hasOwnProperty(t)){n=e[t];for(r in n)n.hasOwnProperty(r)&&("object"!=typeof a[r]&&(a[r]=[]),a[r][t]=n[r])}return a},numeric.sLUP=function(e,t){throw new Error("The function numeric.sLUP had a bug in it and has been removed. Please use the new numeric.ccsLUP function instead.")},numeric.sdotMM=function(e,t){var r,n,a,o,i,s,l,u=e.length,c=(t.length,numeric.stranspose(t)),d=c.length,f=Array(u);for(a=u-1;a>=0;a--){for(l=[],r=e[a],i=d-1;i>=0;i--){s=0,n=c[i];for(o in r)r.hasOwnProperty(o)&&o in n&&(s+=r[o]*n[o]);s&&(l[i]=s)}f[a]=l}return f},numeric.sdotMV=function(e,t){var r,n,a,o,i=e.length,s=Array(i);for(n=i-1;n>=0;n--){r=e[n],o=0;for(a in r)r.hasOwnProperty(a)&&t[a]&&(o+=r[a]*t[a]);o&&(s[n]=o)}return s},numeric.sdotVM=function(e,t){var r,n,a,o,i=[];for(r in e)if(e.hasOwnProperty(r)){a=t[r],o=e[r];for(n in a)a.hasOwnProperty(n)&&(i[n]||(i[n]=0),i[n]+=o*a[n])}return i},numeric.sdotVV=function(e,t){var r,n=0;for(r in e)e[r]&&t[r]&&(n+=e[r]*t[r]);return n},numeric.sdot=function(e,t){var r=numeric.sdim(e).length,n=numeric.sdim(t).length,a=1e3*r+n;switch(a){case 0:return e*t;case 1001:return numeric.sdotVV(e,t);case 2001:return numeric.sdotMV(e,t);case 1002:return numeric.sdotVM(e,t);case 2002:return numeric.sdotMM(e,t);default:throw new Error("numeric.sdot not implemented for tensors of order "+r+" and "+n)}},numeric.sscatter=function(e){var t,r,n,a,o=e[0].length,i=e.length,s=[];for(r=o-1;r>=0;--r)if(e[i-1][r]){for(a=s,n=0;i-2>n;n++)t=e[n][r],a[t]||(a[t]=[]),a=a[t];a[e[n][r]]=e[n+1][r]}return s},numeric.sgather=function c(e,t,r){"undefined"==typeof t&&(t=[]),"undefined"==typeof r&&(r=[]);var n,a,o;n=r.length;for(a in e)if(e.hasOwnProperty(a))if(r[n]=parseInt(a),o=e[a],"number"==typeof o){if(o){if(0===t.length)for(a=n+1;a>=0;--a)t[a]=[];for(a=n;a>=0;--a)t[a].push(r[a]);t[n+1].push(o)}}else c(o,t,r);return r.length>n&&r.pop(),t},numeric.cLU=function(e){var t,r,n,a,o,i,s=e[0],l=e[1],u=e[2],c=s.length,d=0;for(t=0;c>t;t++)s[t]>d&&(d=s[t]);d++;var f,p,h,v=Array(d),g=Array(d),m=numeric.rep([d],1/0),y=numeric.rep([d],-(1/0));for(n=0;c>n;n++)t=s[n],r=l[n],r<m[t]&&(m[t]=r),r>y[t]&&(y[t]=r);for(t=0;d-1>t;t++)y[t]>y[t+1]&&(y[t+1]=y[t]);for(t=d-1;t>=1;t--)m[t]<m[t-1]&&(m[t-1]=m[t]);var x=0,b=0;for(t=0;d>t;t++)g[t]=numeric.rep([y[t]-m[t]+1],0),v[t]=numeric.rep([t-m[t]],0),x+=t-m[t]+1,b+=y[t]-t+1;for(n=0;c>n;n++)t=s[n],g[t][l[n]-m[t]]=u[n];for(t=0;d-1>t;t++)for(a=t-m[t],f=g[t],r=t+1;m[r]<=t&&d>r;r++)if(o=t-m[r],i=y[t]-t,p=g[r],h=p[o]/f[a]){for(n=1;i>=n;n++)p[n+o]-=h*f[n+a];v[r][t-m[r]]=h}var c,w,_,f=[],p=[],k=[],z=[],A=[],j=[];for(c=0,w=0,t=0;d>t;t++){for(a=m[t],o=y[t],_=g[t],r=t;o>=r;r++)_[r-a]&&(f[c]=t,p[c]=r,k[c]=_[r-a],c++);for(_=v[t],r=a;t>r;r++)_[r-a]&&(z[w]=t,A[w]=r,j[w]=_[r-a],w++);z[w]=t,A[w]=t,j[w]=1,w++}return{U:[f,p,k],L:[z,A,j]}},numeric.cLUsolve=function(e,t){var r,n,a=e.L,o=e.U,i=numeric.clone(t),s=a[0],l=a[1],u=a[2],c=o[0],d=o[1],f=o[2],p=c.length,h=(s.length,i.length);for(n=0,r=0;h>r;r++){for(;l[n]<r;)i[r]-=u[n]*i[l[n]],n++;n++}for(n=p-1,r=h-1;r>=0;r--){for(;d[n]>r;)i[r]-=f[n]*i[d[n]],n--;i[r]/=f[n],n--}return i},numeric.cgrid=function(e,t){"number"==typeof e&&(e=[e,e]);var r,n,a,o=numeric.rep(e,-1);if("function"!=typeof t)switch(t){case"L":t=function(t,r){return t>=e[0]/2||r<e[1]/2};break;default:t=function(e,t){return!0}}for(a=0,r=1;r<e[0]-1;r++)for(n=1;n<e[1]-1;n++)t(r,n)&&(o[r][n]=a,a++);return o},numeric.cdelsq=function(e){var t,r,n,a,o,i=[[-1,0],[0,-1],[0,1],[1,0]],s=numeric.dim(e),l=s[0],u=s[1],c=[],d=[],f=[];for(t=1;l-1>t;t++)for(r=1;u-1>r;r++)if(!(e[t][r]<0)){for(n=0;4>n;n++)a=t+i[n][0],o=r+i[n][1],e[a][o]<0||(c.push(e[t][r]),d.push(e[a][o]),f.push(-1));c.push(e[t][r]),d.push(e[t][r]),f.push(4)}return[c,d,f]},numeric.cdotMV=function(e,t){var r,n,a,o=e[0],i=e[1],s=e[2],l=o.length;for(a=0,n=0;l>n;n++)o[n]>a&&(a=o[n]);for(a++,r=numeric.rep([a],0),n=0;l>n;n++)r[o[n]]+=s[n]*t[i[n]];return r},numeric.Spline=function(e,t,r,n,a){this.x=e,this.yl=t,this.yr=r,this.kl=n,this.kr=a},numeric.Spline.prototype._at=function(e,t){var e,r,n,a,o=this.x,i=this.yl,s=this.yr,l=this.kl,u=this.kr,c=numeric.add,d=numeric.sub,f=numeric.mul;r=d(f(l[t],o[t+1]-o[t]),d(s[t+1],i[t])),n=c(f(u[t+1],o[t]-o[t+1]),d(s[t+1],i[t])),a=(e-o[t])/(o[t+1]-o[t]);var p=a*(1-a);return c(c(c(f(1-a,i[t]),f(a,s[t+1])),f(r,p*(1-a))),f(n,p*a))},numeric.Spline.prototype.at=function(e){if("number"==typeof e){var t,r,n,a=this.x,o=a.length,i=Math.floor;for(t=0,r=o-1;r-t>1;)n=i((t+r)/2),a[n]<=e?t=n:r=n;return this._at(e,t)}var s,o=e.length,l=Array(o);for(s=o-1;-1!==s;--s)l[s]=this.at(e[s]);return l},numeric.Spline.prototype.diff=function(){var e,t,r,n=this.x,a=this.yl,o=this.yr,i=this.kl,s=this.kr,l=a.length,u=i,c=s,d=Array(l),f=Array(l),p=numeric.add,h=numeric.mul,v=numeric.div,g=numeric.sub;for(e=l-1;-1!==e;--e)t=n[e+1]-n[e],r=g(o[e+1],a[e]),d[e]=v(p(h(r,6),h(i[e],-4*t),h(s[e+1],-2*t)),t*t),f[e+1]=v(p(h(r,-6),h(i[e],2*t),h(s[e+1],4*t)),t*t);return new numeric.Spline(n,u,c,d,f)},numeric.Spline.prototype.roots=function(){function e(e){return e*e}var t=[],r=this.x,n=this.yl,a=this.yr,o=this.kl,i=this.kr;"number"==typeof n[0]&&(n=[n],a=[a],o=[o],i=[i]);var s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S=n.length,T=r.length-1,t=Array(S),C=Math.sqrt;for(s=0;s!==S;++s){for(c=n[s],d=a[s],f=o[s],p=i[s],h=[],l=0;l!==T;l++){for(l>0&&d[l]*c[l]<0&&h.push(r[l]),_=r[l+1]-r[l],k=r[l],m=c[l],y=d[l+1],v=f[l]/_,g=p[l+1]/_,w=e(v-g+3*(m-y))+12*g*m,x=g+3*m+2*v-3*y,b=3*(g+v+2*(m-y)),0>=w?(A=x/b,z=A>r[l]&&A<r[l+1]?[r[l],A,r[l+1]]:[r[l],r[l+1]]):(A=(x-C(w))/b,j=(x+C(w))/b,z=[r[l]],A>r[l]&&A<r[l+1]&&z.push(A),j>r[l]&&j<r[l+1]&&z.push(j),z.push(r[l+1])),O=z[0],A=this._at(O,l),u=0;u<z.length-1;u++)if(E=z[u+1],j=this._at(E,l),0!==A)if(0===j||A*j>0)O=E,A=j;else{for(var B=0;;){if(F=(A*E-j*O)/(A-j),O>=F||F>=E)break;if(M=this._at(F,l),M*j>0)E=F,j=M,-1===B&&(A*=.5),B=-1;else{if(!(M*A>0))break;O=F,A=M,1===B&&(j*=.5),B=1}}h.push(F),O=z[u+1],A=this._at(O,l)}else h.push(O),O=E,A=j;0===j&&h.push(E)}t[s]=h}return"number"==typeof this.yl[0]?t[0]:t},numeric.spline=function(e,t,r,n){var a,o=e.length,i=[],s=[],l=[],u=numeric.sub,c=numeric.mul,d=numeric.add;for(a=o-2;a>=0;a--)s[a]=e[a+1]-e[a],l[a]=u(t[a+1],t[a]);("string"==typeof r||"string"==typeof n)&&(r=n="periodic");var f=[[],[],[]];switch(typeof r){case"undefined":i[0]=c(3/(s[0]*s[0]),l[0]),f[0].push(0,0),f[1].push(0,1),f[2].push(2/s[0],1/s[0]);break;case"string":i[0]=d(c(3/(s[o-2]*s[o-2]),l[o-2]),c(3/(s[0]*s[0]),l[0])),f[0].push(0,0,0),f[1].push(o-2,0,1),f[2].push(1/s[o-2],2/s[o-2]+2/s[0],1/s[0]);break;default:i[0]=r,f[0].push(0),f[1].push(0),f[2].push(1)}for(a=1;o-1>a;a++)i[a]=d(c(3/(s[a-1]*s[a-1]),l[a-1]),c(3/(s[a]*s[a]),l[a])),f[0].push(a,a,a),f[1].push(a-1,a,a+1),f[2].push(1/s[a-1],2/s[a-1]+2/s[a],1/s[a]);switch(typeof n){case"undefined":i[o-1]=c(3/(s[o-2]*s[o-2]),l[o-2]),f[0].push(o-1,o-1),f[1].push(o-2,o-1),f[2].push(1/s[o-2],2/s[o-2]);break;case"string":f[1][f[1].length-1]=0;break;default:i[o-1]=n,f[0].push(o-1),f[1].push(o-1),f[2].push(1)}i="number"!=typeof i[0]?numeric.transpose(i):[i];var p=Array(i.length);if("string"==typeof r)for(a=p.length-1;-1!==a;--a)p[a]=numeric.ccsLUPSolve(numeric.ccsLUP(numeric.ccsScatter(f)),i[a]),p[a][o-1]=p[a][0];else for(a=p.length-1;-1!==a;--a)p[a]=numeric.cLUsolve(numeric.cLU(f),i[a]);return p="number"==typeof t[0]?p[0]:numeric.transpose(p),new numeric.Spline(e,t,t,p,p)},numeric.fftpow2=function d(e,t){var r=e.length;if(1!==r){var n,a,o=Math.cos,i=Math.sin,s=Array(r/2),l=Array(r/2),u=Array(r/2),c=Array(r/2);for(a=r/2,n=r-1;-1!==n;--n)--a,u[a]=e[n],c[a]=t[n],--n,s[a]=e[n],l[a]=t[n];d(s,l),d(u,c),a=r/2;var f,p,h,v=-6.283185307179586/r;for(n=r-1;-1!==n;--n)--a,-1===a&&(a=r/2-1),f=v*n,p=o(f),h=i(f),e[n]=s[a]+p*u[a]-h*c[a],t[n]=l[a]+p*c[a]+h*u[a]}},numeric._ifftpow2=function f(e,t){var r=e.length;if(1!==r){var n,a,o=Math.cos,i=Math.sin,s=Array(r/2),l=Array(r/2),u=Array(r/2),c=Array(r/2);for(a=r/2,n=r-1;-1!==n;--n)--a,u[a]=e[n],c[a]=t[n],--n,s[a]=e[n],l[a]=t[n];f(s,l),f(u,c),a=r/2;var d,p,h,v=6.283185307179586/r;for(n=r-1;-1!==n;--n)--a,-1===a&&(a=r/2-1),d=v*n,p=o(d),h=i(d),e[n]=s[a]+p*u[a]-h*c[a],t[n]=l[a]+p*c[a]+h*u[a]}},numeric.ifftpow2=function(e,t){numeric._ifftpow2(e,t),numeric.diveq(e,e.length),numeric.diveq(t,t.length)},numeric.convpow2=function(e,t,r,n){numeric.fftpow2(e,t),numeric.fftpow2(r,n);var a,o,i,s,l,u=e.length;for(a=u-1;-1!==a;--a)o=e[a],s=t[a],i=r[a],l=n[a],e[a]=o*i-s*l,t[a]=o*l+s*i;numeric.ifftpow2(e,t)},numeric.T.prototype.fft=function(){var e,t,r=this.x,n=this.y,a=r.length,o=Math.log,i=o(2),s=Math.ceil(o(2*a-1)/i),l=Math.pow(2,s),u=numeric.rep([l],0),c=numeric.rep([l],0),d=Math.cos,f=Math.sin,p=-3.141592653589793/a,h=numeric.rep([l],0),v=numeric.rep([l],0);Math.floor(a/2);for(e=0;a>e;e++)h[e]=r[e];if("undefined"!=typeof n)for(e=0;a>e;e++)v[e]=n[e];for(u[0]=1,e=1;l/2>=e;e++)t=p*e*e,u[e]=d(t),c[e]=f(t),u[l-e]=d(t),c[l-e]=f(t);var g=new numeric.T(h,v),m=new numeric.T(u,c);return g=g.mul(m),numeric.convpow2(g.x,g.y,numeric.clone(m.x),numeric.neg(m.y)),g=g.mul(m),g.x.length=a,g.y.length=a,g},numeric.T.prototype.ifft=function(){var e,t,r=this.x,n=this.y,a=r.length,o=Math.log,i=o(2),s=Math.ceil(o(2*a-1)/i),l=Math.pow(2,s),u=numeric.rep([l],0),c=numeric.rep([l],0),d=Math.cos,f=Math.sin,p=3.141592653589793/a,h=numeric.rep([l],0),v=numeric.rep([l],0);Math.floor(a/2);for(e=0;a>e;e++)h[e]=r[e];if("undefined"!=typeof n)for(e=0;a>e;e++)v[e]=n[e];for(u[0]=1,e=1;l/2>=e;e++)t=p*e*e,u[e]=d(t),c[e]=f(t),u[l-e]=d(t),c[l-e]=f(t);var g=new numeric.T(h,v),m=new numeric.T(u,c);return g=g.mul(m),numeric.convpow2(g.x,g.y,numeric.clone(m.x),numeric.neg(m.y)),g=g.mul(m),g.x.length=a,g.y.length=a,g.div(a)},numeric.gradient=function(e,t){var r=t.length,n=e(t);if(isNaN(n))throw new Error("gradient: f(x) is a NaN!");var a,o,i,s,l,u,c,d,f,p,h=Math.max,v=numeric.clone(t),g=Array(r),h=(numeric.div,numeric.sub,Math.max),m=.001,y=Math.abs,x=Math.min,b=0;for(a=0;r>a;a++)for(var w=h(1e-6*n,1e-8);;){if(++b,b>20)throw new Error("Numerical gradient fails");if(v[a]=t[a]+w,o=e(v),v[a]=t[a]-w,i=e(v),v[a]=t[a],isNaN(o)||isNaN(i))w/=16;else{if(g[a]=(o-i)/(2*w),l=t[a]-w,u=t[a],c=t[a]+w,d=(o-n)/w,f=(n-i)/w,p=h(y(g[a]),y(n),y(o),y(i),y(l),y(u),y(c),1e-8),s=x(h(y(d-g[a]),y(f-g[a]),y(d-f))/p,w/p),!(s>m))break;w/=16}}return g},numeric.uncmin=function(e,t,r,n,a,o,i){var s=numeric.gradient;"undefined"==typeof i&&(i={}),"undefined"==typeof r&&(r=1e-8),"undefined"==typeof n&&(n=function(t){return s(e,t)}),"undefined"==typeof a&&(a=1e3),t=numeric.clone(t);var l,u,c=t.length,d=e(t);if(isNaN(d))throw new Error("uncmin: f(x0) is a NaN!");var f=Math.max,p=numeric.norm2;r=f(r,numeric.epsilon);var h,v,g,m,y,x,b,w,_,k,z=i.Hinv||numeric.identity(c),A=numeric.dot,j=(numeric.inv,numeric.sub),M=numeric.add,O=numeric.tensor,E=numeric.div,F=numeric.mul,S=numeric.all,T=numeric.isFinite,C=numeric.neg,B=0,N="";for(v=n(t);a>B;){if("function"==typeof o&&o(B,t,d,v,z)){N="Callback returned true";break}if(!S(T(v))){N="Gradient has Infinity or NaN";break}if(h=C(A(z,v)),!S(T(h))){N="Search direction has Infinity or NaN";break}if(k=p(h),r>k){N="Newton step smaller than tol";break}for(_=1,u=A(v,h),y=t;a>B&&!(r>_*k)&&(m=F(h,_),y=M(t,m),l=e(y),l-d>=.1*_*u||isNaN(l));)_*=.5,++B;if(r>_*k){N="Line search step size smaller than tol";break}if(B===a){N="maxit reached during line search";break}g=n(y),x=j(g,v),w=A(x,m),b=A(z,x),z=j(M(z,F((w+A(x,b))/(w*w),O(m,m))),E(M(O(b,m),O(m,b)),w)),t=y,d=l,v=g,++B}return{solution:t,f:d,gradient:v,invHessian:z,iterations:B,message:N}},numeric.Dopri=function(e,t,r,n,a,o,i){this.x=e,this.y=t,this.f=r,this.ymid=n,this.iterations=a,this.events=i,this.message=o},numeric.Dopri.prototype._at=function(e,t){function r(e){return e*e}var n,a,o,i,s,l,e,u,c,d,f,p=this,h=p.x,v=p.y,g=p.f,m=p.ymid,y=(h.length,Math.floor,.5),x=numeric.add,b=numeric.mul,w=numeric.sub;return n=h[t],a=h[t+1],i=v[t],s=v[t+1],u=a-n,o=n+y*u,l=m[t],c=w(g[t],b(i,1/(n-o)+2/(n-a))),d=w(g[t+1],b(s,1/(a-o)+2/(a-n))),f=[r(e-a)*(e-o)/r(n-a)/(n-o),r(e-n)*r(e-a)/r(n-o)/r(a-o),r(e-n)*(e-o)/r(a-n)/(a-o),(e-n)*r(e-a)*(e-o)/r(n-a)/(n-o),(e-a)*r(e-n)*(e-o)/r(n-a)/(a-o)],x(x(x(x(b(i,f[0]),b(l,f[1])),b(s,f[2])),b(c,f[3])),b(d,f[4]))},numeric.Dopri.prototype.at=function(e){var t,r,n,a=Math.floor;if("number"!=typeof e){var o=e.length,i=Array(o);for(t=o-1;-1!==t;--t)i[t]=this.at(e[t]);return i}var s=this.x;for(t=0,r=s.length-1;r-t>1;)n=a(.5*(t+r)),s[n]<=e?t=n:r=n;return this._at(e,t)},numeric.dopri=function(e,t,r,n,a,o,i){"undefined"==typeof a&&(a=1e-6),"undefined"==typeof o&&(o=1e3);var s,l,u,c,d,f,p,h,v,g,m,y,x,b=[e],w=[r],_=[n(e,r)],k=[],z=.2,A=[.075,.225],j=[44/45,-56/15,32/9],M=[19372/6561,-25360/2187,64448/6561,-212/729],O=[9017/3168,-355/33,46732/5247,49/176,-5103/18656],E=[35/384,0,500/1113,125/192,-2187/6784,11/84],F=[.10013431883002395,0,.3918321794184259,-0.02982460176594817,.05893268337240795,-0.04497888809104361,.023904308236133973],S=[.2,.3,.8,8/9,1,1],T=[-71/57600,0,71/16695,-71/1920,17253/339200,-22/525,.025],C=0,B=(t-e)/10,N=0,P=numeric.add,I=numeric.mul,q=(Math.max,Math.min),V=Math.abs,R=numeric.norminf,D=Math.pow,U=numeric.any,L=numeric.lt,Y=numeric.and,H=(numeric.sub,new numeric.Dopri(b,w,_,k,-1,""));for("function"==typeof i&&(m=i(e,r));t>e&&o>N;)if(++N,e+B>t&&(B=t-e),s=n(e+S[0]*B,P(r,I(z*B,_[C]))),l=n(e+S[1]*B,P(P(r,I(A[0]*B,_[C])),I(A[1]*B,s))),u=n(e+S[2]*B,P(P(P(r,I(j[0]*B,_[C])),I(j[1]*B,s)),I(j[2]*B,l))),c=n(e+S[3]*B,P(P(P(P(r,I(M[0]*B,_[C])),I(M[1]*B,s)),I(M[2]*B,l)),I(M[3]*B,u))),d=n(e+S[4]*B,P(P(P(P(P(r,I(O[0]*B,_[C])),I(O[1]*B,s)),I(O[2]*B,l)),I(O[3]*B,u)),I(O[4]*B,c))),v=P(P(P(P(P(r,I(_[C],B*E[0])),I(l,B*E[2])),I(u,B*E[3])),I(c,B*E[4])),I(d,B*E[5])),f=n(e+B,v),p=P(P(P(P(P(I(_[C],B*T[0]),I(l,B*T[2])),I(u,B*T[3])),I(c,B*T[4])),I(d,B*T[5])),I(f,B*T[6])),g="number"==typeof p?V(p):R(p),g>a){if(B=.2*B*D(a/g,.25),e+B===e){H.msg="Step size became too small";break}}else{if(k[C]=P(P(P(P(P(P(r,I(_[C],B*F[0])),I(l,B*F[2])),I(u,B*F[3])),I(c,B*F[4])),I(d,B*F[5])),I(f,B*F[6])),++C,b[C]=e+B,w[C]=v,_[C]=f,"function"==typeof i){var X,G,W=e,Q=e+.5*B;if(y=i(Q,k[C-1]),x=Y(L(m,0),L(0,y)),U(x)||(W=Q,Q=e+B,m=y,y=i(Q,v),x=Y(L(m,0),L(0,y))),U(x)){for(var J,K,Z=0,$=1,ee=1;;){if("number"==typeof m)G=(ee*y*W-$*m*Q)/(ee*y-$*m);else for(G=Q,h=m.length-1;-1!==h;--h)m[h]<0&&y[h]>0&&(G=q(G,(ee*y[h]*W-$*m[h]*Q)/(ee*y[h]-$*m[h])));if(W>=G||G>=Q)break;X=H._at(G,C-1),K=i(G,X),J=Y(L(m,0),L(0,K)),U(J)?(Q=G,y=K,x=J,ee=1,-1===Z?$*=.5:$=1,Z=-1):(W=G,m=K,$=1,1===Z?ee*=.5:ee=1,Z=1)}return v=H._at(.5*(e+G),C-1),H.f[C]=n(G,X),H.x[C]=G,H.y[C]=X,H.ymid[C-1]=v,H.events=x,H.iterations=N,H}}e+=B,r=v,m=y,B=q(.8*B*D(a/g,.25),4*B)}return H.iterations=N,H},numeric.LU=function(e,t){t=t||!1;var r,n,a,o,i,s,l,u,c,d=Math.abs,f=e.length,p=f-1,h=new Array(f);for(t||(e=numeric.clone(e)),a=0;f>a;++a){for(l=a,s=e[a],c=d(s[a]),n=a+1;f>n;++n)o=d(e[n][a]),o>c&&(c=o,l=n);for(h[a]=l,l!=a&&(e[a]=e[l],e[l]=s,s=e[a]),i=s[a],r=a+1;f>r;++r)e[r][a]/=i;for(r=a+1;f>r;++r){for(u=e[r],n=a+1;p>n;++n)u[n]-=u[a]*s[n],++n,u[n]-=u[a]*s[n];n===p&&(u[n]-=u[a]*s[n])}}return{LU:e,P:h}},numeric.LUsolve=function(e,t){var r,n,a,o,i,s=e.LU,l=s.length,u=numeric.clone(t),c=e.P;for(r=l-1;-1!==r;--r)u[r]=t[r];for(r=0;l>r;++r)for(a=c[r],c[r]!==r&&(i=u[r],u[r]=u[a],u[a]=i),o=s[r],n=0;r>n;++n)u[r]-=u[n]*o[n];for(r=l-1;r>=0;--r){for(o=s[r],n=r+1;l>n;++n)u[r]-=u[n]*o[n];u[r]/=o[r]}return u},numeric.solve=function(e,t,r){return numeric.LUsolve(numeric.LU(e,r),t)},numeric.echelonize=function(e){var t,r,n,a,o,i,s,l,u=numeric.dim(e),c=u[0],d=u[1],f=numeric.identity(c),p=Array(c),h=Math.abs,v=numeric.diveq;for(e=numeric.clone(e),t=0;c>t;++t){for(n=0,o=e[t],i=f[t],r=1;d>r;++r)h(o[n])<h(o[r])&&(n=r);for(p[t]=n,v(i,o[n]),v(o,o[n]),r=0;c>r;++r)if(r!==t){for(s=e[r],l=s[n],a=d-1;-1!==a;--a)s[a]-=o[a]*l;for(s=f[r],a=c-1;-1!==a;--a)s[a]-=i[a]*l}}return{I:f,A:e,P:p}},numeric.__solveLP=function(e,t,r,n,a,o,i){var s,l,u,c,d=numeric.sum,f=(numeric.log,numeric.mul),p=numeric.sub,h=numeric.dot,v=numeric.div,g=numeric.add,m=e.length,y=r.length,x=!1,b=0,w=1,_=(numeric.transpose(t),numeric.svd,numeric.transpose),k=(numeric.leq,Math.sqrt),z=Math.abs,A=(numeric.muleq,numeric.norminf,numeric.any,Math.min),j=numeric.all,M=numeric.gt,O=Array(m),E=Array(y),F=(numeric.rep([y],1),numeric.solve),S=p(r,h(t,o)),T=h(e,e);for(u=b;a>u;++u){var C,B;for(C=y-1;-1!==C;--C)E[C]=v(t[C],S[C]);var N=_(E);for(C=m-1;-1!==C;--C)O[C]=d(N[C]);w=.25*z(T/h(e,O));var P=100*k(T/h(O,O));for((!isFinite(w)||w>P)&&(w=P),c=g(e,f(w,O)),l=h(N,E),C=m-1;-1!==C;--C)l[C][C]+=1;B=F(l,v(c,w),!0);var I=v(S,h(t,B)),q=1;for(C=y-1;-1!==C;--C)I[C]<0&&(q=A(q,-.999*I[C]));if(s=p(o,f(B,q)),S=p(r,h(t,s)),!j(M(S,0)))return{solution:o,message:"",iterations:u};if(o=s,n>w)return{solution:s,message:"",iterations:u};if(i){var V=h(e,c),R=h(t,c);for(x=!0,C=y-1;-1!==C;--C)if(V*R[C]<0){x=!1;break}}else x=o[m-1]>=0?!1:!0;if(x)return{solution:s,message:"Unbounded",iterations:u}}return{solution:o,message:"maximum iteration count exceeded",iterations:u}},numeric._solveLP=function(e,t,r,n,a){var o,i=e.length,s=r.length,l=(numeric.sum,numeric.log,numeric.mul,numeric.sub),u=numeric.dot,c=(numeric.div,numeric.add,numeric.rep([i],0).concat([1])),d=numeric.rep([s,1],-1),f=numeric.blockMatrix([[t,d]]),p=r,o=numeric.rep([i],0).concat(Math.max(0,numeric.sup(numeric.neg(r)))+1),h=numeric.__solveLP(c,f,p,n,a,o,!1),v=numeric.clone(h.solution);v.length=i;var g=numeric.inf(l(r,u(t,v)));if(0>g)return{solution:NaN,message:"Infeasible",iterations:h.iterations};var m=numeric.__solveLP(e,t,r,n,a-h.iterations,v,!0);return m.iterations+=h.iterations,m},numeric.solveLP=function(e,t,r,n,a,o,i){if("undefined"==typeof i&&(i=1e3),"undefined"==typeof o&&(o=numeric.epsilon),"undefined"==typeof n)return numeric._solveLP(e,t,r,o,i);var s,l=n.length,u=n[0].length,c=t.length,d=numeric.echelonize(n),f=numeric.rep([u],0),p=d.P,h=[];for(s=p.length-1;-1!==s;--s)f[p[s]]=1;for(s=u-1;-1!==s;--s)0===f[s]&&h.push(s);var v=numeric.getRange,g=numeric.linspace(0,l-1),m=numeric.linspace(0,c-1),y=v(n,g,h),x=v(t,m,p),b=v(t,m,h),w=numeric.dot,_=numeric.sub,k=w(x,d.I),z=_(b,w(k,y)),A=_(r,w(k,a)),j=Array(p.length),M=Array(h.length);for(s=p.length-1;-1!==s;--s)j[s]=e[p[s]];for(s=h.length-1;-1!==s;--s)M[s]=e[h[s]];var O=_(M,w(j,w(d.I,y))),E=numeric._solveLP(O,z,A,o,i),F=E.solution;if(F!==F)return E;var S=w(d.I,_(a,w(y,F))),T=Array(e.length);for(s=p.length-1;-1!==s;--s)T[p[s]]=S[s];for(s=h.length-1;-1!==s;--s)T[h[s]]=F[s];return{solution:T,message:E.message,iterations:E.iterations}},numeric.MPStoLP=function(e){function t(t){throw new Error("MPStoLP: "+t+"\nLine "+r+": "+e[r]+"\nCurrent state: "+s[i]+"\n")}e instanceof String&&e.split("\n");var r,n,a,o,i=0,s=["Initial state","NAME","ROWS","COLUMNS","RHS","BOUNDS","ENDATA"],l=e.length,u=0,c={},d=[],f=0,p={},h=0,v=[],g=[],m=[];for(r=0;l>r;++r){a=e[r];var y=a.match(/\S*/g),x=[];for(n=0;n<y.length;++n)""!==y[n]&&x.push(y[n]);if(0!==x.length){for(n=0;n<s.length&&a.substr(0,s[n].length)!==s[n];++n);if(n<s.length){if(i=n,1===n&&(o=x[1]),6===n)return{name:o,c:v,A:numeric.transpose(g),b:m,rows:c,vars:p}}else switch(i){case 0:case 1:t("Unexpected line");case 2:switch(x[0]){case"N":0===u?u=x[1]:t("Two or more N rows");break;case"L":c[x[1]]=f,d[f]=1,m[f]=0,++f;break;case"G":c[x[1]]=f,d[f]=-1,m[f]=0,++f;break;case"E":c[x[1]]=f,d[f]=0,m[f]=0,++f;break;default:t("Parse error "+numeric.prettyPrint(x))}break;case 3:p.hasOwnProperty(x[0])||(p[x[0]]=h,v[h]=0,g[h]=numeric.rep([f],0),++h);var b=p[x[0]];for(n=1;n<x.length;n+=2)if(x[n]!==u){var w=c[x[n]];g[b][w]=(d[w]<0?-1:1)*parseFloat(x[n+1])}else v[b]=parseFloat(x[n+1]);break;case 4:for(n=1;n<x.length;n+=2)m[c[x[n]]]=(d[c[x[n]]]<0?-1:1)*parseFloat(x[n+1]);break;case 5:break;case 6:t("Internal error")}}}t("Reached end of file without ENDATA")},numeric.seedrandom={pow:Math.pow,random:Math.random},function(e,t,r,n,a,o,i){function s(e){var t,n,a=this,o=e.length,i=0,s=a.i=a.j=a.m=0;for(a.S=[],a.c=[],o||(e=[o++]);r>i;)a.S[i]=i++;for(i=0;r>i;i++)t=a.S[i],s=c(s+t+e[i%o]),n=a.S[s],a.S[i]=n,a.S[s]=t;a.g=function(e){var t=a.S,n=c(a.i+1),o=t[n],i=c(a.j+o),s=t[i];t[n]=s,t[i]=o;for(var l=t[c(o+s)];--e;)n=c(n+1),o=t[n],i=c(i+o),s=t[i],t[n]=s,t[i]=o,l=l*r+t[c(o+s)];return a.i=n,a.j=i,l},a.g(r)}function l(e,t,r,n,a){if(r=[],a=typeof e,t&&"object"==a)for(n in e)if(n.indexOf("S")<5)try{r.push(l(e[n],t-1))}catch(o){}return r.length?r:e+("string"!=a?"\x00":"")}function u(e,t,r,n){for(e+="",r=0,n=0;n<e.length;n++)t[c(n)]=c((r^=19*t[c(n)])+e.charCodeAt(n));e="";for(n in t)e+=String.fromCharCode(t[n]);return e}function c(e){return e&r-1}t.seedrandom=function(c,d){var f,p=[];return c=u(l(d?[c,e]:arguments.length?c:[(new Date).getTime(),e,window],3),p),f=new s(p),u(f.S,e),t.random=function(){for(var e=f.g(n),t=i,s=0;a>e;)e=(e+s)*r,t*=r,s=f.g(1);for(;e>=o;)e/=2,t/=2,s>>>=1;return(e+s)/t},c},i=t.pow(r,n),a=t.pow(2,a),o=2*a,u(t.random(),e)}([],numeric.seedrandom,256,6,52),function(e){function t(e){if("object"!=typeof e)return e;var r,n=[],a=e.length;for(r=0;a>r;r++)n[r+1]=t(e[r]);return n}function r(e){if("object"!=typeof e)return e;var t,n=[],a=e.length;for(t=1;a>t;t++)n[t-1]=r(e[t]);return n}function n(e,t,r){var n,a,o,i,s;for(o=1;r>=o;o+=1){for(e[o][o]=1/e[o][o],s=-e[o][o],n=1;o>n;n+=1)e[n][o]=s*e[n][o];if(i=o+1,i>r)break;for(a=i;r>=a;a+=1)for(s=e[o][a],e[o][a]=0,n=1;o>=n;n+=1)e[n][a]=e[n][a]+s*e[n][o]}}function a(e,t,r,n){var a,o,i,s;for(o=1;r>=o;o+=1){for(s=0,a=1;o>a;a+=1)s+=e[a][o]*n[a];n[o]=(n[o]-s)/e[o][o]}for(i=1;r>=i;i+=1)for(o=r+1-i,n[o]=n[o]/e[o][o],s=-n[o],a=1;o>a;a+=1)n[a]=n[a]+s*e[a][o]}function o(e,t,r,n){var a,o,i,s,l,u;for(o=1;r>=o;o+=1){if(n[1]=o,u=0,i=o-1,1>i){if(u=e[o][o]-u,0>=u)break;e[o][o]=Math.sqrt(u)}else{for(s=1;i>=s;s+=1){for(l=e[s][o],a=1;s>a;a+=1)l-=e[a][o]*e[a][s];l/=e[s][s],e[s][o]=l,u+=l*l}if(u=e[o][o]-u,0>=u)break;e[o][o]=Math.sqrt(u)}n[1]=0}}function i(e,t,r,i,s,l,u,c,d,f,p,h,v,g,m,y){function x(){for(g[1]=g[1]+1,j=C,z=1;f>=z;z+=1){for(j+=1,V=-c[z],A=1;i>=A;A+=1)V+=u[A][z]*s[A];if(Math.abs(V)<G&&(V=0),z>p)m[j]=V;else if(m[j]=-Math.abs(V),V>0){for(A=1;i>=A;A+=1)u[A][z]=-u[A][z];c[z]=-c[z]}}for(z=1;v>=z;z+=1)m[C+h[z]]=0;for(N=0,q=0,z=1;f>=z;z+=1)m[C+z]<q*m[I+z]&&(N=z,q=m[C+z]/m[I+z]);return 0===N?999:0}function b(){for(z=1;i>=z;z+=1){for(V=0,A=1;i>=A;A+=1)V+=e[A][z]*u[A][N];m[z]=V}for(M=F,z=1;i>=z;z+=1)m[M+z]=0;for(A=v+1;i>=A;A+=1)for(z=1;i>=z;z+=1)m[M+z]=m[M+z]+e[z][A]*m[A];for(H=!0,z=v;z>=1;z-=1){for(V=m[z],j=T+z*(z+3)/2,M=j-z,A=z+1;v>=A;A+=1)V-=m[j]*m[S+A],j+=A;if(V/=m[M],m[S+z]=V,h[z]<p)break;if(0>V)break;H=!1,E=z}if(!H)for(R=m[B+E]/m[S+E],z=1;v>=z&&!(h[z]<p)&&!(m[S+z]<0);z+=1)q=m[B+z]/m[S+z],R>q&&(R=q,E=z);for(V=0,z=F+1;F+i>=z;z+=1)V+=m[z]*m[z];if(Math.abs(V)<=G){if(H)return y[1]=1,999;for(z=1;v>=z;z+=1)m[B+z]=m[B+z]-R*m[S+z];return m[B+v+1]=m[B+v+1]+R,700}for(V=0,z=1;i>=z;z+=1)V+=m[F+z]*u[z][N];for(D=-m[C+N]/V,X=!0,H||D>R&&(D=R,X=!1),z=1;i>=z;z+=1)s[z]=s[z]+D*m[F+z],Math.abs(s[z])<G&&(s[z]=0);for(l[1]=l[1]+D*V*(D/2+m[B+v+1]),z=1;v>=z;z+=1)m[B+z]=m[B+z]-D*m[S+z];if(m[B+v+1]=m[B+v+1]+D,!X){for(V=-c[N],A=1;i>=A;A+=1)V+=s[A]*u[A][N];if(N>p)m[C+N]=V;else if(m[C+N]=-Math.abs(V),V>0){for(A=1;i>=A;A+=1)u[A][N]=-u[A][N];c[N]=-c[N]}return 700}for(v+=1,h[v]=N,j=T+(v-1)*v/2+1,z=1;v-1>=z;z+=1)m[j]=m[z],j+=1;if(v===i)m[j]=m[i];else{for(z=i;z>=v+1&&0!==m[z]&&(U=Math.max(Math.abs(m[z-1]),Math.abs(m[z])),L=Math.min(Math.abs(m[z-1]),Math.abs(m[z])),q=m[z-1]>=0?Math.abs(U*Math.sqrt(1+L*L/(U*U))):-Math.abs(U*Math.sqrt(1+L*L/(U*U))),U=m[z-1]/q,L=m[z]/q,1!==U);z-=1)if(0===U)for(m[z-1]=L*q,A=1;i>=A;A+=1)q=e[A][z-1],e[A][z-1]=e[A][z],e[A][z]=q;else for(m[z-1]=q,Y=L/(1+U),A=1;i>=A;A+=1)q=U*e[A][z-1]+L*e[A][z],e[A][z]=Y*(e[A][z-1]+q)-e[A][z],e[A][z-1]=q;m[j]=m[v]}return 0}function w(){if(j=T+E*(E+1)/2+1,M=j+E,0===m[M])return 798;if(U=Math.max(Math.abs(m[M-1]),Math.abs(m[M])),L=Math.min(Math.abs(m[M-1]),Math.abs(m[M])),q=m[M-1]>=0?Math.abs(U*Math.sqrt(1+L*L/(U*U))):-Math.abs(U*Math.sqrt(1+L*L/(U*U))),U=m[M-1]/q,L=m[M]/q,1===U)return 798;if(0===U){for(z=E+1;v>=z;z+=1)q=m[M-1],m[M-1]=m[M],m[M]=q,M+=z;for(z=1;i>=z;z+=1)q=e[z][E],e[z][E]=e[z][E+1],e[z][E+1]=q}else{for(Y=L/(1+U),z=E+1;v>=z;z+=1)q=U*m[M-1]+L*m[M],m[M]=Y*(m[M-1]+q)-m[M],m[M-1]=q,M+=z;for(z=1;i>=z;z+=1)q=U*e[z][E]+L*e[z][E+1],e[z][E+1]=Y*(e[z][E]+q)-e[z][E+1],e[z][E]=q}return 0}function _(){for(M=j-E,z=1;E>=z;z+=1)m[M]=m[j],j+=1,M+=1;return m[B+E]=m[B+E+1],h[E]=h[E+1],E+=1,v>E?797:0}function k(){return m[B+v]=m[B+v+1],m[B+v+1]=0,h[v]=0,v-=1,g[2]=g[2]+1,0}var z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H,X,G,W,Q,J;P=Math.min(i,f),j=2*i+P*(P+5)/2+2*f+1,G=1e-60;do G+=G,W=1+.1*G,Q=1+.2*G;while(1>=W||1>=Q);for(z=1;i>=z;z+=1)m[z]=t[z];for(z=i+1;j>=z;z+=1)m[z]=0;for(z=1;f>=z;z+=1)h[z]=0;if(O=[],0===y[1]){if(o(e,r,i,O),0!==O[1])return void(y[1]=2);a(e,r,i,t),n(e,r,i)}else{for(A=1;i>=A;A+=1)for(s[A]=0,z=1;A>=z;z+=1)s[A]=s[A]+e[z][A]*t[z];for(A=1;i>=A;A+=1)for(t[A]=0,z=A;i>=z;z+=1)t[A]=t[A]+e[A][z]*s[z]}for(l[1]=0,A=1;i>=A;A+=1)for(s[A]=t[A],l[1]=l[1]+m[A]*s[A],m[A]=0,z=A+1;i>=z;z+=1)e[z][A]=0;for(l[1]=-l[1]/2,y[1]=0,F=i,S=F+i,B=S+P,T=B+P+1,C=T+P*(P+1)/2,I=C+f,z=1;f>=z;z+=1){for(V=0,A=1;i>=A;A+=1)V+=u[A][z]*u[A][z];m[I+z]=Math.sqrt(V)}for(v=0,g[1]=0,g[2]=0,J=0;;){if(J=x(),999===J)return;for(;;){if(J=b(),0===J)break;if(999===J)return;if(700===J)if(E===v)k();else{for(;;)if(w(),J=_(),797!==J)break;k()}}}}function s(e,n,a,o,s,l){e=t(e),n=t(n),a=t(a);var u,c,d,f,p,h,v=[],g=[],m=[],y=[],x=[];if(s=s||0,l=l?t(l):[void 0,0],o=o?t(o):[],c=e.length-1,d=a[1].length-1,!o)for(u=1;d>=u;u+=1)o[u]=0;for(u=1;d>=u;u+=1)g[u]=0;for(f=0,p=Math.min(c,d),u=1;c>=u;u+=1)m[u]=0;for(v[1]=0,u=1;2*c+p*(p+5)/2+2*d+1>=u;u+=1)y[u]=0;for(u=1;2>=u;u+=1)x[u]=0;return i(e,n,c,c,m,v,a,o,c,d,s,g,f,x,y,l),h="",1===l[1]&&(h="constraints are inconsistent, no solution!"),2===l[1]&&(h="matrix D in quadratic function is not positive definite!"),{solution:r(m),value:r(v),unconstrained_solution:r(n),iterations:r(x),iact:r(g),message:h}}e.solveQP=s}(numeric),numeric.svd=function(e){function t(e,t){return e=Math.abs(e),t=Math.abs(t),e>t?e*Math.sqrt(1+t*t/e/e):0==t?e:t*Math.sqrt(1+e*e/t/t)}var r,n=numeric.epsilon,a=1e-64/n,o=50,i=0,s=0,l=0,u=0,c=0,d=numeric.clone(e),f=d.length,p=d[0].length;if(p>f)throw"Need more rows than columns";var h=new Array(p),v=new Array(p);for(s=0;p>s;s++)h[s]=v[s]=0;var g=numeric.rep([p,p],0),m=0,y=0,x=0,b=0,w=0,_=0,k=0;for(s=0;p>s;s++){for(h[s]=y,k=0,c=s+1,l=s;f>l;l++)k+=d[l][s]*d[l][s];if(a>=k)y=0;else for(m=d[s][s],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,d[s][s]=m-y,l=c;p>l;l++){for(k=0,u=s;f>u;u++)k+=d[u][s]*d[u][l];for(m=k/x,u=s;f>u;u++)d[u][l]+=m*d[u][s]}for(v[s]=y,k=0,l=c;p>l;l++)k+=d[s][l]*d[s][l];if(a>=k)y=0;else{for(m=d[s][s+1],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,d[s][s+1]=m-y,l=c;p>l;l++)h[l]=d[s][l]/x;for(l=c;f>l;l++){for(k=0,u=c;p>u;u++)k+=d[l][u]*d[s][u];for(u=c;p>u;u++)d[l][u]+=k*h[u]}}w=Math.abs(v[s])+Math.abs(h[s]),w>b&&(b=w)}for(s=p-1;-1!=s;s+=-1){if(0!=y){for(x=y*d[s][s+1],l=c;p>l;l++)g[l][s]=d[s][l]/x;for(l=c;p>l;l++){for(k=0,u=c;p>u;u++)k+=d[s][u]*g[u][l];for(u=c;p>u;u++)g[u][l]+=k*g[u][s]}}for(l=c;p>l;l++)g[s][l]=0,g[l][s]=0;g[s][s]=1,y=h[s],c=s}for(s=p-1;-1!=s;s+=-1){for(c=s+1,y=v[s],l=c;p>l;l++)d[s][l]=0;if(0!=y){for(x=d[s][s]*y,l=c;p>l;l++){for(k=0,u=c;f>u;u++)k+=d[u][s]*d[u][l];for(m=k/x,u=s;f>u;u++)d[u][l]+=m*d[u][s]}for(l=s;f>l;l++)d[l][s]=d[l][s]/y}else for(l=s;f>l;l++)d[l][s]=0;d[s][s]+=1}for(n*=b,u=p-1;-1!=u;u+=-1)for(var z=0;o>z;z++){var A=!1;for(c=u;-1!=c;c+=-1){if(Math.abs(h[c])<=n){A=!0;break}if(Math.abs(v[c-1])<=n)break}if(!A){i=0,k=1;var j=c-1;for(s=c;u+1>s&&(m=k*h[s],h[s]=i*h[s],!(Math.abs(m)<=n));s++)for(y=v[s],x=t(m,y),v[s]=x,i=y/x,k=-m/x,l=0;f>l;l++)w=d[l][j],_=d[l][s],d[l][j]=w*i+_*k,d[l][s]=-w*k+_*i}if(_=v[u],c==u){if(0>_)for(v[u]=-_,l=0;p>l;l++)g[l][u]=-g[l][u];break}if(z>=o-1)throw"Error: no convergence.";for(b=v[c],w=v[u-1],y=h[u-1],x=h[u],m=((w-_)*(w+_)+(y-x)*(y+x))/(2*x*w),y=t(m,1),m=0>m?((b-_)*(b+_)+x*(w/(m-y)-x))/b:((b-_)*(b+_)+x*(w/(m+y)-x))/b,i=1,k=1,s=c+1;u+1>s;s++){for(y=h[s],w=v[s],x=k*y,y=i*y,_=t(m,x),h[s-1]=_,i=m/_,k=x/_,m=b*i+y*k,y=-b*k+y*i,x=w*k,w*=i,l=0;p>l;l++)b=g[l][s-1],_=g[l][s],g[l][s-1]=b*i+_*k,g[l][s]=-b*k+_*i;for(_=t(m,x),v[s-1]=_,i=m/_,k=x/_,m=i*y+k*w,b=-k*y+i*w,l=0;f>l;l++)w=d[l][s-1],_=d[l][s],d[l][s-1]=w*i+_*k,d[l][s]=-w*k+_*i}h[c]=0,h[u]=m,v[u]=b}for(s=0;s<v.length;s++)v[s]<n&&(v[s]=0);for(s=0;p>s;s++)for(l=s-1;l>=0;l--)if(v[l]<v[s]){for(i=v[l],v[l]=v[s],v[s]=i,u=0;u<d.length;u++)r=d[u][s],d[u][s]=d[u][l],d[u][l]=r;for(u=0;u<g.length;u++)r=g[u][s],g[u][s]=g[u][l],g[u][l]=r;s=l}return{U:d,S:v,V:g}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,r){!function(){"use strict";function e(e,t){var r=e.x-t.x,n=e.y-t.y;return r*r+n*n}function r(e,t,r){var n=t.x,a=t.y,o=r.x-n,i=r.y-a;if(0!==o||0!==i){var s=((e.x-n)*o+(e.y-a)*i)/(o*o+i*i);s>1?(n=r.x,a=r.y):s>0&&(n+=o*s,a+=i*s)}return o=e.x-n,i=e.y-a,o*o+i*i}function n(t,r){for(var n,a=t[0],o=[a],i=1,s=t.length;s>i;i++)n=t[i],e(n,a)>r&&(o.push(n),a=n);return a!==n&&o.push(n),o}function a(e,t){var n,a,o,i,s=e.length,l="undefined"!=typeof Uint8Array?Uint8Array:Array,u=new l(s),c=0,d=s-1,f=[],p=[];for(u[c]=u[d]=1;d;){for(a=0,n=c+1;d>n;n++)o=r(e[n],e[c],e[d]),o>a&&(i=n,a=o);a>t&&(u[i]=1,f.push(c,i,i,d)),d=f.pop(),c=f.pop()}for(n=0;s>n;n++)u[n]&&p.push(e[n]);return p}function o(e,t,r){var o=void 0!==t?t*t:1;return e=r?e:n(e,o),e=a(e,o)}"function"==typeof define&&define.amd?define(function(){return o}):"undefined"!=typeof t?t.exports=o:"undefined"!=typeof self?self.simplify=o:window.simplify=o}()},{}],9:[function(e,t,r){"use strict";function n(e,t,r,n){this.points=e,this.ids=t,this.dimension=n,this.length=r}function a(e){var t,r,a;if(Array.isArray(e)){if(t=e.length,0===t)return new n(null,null,0,0);r=e[0].length,a=i(d.mallocDouble(t*(r+1)),[t,r+1]),l(e,a.hi(t,r))}else{t=e.shape[0],r=e.shape[1];var o=e.dtype;o="int8"===o||"int16"===o||"int32"===o?"int32":"uint8"===o||"uint8_clamped"===o||"buffer"===o||"uint16"===o||"uint32"===o?"uint32":"float32"===o?"float32":"float64",a=i(d.malloc(t*(r+1)),[t,r+1]),u.assign(a.hi(t,r),e)}for(var h=0;t>h;++h)a.set(h,r,h);for(var v=c.malloc([t,r],e.dtype),g=d.mallocInt32(t),m=0,y=v.data,x=a.data,b=(p.log2(p.nextPow2(t)),s.compile(a.order,!0,a.dtype)),w=[a];t>m;){var _=w.shift(),k=_,z=0|k.shape[0];if(z>1){var A,j=p.log2(m+1)%r,M=f.root(z);A=b(k,M,function(e,t){return e.get(j)-t.get(j)});for(var O=v.index(m,0),E=A.offset,h=0;r>h;++h)y[O++]=x[E++];g[m]=x[E],m+=1,w.push(k.hi(M)),z>2&&w.push(k.lo(M+1))}else{for(var E=k.offset,O=v.index(m,0),h=0;r>h;++h)y[O+h]=x[E++];g[m]=x[E],m+=1}}return d.free(a.data),new n(v,g,t,r)}function o(e){var t=e.p,r=e.i;if(t){for(var a=t.length,o=d.mallocFloat64(a),s=0;a>s;++s)o[s]=t[s];for(var l=r.length,u=d.mallocInt32(l),s=0;l>s;++s)u[s]=r[s];var c=a/l|0;return new n(i(o,[l,c]),u,l,c)}return new n(null,null,0,e.d)}t.exports=a,t.exports.deserialize=o;var i=e("ndarray"),s=e("ndarray-select"),l=e("ndarray-pack"),u=e("ndarray-ops"),c=e("ndarray-scratch"),d=e("typedarray-pool"),f=e("inorder-tree-layout"),p=e("bit-twiddle"),h=e("./lib/heap.js"),v=n.prototype;v.serialize=function(){return this.length>0?{p:Array.prototype.slice.call(this.points.data,0,this.length*this.dimension),i:Array.prototype.slice.call(this.ids,0,this.length)}:{d:this.dimension}},v.range=function(e,t,r){var n=this.length;if(!(1>n)){for(var a=this.dimension,o=0;a>o;++o)if(t[o]<e[o])return;
var i,s=this.points,u=this.ids,f=c.malloc([n,2,a]),h=d.mallocInt32(n),v=f.data,g=s.data,m=1,y=0;for(h[0]=0,l(e,f.pick(0,0)),l(t,f.pick(0,1));m>y;){for(var x=h[y],b=p.log2(x+1)%a,w=f.index(y,0,0),_=f.index(y,1,0),k=s.index(x,0),z=!0,o=0;a>o;++o){var A=g[k+o];if(A<v[w+o]||v[_+o]<A){z=!1;break}}if(z&&(i=r(u[x]),void 0!==i))break;var j=g[k+b],M=v[_+b],O=v[w+b];if(j>=O){var E=2*x+1;if(n>E){h[m]=E;for(var F=f.index(m,0,0),o=0;a>o;++o)v[F+o]=v[w+o];for(var S=f.index(m,1,0),o=0;a>o;++o)v[S+o]=v[_+o];v[S+b]=Math.min(M,j),m+=1}}if(M>=j){var T=2*(x+1);if(n>T){h[m]=T;for(var F=f.index(m,0,0),o=0;a>o;++o)v[F+o]=v[w+o];for(var S=f.index(m,1,0),o=0;a>o;++o)v[S+o]=v[_+o];v[F+b]=Math.max(O,j),m+=1}}y+=1}return c.free(f),d.free(h),i}},v.rnn=function(e,t,r){if(!(0>t)){var n=this.length;if(!(1>n)){var a,o=this.dimension,i=this.points,s=this.ids,l=c.malloc([n,o]),u=d.mallocInt32(n),f=l.data,h=i.data,v=1,g=0,m=t*t;u[0]=0;for(var y=0;o>y;++y)l.set(0,y,0);for(;v>g;){for(var x=u[g],b=i.index(x,0),w=0,y=0;o>y;++y)w+=Math.pow(e[y]-h[b+y],2);if(m>=w&&(a=r(s[x]),void 0!==a))break;for(var _=p.log2(x+1)%o,k=0,z=l.index(g,0),y=0;o>y;++y)y!==_&&(k+=f[z+y]);var A=e[_],j=h[b+_],M=f[z+_],O=M,E=M;j>A?E=Math.max(M,Math.pow(j-A,2)):O=Math.max(M,Math.pow(j-A,2));var F=O+k,S=E+k;if(m>=F){var T=2*x+1;if(n>T){u[v]=T;for(var C=l.index(v,0),y=0;o>y;++y)f[C+y]=f[z+y];f[C+_]=O,v+=1}}if(m>=S){var B=2*(x+1);if(n>B){u[v]=B;for(var C=l.index(v,0),y=0;o>y;++y)f[C+y]=f[z+y];f[C+_]=E,v+=1}}g+=1}return c.free(l),d.free(u),a}}},v.nn=function(e,t){var r=this.length;if(1>r)return-1;if("number"==typeof t){if(0>t)return-1}else t=1/0;var n=this.dimension,a=this.points,o=a.data,i=d.mallocFloat64(n),s=new h(r,n+1),l=s.index,u=s.data;l[0]=0;for(var c=0;n>=c;++c)u[c]=0;s.count+=1;for(var f=-1,v=t;s.count>0&&!(u[0]>=v);){for(var g=l[0],m=a.index(g,0),y=0,c=0;n>c;++c)y+=Math.pow(e[c]-o[m+c],2);v>y&&(v=y,f=g);for(var x=p.log2(g+1)%n,b=0,c=0;n>c;++c){var w=u[c+1];c!==x&&(b+=w),i[c]=w}var _=e[x],k=o[m+x],z=i[x],A=z,j=z;k>_?j=Math.max(z,Math.pow(k-_,2)):A=Math.max(z,Math.pow(k-_,2));var M=A+b,O=j+b;if(s.pop(),v>M){var E=2*g+1;if(r>E){var F=s.count;l[F]=E;var S=F*(n+1);u[S]=M;for(var c=1;n>=c;++c)u[S+c]=i[c-1];u[S+x+1]=A,s.push()}}if(v>O){var T=2*(g+1);if(r>T){var F=s.count;l[F]=T;var S=F*(n+1);u[S]=O;for(var c=1;n>=c;++c)u[S+c]=i[c-1];u[S+x+1]=j,s.push()}}}return d.freeFloat64(i),s.dispose(),0>f?-1:this.ids[f]},v.knn=function(e,t,r){if("number"==typeof r){if(0>r)return[]}else r=1/0;var n=this.length;if(1>n)return[];if("number"==typeof t){if(0>=t)return[];t=0|Math.min(t,n)}else t=n;var a=this.ids,o=this.dimension,i=this.points,s=i.data,l=d.mallocFloat64(o),u=new h(t,1),c=u.index,f=u.data,v=new h(n,o+1),g=v.index,m=v.data;g[0]=0;for(var y=0;o>=y;++y)m[y]=0;v.count+=1;for(var x=r;v.count>0&&!(m[0]>=x);){for(var b=g[0],w=i.index(b,0),_=0,y=0;o>y;++y)_+=Math.pow(e[y]-s[w+y],2);if(x>_){u.count>=t&&u.pop();var k=u.count;c[k]=b,f[k]=-_,u.push(),u.count>=t&&(x=-f[0])}for(var z=p.log2(b+1)%o,A=0,y=0;o>y;++y){var j=m[y+1];y!==z&&(A+=j),l[y]=j}var M=e[z],O=s[w+z],E=l[z],F=E,S=E;O>M?S=Math.max(E,Math.pow(O-M,2)):F=Math.max(E,Math.pow(O-M,2));var T=F+A,C=S+A;if(v.pop(),x>T){var B=2*b+1;if(n>B){var N=v.count;g[N]=B;var P=N*(o+1);m[P]=T;for(var y=1;o>=y;++y)m[P+y]=l[y-1];m[P+z+1]=F,v.push()}}if(x>C){var I=2*(b+1);if(n>I){var N=v.count;g[N]=I;var P=N*(o+1);m[P]=C;for(var y=1;o>=y;++y)m[P+y]=l[y-1];m[P+z+1]=S,v.push()}}}d.freeFloat64(l),v.dispose();for(var q=new Array(u.count),a=this.ids,y=u.count-1;y>=0;--y)q[y]=a[c[0]],u.pop();return u.dispose(),q},v.dispose=function(){d.free(this.points.data),d.freeInt32(this.ids),this.points=null,this.ids=null,this.length=0}},{"./lib/heap.js":10,"bit-twiddle":11,"inorder-tree-layout":12,ndarray:27,"ndarray-ops":14,"ndarray-pack":19,"ndarray-scratch":25,"ndarray-select":26,"typedarray-pool":31}],10:[function(e,t,r){"use strict";function n(e){return 1&e?e-1>>1:(e>>1)-1}function a(e,t){this.count=0,this.dataSize=t,this.index=o.mallocInt32(e),this.data=o.mallocFloat64(e*t)}t.exports=a;var o=e("typedarray-pool"),i=a.prototype;i.heapSwap=function(e,t){var r=this.data,n=this.index,a=this.dataSize,o=n[e];n[e]=n[t],n[t]=o;for(var i=a*e,s=a*t,l=0;a>l;++l){var u=r[i];r[i]=r[s],r[s]=u,i+=1,s+=1}},i.heapUp=function(e){for(var t=this.dataSize,r=(this.index,this.data),a=r[t*e];e>0;){var o=n(e);if(o>=0){var i=r[t*o];if(i>a){this.heapSwap(e,o),e=o;continue}}break}},i.heapDown=function(e){for(var t=this.dataSize,r=(this.index,this.data),n=this.count,a=r[t*e];;){var o=a,i=2*e+1,s=2*(e+1),l=e;if(n>i){var u=r[t*i];o>u&&(l=i,o=u)}if(n>s){var c=r[t*s];o>c&&(l=s)}if(l===e)break;this.heapSwap(e,l),e=l}},i.pop=function(){this.count-=1,this.heapSwap(0,this.count),this.heapDown(0)},i.push=function(){this.heapUp(this.count),this.count+=1},i.dispose=function(){o.freeInt32(this.index),o.freeFloat64(this.data)}},{"typedarray-pool":31}],11:[function(e,t,r){"use strict";"use restrict";function n(e){var t=32;return e&=-e,e&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}var a=32;r.INT_BITS=a,r.INT_MAX=2147483647,r.INT_MIN=-1<<a-1,r.sign=function(e){return(e>0)-(0>e)},r.abs=function(e){var t=e>>a-1;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(t>e)},r.max=function(e,t){return e^(e^t)&-(t>e)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return e-=e>>>1&1431655765,e=(858993459&e)+(e>>>2&858993459),16843009*(e+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var o=new Array(256);!function(e){for(var t=0;256>t;++t){var r=t,n=t,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;e[t]=n<<a&255}}(o),r.reverse=function(e){return o[255&e]<<24|o[e>>>8&255]<<16|o[e>>>16&255]<<8|o[e>>>24&255]},r.interleave2=function(e,t){return e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1},r.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=858993459&(e|e>>>1),e=252645135&(e|e>>>2),e=16711935&(e|e>>>4),e=65535&(e|e>>>16),e<<16>>16},r.interleave3=function(e,t,r){return e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e|=t<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),e|r<<2},r.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=3272356035&(e|e>>>2),e=251719695&(e|e>>>4),e=4278190335&(e|e>>>8),e=1023&(e|e>>>16),e<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],12:[function(e,t,r){"use strict";function n(e){var t=(v.nextPow2(e+1)>>>1)-1,r=e-t;return v.nextPow2(r)-1>=t?t:(t>>>1)+r}function a(e){return 0}function o(e){return e-1}function i(e,t){if(0>=e)return 0;var r=n(e);return t>r?i(e-r-1,t-r-1):t===r?v.log2(e):i(r,t)}function s(e,t){return Math.max(t-1,0)}function l(e,t){return Math.min(t+1,e-1)}function u(e,t){if(0>=e)return-1;var r=n(e);if(t>r){var a=u(e-r-1,t-r-1);return 0>a?r:a+r+1}if(t===r)return-1;var a=u(r,t);return 0>a?r:a}function c(e,t){if(0>=e)return 0;var r=n(e);return t>r?c(e-r-1,t-r-1)+r+1:t===r?n(t):c(r,t)}function d(e,t){if(0>=e)return 0;var r=n(e);return t>r?d(e-r-1,t-r-1)+r+1:t===r?n(e-r-1)+r+1:d(r,t)}function f(e,t){return 0===i(e,t)}function p(e,t){e|=0,t|=0;for(var r=0;e>1;){var a=n(e);if(t>a)r+=a+1,e-=a+1,t-=a+1;else{if(t===a)break;e=a}}return r}function h(e,t){e|=0,t|=0;for(var r=0;e>1;){var a=n(e);if(t>a)r+=a+1,e-=a+1,t-=a+1;else{if(t===a){r+=e-1;break}e=a}}return r}var v=e("bit-twiddle");r.root=n,r.begin=a,r.end=o,r.height=i,r.prev=s,r.next=l,r.parent=u,r.left=c,r.right=d,r.leaf=f,r.lo=p,r.hi=h},{"bit-twiddle":13}],13:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],14:[function(e,t,r){"use strict";function n(e){if(!e)return s;for(var t=0;t<e.args.length;++t){var r=e.args[t];0===t?e.args[t]={name:r,lvalue:!0,rvalue:!!e.rvalue,count:e.count||1}:e.args[t]={name:r,lvalue:!1,rvalue:!0,count:1}}return e.thisVars||(e.thisVars=[]),e.localVars||(e.localVars=[]),e}function a(e){return i({args:e.args,pre:n(e.pre),body:n(e.body),post:n(e.proc),funcName:e.funcName})}function o(e){for(var t=[],r=0;r<e.args.length;++r)t.push("a"+r);var n=new Function("P",["return function ",e.funcName,"_ndarrayops(",t.join(","),") {P(",t.join(","),");return a0}"].join(""));return n(a(e))}var i=e("cwise-compiler"),s={body:"",args:[],thisVars:[],localVars:[]},l={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var e in l){var t=l[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+t+"=b"},rvalue:!0,funcName:e+"eq"}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+t+"=s"},rvalue:!0,funcName:e+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var e in u){var t=u[e];r[e]=o({args:["array","array"],body:{args:["a","b"],body:"a="+t+"b"},funcName:e}),r[e+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+t+"a"},rvalue:!0,count:2,funcName:e+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var e in c){var t=c[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+t+"b"},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+t+"s"},rvalue:!0,count:2,funcName:e+"seq"})}}();var d=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var e=0;e<d.length;++e){var t=d[e];r[t]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:t}),r[t+"eq"]=o({args:["array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"})}}();var f=["max","min","atan2","pow"];!function(){for(var e=0;e<f.length;++e){var t=f[e];r[t]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"seq"})}}();var p=["atan2","pow"];!function(){for(var e=0;e<p.length;++e){var t=p[e];r[t+"op"]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"op"}),r[t+"ops"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"ops"}),r[t+"opeq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opeq"}),r[t+"opseq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opseq"})}}(),r.any=i({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=i({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=i({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=i({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=i({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=i({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=i({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":15}],15:[function(e,t,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function a(e){var t=new n;t.pre=e.pre,t.body=e.body,t.post=e.post;var r=e.args.slice(0);t.argTypes=r;for(var a=0;a<r.length;++a){var i=r[a];if("array"===i||"object"==typeof i&&i.blockIndices){if(t.argTypes[a]="array",t.arrayArgs.push(a),t.arrayBlockIndices.push(i.blockIndices?i.blockIndices:0),t.shimArgs.push("array"+a),a<t.pre.args.length&&t.pre.args[a].count>0)throw new Error("cwise: pre() block may not reference array args");if(a<t.post.args.length&&t.post.args[a].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===i)t.scalarArgs.push(a),t.shimArgs.push("scalar"+a);else if("index"===i){if(t.indexArgs.push(a),a<t.pre.args.length&&t.pre.args[a].count>0)throw new Error("cwise: pre() block may not reference array index");if(a<t.body.args.length&&t.body.args[a].lvalue)throw new Error("cwise: body() block may not write to array index");if(a<t.post.args.length&&t.post.args[a].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===i){if(t.shapeArgs.push(a),a<t.pre.args.length&&t.pre.args[a].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(a<t.body.args.length&&t.body.args[a].lvalue)throw new Error("cwise: body() block may not write to array shape");if(a<t.post.args.length&&t.post.args[a].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof i||!i.offset)throw new Error("cwise: Unknown argument type "+r[a]);t.argTypes[a]="offset",t.offsetArgs.push({array:i.array,offset:i.offset}),t.offsetArgIndex.push(a)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,o(t)}var o=e("./lib/thunk.js");t.exports=a},{"./lib/thunk.js":17}],16:[function(e,t,r){"use strict";function n(e,t,r){var n,a,o=e.length,i=t.arrayArgs.length,s=t.indexArgs.length>0,l=[],u=[],c=0,d=0;for(n=0;o>n;++n)u.push(["i",n,"=0"].join(""));for(a=0;i>a;++a)for(n=0;o>n;++n)d=c,c=e[n],0===n?u.push(["d",a,"s",n,"=t",a,"p",c].join("")):u.push(["d",a,"s",n,"=(t",a,"p",c,"-s",d,"*t",a,"p",d,")"].join(""));for(l.push("var "+u.join(",")),n=o-1;n>=0;--n)c=e[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;o>n;++n){for(d=c,c=e[n],a=0;i>a;++a)l.push(["p",a,"+=d",a,"s",n].join(""));s&&(n>0&&l.push(["index[",d,"]-=s",d].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function a(e,t,r,a){for(var o=t.length,i=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;i>c;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=e;o>c;++c)u.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",t[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",t[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",t[c],"]=j",c].join(""));for(var c=0;i>c;++c){for(var d=["offset"+c],f=e;o>f;++f)d.push(["j",f,"*t",c,"p",t[f]].join(""));u.push(["p",c,"=(",d.join("+"),")"].join(""))}u.push(n(t,r,a));for(var c=e;o>c;++c)u.push("}");return u.join("\n")}function o(e){for(var t=0,r=e[0].length;r>t;){for(var n=1;n<e.length;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function i(e,t,r){for(var n=e.body,a=[],o=[],i=0;i<e.args.length;++i){var s=e.args[i];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=t.arrayArgs.indexOf(i);switch(t.argTypes[i]){case"offset":var d=t.offsetArgIndex.indexOf(i),f=t.offsetArgs[d];c=f.array,u="+q"+d;case"array":u="p"+c+u;var p="l"+i,h="a"+c;if(0===t.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),o.push([h,".set(",u,",",p,")"].join(""))):n=n.replace(l,[h,".get(",u,")"].join("")):n=n.replace(l,[h,"[",u,"]"].join("")):"generic"===r[c]?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,".set(",u,",",p,")"].join(""))):(a.push(["var ",p,"=",h,"[",u,"]"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,"[",u,"]=",p].join("")));else{for(var v=[s.name],g=[u],m=0;m<Math.abs(t.arrayBlockIndices[c]);m++)v.push("\\s*\\[([^\\]]+)\\]"),g.push("$"+(m+1)+"*t"+c+"b"+m);if(l=new RegExp(v.join(""),"g"),u=g.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[h,"[",u,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+t.scalarArgs.indexOf(i));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[a.join("\n"),n,o.join("\n")].join("\n").trim()}function s(e){for(var t=new Array(e.length),r=!0,n=0;n<e.length;++n){var a=e[n],o=a.match(/\d+/);o=o?o[0]:"",0===a.charAt(0)?t[n]="u"+a.charAt(1)+o:t[n]=a.charAt(0)+o,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function l(e,t){for(var r=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,l=new Array(e.arrayArgs.length),c=new Array(e.arrayArgs.length),d=0;d<e.arrayArgs.length;++d)c[d]=t[2*d],l[d]=t[2*d+1];for(var f=[],p=[],h=[],v=[],g=[],d=0;d<e.arrayArgs.length;++d){e.arrayBlockIndices[d]<0?(h.push(0),v.push(r),f.push(r),p.push(r+e.arrayBlockIndices[d])):(h.push(e.arrayBlockIndices[d]),v.push(e.arrayBlockIndices[d]+r),f.push(0),p.push(e.arrayBlockIndices[d]));for(var m=[],y=0;y<l[d].length;y++)h[d]<=l[d][y]&&l[d][y]<v[d]&&m.push(l[d][y]-h[d]);g.push(m)}for(var x=["SS"],b=["'use strict'"],w=[],y=0;r>y;++y)w.push(["s",y,"=SS[",y,"]"].join(""));for(var d=0;d<e.arrayArgs.length;++d){x.push("a"+d),x.push("t"+d),x.push("p"+d);for(var y=0;r>y;++y)w.push(["t",d,"p",y,"=t",d,"[",h[d]+y,"]"].join(""));for(var y=0;y<Math.abs(e.arrayBlockIndices[d]);++y)w.push(["t",d,"b",y,"=t",d,"[",f[d]+y,"]"].join(""))}for(var d=0;d<e.scalarArgs.length;++d)x.push("Y"+d);if(e.shapeArgs.length>0&&w.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var _=new Array(r),d=0;r>d;++d)_[d]="0";w.push(["index=[",_.join(","),"]"].join(""))}for(var d=0;d<e.offsetArgs.length;++d){for(var k=e.offsetArgs[d],z=[],y=0;y<k.offset.length;++y)0!==k.offset[y]&&(1===k.offset[y]?z.push(["t",k.array,"p",y].join("")):z.push([k.offset[y],"*t",k.array,"p",y].join("")));0===z.length?w.push("q"+d+"=0"):w.push(["q",d,"=",z.join("+")].join(""))}var A=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));w=w.concat(A),b.push("var "+w.join(","));for(var d=0;d<e.arrayArgs.length;++d)b.push("p"+d+"|=0");e.pre.body.length>3&&b.push(i(e.pre,e,c));var j=i(e.body,e,c),M=o(g);r>M?b.push(a(M,g[0],e,j)):b.push(n(g[0],e,j)),e.post.body.length>3&&b.push(i(e.post,e,c)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+b.join("\n")+"\n----------");var O=[e.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",M,s(c)].join(""),E=new Function(["function ",O,"(",x.join(","),"){",b.join("\n"),"} return ",O].join(""));return E()}var u=e("uniq");t.exports=l},{uniq:18}],17:[function(e,t,r){"use strict";function n(e){var t=["'use strict'","var CACHED={}"],r=[],n=e.funcName+"_cwise_thunk";t.push(["return function ",n,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],i=[],s=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c<e.arrayArgs.length;++c){var d=e.arrayArgs[c];r.push(["t",d,"=array",d,".dtype,","r",d,"=array",d,".order"].join("")),o.push("t"+d),o.push("r"+d),i.push("t"+d),i.push("r"+d+".join()"),s.push("array"+d+".data"),s.push("array"+d+".stride"),s.push("array"+d+".offset|0"),c>0&&(l.push("array"+e.arrayArgs[0]+".shape.length===array"+d+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),u.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+d+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}e.arrayArgs.length>1&&(t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}"));for(var c=0;c<e.scalarArgs.length;++c)s.push("scalar"+e.scalarArgs[c]);r.push(["type=[",i.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",s.join(","),")}"].join("")),e.debug&&console.log("-----Generated thunk:\n"+t.join("\n")+"\n----------");var f=new Function("compile",t.join("\n"));return f(a.bind(void 0,e))}var a=e("./compile.js");t.exports=n},{"./compile.js":16}],18:[function(e,t,r){"use strict";function n(e,t){for(var r=1,n=e.length,a=e[0],o=e[0],i=1;n>i;++i)if(o=a,a=e[i],t(a,o)){if(i===r){r++;continue}e[r++]=a}return e.length=r,e}function a(e){for(var t=1,r=e.length,n=e[0],a=e[0],o=1;r>o;++o,a=n)if(a=n,n=e[o],n!==a){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function o(e,t,r){return 0===e.length?e:t?(r||e.sort(t),n(e,t)):(r||e.sort(),a(e))}t.exports=o},{}],19:[function(e,t,r){"use strict";var n=e("ndarray"),a=e("./doConvert.js");t.exports=function(e,t){for(var r=[],o=e,i=1;o instanceof Array;)r.push(o.length),i*=o.length,o=o[0];return 0===r.length?n():(t||(t=n(new Float64Array(i),r)),a(t,e),t)}},{"./doConvert.js":20,ndarray:27}],20:[function(e,t,r){t.exports=e("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":21}],21:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/thunk.js":23,dup:15}],22:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{dup:16,uniq:24}],23:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./compile.js":22,dup:17}],24:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],25:[function(e,t,r){"use strict";function n(e){var t=e.dtype;("generic"===t||"array"===t)&&(t="double");var r=d.malloc(e.size,t),n=u(r,e.shape);return c.assign(n,e),n}function a(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];return u(d.malloc(r,t),e,n,0)}function o(e){"generic"!==e.dtype&&"array"!==e.dtype&&d.free(e.data)}function i(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];for(var o=d.malloc(r,t),a=0;r>a;++a)o[a]=0;return u(o,e,n,0)}function s(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];for(var o=d.malloc(r,t),a=0;r>a;++a)o[a]=1;return u(o,e,n,0)}function l(e,t){var r,n;t||(t="double");var a=1,o=new Array(e.length);for(r=e.length-1;r>=0;--r)o[r]=a,a*=e[r];var i=d.malloc(a,t);for(r=0;a>r;++r)i[r]=0;var s=1/0,l=0;for(r=e.length-1;r>=0;r--)l+=o[r],s=Math.min(s,e[r]);for(r=0,n=0;s>r;r++,n+=l)i[n]=1;return u(i,e,o,0)}var u=e("ndarray"),c=e("ndarray-ops"),d=e("typedarray-pool");r.clone=n,r.malloc=a,r.free=o,r.zeros=i,r.ones=s,r.eye=l},{ndarray:27,"ndarray-ops":14,"typedarray-pool":31}],26:[function(e,t,r){"use strict";function n(e){return"s"+e}function a(e){return"t"+e}function o(e){return"u"+e}function i(e){return"v"+e}function s(e){return"i"+e}function l(e){return"p"+e}function u(e){return"x"+e}function c(e){var t=e.slice();return t.splice(e.indexOf(0),1),t.unshift(0),t}function d(e,t,r){function d(r,o,c){if(t)j.push(l(0),".offset=",y,"+",a(e[0]),"*(",o,");",l(1),".offset=",y,"+",a(e[0]),"*(",c,");",r,"=",g,"(",l(0),",",l(1),");");else{j.push(u(0),"=",y,"+",a(0),"*(",o,");",u(1),"=",y,"+",a(0),"*(",c,");"),p>1&&j.push("_cmp:");for(var d=p-1;d>0;--d)j.push("for(",s(d),"=0;",s(d),"<",n(d),";",s(d),"++){");z?j.push(r,"=",m,".get(",u(0),")-",m,".get(",u(1),");"):j.push(r,"=",m,"[",u(0),"]-",m,"[",u(1),"];"),p>1&&j.push("if(",r,")break _cmp;");for(var d=1;p>d;++d)j.push(u(0),"+=",i(d),";",u(1),"+=",i(d),"}")}}function f(t,r){j.push(u(0),"=",y,"+",a(e[0]),"*(",t,");",u(1),"=",y,"+",a(e[0]),"*(",r,");");for(var i=p-1;i>0;--i)j.push("for(",s(e[i]),"=0;",s(e[i]),"<",n(e[i]),";",s(e[i]),"++){");z?j.push(b,"=",m,".get(",u(0),");",m,".set(",u(0),",",m,".get(",u(1),"));",m,".set(",u(1),",",b,");"):j.push(b,"=",m,"[",u(0),"];",m,"[",u(0),"]=",m,"[",u(1),"];",m,"[",u(1),"]=",b,";");for(var i=1;p>i;++i)j.push(u(0),"+=",o(e[i]),";",u(1),"+=",o(e[i]),"}")}e=c(e);var p=e.length,z="generic"===r,A="ndSelect"+r+e.join("_")+"_"+(t?"cmp":"lex"),j=[],M=[h,v];t&&M.push(g);for(var O=[m+"="+h+".data",y+"="+h+".offset|0",x+"=Math.random",b],E=0;2>E;++E)O.push(u(E)+"=0");for(var E=0;p>E;++E)O.push(n(E)+"="+h+".shape["+E+"]|0",a(E)+"="+h+".stride["+E+"]|0",s(E)+"=0");for(var E=1;p>E;++E)E>1?O.push(i(E)+"=("+a(E)+"-"+n(E-1)+"*"+a(E-1)+")|0",o(e[E])+"=("+a(e[E])+"-"+n(e[E-1])+"*"+a(e[E-1])+")|0"):O.push(i(E)+"="+a(E),o(e[E])+"="+a(e[E]));if(t)for(var E=0;2>E;++E)O.push(l(E)+"="+h+".pick(0)");O.push(k+"=0",w+"=0",_+"="+n(e[0])+"-1"),j.push("while(",w,"<",_,"){",k,"=(",x,"()*(",_,"-",w,"+1)+",w,")|0;"),f(k,_),j.push(k,"=",w,";","for(",s(0),"=",w,";",s(0),"<",_,";",s(0),"++){"),d(b,s(0),_),j.push("if(",b,"<0){"),f(k,s(0)),j.push(k,"++;"),j.push("}}"),f(k,_),j.push("if(",k,"===",v,"){",w,"=",k,";","break;","}else if(",v,"<",k,"){",_,"=",k,"-1;","}else{",w,"=",k,"+1;","}","}"),t?j.push(l(0),".offset=",y,"+",w,"*",a(0),";","return ",l(0),";"):j.push("return ",h,".pick(",w,");");var F=["'use strict';function ",A,"(",M,"){","var ",O.join(),";",j.join(""),"};return ",A].join(""),S=new Function(F);
return S()}function f(e,t,r){var n=e.join()+t+r,a=z[n];return a?a:z[n]=d(e,t,r)}function p(e,t,r){if(t|=0,0===e.dimension||e.shape[0]<=t||0>t)return null;var n=!!r,a=f(e.order,n,e.dtype);return n?a(e,t,r):a(e,t)}t.exports=p,t.exports.compile=f;var h="a",v="K",g="C",m="d",y="o",x="R",b="T",w="L",_="H",k="X",z={}},{}],27:[function(e,t,r){function n(e,t){return e[0]-t[0]}function a(){var e,t=this.stride,r=new Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(n);var a=new Array(r.length);for(e=0;e<a.length;++e)a[e]=r[e][1];return a}function o(e,t){var r=["View",t,"d",e].join("");0>t&&(r="View_Nil"+e);var n="generic"===e;if(-1===t){var o="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",i=new Function(o);return i()}if(0===t){var o="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",i=new Function("TrivialArray",o);return i(d[e][0])}var o=["'use strict'"],s=l(t),u=s.map(function(e){return"i"+e}),c="this.offset+"+s.map(function(e){return"this.stride["+e+"]*i"+e}).join("+"),f=s.map(function(e){return"b"+e}).join(","),p=s.map(function(e){return"c"+e}).join(",");o.push("function "+r+"(a,"+f+","+p+",d){this.data=a","this.shape=["+f+"]","this.stride=["+p+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),o.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(e){return"this.shape["+e+"]"}).join("*"),"}})"),1===t?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),4>t?(o.push("function "+r+"_order(){"),2===t?o.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")}).join(",")+","+s.map(function(e){return"this.stride["+e+"]"}).join(",")+",this.offset)}");var h=s.map(function(e){return"a"+e+"=this.shape["+e+"]"}),v=s.map(function(e){return"c"+e+"=this.stride["+e+"]"});o.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+v.join(","));for(var g=0;t>g;++g)o.push("if(typeof i"+g+"==='number'&&i"+g+">=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");o.push("return new "+r+"(this.data,"+s.map(function(e){return"a"+e}).join(",")+","+s.map(function(e){return"c"+e}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(e){return"a"+e+"=this.shape["+e+"]"}).join(",")+","+s.map(function(e){return"b"+e+"=this.stride["+e+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var g=0;t>g;++g)o.push("if(typeof i"+g+"==='number'){d=i"+g+"|0;if(d<0){c+=b"+g+"*(a"+g+"-1);a"+g+"=ceil(-a"+g+"/d)}else{a"+g+"=ceil(a"+g+"/d)}b"+g+"*=d}");o.push("return new "+r+"(this.data,"+s.map(function(e){return"a"+e}).join(",")+","+s.map(function(e){return"b"+e}).join(",")+",c)}");for(var m=new Array(t),y=new Array(t),g=0;t>g;++g)m[g]="a[i"+g+"]",y[g]="b[i"+g+"]";o.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+m.join(",")+","+y.join(",")+",this.offset)}"),o.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var g=0;t>g;++g)o.push("if(typeof i"+g+"==='number'&&i"+g+">=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(e){return"shape["+e+"]"}).join(",")+","+s.map(function(e){return"stride["+e+"]"}).join(",")+",offset)}");var i=new Function("CTOR_LIST","ORDER",o.join("\n"));return i(d[e],a)}function i(e){if(u(e))return"buffer";if(c)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(e)?"array":"generic"}function s(e,t,r,n){if(void 0===e){var a=d.array[0];return a([])}"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var s=t.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=t[l]}if(void 0===n){n=0;for(var l=0;s>l;++l)r[l]<0&&(n-=(t[l]-1)*r[l])}for(var c=i(e),f=d[c];f.length<=s+1;)f.push(o(c,f.length-1));var a=f[s+1];return a(e,t,r,n)}var l=e("iota-array"),u=e("is-buffer"),c="undefined"!=typeof Float64Array,d={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=s},{"iota-array":28,"is-buffer":29}],28:[function(e,t,r){"use strict";function n(e){for(var t=new Array(e),r=0;e>r;++r)t[r]=r;return t}t.exports=n},{}],29:[function(e,t,r){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],30:[function(e,t,r){"use strict";function n(e,t,r){var a=0|e[r];if(0>=a)return[];var o,i=new Array(a);if(r===e.length-1)for(o=0;a>o;++o)i[o]=t;else for(o=0;a>o;++o)i[o]=n(e,t,r+1);return i}function a(e,t){var r,n;for(r=new Array(e),n=0;e>n;++n)r[n]=t;return r}function o(e,t){switch("undefined"==typeof t&&(t=0),typeof e){case"number":if(e>0)return a(0|e,t);break;case"object":if("number"==typeof e.length)return n(e,t,0)}return[]}t.exports=o},{}],31:[function(e,t,r){(function(t,n){"use strict";function a(e){if(e){var t=e.length||e.byteLength,r=y.log2(t);_[r].push(e)}}function o(e){a(e.buffer)}function i(e){var e=y.nextPow2(e),t=y.log2(e),r=_[t];return r.length>0?r.pop():new ArrayBuffer(e)}function s(e){return new Uint8Array(i(e),0,e)}function l(e){return new Uint16Array(i(2*e),0,e)}function u(e){return new Uint32Array(i(4*e),0,e)}function c(e){return new Int8Array(i(e),0,e)}function d(e){return new Int16Array(i(2*e),0,e)}function f(e){return new Int32Array(i(4*e),0,e)}function p(e){return new Float32Array(i(4*e),0,e)}function h(e){return new Float64Array(i(8*e),0,e)}function v(e){return b?new Uint8ClampedArray(i(e),0,e):s(e)}function g(e){return new DataView(i(e),0,e)}function m(e){e=y.nextPow2(e);var t=y.log2(e),r=k[t];return r.length>0?r.pop():new n(e)}var y=e("bit-twiddle"),x=e("dup");t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:x([32,0]),UINT16:x([32,0]),UINT32:x([32,0]),INT8:x([32,0]),INT16:x([32,0]),INT32:x([32,0]),FLOAT:x([32,0]),DOUBLE:x([32,0]),DATA:x([32,0]),UINT8C:x([32,0]),BUFFER:x([32,0])});var b="undefined"!=typeof Uint8ClampedArray,w=t.__TYPEDARRAY_POOL;w.UINT8C||(w.UINT8C=x([32,0])),w.BUFFER||(w.BUFFER=x([32,0]));var _=w.DATA,k=w.BUFFER;r.free=function(e){if(n.isBuffer(e))k[y.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|y.log2(t);_[r].push(e)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=o,r.freeArrayBuffer=a,r.freeBuffer=function(e){k[y.log2(e.length)].push(e)},r.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return i(e);switch(t){case"uint8":return s(e);case"uint16":return l(e);case"uint32":return u(e);case"int8":return c(e);case"int16":return d(e);case"int32":return f(e);case"float":case"float32":return p(e);case"double":case"float64":return h(e);case"uint8_clamped":return v(e);case"buffer":return m(e);case"data":case"dataview":return g(e);default:return null}return null},r.mallocArrayBuffer=i,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=d,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=p,r.mallocFloat64=r.mallocDouble=h,r.mallocUint8Clamped=v,r.mallocDataView=g,r.mallocBuffer=m,r.clearCache=function(){for(var e=0;32>e;++e)w.UINT8[e].length=0,w.UINT16[e].length=0,w.UINT32[e].length=0,w.INT8[e].length=0,w.INT16[e].length=0,w.INT32[e].length=0,w.FLOAT[e].length=0,w.DOUBLE[e].length=0,w.UINT8C[e].length=0,_[e].length=0,k[e].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"bit-twiddle":11,buffer:1,dup:30}],32:[function(e,t,r){var n;n=e("../color/sort.coffee"),t.exports=function(e,t,r,a,o,i,s){var l,u,c;for(a||(a="asc"),o instanceof Array||(o=[o]),r instanceof Array||(r=[r]),i&&void 0!==s&&"number"!=typeof s&&(s=i.id.nesting.indexOf(s)),c=0,l=0;l<r.length&&(u=r[l],e=i&&e.d3plus&&e.d3plus.sortKeys?e.d3plus.sortKeys[u]:e[u],t=i&&t.d3plus&&t.d3plus.sortKeys?t.d3plus.sortKeys[u]:t[u],c=i&&o.indexOf(u)>=0?n(e,t):t>e?-1:1,0===c&&l!==r.length-1);)l++;return"asc"===a?c:-c}},{"../color/sort.coffee":49}],33:[function(e,t,r){t.exports=function(e,t){var r;return e instanceof Array?(r=void 0===t||null===t?t:t.constructor,e.indexOf(t)>=0||e.indexOf(r)>=0):!1}},{}],34:[function(e,t,r){var n,a;n=e("./comparator.coffee"),a=e("../core/fetch/sort.coffee"),t.exports=function(e,t,r,o,i,s){var l,u,c,d;if(!e||e.length<=1)return e||[];if(i)for(t||(t=i.order.value||i.size.value||i.id.value),r||(r=i.order.sort.value),o||(o=i.color.value||[]),c=0,d=e.length;d>c;c++)l=e[c],l.d3plus||(l.d3plus={}),u="d3plus"in l&&"d3plus"in l.d3plus?l.d3plus:l,l.d3plus.sortKeys=a(i,u,t,o,s);return e.sort(function(e,a){return n(e,a,t,r,o,i,s)})}},{"../core/fetch/sort.coffee":65,"./comparator.coffee":32}],35:[function(e,t,r){t.exports=function(e,t){return void 0===t?e:t===!1?[]:t instanceof Array?t:(e instanceof Array||(e=[]),e.indexOf(t)>=0?e.splice(e.indexOf(t),1):e.push(t),e)}},{}],36:[function(e,t,r){var n;n=function(e){var t,r,a,o;if(o=n.tested,e in o)return o[e];for(r=0,a=!1;r<document.styleSheets.length;){if(t=document.styleSheets[r],t.href&&t.href.indexOf(e)>=0){a=!0;break}r++}return a},n.tested={},t.exports=n},{}],37:[function(e,t,r){t.exports=/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent)},{}],38:[function(e,t,r){var n,a;n=e("./ie.js"),a=e("./touch.coffee"),a?t.exports={click:"click",down:"touchstart",up:"touchend",over:n?"mouseenter":"mouseover",out:n?"mouseleave":"mouseout",move:"mousemove"}:t.exports={click:"click",down:"mousedown",up:"mouseup",over:n?"mouseenter":"mouseover",out:n?"mouseleave":"mouseout",move:"mousemove"}},{"./ie.js":37,"./touch.coffee":43}],39:[function(e,t,r){var n;n=function(){var e;return e="-webkit-transform"in document.body.style?"-webkit-":"-moz-transform"in document.body.style?"-moz-":"-ms-transform"in document.body.style?"-ms-":"-o-transform"in document.body.style?"-o-":"",n=function(){return e},e},t.exports=n},{}],40:[function(e,t,r){t.exports="rtl"===d3.select("html").attr("dir")},{}],41:[function(e,t,r){t.exports={y:function(){return void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop},x:function(){return void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft}}},{}],42:[function(e,t,r){var n;n=function(){var e,t,r,a,o;return e=document.createElement("p"),e.style.width="100%",e.style.height="200px",t=document.createElement("div"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t),a=e.offsetWidth,t.style.overflow="scroll",o=e.offsetWidth,a===o&&(o=t.clientWidth),document.body.removeChild(t),r=a-o,n=function(){return r},r},t.exports=n},{}],43:[function(e,t,r){t.exports="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?!0:!1},{}],44:[function(e,t,r){t.exports=function(e){var t;return t=d3.hsl(e),t.l>.45&&(t.s>.8&&(t.s=.8),t.l=.45),t.toString()}},{}],45:[function(e,t,r){t.exports=function(e,t){var r;return void 0===t&&(t=.5),r=d3.hsl(e),t=(1-r.l)*t,r.l+=t,r.s-=t,r.toString()}},{}],46:[function(e,t,r){t.exports=function(e,t,r,n){var a,o,i;return r||(r=1),n||(n=1),e=d3.rgb(e),t=d3.rgb(t),i=(r*e.r+n*t.r-r*n*t.r)/(r+n-r*n),o=(r*e.g+n*t.g-r*n*t.g)/(r+n-r*n),a=(r*e.b+n*t.b-r*n*t.b)/(r+n-r*n),d3.rgb(i,o,a).toString()}},{}],47:[function(e,t,r){var n;n=e("./scale.coffee"),t.exports=function(e,t){var r;return r=e||Math.floor(20*Math.random()),(t=t||n)(r)}},{"./scale.coffee":48}],48:[function(e,t,r){t.exports=d3.scale.ordinal().range(["#b22200","#282F6B","#EACE3F","#B35C1E","#224F20","#5F487C","#759143","#419391","#993F88","#e89c89","#ffee8d","#afd5e8","#f7ba77","#a5c697","#c5b5e5","#d1d392","#bbefd0","#e099cf"])},{}],49:[function(e,t,r){t.exports=function(e,t){var r,n;return r=d3.hsl(e),n=d3.hsl(t),e=0===r.s?361:r.h,t=0===n.s?361:n.h,e===t?r.l-n.l:e-t}},{}],50:[function(e,t,r){t.exports=function(e){var t,r,n,a,o;return a=d3.rgb(e),n=a.r,r=a.g,t=a.b,o=(299*n+587*r+114*t)/1e3,o>=128?"#444444":"#f7f7f7"}},{}],51:[function(e,t,r){t.exports=function(e){var t,r,n;return e+="",e=e.replace(RegExp(" ","g"),""),0===e.indexOf("rgb")&&(e=e.split("(")[1].split(")")[0].split(",").slice(0,3).join(",")),0===e.indexOf("hsl")&&(e=e.split(",")[2].split(")")[0]),r=d3.rgb(e).toString(),t=["black","#000","#000000","0%","0,0,0"],n=t.indexOf(e)>=0,"#000000"!==r||n}},{}],52:[function(e,t,r){var n,a,o;n=e("../../client/ie.js"),o=e("./wiki.coffee"),a=function(e,t,r){r=r||"",n||"undefined"!=typeof InstallTrigger?console.log("[ D3plus ] "+t):0===e.indexOf("group")?console[e]("%c[ D3plus ]%c "+t,"font-weight: 800;color: #b35c1e;margin-left: 0px;","font-weight:200;"+r):console[e]("%c"+t,r+"font-weight:200;")},a.comment=function(e){this("log",e,"color:#aaa;")},a.error=function(e,t){this("groupCollapsed","ERROR: "+e,"font-weight:800;color:#D74B03;"),this.stack(),this.wiki(t),this.groupEnd()},a.group=function(e){this("group",e,"color:#888;")},a.groupCollapsed=function(e){this("groupCollapsed",e,"color:#888;")},a.groupEnd=function(){n||console.groupEnd()},a.log=function(e){this("log",e,"color:#444444;")},a.stack=function(){var e,t,r,a,o,i,s;n||(e=new Error,e.stack&&(i=e.stack.split("\n"),i=i.filter(function(e){return 0!==e.indexOf("Error")&&e.indexOf("d3plus.js:")<0&&e.indexOf("d3plus.min.js:")<0}),i.length&&i[0].length&&(o=window.chrome?"at ":"@",s=i[0],s.indexOf(o)>=0&&(s=s.split(o)[1]),i=s.split(":"),3===i.length&&i.pop(),t=i.pop(),a=i.join(":").split("/"),a=a[a.length-1],r="line "+t+" of "+a+": "+s,this("log",r,"color:#D74B03;"))))},a.time=function(e){n||console.time(e)},a.timeEnd=function(e){n||console.timeEnd(e)},a.warning=function(e,t){this("groupCollapsed",e,"color:#888;"),this.stack(),this.wiki(t),this.groupEnd()},a.wiki=function(e){e&&(e in o&&(e=d3plus.repo+"wiki/"+o[e]),this("log","documentation: "+e,"color:#aaa;"))},t.exports=a},{"../../client/ie.js":37,"./wiki.coffee":53}],53:[function(e,t,r){t.exports={active:"Visualizations#active",aggs:"Visualizations#aggs",alt:"Forms#alt",attrs:"Visualizations#attrs",axes:"Visualizations#axes",background:"Visualizations#background",color:"Visualizations#color",cols:"Visualizations#cols",config:"Visualizations#config",container:"Visualizations#container",coords:"Visualizations#coords",csv:"Visualizations#csv",data:"Visualizations#data",depth:"Visualizations#depth",descs:"Visualizations#descs",dev:"Visualizations#dev",draw:"Visualizations#draw",edges:"Visualizations#edges",error:"Visualizations#error",focus:"Visualizations#focus",font:"Visualizations#font",footer:"Visualizations#footer",format:"Visualizations#format",height:"Visualizations#height",history:"Visualizations#history",hover:"Forms#hover",icon:"Visualizations#icon",id:"Visualizations#id",keywords:"Forms#keywords",labels:"Visualizations#labels",legend:"Visualizations#legend",links:"Visualizations#links",margin:"Visualizations#margin",messages:"Visualizations#messages",method:"Methods",mouse:"Visualizations#mouse",nodes:"Visualizations#nodes",open:"Forms#open",order:"Visualizations#order",remove:"Forms#remove",search:"Forms#search",select:"Forms#select",selectAll:"Forms#selectAll",shape:"Visualizations#shape",size:"Visualizations#size",temp:"Visualizations#temp",text:"Visualizations#text",time:"Visualizations#time",timeline:"Visualizations#timeline",timing:"Visualizations#timing",title:"Visualizations#title",tooltip:"Visualizations#tooltip",total:"Visualizations#total",type:"Visualizations#type",ui:"Visualizations#ui",width:"Visualizations#width",x:"Visualizations#x",y:"Visualizations#y",zoom:"Visualizations#zoom"}},{}],54:[function(e,t,r){var n=e("../../util/buckets.coffee"),a=e("../fetch/value.coffee"),o=e("../console/print.coffee");t.exports=function(e){e.dev.value&&o.time("getting color data range");var t=[];if(e.data.pool.forEach(function(r){var n=parseFloat(a(e,r,e.color.value));"number"==typeof n&&!isNaN(n)&&t.indexOf(n)<0&&t.push(n)}),e.dev.value&&o.timeEnd("getting color data range"),t.length>1){if(e.dev.value&&o.time("calculating color scale"),t=d3.extent(t),t[0]<0&&t[1]>0){var r=e.color.range;3==r.length&&(t.push(t[1]),t[1]=0)}else if(t[1]>0&&t[0]>=0){var r=e.color.heatmap;t=n(t,r.length)}else{var r=e.color.range.slice(0);t[0]<0?r.pop():r.shift()}e.color.valueScale=d3.scale.sqrt().domain(t).range(r).interpolate(d3.interpolateRgb),e.dev.value&&o.timeEnd("calculating color scale")}else e.color.valueScale=null}},{"../../util/buckets.coffee":203,"../console/print.coffee":52,"../fetch/value.coffee":67}],55:[function(e,t,r){var n=e("../fetch/value.coffee"),a=e("../console/print.coffee"),o=e("../../object/validate.coffee");t.exports=function(e,t){e.dev.value&&a.time("filtering data");var r=d3.keys(e.data.keys||{});"attrs"in e&&(r=r.concat(d3.keys(e.attrs.keys||{}))),t=t.filter(function(t){var r=n(e,t,e.id.value);return null!==r});var i=e.types[e.type.value].requirements||[];e.data.filters.forEach(function(a){r.indexOf(e[a].value)>=0&&i.indexOf(a)>=0&&(t=t.filter(function(t){var r=n(e,t,e[a].value);return"y"===a&&e.y2.value&&null===r?r=n(e,t,e.y2.value):"x"===a&&e.x2.value&&null===r&&(r=n(e,t,e.x2.value)),"size"===a?"number"==typeof r:null!==r}))});var s=e.data.solo.length?"solo":"mute";return e.data[s].length?e.data[s].forEach(function(r){function i(t){var n=e[r][s].value,a=!1;return n.forEach(function(e){"function"==typeof e?a=e(t):e===t&&(a=!0)}),"solo"===s?a:!a}function l(t,a){if(!a&&e[r].nesting){var s=e[r].nesting;o(s)&&(s=d3.values(s));for(var l=0;l<s.length;l++){var u=t.filter(function(t){return i(n(e,t,s[l]))});u.length&&(t=u)}}else t=t.filter(function(t){return i(n(e,t,e[r].value))});return t}t=l(t),"id"===r&&("nodes"in e&&e.nodes.value&&(e.dev.value&&a.time("filtering nodes"),e.nodes.restricted=l(e.nodes.value),e.dev.value&&a.timeEnd("filtering nodes")),"edges"in e&&e.edges.value&&(e.dev.value&&a.time("filtering edges"),e.edges.restricted=e.edges.value.filter(function(t){var r=l([t[e.edges.source],t[e.edges.target]]);return 2===r.length}),e.dev.value&&a.timeEnd("filtering edges")))}):"nodes"in e&&(e.nodes.restricted=void 0,e.edges.restricted=void 0),e.dev.value&&a.timeEnd("filtering data"),t}},{"../../object/validate.coffee":171,"../console/print.coffee":52,"../fetch/value.coffee":67}],56:[function(e,t,r){var n=e("./nest.js"),a=e("../fetch/value.coffee"),o=e("../console/print.coffee"),i=e("../../util/uniques.coffee");t.exports=function(e){var t;if(e.data.time={values:[]},e.time&&e.time.value){e.dev.value&&(t="analyzing time periods",o.time(t)),e.data.time.values=i(e.data.value,e.time.value,a,e),e.data.time.values.sort(function(e,t){return e-t});var r=[];e.data.time.values.forEach(function(t,n){if(0!==n){var a=e.data.time.values[n-1];r.push(t-a),n===e.data.time.values.length-1&&(e.data.time.total=t-e.data.time.values[0])}}),r=d3.min(r),e.data.time.step=r;var s=["Milliseconds","Seconds","Minutes","Hours","Date","Month","FullYear"],l=[1e3,60,60,24,30,12,1];e.data.time.periods=s;var u=function(t,r,n){return e.data.time.stepDivider||(arr=l.slice(0,n),arr.length?e.data.time.stepDivider=arr.reduce(function(e,t){return e*t}):e.data.time.stepDivider=1),Math.round(Math.floor(r-t)/e.data.time.stepDivider)},c=e.data.time.total;s.forEach(function(t,n){var a="Date"===t?28:l[n];if(!e.data.time.stepType&&(n===s.length-1||Math.round(r)<a)){e.data.time.stepType=t;var o=e.data.time.values[0],i=e.data.time.values[e.data.time.values.length-1];e.data.time.stepIntervals=u(o,i,n)}!e.data.time.totalType&&(n===s.length-1||Math.round(c)<a)&&(e.data.time.totalType=t),r/=a,c/=a}),e.data.time.values.forEach(function(t,r){if(0!==r){var n=e.data.time.values[0];e.data.time.dataSteps.push(u(n,t,s.indexOf(e.data.time.stepType)))}else e.data.time.dataSteps=[0]});var d=e.time.format.value,f=e.format.locale.value,p=[function(e){return e.getMilliseconds()},function(e){return e.getSeconds()},function(e){return e.getMinutes()},function(e){return e.getHours()},function(e){return 1!=e.getDate()},function(e){return e.getMonth()},function(e){return!0}];e.data.time.functions=p;var h=function(e,t,r){if(e===t)return r&&f.timeFormat[e+"Small"]?f.timeFormat[e+"Small"]:f.timeFormat[e];if(s.indexOf(e)>=4||s.indexOf(t)<=3)return f.timeFormat[t+"-"+e];var n;return n="Date"===t?f.timeFormat[t]:f.timeFormat[t+"-Date"],"Hours"===e?n+" "+f.timeFormat[e]:n+" "+f.timeFormat["Hours-"+e]};if(e.data.time.getFormat=h,d)"string"==typeof d?e.data.time.format=d3.locale(f.format).timeFormat(d):"function"==typeof d?e.data.time.format=d:d instanceof Array&&(e.data.time.format=d3.locale(f.format).timeFormat.multi(d)),e.data.time.multiFormat=e.data.time.format;else{for(var v=e.data.time.stepType,g=e.data.time.totalType,m=[],y=s.indexOf(v);y<=s.indexOf(g);y++){var x=y-1<s.indexOf(v)?s[y]:s[y-1],b=s[y]===x&&v!==g,w=h(x,s[y],b);m.push([w,p[y]])}e.data.time.format=d3.locale(f.format).timeFormat(h(v,g)),m.length>1?(m[m.length-1][1]=function(e){return!0},e.data.time.multiFormat=d3.locale(f.format).timeFormat.multi(m)):e.data.time.multiFormat=e.data.time.format}e.data.time.ticks=[];for(var _=d3.min(e.data.time.values),k=d3.max(e.data.time.values),z=0;z<=e.data.time.stepIntervals;z++){var A=new Date(_);A["set"+e.data.time.stepType](A["get"+e.data.time.stepType]()+z),k>=A&&e.data.time.ticks.push(A)}e.dev.value&&o.timeEnd(t)}if(e.dev.value&&(t="nesting data by time and depths",o.time(t)),e.data.nested={},0===e.data.time.values.length)e.data.nested.all={},e.id.nesting.forEach(function(t,r){var a=e.id.nesting.slice(0,r+1);e.data.nested.all[t]=n(e,e.data.value,a)});else{var j=e.data.value.reduce(function(t,r){var n=a(e,r,e.time.value).getTime();return n in t||(t[n]=[]),t[n].push(r),t},{});e.data.time.values.forEach(function(t){var r=t.getTime();e.data.nested[r]={},e.id.nesting.forEach(function(t,a){var o=e.id.nesting.slice(0,a+1);e.data.nested[r][t]=n(e,j[r],o)})})}e.dev.value&&o.timeEnd(t)}},{"../../util/uniques.coffee":209,"../console/print.coffee":52,"../fetch/value.coffee":67,"./nest.js":60}],57:[function(e,t,r){var n;n=e("../fetch/value.coffee"),t.exports=function(e,t,r){var a,o,i,s,l,u,c,d,f,p;if(o=d3.nest(),e.id.grouping.value)for(void 0===r&&(r=e.id.nesting),i=s=0,u=r.length;u>s;i=++s)d=r[i],i<e.depth.value&&!function(t){return o.key(function(r){return n(e,r.d3plus,t)})}(d);for(f=[],l=0,c=t.length;c>l;l++)a=t[l],p=e.size.value?n(e,a,e.size.value):1,p&&"number"==typeof p&&p>0&&(delete a.d3plus.r,delete a.d3plus.x,delete a.d3plus.y,f.push({d3plus:a,id:a[e.id.value],value:p}));return o.entries(f)}},{"../fetch/value.coffee":67}],58:[function(e,t,r){var n,a,o=[].indexOf||function(e){for(var t=0,r=this.length;r>t;t++)if(t in this&&this[t]===e)return t;return-1};n=e("../console/print.coffee"),a=e("../../object/validate.coffee"),t.exports=function(e,t){var r,i,s,l,u,c,d,f,p;if(d=t+" key analysis",e.dev.value&&n.time(d),e[t].keys={},r=function(n){var i,s,l,u,c,d,f;if(n instanceof Array){for(c=[],s=0,u=n.length;u>s;s++)i=n[s],c.push(r(i));return c}if(a(n)){d=[];for(l in n)f=n[l],0===l.indexOf("d3plus")||o.call(e[t].keys,l)>=0||null===f?d.push(void 0):d.push(e[t].keys[l]=typeof f);return d}},a(e[t].value)){l=d3.keys(e[t].value).length===e.id.nesting.length,u=e[t].value;for(i in u)if(f=u[i],l&&e.id.nesting.indexOf(i)>=0&&a(f))for(s in f)p=f[s],r(p);else r(f)}else{c=e[t].value;for(i in c)f=c[i],r(f)}return e.dev.value?n.time(d):void 0}},{"../../object/validate.coffee":171,"../console/print.coffee":52}],59:[function(e,t,r){var n,a;n=e("../console/print.coffee"),a=e("../../object/validate.coffee"),t.exports=function(e,t,r){var o,i,s,l;return o=e.dev.value,o&&n.time("loading "+t),l=e[t].url,e[t].filetype.value?i=e[t].filetype.value:(i=l.slice(l.length-5).split("."),i=i.length>1?i[1]:!1,i?("txt"===i&&(i="text"),e[t].filetype.accepted.indexOf(i)<0&&(i="json")):i="json"),(s="dsv"===i?d3.dsv(e[t].delimiter.value,"text/plain"):d3[i])(l,function(s,u){var c,d;if(!s&&u){if("function"==typeof e[t].callback){if(d=e[t].callback(u))if(a(d)&&t in d)for(c in d)c in e&&(e[c].value=d[c]);else e[t].value=d}else e[t].value=u;["json"].indexOf(i)<0&&e[t].value.forEach(function(e){var t;t=[];for(c in e)isNaN(e[c])?"false"===e[c].toLowerCase()?t.push(e[c]=!1):"true"===e[c].toLowerCase()?t.push(e[c]=!0):"null"===e[c].toLowerCase()?t.push(e[c]=null):"undefined"===e[c].toLowerCase()?t.push(e[c]=void 0):t.push(void 0):t.push(e[c]=parseFloat(e[c]));return t}),e[t].changed=!0,e[t].loaded=!0}else e.error.internal='Could not load data from: "'+l+'"';return o&&n.timeEnd("loading "+t),r()})}},{"../../object/validate.coffee":171,"../console/print.coffee":52}],60:[function(e,t,r){var n=e("../fetch/value.coffee"),a=e("../../object/validate.coffee"),o=e("../../util/uniques.coffee"),i=function(e,t,r,a){void 0===a&&(a=!0);var i=d3.nest(),c=[],d="temp"in e?["active","temp","total"]:[];r.length?r.forEach(function(t,r){i.key(function(r){return n(e,r,t)})}):i.key(function(e){return!0}),a&&e.axes&&e.axes.discrete&&(!e.time||e[e.axes.discrete].value!==e.time.value)&&i.key(function(t){return n(e,t,e[e.axes.discrete].value)});var f=r.length&&e.id.nesting.indexOf(r[r.length-1])>=0,p=r.length&&f?r.length-1:0;f?e.id.nesting[p]:e.depth.value;i.rollup(function(t){if(1===t.length&&"d3plus"in t[0])return c.push(t[0]),t[0];t=t.reduce(function(e,t){return t.values instanceof Array?e.concat(t.values):(e.push(t),e)},[]);var a={d3plus:{data:{},depth:p}},i=d3.sum(t,function(e){return"d3plus"in e&&e.d3plus.merged?1:0});if(i===t.length)for(var u=0;u<t.length;u++){var f=t[u];a.d3plus.merged||(a.d3plus.merged=[]),a.d3plus.merged=a.d3plus.merged.concat(f.d3plus.merged),f.d3plus.text&&(a.d3plus.text=f.d3plus.text)}for(var h=0;h<d.length;h++){var v=d[h],g=e.aggs&&e.aggs.value[m]?e.aggs.value[m]:"sum";"d3plus"in t[0]&&v in t[0].d3plus?a.d3plus[v]=d3.sum(t,function(e){return e.d3plus[v]}):"function"==typeof g?a.d3plus[v]=g(t):a.d3plus[v]=d3[g](t,function(t){var r="total"===v?1:0;return e[v].value&&(r=n(e,t,e[v].value),"number"!=typeof r&&(r=r?1:0)),r})}for(var m in e.data.keys){if(m in a.d3plus.data)a[m]=a.d3plus[m];else{var y=e.aggs&&e.aggs.value[m]?e.aggs.value[m]:"sum",x=typeof y,b=e.data.keys[m],w=e.id.nesting.indexOf(m)>=0,_="time"in e&&m===e.time.value;if(m in a.d3plus.data)a[m]=a.d3plus[m];else if("function"===x)a[m]=e.aggs.value[m](t);else if(_)a[m]=l(o(t,m));else if(e.axes&&e.axes.discrete&&e[e.axes.discrete].value===m)a[m]=o(t,m);else if("number"!==b||"string"!==x||w){var k=s(t,m),z=1===k.length?k[0][m]:o(k,m);if(1===k.length)a[m]=z;else if(z&&z.length)z instanceof Array||(z=[z]),w&&e.id.nesting.indexOf(m)>p?a[m]=k:a[m]=z;else if(w){var A=e.id.nesting.indexOf(m)-1;A>=p&&(!("endPoint"in a.d3plus)||a.d3plus.endPoint>p)&&(a.d3plus.endPoint=p)}}else{var j=t.map(function(e){return e[m]});j=j.filter(function(e){return typeof e===b}),j.length&&(a[m]=d3[y](j))}}m in a&&a[m]instanceof Array&&1===a[m].length&&(a[m]=a[m][0])}for(var M=0;M<r.length;M++){var O=r[M];O in a||(a[O]=n(e,t[0],O))}return c.push(a),a});var h=function(t,n,a){if(t.children){"number"==e.data.keys[r[n]]&&(t.key=parseFloat(t.key)),a[r[n]]=t.key,delete t.key;for(var o in a)t[o]=a[o];n++,t.children.forEach(function(e){h(e,n,a)})}};return i=i.entries(t).map(u).map(function(e){return h(e,0,{}),e}),c},s=function(e,t){function r(e){e instanceof Array?e.forEach(r):a(e)&&t in e&&(e[t]instanceof Array?e[t].forEach(r):n.push(e))}var n=[];return r(e),n},l=function(e){function t(e){for(var n=0;n<e.length;n++){var a=e[n];a&&(a.constructor===Array?t(a):r.push(a))}}var r=[];return t(e),o(r)},u=function(e){return e.values&&e.values.length?(e.children=e.values.map(function(e){return u(e)}),delete e.values,e):e.values?e.values:e};t.exports=i},{"../../object/validate.coffee":171,"../../util/uniques.coffee":209,"../fetch/value.coffee":67}],61:[function(e,t,r){var n=e("../../array/sort.coffee"),a=e("./nest.js"),o=e("../fetch/value.coffee"),i=(e("../fetch/color.coffee"),e("../fetch/text.js"));t.exports=function(e,t,r){var s;if(s=e.size.threshold.value===!1?0:"number"==typeof e.size.threshold.value?e.size.threshold.value:"function"==typeof e.size.threshold.value?e.size.threshold.value(e):"number"==typeof e.types[e.type.value].threshold?e.types[e.type.value].threshold:"function"==typeof e.types[e.type.value].threshold?e.types[e.type.value].threshold(e):.02,"number"==typeof s&&s>0){var l=[],u=0===e.depth.value?0:{},c=[],d=[],f=[],p={},h=d3.nest();r&&h.key(function(t){return o(e,t,r)}),h.rollup(function(t){var n=t.length;e.aggs.value[e.size.value]?"function"==typeof e.aggs.value[e.size.value]?n=e.aggs.value[e.size.value](t):"string"==typeof e.aggs.value[e.size.value]&&(n=d3[e.aggs.value[e.size.value]](t,function(t){return o(e,t,e.size.value)})):n=d3.sum(t,function(t){return o(e,t,e.size.value)});var a=r?o(e,t[0],r):"all";return p[a]=n,n}).entries(t),t.forEach(function(t){var n=o(e,t,e.id.value),a=o(e,t,e.size.value),i=r?o(e,t,r):"all",u=a/p[i]>=s;if(u&&l.indexOf(n)<0&&(l.push(n),e.depth.value)){var c=o(e,t,e.id.nesting[e.depth.value-1]);d.indexOf(c)<0&&d.push(c)}});var v=t.filter(function(t){var r=o(e,t,e.id.value),n=l.indexOf(r)>=0,a=e.depth.value?o(e,t,e.id.nesting[e.depth.value-1]):null;if(null!==a&&d.indexOf(a)<0&&f.indexOf(a)<0&&f.push(a),!n){var i=o(e,t,e.size.value);i>0&&(0===e.depth.value?i>u&&(u=i):(a in u||(u[a]=0),i>u[a]&&(u[a]=i)),c.push(t))}return n});if(c.length>1){c=n(c,e.size.value,"desc",[],e);var g=e.id.nesting.slice(0,e.depth.value);e.types[e.type.value].requirements.indexOf(e.axes.discrete)>=0&&g.push(e[e.axes.discrete].value);
var m=a(e,c,g);m.forEach(function(t){var r=e.id.nesting[e.depth.value-1],n=o(e,t,r);if(children=r?c.filter(function(t){return o(e,t,r)===n}):c,children.length>1){e.id.nesting.forEach(function(r,n){if(e.depth.value==n){var a=t[r];"string"==typeof a?t[r]="d3plus_other_"+a:t[r]="d3plus_other"}else n>e.depth.value&&delete t[r]}),e.color.value&&"string"===e.color.type&&(0===e.depth.value?t[e.color.value]=e.color.missing:t[e.color.value]=o(e,n,e.color.value,r)),e.icon.value&&(t[e.icon.value]=o(e,n,e.icon.value,r)),n&&(t.d3plus.depth=e.depth.value);var a;0===e.depth.value?(a=e.format.value(e.format.locale.value.ui.values,{key:"threshold",vars:e}),a+=" < "+e.format.value(u,{key:e.size.value,vars:e})):(a=i(e,t,e.depth.value-1),a=a.length?a[0].split(" < ")[0]:e.format.value(e.format.locale.value.ui.values,{key:"threshold",vars:e}),f.indexOf(n)<0&&(a+=" < "+e.format.value(u[n],{key:e.size.value,vars:e}))),f.indexOf(n)<0&&(a+=" ("+e.format.value(100*s,{key:"share",vars:e})+")"),t.d3plus.threshold=u,t.d3plus.merged=children,e.text.value&&(t[e.text.value]=a),t.d3plus.text=a}})}else m=c;return v.concat(m)}return t}},{"../../array/sort.coffee":34,"../fetch/color.coffee":63,"../fetch/text.js":66,"../fetch/value.coffee":67,"./nest.js":60}],62:[function(e,t,r){var n;n=e("../../font/sizes.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b;if(b=t.values||e.data.time.ticks,g=t.style||{},s=t.limit||e.width.value,m={},c=e.data.time.periods,v=e.data.time.stepType,y=e.data.time.totalType,o=e.data.time.functions,i=e.data.time.getFormat,l=e.format.locale.value.format,e.time.format.value)m.format=e.data.time.format,m.values=b,m.sizes=n(b.map(function(e){return m.format(e)}),g);else for(u=c.indexOf(v);u<=c.indexOf(y);){if(x=b.filter(function(e){var t,r;if(u===c.indexOf(v))return!0;if(t=!0,r=u-1,0>u)return!0;for(;r>=c.indexOf(v)&&t;)t=!o[r](e),r--;return t}),c[u]===y)a=d3.locale(l).timeFormat(i(c[u],y));else{for(d=u,a=[];d<=c.indexOf(y);)f=d-1<c.indexOf(v)?d:d-1,f=c[f],h=c[d]===f&&v!==y,r=i(f,c[d],h),a.push([r,o[d]]),d++;a[a.length-1][1]=function(){return!0},a=d3.locale(l).timeFormat.multi(a)}if(p=n(x.map(function(e){return a(e)}),g),d3.sum(p,function(e){return e.width})<s||u===c.indexOf(y)){m.format=a,m.values=x,m.sizes=p;break}u++}return m}},{"../../font/sizes.coffee":101}],63:[function(e,t,r){var n,a,o,i,s,l,u;n=e("./value.coffee"),i=e("../../color/random.coffee"),l=e("../../color/validate.coffee"),u=e("../../object/validate.coffee"),s=e("../../util/uniques.coffee"),t.exports=function(e,t,r){var i,l,c,d,f,p;if(f=u(t),f&&"d3plus"in t&&"color"in t.d3plus)return t.d3plus.color;if(void 0===r&&(r=e.id.value),"number"==typeof r&&(r=e.id.nesting[r]),e.color.value){for(c=[],d=e.id.nesting.indexOf(r);d>=0;){if(l=e.id.nesting[d],p=s(t,e.color.value,n,e,l),1===p.length&&(p=p[0]),!(p instanceof Array)&&void 0!==p&&null!==p){i=a(e,t,p,r),c.indexOf(i)<0&&c.push(i);break}d--}return 1===c.length?c[0]:e.color.missing}return o(e,t,r)},a=function(e,t,r,n){return r?e.color.valueScale?e.color.valueScale(r):l(r)?r:o(e,r,n):e.color.value&&"function"==typeof e.color.valueScale?e.color.valueScale(0):o(e,t,n)},o=function(e,t,r){return u(t)&&(t=n(e,t,r)),t instanceof Array&&(t=t[0]),i(t,e.color.scale.value)}},{"../../color/random.coffee":47,"../../color/validate.coffee":51,"../../object/validate.coffee":171,"../../util/uniques.coffee":209,"./value.coffee":67}],64:[function(e,t,r){var n=e("../data/filter.js"),a=e("../data/nest.js"),o=e("../console/print.coffee"),i=e("../../string/format.js"),s=e("../../string/list.coffee");t.exports=function(e,t,r){if(!e.data.value)return[];void 0===r&&(r=e.depth.value);var l=e.id.nesting[r];if(!t||t instanceof Array||(t=[t]),!t&&"time"in e){t=[];var u=e.time.solo.value.length?"solo":"mute",c=e.time[u].value;if(c.length){t=[];for(var d=0;d<c.length;d++){var f=c[d];if("function"==typeof f)for(var p=0;p<e.data.time.values.length;p++){var h=e.data.time.values[p].getTime();f(h)&&t.push(h)}else if(f.constructor===Date)t.push(new Date(f).getTime());else{f+="",4===f.length&&parseInt(f)+""===f&&(f+="/01/01");var v=new Date(f);"Invalid Date"!==v&&t.push(v.getTime())}}"mute"===u&&(t=e.data.time.values.filter(function(e){return t.indexOf(e.getTime())<0}))}else t.push("all")}else t=["all"];if(t.indexOf("all")>=0&&e.data.time.values.length){t=e.data.time.values.slice(0);for(var g=0;g<t.length;g++)t[g]=t[g].getTime()}var m=[e.type.value,l,r].concat(e.data.filters).concat(t),y=e.data.solo.length?"solo":"mute",x=d3.keys(e.data.cache),b=e.types[e.type.value].filter||void 0;if(e.data[y].length)for(var w=0;w<e.data[y].length;w++){var _=e.data[y][w],k=e[_][y].value.slice(0);k.unshift(_),m=m.concat(k)}e.axes&&e.axes.discrete&&m.push(e.axes.discrete),m=m.join("_"),e.data.cacheID=m;for(var z=0;z<x.length;z++){var A=x[z].split("_").slice(1).join("_");if(A===m){m=(new Date).getTime()+"_"+m,e.data.cache[m]=e.data.cache[x[z]],delete e.data.cache[x[z]];break}}var j;if(e.data.cache[m])return e.dev.value&&o.comment("data already cached"),j=e.data.cache[m].data,"nodes"in e&&(e.nodes.restricted=e.data.cache[m].nodes,e.edges.restricted=e.data.cache[m].edges),"function"==typeof b&&(j=b(e,j)),j;var M=[];if(j=[],e.data.value&&e.data.value.length)for(var O=0;O<t.length;O++){var E=t[O];e.data.nested[E]?j=j.concat(e.data.nested[E][l]):M.push(E)}if(0===j.length&&M.length&&!e.error.internal){M.length>1&&(M=d3.extent(M)),M=M.map(function(t){return e.data.time.format(new Date(t))}),M=M.join(" - ");var F=e.format.locale.value.error.dataYear,S=e.format.locale.value.ui.and;M=s(M,S),e.error.internal=i(F,M),e.time.missing=!0}else{if(e.time&&(e.time.missing=!1),t.length>1){var T=!1;if(["x","y","x2","y2"].forEach(function(t){e[t].value===e.time.value&&"discrete"===e[t].scale.value&&(T=!0)}),!T){var C=e.id.nesting.slice(0,r+1);j=a(e,j,C)}}j=j?n(e,j):[],20===x.length&&(x.sort(),delete e.data.cache[x[0]]),m=(new Date).getTime()+"_"+m,e.data.cache[m]={data:j},"nodes"in e&&(e.data.cache[m].nodes=e.nodes.restricted,e.data.cache[m].edges=e.edges.restricted),"function"==typeof b&&(j=b(e,j)),e.dev.value&&o.comment("storing data in cache")}return j}},{"../../string/format.js":172,"../../string/list.coffee":173,"../console/print.coffee":52,"../data/filter.js":55,"../data/nest.js":60}],65:[function(e,t,r){var n,a,o;o=e("./value.coffee"),n=e("./color.coffee"),a=e("./text.js"),t.exports=function(e,t,r,i,s){var l,u,c,d,f,p;for(r instanceof Array||(r=[r]),i instanceof Array||(i=[i]),e&&(void 0===s?s=e.id.value:"number"!=typeof s&&(s=e.id.nesting.indexOf(s))),f={},u=0,d=r.length;d>u;u++)c=r[u],p=e?i.indexOf(c)>=0?n(e,t,s):c===e.text.value?a(e,t,s):3===d3.keys(t).length&&t.d3plus&&t.key&&t.values?o(e,t.values.map(function(e){return e.d3plus}),c,s):o(e,t,c,s):t[c],[e.data.keys[c],e.attrs.keys[c]].indexOf("number")>=0?(l=e.order.agg.value||e.aggs.value[c]||"sum",p instanceof Array||(p=[p]),p=d3[l](p)):(p instanceof Array&&(p=p[0]),p="string"==typeof p?p.toLowerCase():p),f[c]=p;return f}},{"./color.coffee":63,"./text.js":66,"./value.coffee":67}],66:[function(e,t,r){var n=e("./value.coffee"),a=e("../../object/validate.coffee"),o=e("../../util/uniques.coffee");t.exports=function(e,t,r){"number"!=typeof r&&(r=e.depth.value);var i,s=e.id.nesting[r];e.text.nesting&&a(e.text.nesting)?i=e.text.nesting[s]?e.text.nesting[s]:e.text.value:(i=[],e.text.value&&r===e.depth.value&&i.push(e.text.value),i.push(s)),i instanceof Array||(i=[i]);var l=[];if(a(t)&&"d3plus"in t&&t.d3plus.text)l.push(t.d3plus.text.toString()),l.push(e.format.value(t.d3plus.text.toString(),{vars:e,data:t}));else{var u=a(t)?t:void 0;u&&t[e.id.value]instanceof Array?t=t[e.id.value]:t instanceof Array||(t=[t]),i.forEach(function(r){var a=o(t,r,n,e,s);a.length&&(a.length>1&&(a=a.filter(function(e){return e instanceof Array||"string"==typeof e&&e.indexOf(" < ")<0})),a=a.map(function(t){return t instanceof Array?(t=t.filter(function(e){return e}),t.map(function(t){return e.format.value(t.toString(),{vars:e,data:u,key:r})})):t?e.format.value(t.toString(),{vars:e,data:u,key:r}):void 0}),1===a.length&&(a=a[0]),l.push(a))})}return l}},{"../../object/validate.coffee":171,"../../util/uniques.coffee":209,"./value.coffee":67}],67:[function(e,t,r){var n,a,o,i,s,l,u,c,d,f;d=e("../../object/validate.coffee"),c=e("../../util/uniques.coffee"),u=function(e,t,r,i){var s,l,u,f;if(l=d(t),"function"==typeof r&&l)return r(t,e);if(l){if(r in t)return t[r];if(s=e.data.cacheID+"_"+i,n(t,s,e),r in t.d3plus.data[s])return t.d3plus.data[s][r];if(i in t)t=t[i];else{if(!(e.id.value in t))return null;if(t=t[e.id.value],i!==r&&(u=o(e,t,i,e.id.value)),(null===u||void 0===u)&&(u=a(e,t,i,e.id.value)),null===u||void 0===u)return null;if(i===r)return u;t=u}}return t instanceof Array&&!d(t[0])&&(t=c(t)),t instanceof Array&&d(t[0])&&(f=c(t,r),f.length)?f:(f=o(e,t,r,i))?f:f=a(e,t,r,i)},o=function(e,t,r,n){var a;return e.data.viz instanceof Array&&r in e.data.keys&&(a=c(l(e.data.viz,t,n),r)),a&&a.length?a:null},a=function(e,t,r,n){var a,o,i,s;if("attrs"in e&&e.attrs.value&&r in e.attrs.keys)if(a=d(e.attrs.value)&&n in e.attrs.value?e.attrs.value[n]:e.attrs.value,a instanceof Array){if(i=c(l(a,t,n),r),i.length)return i}else if(t instanceof Array){if(a=[function(){var e,r,n;if(o in a){for(n=[],e=0,r=t.length;r>e;e++)o=t[e],n.push(a[o]);return n}}()],a.length&&(s=c(a,r),s.length))return s}else if(t in a)return a[t][r];return null},l=function(e,t,r){return t instanceof Array?e.filter(function(e){return t.indexOf(e[r])>=0}):e.filter(function(e){return e[r]===t})},n=function(e,t,r){return"d3plus"in e||(e.d3plus={}),"data"in e.d3plus||(e.d3plus.data={}),(r.data.changed||r.attrs&&r.attrs.changed||!(t in e.d3plus.data))&&(e.d3plus.data[t]={}),e},f=function(e,t,r,n,a){var o,i,s,l,u,c,f;if(null===a)return a;c="time"in e&&e.time.value===n,a instanceof Array||(a=[a]);for(s=l=0,u=a.length;u>l;s=++l)f=a[s],c&&null!==f&&f.constructor!==Date&&(f+="",4===f.length&&parseInt(f)+""===f&&(f+="/01/01"),i=new Date(f),"Invalid Date"!==i&&(a[s]=i));return 1===a.length&&(a=a[0]),null===a||!d(t)||"string"!=typeof n||n in t||(o=e.data.cacheID+"_"+r,t.d3plus.data[o][n]=a),a},s=function(e,t,r,n){var a,o,i,s,l;for(l=[],o=0,i=t.length;i>o;o++)a=t[o],d(a)?(s=u(e,a,r,n),l.push(f(e,a,n,r,s))):l.push(a);return"number"!=typeof l[0]&&(l=c(l)),1===l.length?l[0]:l},i=function(e,t,r,n){var a,o;return r?"number"==typeof r?r:(a=d(t),n||(n=e.id.value),a&&t.values instanceof Array?o=s(e,t.values,r,n):a&&t[r]instanceof Array?o=s(e,t[r],r,n):t instanceof Array?o=s(e,t,r,n):(o=u(e,t,r,n),o=f(e,t,n,r,o)),o):null},t.exports=i},{"../../object/validate.coffee":171,"../../util/uniques.coffee":209}],68:[function(e,t,r){t.exports=function(e){var t,r,n;return["div","svg"].indexOf(e)<0&&(e="div"),r={position:"absolute",left:"-9999px",top:"-9999px",visibility:"hidden",display:"block"},t="div"===e?{}:{position:"absolute"},n=d3.select("body").selectAll(e+".d3plus_tester").data([0]),n.enter().append(e).attr("class","d3plus_tester").style(r).attr(t),n}},{}],69:[function(e,t,r){t.exports={dev:{accepted:"{0} is not an accepted value for {1}, please use one of the following: {2}.",deprecated:"the {0} method has been removed, please update your code to use {1}.",noChange:"{0} was not updated because it did not change.",noContainer:"cannot find a container on the page matching {0}.",of:"of",oldStyle:"style properties for {0} have now been embedded directly into .{1}().",sameEdge:"edges cannot link to themselves. automatically removing self-referencing edge {0}.",set:"{0} has been set.",setLong:"{0} has been set to {1}.",setContainer:"please define a container div using .container()"},error:{accepted:"{0} is not an accepted {1} for {2} visualizations, please use one of the following: {3}.",connections:"no connections available for {0}.",data:"no data available",dataYear:"no data available for {0}.",lib:"{0} visualizations require loading the {1} library.",libs:"{0} visualizations require loading the following libraries: {1}.",method:"{0} visualizations require setting the {1} method.",methods:"{0} visualizations require setting the following methods: {1}."},format:{decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%A, %B %-d, %Y %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"]},lowercase:["a","an","and","as","at","but","by","for","from","if","in","into","near","nor","of","on","onto","or","per","that","the","to","with","via","vs","vs."],message:{data:"analyzing data",draw:"drawing visualization",initializing:"initializing {0}",loading:"loading data",tooltipReset:"resetting tooltips",ui:"updating ui"},method:{active:"active segments",color:"color",depth:"depth",dev:"verbose",focus:"focus",icon:"icon",id:"id",height:"height",labels:"labels",legend:"legend",margin:"margin",messages:"status messages",mode:"mode",mute:"hide",order:"order",search:"search",shape:"shape",size:"size",solo:"isolate",style:"style",temp:"temporary segments",text:"text",time:"time",timeline:"timeline",total:"total segments",type:"type",width:"width",x:"x axis",y:"y axis",zoom:"zoom"},time:["date","day","month","time","year"],timeFormat:{FullYear:"%Y",Month:"%B",MonthSmall:"%b",Date:"%A %-d",DateSmall:"%-d",Hours:"%I %p",Minutes:"%I:%M",Seconds:"%Ss",Milliseconds:"%Lms","FullYear-Month":"%b %Y","FullYear-Date":"%-m/%-d/%Y","Month-Date":"%b %-d","Hours-Minutes":"%I:%M %p","Hours-Seconds":"%I:%M:%S %p","Hours-Milliseconds":"%H:%M:%S.%L","Minutes-Seconds":"%I:%M:%S %p","Minutes-Milliseconds":"%H:%M:%S.%L","Seconds-Milliseconds":"%H:%M:%S.%L"},ui:{and:"and",back:"back",collapse:"click to collapse",error:"error",expand:"click to expand",including:"including",loading:"loading...",more:"{0} more",moreInfo:"click for more info",or:"or",noResults:"no results matching {0}.",primary:"primary connections",share:"share",total:"total",values:"values"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","GDP","HVAC","ID","IT","R&D","TV","UI"],visualization:{bar:"Bar Chart",box:"Box Plot",bubbles:"Bubbles",chart:"Chart",geo_map:"Geo Map",line:"Line Plot",network:"Network",paths:"Paths",pie:"Pie Chart",rings:"Rings",scatter:"Scatter Plot",stacked:"Stacked Area",table:"Table",tree_map:"Tree Map"}}},{}],70:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:[""," €"],dateTime:"%A, %e de %B de %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"]},dev:{accepted:"{0} no es un valor aceptado para {1}, por favor utilice uno de los siguientes: {2}.",deprecated:"el método {0} ha sido eliminado, por favor, actualiza tu código para utilizar {1}.",noChange:"{0} no se actualiza porque no cambió.",noContainer:"no se puede encontrar un contenedor en la página correspondiente a {0}.",of:"de",oldStyle:"propiedades de estilo para {0} ahora se han incorporado directamente en. {1} ().",sameEdge:"los vínculos no se pueden enlazar con si mismos. eliminando automáticamente el vínculo {0} que se autorreferencia.",set:"{0} se ha establecido.",setLong:"{0} ha sido establecido a {1}.",setContainer:"defina un div contenedor utilizando .container ()"},error:{accepted:"{0} no es un {1} aceptado para visualizaciones de {2}, por favor utilice uno de los siguientes: {3}.",connections:"no hay conexiones disponibles para {0}.",data:"No hay datos disponibles",dataYear:"no hay datos disponibles para {0}.",lib:"{0} visualizaciones requieren cargar las siguientes librerías: {1}.",libs:"{0} visualizaciones requieren cargar las siguientes librerías: {1}.",method:"{0} visualizaciones requieren establecer el método {1}.",methods:"{0} visualizaciones requieren establecer los siguientes métodos: {1}."},lowercase:["una","y","en","pero","en","de","o","el","la","los","las","para","a","con"],method:{active:"segmentos activos",color:"color",depth:"profundidad",dev:"detallado",focus:"foco",icon:"ícono",id:"id",height:"alto",labels:"rótulo",legend:"leyenda",margin:"margen",messages:"mensajes de estado",mute:"ocultar",order:"orden",search:"búsqueda",shape:"forma",size:"tamaño",solo:"aislar",style:"estilo",temp:"segmentos temporales",text:"texto",time:"tiempo",timeline:"línea de tiempo",total:"segmentos totales",type:"tipo",width:"anchura",x:"eje x",y:"eje Y",zoom:"#ERROR!",mode:"modo"},time:["fecha","día","mes","hora","año"],visualization:{bubbles:"Burbujas",chart:"Tabla",geo_map:"Mapa Geo",line:"Línea Solar",network:"Red",rings:"Anillos",scatter:"Gráfico De Dispersión",stacked:"Área Apilada",tree_map:"Mapa de Árbol",bar:"Gráfico De Barras",box:"Diagrama de Cajas",paths:"Caminos",pie:"Gráfico de Pastel",table:"Tabla"},ui:{and:"y",back:"atrás",collapse:"click para cerrar",error:"error",expand:"haga clic para ampliar",loading:"Cargando ...",more:"{0} más",moreInfo:"clic para más información",noResults:"no se encontraron resultados para {0}.",primary:"relaciones principales",share:"porcentaje",total:"total",values:"valores",including:"Incluyendo",or:"o"},message:{data:"analizando los datos",draw:"visualizando",initializing:"inicializando {0}",loading:"cargando datos",tooltipReset:"restableciendo las descripciones emergentes",ui:"actualizando la interfaz de usuario"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","TI","I&D","TV","UI"]}},{}],71:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:[""," €"],dateTime:"%A, le %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."]},dev:{accepted:"{0} n'est pas une option valide pour {1}, les valeurs possibles sont: {2}.",deprecated:"{0} a été éliminé de la version courante, mettez à jour votre code source avec {1}.",noChange:"{0} n'a pas été mis à jour car inchangé.",noContainer:"impossible de trouver un contenant correspondant à {0}.",of:"de",oldStyle:"les propriétés de {0} ont été imbriquées dans .{1}().",sameEdge:"un arc ne peut pas boucler sur lui même. L'auto-référence est automatiquement éliminée {0}.",set:"{0} a été mis à jour.",setLong:"{0} a été mis à jour à {1}.",setContainer:"merci de choisir un div qui utilise .container()"},error:{accepted:"{0} n'est pas correct {1} pour {2} visualisations, merci d'utilisez une des options suivantes: {3}.",connections:"Pas de connections disponibles pour {0}.",data:"Pas de données disponibles",dataYear:"Pas de données disponibles pour {0}.",lib:"La visualisation de {0} nécessite le chargement de la librairie {1}.",libs:"La visualisation de {0} nécessite le chargement des librairies {1}.",method:"La visualisation du {0} exige la définition de {1}.",methods:"La visualisation du {0} exige les définitions de {1}."},lowercase:["un","une","de","des","et","mais","les","ou","pour","avec","comme","par","vers","si","dans","près","ni","dessus","que","le","la","via","sinon","alors"],method:{active:"segments actifs",color:"couleur",depth:"profondeur",dev:"verbeux",focus:"focus",icon:"ícone",id:"id",height:"hauteur",labels:"labels",legend:"légende",margin:"marge",messages:"messages",mute:"cacher",order:"ordre",search:"recherche",shape:"format",size:"taille",solo:"isoler",style:"style",temp:"segments temporaires",text:"texte",time:"temps",timeline:"ligne temporelle",total:"segments totaux",type:"type",width:"largeur",x:"axe x",y:"axe y",zoom:"zoom",mode:"mode"},time:["année","date","jour","heure","mois"],visualization:{bubbles:"Bulles",chart:"Graphique",geo_map:"Carte",line:"Courbes",network:"Réseau",rings:"Anneaux",scatter:"Nuage de points",stacked:"Aires empilées",tree_map:"Arbre",bar:"Diagramme en barres",box:"Boîtes à Moustaches",paths:"Chemins",pie:"Camembert",table:"Table"},ui:{and:"et",back:"retour",collapse:"clic pour réduire",error:"erreur",expand:"clic pour agrandir",loading:"chargement ...",more:"plus {0}",moreInfo:"clic pour plus d'information",noResults:"pas de résultat correspondant à {0}.",primary:"connections primaires",share:"part",total:"total",values:"valeurs",including:"incluant",or:"ou"},message:{data:"analyse des données",draw:"tracé en cours",initializing:"Initialisation {0}",loading:"chargement",tooltipReset:"réinitialisation des bulles",ui:"rafraichissement de l'interface"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","IT","TV","UI"]}},{}],72:[function(e,t,r){t.exports={format:{decimal:".",thousands:",",grouping:[3],currency:["₩",""],dateTime:"%Y/%m/%d %a %X",date:"%Y/%m/%d",time:"%H:%M:%S",periods:["오전","오후"],days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],shortDays:["일","월","화","수","목","금","토"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],shortMonths:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},dev:{accepted:"{0} {1}, 다음 중 하나를 사용하십시오에 대한 허용 값이 아닙니다 : {2}.",deprecated:"{0} 메소드가 제거 된, 사용하는 코드를 업데이트하십시오 {1}.",noChange:"{0}이 변경되지 않았기 때문에 업데이트되지 않았습니다.",noContainer:"페이지 매칭 {0}에 컨테이너를 찾을 수 없다.",of:"의",oldStyle:"{0} 지금에 직접 내장 된위한 스타일의 호텔 .{1}().",sameEdge:"가장자리는 자신에 링크 할 수 없습니다. 자동으로 자체 참조 가장자리 {0}을 제거하는 단계를 포함한다.",set:"{0} 설정되어 있습니다.",setLong:"{0} {1}로 설정되어 있습니다.",setContainer:".container() 사용하여 컨테이너 사업부를 정의하십시오"},error:{accepted:"{0} 아니다 허용 {1} {2} 시각화는 다음 중 하나를 사용하시기 바랍니다 : {3}.",connections:"{0}에 대한 연결이 없음.",data:"자료 없음",dataYear:"{0}에 대한 자료가 없음.",lib:"{0} 시각화는 {1} 라이브러리를로드 할 필요합니다.",libs:"{0} 시각화는 다음과 같은 라이브러리를로드 할 필요 : {1}.",method:"{0} 시각화를 위해 {1} 메서드를 설정해야 한다.",methods:"{0} 시각화를 위해 다음과 같은 메서드를 설정해야한다: {1}."},lowercase:[],method:{active:"활성 세그먼트",color:"색",depth:"깊이",dev:"풀어서",focus:"초점",icon:"상",id:"신분증",height:"높이",labels:"라벨",legend:"범례",margin:"여유",messages:"상태 메시지",order:"주문",search:"수색",shape:"모양",size:"크기",style:"스타일",temp:"임시 세그먼트",text:"본문",time:"시각",timeline:"타임 라인",total:"총 세그먼트",type:"유형",width:"폭",x:"X 축",y:"Y 축",zoom:"줌",mode:"모드",mute:"숨김",solo:"독주"},time:["날짜","요일","월","시간","년"],visualization:{bubbles:"버블 차트",chart:"차트",geo_map:"지도형",line:"선형 그래프",network:"네트워크 그래프",rings:"반지",scatter:"산포도",stacked:"스택 영역",tree_map:"트리 맵",bar:"막대 차트",box:"박스 플롯",paths:"경로",pie:"파이 차트",table:"표"},ui:{and:"과",back:"뒤로",collapse:"축소하려면 클릭",error:"오류",expand:"확장하려면 클릭",loading:"로드 중 ...",more:"{0} 이상",moreInfo:"추가 정보를 위해 클릭하십시오",noResults:"일치하는 결과값이 없음 {0}.",primary:"기본 연결",share:"비중",total:"합계",values:"값",including:"...을 포함하여",or:"또는"},message:{data:"데이터 분석 중",draw:"데이터 시각화 중",initializing:"초기화 {0}",loading:"데이터 로딩 중",tooltipReset:"툴팁을 재설정",ui:"UI 업데이트 중"},uppercase:["CEO","최고 경영자","최고 재무 책임자 (CFO)","CFO는","CNC","COO","구구","CPU","CPU를","국내 총생산 (GDP)","HVAC","ID","IT","R & D","TV","UI"]}},{}],73:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:[""," ден."],dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["недела","понеделник","вторник","среда","четврток","петок","сабота"],shortDays:["нед","пон","вто","сре","чет","пет","саб"],months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],shortMonths:["јан","фев","мар","апр","мај","јун","јул","авг","сеп","окт","ное","дек"]},dev:{accepted:"{0} не е прифатенa вредноста за {1}, ве молиме користете еднa од следниве вредности: {2}.",deprecated:"{0} метод е отстранета, ве молиме обновете го вашиот код за да се користи {1}.",noChange:"{0} не е ажурирана, бидејќи немаше промени.",noContainer:"не можe да се најде контејнер на страницата кој се совпаѓа со {0}.",of:"на",oldStyle:"својствата за стилот за {0} сега се вградени директно во. {1} ().",sameEdge:"рабовите не може да имаат алка самите кон себе. автоматски ги отстранувам рабовите кои се само-референцираат {0}.",set:"{0} е наместен.",setLong:"{0} е поставен на {1}.",setContainer:"Ве молиме дефинирајте контејнер div користејќи .container()"},error:{accepted:"{0} не е прифатлива за {1} {2} визуелизација, ве молиме користете една од следниве: {3}.",connections:"не е достапна за врски {0}.",data:"нема податоци",dataYear:"Нема достапни податоци за {0}.",lib:"{0} визуализации бараат вчитување на библиотеката {1} .",libs:"{0} визуализации бараат вчитување следниве библиотеки: {1}.",method:"{0} визуализации бара поставување на {1} методот.",methods:"{0} визуализации бараат поставување на следниве методи: {1}."},lowercase:["a","и","во","но","на","или","да","се","со"],method:{active:"активни сегменти",color:"боја",depth:"длабочина",dev:"опширно",focus:"фокус",icon:"икона",id:"id",height:"висина",labels:"етикети",legend:"легенда",margin:"маргина",messages:"пораки за статусот",mute:"скрие",order:"цел",search:"барај",shape:"форма",size:"големина",solo:"изолирање",style:"стил",temp:"привремени сегменти",text:"текст",time:"време",timeline:"времеплов",total:"Вкупно сегменти",type:"тип",width:"ширина",x:"x оската",y:"оската y",zoom:"зум",mode:"режим"},time:["датум","ден","месец","време","година"],visualization:{bubbles:"Меурчиња",chart:"Шема",geo_map:"Гео мапа",line:"Линиски график",network:"Мрежа",rings:"Прстени",scatter:"Распрскан график",stacked:"Наредена површина",tree_map:"Мапа во вид на дрво",bar:"Бар табела",box:"Кутија Парцел",paths:"Патеки",pie:"Пита графикон",table:"Табела"},ui:{and:"и",back:"назад",collapse:"кликни за да се собере",error:"грешка",expand:"кликни за да се прошири",loading:"Се вчитува ...",more:"{0} повеќе",moreInfo:"кликнете за повеќе информации",noResults:"Не се пронајдени појавување на {0}.",primary:"основно врски",share:"удел",total:"Вкупниот",values:"вредности",including:"Вклучувајќи",or:"или"},message:{data:"анализа на податоци",draw:"цртање на визуелизација",initializing:"иницијализација {0}",loading:"податоци за вчитување",tooltipReset:"ресетирање на објаснувањата",ui:"ажурирање на кориничкиот интерфејс"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","GDP","HVAC","ID","IT","R&D","TV","UI"]}},{}],74:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:["R$",""],dateTime:"%A, %e de %B de %Y. %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]},dev:{accepted:"{0} não é um valor válido para {1}, por favor use um dos seguintes procedimentos: {2}.",deprecated:"{0} método foi removido, por favor atualize seu código para utilizar {1}.",noChange:"{0} não foi atualizado porque ele não mudou.",noContainer:"Não foi possível encontrar um local na página correspondente a {0}.",of:"de",oldStyle:"propriedades de estilo para {0} já foi incorporado diretamente no. {1} ().",sameEdge:"bordas não podem vincular a si mesmos. removendo automaticamente borda de auto-referência {0}.",set:"{0} foi definido.",setLong:"{0} foi definida para {1}.",setContainer:"por favor, defina um div utilizando .container()"},error:{accepted:"{0} não é um {1} reconhecido para visualizações {2}, favor usar um dos seguintes procedimentos: {3}.",connections:"Não há conexões disponíveis para {0}.",data:"Não há dados disponíveis",dataYear:"Não há dados disponíveis para {0}.",lib:"A visualização {0} necessita que seja carregado a biblioteca {1}.",libs:"A visualização {0} necessita que seja carregado as bibliotecas {1}.",method:"A visualização {0} exige a definição do método {1}.",methods:"A visualização {0} exige a definição dos métodos {1}."},lowercase:["um","uma","e","como","em","no","na","mas","por","para","pelo","pela","de","do","da","se","perto","nem","ou","que","o","a","com","v"],method:{active:"segmentos activos",color:"cor",depth:"profundidade",dev:"verboso",focus:"foco",icon:"ícone",id:"identificador",height:"altura",labels:"etiquetas",legend:"legenda",margin:"margem",messages:"mensagens de status",mute:"ocultar",order:"ordenar",search:"pesquisar",shape:"forma",size:"tamanho",solo:"isolar",style:"estilo",temp:"segmentos temporários",text:"texto",time:"tempo",timeline:"linha do tempo",total:"segmentos no total",type:"tipo",width:"largura",x:"eixo x",y:"eixo y",zoom:"zoom",mode:"modo"},time:["data","dia","mês","hora","ano"],visualization:{bubbles:"Bolhas",chart:"Gráfico",geo_map:"Mapa",line:"Gráfico de Linha",network:"Rede",rings:"Anéis",scatter:"Dispersão",stacked:"Evolução",tree_map:"Tree Map",bar:"Gráfico de Barras",box:"Box Plot",paths:"Caminhos",pie:"Pie Chart",table:"Tabela"},ui:{and:"e",back:"voltar",collapse:"Clique para fechar",error:"erro",expand:"clique para expandir",loading:"carregando ...",more:"mais {0}",moreInfo:"Clique para mais informações",noResults:"nenhum resultado para {0}.",primary:"conexões primárias",share:"participação",total:"total",values:"valores",including:"Incluindo",or:"ou"},message:{data:"analisando dados",draw:"desenhando visualização",initializing:"inicializando {0}",loading:"carregando dados",tooltipReset:"redefinindo as dicas",ui:"atualizando interface"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","TI","P&D","TV","IU"]}},{}],75:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:["€",""],dateTime:"%A, %e de %B de %Y. %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]},dev:{accepted:"{0} não é um valor válido para {1}, por favor escolha uma das seguintes opções: {2}.",deprecated:"o método {0} foi removido, por favor atualize o seu código para usar {1}.",noChange:"{0} não foi atualizado porque não houve modificações.",noContainer:"Não foi possível encontrar um elemento na página correspondente a {0}.",of:"de",oldStyle:"as propriedades de {0} já foram incluídas em .{1}().",sameEdge:"bordas não podem vincular a si mesmos. removendo automaticamente borda de auto-referência {0}.",set:"{0} foi definido.",setLong:"{0} foi alterado para {1}.",setContainer:"por favor indique um elemento div através do método .container()"},error:{accepted:"{0} não é uma {1} válida para a visualização {2}, por favor escolha uma das seguintes: {3}.",connections:"não existem ligações disponíveis para {0}.",data:"não existem dados disponíveis",dataYear:"não existem dados disponíveis para {0}.",lib:"a visualização {0} necessita que a biblioteca {1} seja carregada.",libs:"a visualização {0} necessita que as seguintes bibliotecas sejam carregadas: {1}.",method:"A visualização {0} exige a definição do método {1}.",methods:"A visualização {0} exige a definição dos seguintes métodos {1}."},lowercase:["um","uma","e","como","em","no","na","mas","por","para","pelo","pela","de","do","da","se","perto","nem","ou","que","o","a","com","v"],method:{active:"segmentos activos",color:"cor",depth:"profundidade",dev:"verboso",focus:"foco",icon:"ícone",id:"identificador",height:"altura",labels:"etiquetas",legend:"legenda",margin:"margem",messages:"estado",order:"ordenar",search:"pesquisar",
shape:"forma",size:"tamanho",style:"estilo",temp:"segmentos temporários",text:"texto",time:"tempo",timeline:"linha temporal",total:"segmentos no total",type:"tipo",width:"largura",x:"eixo dos xx",y:"eixo dos yy",zoom:"zoom",mode:"#ERROR!",mute:"ocultar",solo:"isolar"},time:["data","dia","mês","hora","ano"],visualization:{bubbles:"Bolhas",chart:"Diagrama",geo_map:"Mapa",line:"Gráfico de Linha",network:"Grafo",rings:"Anéis",scatter:"Gráfico de Dispersão",stacked:"Gráfico de Área",tree_map:"Tree Map",bar:"Gráfico de Barras",box:"Diagrama de Caixa e Bigodes",paths:"Caminhos",pie:"Gráfico de Setores",table:"Tabela"},ui:{and:"e",back:"voltar",collapse:"Clique para colapsar",error:"erro",expand:"clique para expandir",loading:"a carregar ...",more:"mais {0}",moreInfo:"Clique para mais informações",noResults:"nenhum resultado para {0}.",primary:"ligações principais",share:"proporção",total:"total",values:"valores",including:"Incluindo",or:"ou"},message:{data:"a analisar os dados",draw:"a desenhar a visualização",initializing:"a inicializar {0}",loading:"a carregar os dados",tooltipReset:"a actualizar as caixas de informação",ui:"a actualizar o interface"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","TI","I&D","TV","IU"]}},{}],76:[function(e,t,r){t.exports={format:{decimal:",",thousands:" ",grouping:[3],currency:[""," руб."],dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shortDays:["вс","пн","вт","ср","чт","пт","сб"],months:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"]},dev:{accepted:"{0} не принимаются значение {1}, пожалуйста, используйте один из следующих: {2}.",deprecated:"Метод {0} был удален, пожалуйста, обновите ваш код, чтобы использовать {1}.",noChange:"{0} не обновлен, поскольку он не изменится.",noContainer:"не могу найти контейнер на странице соответствия {0}.",of:"из",oldStyle:"свойства стиля для {0} уже в настоящее время были встроен непосредственно в. {1} ().",sameEdge:"Края не может связать себя. автоматически удаляя автореферентных ребро {0}.",set:"{0} был установлен.",setLong:"{0} установлено значение {1}.",setContainer:"пожалуйста, определить контейнер DIV с помощью .container ()"},error:{accepted:"{0} не принимаются {1} для {2} визуализации, пожалуйста, используйте один из следующих: {3}.",connections:"нет соединения, доступные для {0}.",data:"данные недоступны",dataYear:"нет данных {0}.",lib:"{0} визуализации требуют загрузки {1} библиотеку.",libs:"{0} визуализации требуют загрузки следующих библиотек: {1}.",method:"{0} визуализации требуют установки {1} метода.",methods:"{0} визуализации требуют установки следующих методов: {1}."},lowercase:["и","как","в","но","для","из","если в","в","недалеко","ни","на","на","или","в","что","к","с","с помощью","против","против"],method:{active:"активные сегменты",color:"цвет",depth:"глубина",dev:"многословный",focus:"фокус",icon:"значок",id:"ID",height:"высота",labels:"надписи",legend:"легенда",margin:"поле",messages:"Сообщения о состоянии",mute:"скрывать",order:"порядок",search:"поиск",shape:"форма",size:"размер",solo:"изолировать",style:"стиль",temp:"временные сегменты",text:"текст",time:"время",timeline:"график",total:"всего сегментов",type:"тип",width:"ширина",x:"ось х",y:"Ось Y",zoom:"масштаб",mode:"режим"},time:["дата","день","месяц","время","год"],visualization:{bubbles:"Пузыри",chart:"График",geo_map:"Гео Карта",line:"Линия земля",network:"Сеть",rings:"Кольца",scatter:"Разброс земля",stacked:"С накоплением Площадь",tree_map:"Дерево Карта",bar:"Гистограмма",box:"Коробка земля",paths:"Пути",pie:"Круговая диаграмма",table:"Стол"},ui:{and:"и",back:"назад",collapse:"Щелкните, чтобы свернуть",error:"ошибка",expand:"щелкните, чтобы развернуть",loading:"загрузка ...",more:"{0} более",moreInfo:"нажмите для получения более подробной информации",noResults:"нет результатов, соответствующих {0}.",primary:"первичные соединения",share:"доля",total:"общее",values:"значения",including:"включая",or:"или"},message:{data:"Анализируя данные",draw:"рисунок визуализация",initializing:"инициализации {0}",loading:"загрузка данных",tooltipReset:"сброс подсказки",ui:"обновление пользовательского интерфейса"},uppercase:["ID"]}},{}],77:[function(e,t,r){t.exports={format:{decimal:".",thousands:",",grouping:[3],currency:["¥",""],dateTime:"%A %B %e %Y %X",date:"%Y/%-m/%-d",time:"%H:%M:%S",periods:["上午","下午"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},dev:{accepted:"{0}不是{1}的可接受值, 请用下列之一的值:{2}",deprecated:"{0}的方法已被移除, 请更新您的代码去使用{1}",noChange:"{0}没有更新, 因为它并没有改变。",noContainer:"无法在该页找到容器去匹配{0}",of:"的",oldStyle:"样式属性{0}现在已经直接嵌入到。{1}()。",sameEdge:"边缘不能链接到自己。自动去除自我参照边缘{0}。",set:"{0}已经被设置。",setLong:"{0}被设置为{1}。",setContainer:"请使用()容器来定义div容器"},error:{accepted:"{0}对于{2}的可视化效果并不是一个可接受的{1}, 请使用如下的一个:{3}.",connections:"没有对{0}可用的连接。",data:"无可用数据",dataYear:"没有数据对{0}可用。",lib:"{0}的可视化要求装载{1}库。",libs:"{0}的可视化需要加载以下库:{1}。",method:"{0}的可视化要求设置{1}方法。",methods:"{0}的可视化要求设置以下方法:{1}。"},lowercase:["一个","和","在","但是","在...里","的","或者","这","向","与...一起"],method:{active:"活跃段",color:"颜色",depth:"深度",dev:"详细",focus:"焦点",icon:"图标",id:"身份认证",height:"高度",labels:"标签",legend:"图例注释",margin:"外边距",messages:"状态消息",mute:"隐藏",order:"规则",search:"搜索",shape:"形状",size:"大小",solo:"隔离",style:"样式",temp:"暂时性区段",text:"文本",time:"时间",timeline:"时间轴",total:"总段",type:"类型",width:"宽度",x:"X轴",y:"Y轴",zoom:"缩放",mode:"模式"},time:["日","星期","月","时间","年"],visualization:{bubbles:"气泡",chart:"图表",geo_map:"地理地图",line:"线图",network:"网络",rings:"特性",scatter:"散点图",stacked:"堆积面积图",tree_map:"树图",bar:"条图",box:"箱线图",paths:"路径",pie:"饼图",table:"表"},ui:{and:"和",back:"后面",collapse:"点击合并",error:"错误",expand:"单击以展开",loading:"载入中...",more:"{0}更多",moreInfo:"点击了解更多信息",noResults:"没有结果匹配{0}。",primary:"主要连接",share:"共享",total:"总",values:"值",including:"包括",or:"或"},message:{data:"分析数据",draw:"绘制可视化",initializing:"初始化{0}",loading:"加载数据",tooltipReset:"重置工具提示",ui:"更新UI"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","GDP","HVAC","ID","电视","用户界面","研发"]}},{}],78:[function(e,t,r){t.exports={en_US:e("./languages/en_US.coffee"),es_ES:e("./languages/es_ES.js"),fr_FR:e("./languages/fr_FR.js"),ko_KR:e("./languages/ko_KR.js"),mk_MK:e("./languages/mk_MK.js"),pt_BR:e("./languages/pt_BR.js"),pt_PT:e("./languages/pt_PT.js"),ru_RU:e("./languages/ru_RU.js"),zh_CN:e("./languages/zh_CN.js")}},{"./languages/en_US.coffee":69,"./languages/es_ES.js":70,"./languages/fr_FR.js":71,"./languages/ko_KR.js":72,"./languages/mk_MK.js":73,"./languages/pt_BR.js":74,"./languages/pt_PT.js":75,"./languages/ru_RU.js":76,"./languages/zh_CN.js":77}],79:[function(e,t,r){var n,a,o,i,s,l,u,c,d;a=e("../../util/copy.coffee"),s=e("../console/print.coffee"),l=e("./process/detect.coffee"),u=e("./set.coffee"),c=e("../../string/format.js"),d=e("../../object/validate.coffee"),t.exports=function(e,t){var r,n,s;s=[];for(r in t)n=t[r],e[r]=a(n),e[r].initialized=i(e,e[r],r),s.push(e.self[r]=o(e,r));return s},i=function(e,t,r,n){var a,o,u,f,p;t.previous=!1,t.changed=!1,t.initialized=!1,t.callback=!1,"init"in t&&!("value"in t)&&(t.value=t.init(e),delete t.init),"process"in t&&(t.value=l(e,t,t.value));for(p in t)if("deprecates"===p)for(o=t[p]instanceof Array?t[p]:[t[p]],u=0,f=o.length;f>u;u++)a=o[u],e.self[a]=function(t,r){return function(a){var o,i,l;return l=e.format.locale.value.dev.deprecated,t="."+t+"()",i=n?'"'+r+'" in .'+n+"()":"."+r+"()",o=n||r,s.error(c(l,t,i),o),e.self}}(a,r);else"global"===p?r in e||(e[r]=[]):"value"!==p&&d(t[p])&&i(e,t[p],p,r);return!0},o=function(e,t){return function(r,a){var o,i,l,u,f,p,h,v;if(o="accepted"in e[t]?e[t].accepted:null,"function"==typeof o&&(o=o(e)),o instanceof Array||(o=[o]),r===Object)return e[t];if(!arguments.length&&o.indexOf(void 0)<0)return"value"in e[t]?e[t].value:e[t];if("style"===t&&"object"==typeof r){v=e.format.locale.value.dev.oldStyle;for(p in r)s.warning(c(v,'"'+p+'"',p),p),e.self[p](r[p])}if("font"===t){"string"==typeof r&&(r={family:r}),h=!0,l=function(e,t,r,n){d(e[r])&&t in e[r]&&(d(e[r][t])?e[r][t].process?e[r][t].value=e[r][t].process(n):e[r][t].value=n:e[r][t]=n)},i=function(e,t,r){var n;if(d(e)){if(h)for(n in e)l(e,t,n,r);else"font"in e&&l(e,t,"font",r);h=!1;for(n in e)i(e[n],t,r)}};for(u in r)f=r[u],"secondary"!==u&&(d(f)&&(f=f.value),f&&i(e,u,f))}return n(e,t,e,t,r),"function"==typeof a&&(e[t].callback=a),e[t].chainable===!1?e[t].value:e.self}},n=function(e,t,r,a,o){var i,s,l,c;if(["accepted","changed","initialized","previous","process"].indexOf(a)<0)if(c=d(o),l=d(r[a])&&"objectAccess"in r[a]&&r[a].objectAccess===!1,i=c&&(l||!("value"in o)&&(!d(r[a])||!(d3.keys(o)[0]in r[a]))),null===o||!c||i)u(e,t,r,a,o);else if(c)for(s in o)n(e,t,r[a],s,o[s])}},{"../../object/validate.coffee":171,"../../string/format.js":172,"../../util/copy.coffee":206,"../console/print.coffee":52,"./process/detect.coffee":87,"./set.coffee":93}],80:[function(e,t,r){t.exports=function(e){return e||(e=!1),{accepted:[!1,Array,Function,Number,Object,String],callback:{accepted:[!1,Function],value:!1},global:e,process:Array,value:[]}}},{}],81:[function(e,t,r){var n;n=e("../../../client/rtl.coffee"),t.exports=function(e){var t;return t=["left","center","right"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="left"),{accepted:t,process:function(e){return n?"left"===e?"right":"right"===e?"left":e:e},value:e}}},{"../../../client/rtl.coffee":40}],82:[function(e,t,r){t.exports=function(e){var t;return t=["line-through","none","overline","underline"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="none"),{accepted:t,value:e}}},{}],83:[function(e,t,r){var n,a;a=e("../../../font/validate.coffee"),n=["Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"],t.exports=function(e){return void 0===e&&(e=n),{process:a,value:e}}},{"../../../font/validate.coffee":102}],84:[function(e,t,r){t.exports=function(e){var t;return t=["top","middle","bottom"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="bottom"),{accepted:t,mapping:{top:"0ex",middle:"0.5ex",bottom:"1ex"},process:function(e){return this.text=e,this.mapping[e]},value:e}}},{}],85:[function(e,t,r){t.exports=function(e){var t;return t=["capitalize","lowercase","none","uppercase"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="none"),{accepted:t,value:e}}},{}],86:[function(e,t,r){t.exports=function(e,t,r){var n;return t.history&&t.history.reset(),e.constructor===String?e.indexOf("/")>=0?(r.url=e,[]):(n=d3.selectAll(e),n.size()?n:(e.indexOf(".")>=0&&(r.url=e),[])):e}},{}],87:[function(e,t,r){var n,a;n=e("../../../util/copy.coffee"),a=e("../../../array/update.coffee"),t.exports=function(e,t,r){return t.process===Array?a(n(t.value),r):"object"==typeof t.process&&"string"==typeof r?t.process[r]:"function"==typeof t.process?t.process(r,e,t):r}},{"../../../array/update.coffee":35,"../../../util/copy.coffee":206}],88:[function(e,t,r){var n;n=e("../../../client/css.coffee"),t.exports=function(e,t,r){return e===!1||e.indexOf("fa-")<0||0===e.indexOf("fa-")&&n("font-awesome")?e:r.fallback}},{"../../../client/css.coffee":36}],89:[function(e,t,r){t.exports=function(e,t){var r,n,a,o,i,s,l,u,c,d,f,p,h;if("string"==typeof e){for(e=e.split(" "),r=n=0,i=e.length;i>n;r=++n)h=e[r],e[r]=parseFloat(h,10);e=1===e.length?e[0]:2===e.length?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:3===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[1]}:4===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[3]}:0}if(p=["top","right","bottom","left"],"number"==typeof e)for(a=0,s=p.length;s>a;a++)f=p[a],t[f]=e;else for(o=0,l=p.length;l>o;o++)f=p[o],t[f]=e[f];for(t.css="",d=[],r=c=0,u=p.length;u>c;r=++c)f=p[r],r&&(t.css+=" "),d.push(t.css+=t[f]+"px");return d}},{}],90:[function(e,t,r){var n,a,o,i;n=e("../../array/contains.coffee"),a=e("../../string/format.js"),o=e("../../string/list.coffee"),i=e("../console/print.coffee"),t.exports=function(e,t,r,s,l){var u,c,d,f,p,h,v,g;if("function"==typeof t&&(t=t(e)),t instanceof Array||(t=[t]),c=n(t,r),c===!1&&void 0!==r){for(h=[],g=JSON.stringify(r),"string"!=typeof r&&(g='"'+g+'"'),f=0,p=t.length;p>f;f++)u=t[f],"string"==typeof u?h.push('"'+u+'"'):"function"==typeof u?h.push(u.toString().split("()")[0].substring(9)):void 0===u?h.push("undefined"):h.push(JSON.stringify(u));h=o(h,e.format.locale.value.ui.or),e.type&&["mode","shape"].indexOf(s)>=0?(v=e.format.locale.value.error.accepted,d=e.format.locale.value.visualization[e.type.value]||e.type.value,i.warning(a(v,g,s,d,h),s)):(v=e.format.locale.value.dev.accepted,i.warning(a(v,g,l,h),s))}return!c}},{"../../array/contains.coffee":33,"../../string/format.js":172,"../../string/list.coffee":173,"../console/print.coffee":52}],91:[function(e,t,r){t.exports=function(e){var t;return t=["auto","optimizeSpeed","crispEdges","geometricPrecision"],t.indexOf(e)>=0||(e="crispEdges"),{accepted:t,value:e}}},{}],92:[function(e,t,r){var n,a;a=e("../../object/validate.coffee"),n=function(e,t){var r;e.changed&&(e.changed=!1),"draw"===t&&(e.frozen=!1,e.update=!0,e.first=!1);for(r in e)r.indexOf("d3plus")<0&&a(e[r])&&n(e[r],r)},t.exports=n},{"../../object/validate.coffee":171}],93:[function(e,t,r){var n,a,o,i,s,l,u,c,d;n=e("../../util/copy.coffee"),a=e("../../util/d3selection.coffee"),d=e("../../object/validate.coffee"),o=e("../../object/merge.coffee"),i=e("../console/print.coffee"),s=e("./process/detect.coffee"),l=e("./rejected.coffee"),u=e("../../string/format.js"),c=e("../../array/update.coffee"),t.exports=function(e,t,r,f,p){var h,v,g,m,y,x,b,w,_,k,z,A,j,M;if(A="value"!==f&&f&&f!==t?'"'+f+'" '+e.format.locale.value.dev.of+" ."+t+"()":"."+t+"()",h="value"===f&&"accepted"in r?r.accepted:d(r[f])&&"accepted"in r[f]?r[f].accepted:[p],!l(e,h,p,t,A)){if(d(r[f])&&"value"in r[f]&&(k=f,r=r[f],f="value"),"value"===f&&"process"in r&&(p=s(e,r,p)),r[f]instanceof Array||r[f]!==p||void 0===p){if(r.changed=!0,r.loaded&&(r.loaded=!1),"history"in e&&"draw"!==t&&(v=n(r),v.method=t,e.history.chain.push(v)),r.previous=r[f],"id"in e&&"value"===f&&"nesting"in r)if("id"!==t){if("object"!=typeof r.nesting&&(r.nesting={}),d(p)){for(x in p)"string"==typeof p[x]&&(p[x]=[p[x]]);r.nesting=o(r.nesting,p),e.id.value in r.nesting||(r.nesting[e.id.value]=p[d3.keys(p)[0]])}else p instanceof Array?r.nesting[e.id.value]=p:r.nesting[e.id.value]=[p];r[f]=r.nesting[e.id.value][0]}else p instanceof Array?(r.nesting=p,"depth"in e&&e.depth.value<p.length?r[f]=p[e.depth.value]:(r[f]=p[0],"depth"in e&&(e.depth.value=0))):(r[f]=p,r.nesting=[p],"depth"in e&&(e.depth.value=0));else"depth"===t?(p>=e.id.nesting.length?e.depth.value=e.id.nesting.length-1:0>p?e.depth.value=0:e.depth.value=p,e.id.value=e.id.nesting[e.depth.value],"object"==typeof e.text.nesting&&(_=e.text.nesting[e.id.value],_&&(e.text.nesting[e.id.value]="string"==typeof _?[_]:_,e.text.value=_ instanceof Array?_[0]:_))):d(r[f])&&d(p)?r[f]=o(r[f],p):r[f]=p;"value"===f&&r.global&&(y=r[f].length>0,b=k||f,b in e&&(y&&e.data[b].indexOf(t)<0||!y&&e.data[b].indexOf(t)>=0)&&(e.data[b]=c(e.data[b],t))),"value"===f&&r.dataFilter&&e.data&&e.data.filters.indexOf(t)<0&&e.data.filters.push(t),e.dev.value&&r.changed&&void 0!==r[f]&&(w=r[f]instanceof Array&&r[f].length>10,m=a(r[f]),j="function"==typeof r[f],M=w||m||j?null:"string"==typeof r[f]?r[f]:JSON.stringify(r[f]),null!==M&&M.length<260?(z=e.format.locale.value.dev.setLong,i.log(u(z,A,'"'+M+'"'))):(z=e.format.locale.value.dev.set,i.log(u(z,A))))}else z=e.format.locale.value.dev.noChange,e.dev.value&&i.comment(u(z,A));"value"===f&&r.callback&&!r.url&&(g="function"==typeof r.callback?r.callback:r.callback.value,g&&g(p,e.self))}}},{"../../array/update.coffee":35,"../../object/merge.coffee":170,"../../object/validate.coffee":171,"../../string/format.js":172,"../../util/copy.coffee":206,"../../util/d3selection.coffee":207,"../console/print.coffee":52,"./process/detect.coffee":87,"./rejected.coffee":90}],94:[function(e,t,r){var n=e("../console/print.coffee"),a=e("../../string/format.js");t.exports=function(e){if(e.dev.value){var t="analyzing edges list";n.time(t)}var r=e.types[e.type.value].requirements;r instanceof Array||(r=[r]);var o=r.indexOf("nodes")>=0&&!e.nodes.value;if(o){e.nodes.value=[];var i=[];e.nodes.changed=!0}e.edges.value.forEach(function(t){["source","target"].forEach(function(r){var n=typeof t[e.edges[r]];if("object"!==n)if("number"!==n||o||"number"===e.data.keys[e.id.value])if(o&&i.indexOf(t[e.edges[r]])>=0)t[e.edges[r]]=e.nodes.value.filter(function(n){return n[e.id.value]===t[e.edges[r]]})[0];else{var a={};a[e.id.value]=t[e.edges[r]],t[e.edges[r]]=a}else t[e.edges[r]]=e.nodes.value[t[e.edges[r]]];var s=t[e.edges[r]];o&&i.indexOf(s[e.id.value])<0&&(i.push(s[e.id.value]),e.nodes.value.push(s))}),"keys"in e.data||(e.data.keys={}),e.id.value in e.data.keys||(e.data.keys[e.id.value]=typeof t[e.edges.source][e.id.value])}),e.edges.value=e.edges.value.filter(function(t){var r=t[e.edges.source][e.id.value],o=t[e.edges.target][e.id.value];if(r===o){var i=e.format.locale.value.dev.sameEdge;return n.warning(a(i,'"'+r+'"'),"edges"),!1}return!0}),e.edges.linked=!0,e.dev.value&&n.timeEnd(t)}},{"../../string/format.js":172,"../console/print.coffee":52}],95:[function(e,t,r){var n=e("./hideElement.js");t.exports=function(e){function t(e,t){[].forEach.call(t.attributes,function(t){if(/^data-/.test(t.name)){var r=t.name.substr(5).replace(/-(.)/g,function(e,t){return t.toUpperCase()});e[r]=t.value}}),r.forEach(function(r){null!==t.getAttribute(r)&&(e[r]=t.getAttribute(r))})}var r=[e.color.value,e.icon.value,e.keywords.value,e.alt.value,"style"];e.text.value||e.self.text("text"),r=r.concat(e.id.nesting),e.self.data({element:e.data.value});var a=e.data.element.value.node().tagName.toLowerCase(),o=e.data.element.value.attr("type"),i=[];if("select"===a){var s=e.data.element.value.node().id;s&&e.self.container({id:s}),e.data.element.value.selectAll("option").each(function(r,n){var a={};if(a.text=d3.select(this).text(),t(a,this),i.push(a),this.selected)for(var n=e.id.nesting.length-1;n>=0;n--){var o=e.id.nesting[n];if(o in a){e.self.focus(a[o]);break}}})}else if("input"===a&&"radio"===o){var l=e.data.element.value.node().getAttribute("name");l&&e.self.container({id:l}),e.data.element.value.each(function(r,a){var o={};t(o,this);var s=o[e.id.value]||this.id||!1;if(s&&isNaN(parseFloat(s))){var l=d3.select("label[for="+s+"]");l.empty()||(o.text=l.html(),l.call(n))}i.push(o),this.checked&&e.self.focus(o[e.id.value])})}!e.focus.value.length&&i.length&&(e.data.element.value.node().selectedIndex=0,e.self.focus(i[0][e.id.value]));var u=d3.select("legend[for="+e.container.id+"]");u.empty()||(e.self.title(u.html()),u.call(n));var c=e.container.value?e.container.value.node().tagName.toLowerCase():!1;return(e.container.value===!1||"body"===c)&&(e.container.value=d3.select(e.data.element.value.node().parentNode)),e.data.element.value.call(n),i}},{"./hideElement.js":96}],96:[function(e,t,r){t.exports=function(e){e.style("position","absolute","important").style("clip","rect(1px 1px 1px 1px)","important").style("clip","rect(1px, 1px, 1px, 1px)","important").style("width","1px","important").style("height","1px","important").style("margin","-1px","important").style("padding","0","important").style("border","0","important").style("overflow","hidden","important")}},{}],97:[function(e,t,r){var n=e("../console/print.coffee");t.exports=function(e){if("network"===e.type.value){if(e.dev.value){var t="analyzing node positions";n.time(t)}var r=e.nodes.value.filter(function(e){return"number"==typeof e.x&&"number"==typeof e.y}).length;if(r===e.nodes.value.length)e.nodes.positions=!0;else{var a=d3.layout.force().size([e.width.viz,e.height.viz]).nodes(e.nodes.value).links(e.edges.value),o=e.edges.strength.value;o&&("string"==typeof o?a.linkStrength(function(e){return e[o]}):a.linkStrength(o));var i=50,s=.01;a.start();for(var l=i;l>0&&(a.tick(),!(a.alpha()<s));--l);a.stop(),e.nodes.positions=!0}e.dev.value&&n.timeEnd(t)}}},{"../console/print.coffee":52}],98:[function(e,t,r){var n;n=e("numeric"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M;for(null==t&&(t={}),null==t.maxDegree&&(t.maxDegree=5),r=e.length,x=Number.MAX_VALUE,s=null,o=function(){var r,n,a;for(a=[],c=r=1,n=t.maxDegree+1;n>=1?n>r:r>n;c=n>=1?++r:--r)a.push(function(){var t,r,n;for(n=[],r=0,t=e.length;t>r;r++)y=e[r],n.push(Math.pow(y[0],c));return n}());return a}(),j=function(){var t,r,n;for(n=[],t=0,r=e.length;r>t;t++)y=e[t],n.push(y[1]);return n}(),f=v=0,w=1<<t.maxDegree;w>=0?w>v:v>w;f=w>=0?++v:--v){for(i=[function(){var e,t,n;for(n=[],b=e=0,t=r;t>=0?t>e:e>t;b=t>=0?++e:--e)n.push(1);return n}()],d=[0],p=m=0,_=t.maxDegree;_>=0?_>m:m>_;p=_>=0?++m:--m)(f&1<<p)>0&&(i.push(o[p]),d.push(p+1));a=n.transpose(i),h=d.length,l=n.dot(n.dot(n.inv(n.dot(i,a)),i),j),M=n.dot(a,l),k=n.sub(j,M),A=n.dot(k,k),z=A/(r-h),g=-.5*r*Math.log(2*Math.PI)-.5*r*Math.log(z)-A/(2*z),u=-2*g+h*(Math.log(r)-Math.log(2*Math.PI)),x>u&&(x=u,s=[d,l,M])}return s}},{numeric:7}],99:[function(e,t,r){var n;n=e("static-kdtree"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,d,f,p,h;return null==t&&(t=10),h=n(e),u=function(){var r,n,a;for(a=[],r=0,n=e.length;n>r;r++)c=e[r],a.push(h.knn(c,t+1).slice(1));return a}(),p=function(t,r){var n,a,o,i,s,l;for(n=e[t],a=e[r],i=0,t=s=0,l=n.length;l>=0?l>s:s>l;t=l>=0?++s:--s)o=n[t]-a[t],i+=o*o;return i},i=function(){var r,n,o;for(o=[],a=r=0,n=e.length;n>=0?n>r:r>n;a=n>=0?++r:--r)o.push(p(a,u[a][t-1]));return o}(),d=function(e,t){return Math.max(p(e,t),i[t])},s=function(e){var r,n,a,o,i;for(o=0,i=u[e],n=0,a=i.length;a>n;n++)r=i[n],o+=d(e,r);return t/o},l=function(){var t,r,n;for(n=[],a=t=0,r=e.length;r>=0?r>t:t>r;a=r>=0?++t:--t)n.push(s(a));return n}(),f=function(){var n,i,s,c,d,f;for(f=[],a=n=0,c=e.length;c>=0?c>n:n>c;a=c>=0?++n:--n){for(r=0,d=u[a],i=0,s=d.length;s>i;i++)o=d[i],r+=l[o];r/=t,f.push([a,r/l[a]])}return f}(),f.sort(function(e,t){return t[1]-e[1]})}},{"static-kdtree":9}],100:[function(e,t,r){t.exports=function(e){var t,r,n;return r=d3.median(e),t=d3.median(e.map(function(e){return Math.abs(e-r)})),n=e.map(function(e,n){return[n,Math.abs(e-r)/t]}),n.sort(function(e,t){return t[1]-e[1]})}},{}],101:[function(e,t,r){var n;n=e("../core/font/tester.coffee"),t.exports=function(e,t,r){var a,o,i,s,l,u,c;return r||(r={}),t=t||{},u=r.parent||n("svg").append("text"),s=[],e instanceof Array||(e=[e]),c=u.selectAll("tspan").data(e),a={left:"0px",position:"absolute",top:"0px",x:0,y:0},l=0,"letter-spacing"in t&&(l=parseFloat(t["letter-spacing"]),delete t["letter-spacing"]),i=function(e){var t;return t=0,l&&(t=(d3.select(e).text().length-1)*l),e.getComputedTextLength()+t},o=function(e){return e.offsetHeight||e.parentNode.getBBox().height||e.getBoundingClientRect().height},c.enter().append("tspan").text(String).style(t).attr(a).each(function(e){return"function"==typeof r.mod?r.mod(this):void 0}).each(function(e){var t,r,n;return t=d3.select(this).selectAll("tspan"),t.size()?(n=[],t.each(function(){return n.push(i(this))}),n=d3.max(n)):n=i(this),r=o(this),s.push({height:r,text:e,width:n})}),c.remove(),r.parent||u.remove(),s}},{"../core/font/tester.coffee":68}],102:[function(e,t,r){var n,a;n=e("../core/font/tester.coffee"),a=function(e){var t,r,o,i,s,l,u,c,d,f,p,h,v,g;for(e instanceof Array||(e=e.split(",")),s=0,u=e.length;u>s;s++)o=e[s],o.trim();if(i=e.join(", "),t=a.complete,i in t)return t[i];for(p=function(e){return v.append("span").style("font-family",e).style("font-size","32px").style("padding","0px").style("margin","0px").text("abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890")},h=function(e,t){var r,n,a;return r=p(e),n=r.node().offsetWidth,a=t.node().offsetWidth,r.remove(),n!==a},v=n("div"),d=p("monospace"),f=p("sans-serif"),l=0,c=e.length;c>l;l++)if(r=e[l],g=h(r+",monospace",d),g||(g=h(r+",sans-serif",f)),g){g=r;break}return g||(g="sans-serif"),d.remove(),f.remove(),t[i]=g,g},a.complete={},t.exports=a},{"../core/font/tester.coffee":68}],103:[function(e,t,r){var n=e("../array/sort.coffee"),a=e("../core/methods/attach.coffee"),o=e("../core/data/format.js"),i=e("../core/data/keys.coffee"),s=e("../core/data/load.coffee"),l=e("../core/fetch/data.js"),u=e("../client/ie.js"),c=e("../core/methods/reset.coffee"),d=e("../core/console/print.coffee");t.exports=function(){var t={types:{auto:e("./types/auto.js"),button:e("./types/button/button.coffee"),drop:e("./types/drop/drop.coffee"),toggle:e("./types/toggle.js")}};return t.self=function(e){var r=t.data.value instanceof Array&&t.data.value.length>t.data.large;if(t.draw.timing=t.draw.first||r||u?0:t.timing.ui,t.data.value instanceof Array){if(t.dev.value&&d.group('drawing "'+t.type.value+'"'),t.data.changed&&(t.data.cache={},i(t,"data"),o(t)),t.data.viz=l(t),t.data.sort.value&&(t.data.changed||t.order.changed||t.order.sort.changed)&&n(t.data.viz,t.order.value||t.text.value,t.order.sort.value,t.color.value,t),t.focus.value===!1&&["auto","button"].indexOf(t.type.value)<0){var a=t.data.element.value;if(a&&"select"===a.node().tagName.toLowerCase()){var f=a.property("selectedIndex");f=0>f?0:f;var p=a.selectAll("option")[0][f],h=p.getAttribute("data-"+t.id.value)||p.getAttribute(t.id.value);h&&(t.focus.value=h)}t.focus.value===!1&&t.data.viz.length&&(t.focus.value=t.data.viz[0][t.id.value]),t.dev.value&&t.focus.value!==!1&&d.log('"value" set to "'+t.focus.value+'"')}var v=function(e,r){r="number"!=typeof r?1===t.id.nesting.length?0:t.id.nesting.length-1:r;var n=t.id.nesting[r];return r>0&&(!(n in e)||e[n]instanceof Array)?v(e,r-1):n};if(t.data.changed){"auto"===t.search.value?t.data.viz.length>10?(t.search.enabled=!0,t.dev.value&&d.log("Search enabled.")):(t.search.enabled=!1,t.dev.value&&d.log("Search disabled.")):t.search.enabled=t.search.value;var g=t.data.element.value?t.data.element.value.node().tagName.toLowerCase():"";if(t.data.element.value&&"select"===g){var m=[];for(var y in t.data.nested.all)m=m.concat(t.data.nested.all[y]);options=t.data.element.value.selectAll("option").data(m,function(e){var t=e?v(e):!1;return e&&t in e?e[t]:!1}),options.exit().remove(),options.enter().append("option"),options.each(function(e){var r=v(e),n=r===t.id.value?t.text.value||t.id.value:t.text.nesting!==!0&&r in t.text.nesting?t.text.nesting[r]:r;for(var a in e)"object"!=typeof e[a]&&(a===n&&d3.select(this).html(e[a]),["alt","value"].indexOf(a)>=0?d3.select(this).attr(a,e[a]):d3.select(this).attr("data-"+a,e[a]));e[r]===t.focus.value?this.selected=!0:this.selected=!1})}}else if(t.focus.changed&&t.data.element.value){var x=t.data.element.value.node().tagName.toLowerCase();if("select"===x)t.data.element.value.selectAll("option").each(function(e){e[v(e)]===t.focus.value?this.selected=!0:this.selected=!1});else{var x=t.data.element.value.attr("type").toLowerCase();"radio"===x&&t.data.element.value.each(function(e){this.value===t.focus.value?this.checked=!0:this.checked=!1})}}if("auto"!==t.type.value){if(!t.container.ui){t.container.ui=t.container.value.selectAll("div#d3plus_"+t.type.value+"_"+t.container.id).data(["container"]);var b=t.data.element.value?t.data.element.value[0][0]:null;if(b)if(b.id)b="#"+b.id;else{var w=b.getAttribute(t.id.value)?t.id.value:"data-"+t.id.value;b=b.getAttribute(w)?"["+w+"="+b.getAttribute(w)+"]":null}t.container.ui.enter().insert("div",b).attr("id","d3plus_"+t.type.value+"_"+t.container.id).style("position","relative").style("overflow","visible").style("vertical-align","top")}t.container.ui.style("display",t.ui.display.value),t.container.ui.transition().duration(t.draw.timing).style("margin",t.ui.margin.css);var _=t.container.ui.selectAll("div.d3plus_title").data(t.title.value?[t.title.value]:[]);_.enter().insert("div","#d3plus_"+t.type.value+"_"+t.container.id).attr("class","d3plus_title").style("display","inline-block"),_.style("color",t.font.color).style("font-family",t.font.family.value).style("font-size",t.font.size+"px").style("font-weight",t.font.weight).style("padding",t.ui.padding.css).style("border-color","transparent").style("border-style","solid").style("border-width",t.ui.border+"px").text(String).each(function(e){t.margin.left=this.offsetWidth})}if(t.data.value.length){var k=t.format.locale.value.visualization[t.type.value];t.dev.value&&d.time("drawing "+k),t.types[t.type.value](t),t.dev.value&&d.timeEnd("drawing "+k)}else!t.data.url||t.data.loaded&&!t.data.stream||s(t,"data",t.self.draw);t.dev.value&&d.timeEnd("total draw time"),c(t)}},a(t,{active:e("./methods/active.coffee"),alt:e("./methods/alt.coffee"),color:e("./methods/color.coffee"),config:e("./methods/config.coffee"),container:e("./methods/container.coffee"),data:e("./methods/data.js"),depth:e("./methods/depth.coffee"),dev:e("./methods/dev.coffee"),draw:e("./methods/draw.js"),focus:e("./methods/focus.coffee"),font:e("./methods/font.coffee"),format:e("./methods/format.coffee"),height:e("./methods/height.coffee"),history:e("./methods/history.coffee"),hover:e("./methods/hover.coffee"),icon:e("./methods/icon.coffee"),id:e("./methods/id.coffee"),keywords:e("./methods/keywords.coffee"),margin:e("./methods/margin.coffee"),open:e("./methods/open.coffee"),order:e("./methods/order.coffee"),remove:e("./methods/remove.coffee"),search:e("./methods/search.coffee"),select:e("./methods/select.coffee"),selectAll:e("./methods/selectAll.coffee"),text:e("./methods/text.coffee"),timing:e("./methods/timing.coffee"),title:e("./methods/title.coffee"),type:e("./methods/type.coffee"),ui:e("./methods/ui.coffee"),width:e("./methods/width.coffee")}),t.self}},{"../array/sort.coffee":34,"../client/ie.js":37,"../core/console/print.coffee":52,"../core/data/format.js":56,"../core/data/keys.coffee":58,"../core/data/load.coffee":59,"../core/fetch/data.js":64,"../core/methods/attach.coffee":79,"../core/methods/reset.coffee":92,"./methods/active.coffee":104,"./methods/alt.coffee":105,"./methods/color.coffee":106,"./methods/config.coffee":107,"./methods/container.coffee":108,"./methods/data.js":109,"./methods/depth.coffee":110,"./methods/dev.coffee":111,"./methods/draw.js":112,"./methods/focus.coffee":113,"./methods/font.coffee":114,"./methods/format.coffee":115,"./methods/height.coffee":116,"./methods/history.coffee":117,"./methods/hover.coffee":118,"./methods/icon.coffee":119,"./methods/id.coffee":120,"./methods/keywords.coffee":121,"./methods/margin.coffee":122,"./methods/open.coffee":123,"./methods/order.coffee":124,"./methods/remove.coffee":125,"./methods/search.coffee":126,"./methods/select.coffee":127,"./methods/selectAll.coffee":128,"./methods/text.coffee":129,"./methods/timing.coffee":130,"./methods/title.coffee":131,"./methods/type.coffee":132,"./methods/ui.coffee":133,"./methods/width.coffee":134,"./types/auto.js":135,"./types/button/button.coffee":136,"./types/drop/drop.coffee":141,"./types/toggle.js":158}],104:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Number,String],value:!1}},{"../../core/methods/filter.coffee":80}],105:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],mute:n(!0),solo:n(!0),value:"alt"}},{"../../core/methods/filter.coffee":80}],106:[function(e,t,r){t.exports={accepted:[String],value:"color"}},{}],107:[function(e,t,r){t.exports={accepted:[Object],objectAccess:!1,process:function(e,t){var r,n;for(r in e)n=e[r],r in t.self&&t.self[r](n);return e},value:{}}},{}],108:[function(e,t,r){var n;n=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],element:!1,id:"default",process:function(e){return e===!1?d3.select("body"):n(e)?e:e instanceof Array?d3.select(e[0][0]):d3.select(e)},value:d3.select("body")}},{"../../util/d3selection.coffee":207}],109:[function(e,t,r){var n=e("../../util/d3selection.coffee"),a=e("../../core/methods/process/data.coffee");t.exports={
accepted:[!1,Array,Function,String],delimiter:{accepted:[String],value:"|"},element:{process:function(e,t){var r=!1;return n(e)?r=e:"string"!=typeof e||d3.select(e).empty()||(r=d3.select(e)),r&&t.self.container(d3.select(r.node().parentNode)),r},value:!1},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},filters:[],large:400,mute:[],process:function(e,t){return"default"===t.container.id&&e.length&&t.self.container({id:"default"+e.length}),a(e,t,this)},solo:[],sort:{accepted:[Boolean],value:!1},value:!1}},{"../../core/methods/process/data.coffee":86,"../../util/d3selection.coffee":207}],110:[function(e,t,r){t.exports={accepted:[Number],value:0}},{}],111:[function(e,t,r){t.exports={accepted:[Boolean],value:!1}},{}],112:[function(e,t,r){var n=e("../../util/d3selection.coffee"),a=e("../../core/parse/hideElement.js"),o=e("../../core/parse/element.js"),i=e("../../core/console/print.coffee"),s=e("../../string/format.js");t.exports={accepted:[void 0,Function],first:!0,frozen:!1,process:function(e,t){if(this.initialized===!1)return this.initialized=!0,e;if(!t.data.value||t.data.value instanceof Array&&!n(t.data.value)?t.data.element.value&&t.data.element.value.call(a):t.data.value=o(t),void 0===e&&"function"==typeof this.value&&(e=this.value),t.container.value===!1){var r=t.format.locale.value.dev.setContainer;i.warning(r,"container")}else if(t.container.value.empty()){var r=t.format.locale.value.dev.noContainer;i.warning(s(r,'"'+t.container.value+'"'),"container")}else t.dev.value&&i.time("total draw time"),t.container.value.call(t.self);if("function"==typeof e&&t.history.chain.length){var l={};changes.forEach(function(e){var t=e.method;delete e.method,l[t]=e}),e(l),t.history.chain=[]}return e},update:!0,value:void 0}},{"../../core/console/print.coffee":52,"../../core/parse/element.js":95,"../../core/parse/hideElement.js":96,"../../string/format.js":172,"../../util/d3selection.coffee":207}],113:[function(e,t,r){t.exports={accepted:[!1,Number,String],deprecates:"highlight",process:function(e,t){var r,n,a,o,i,s,l,u,c,d;if(n=t.data.element.value,n&&["string","number"].indexOf(typeof e)>=0)if(a=n.node().tagName.toLowerCase(),o=n.attr("type"),"select"===a)for(d=n.selectAll("option"),i=s=0,u=d.length;u>s;i=++s)r=d[i],r&&r[t.id.value]===e&&(n.node().selectedIndex=i);else if("input"===a&&"radio"===o)for(l=0,c=n.length;c>l;l++)r=n[l],this.checked=r&&r[t.id.value]===e;return e},value:!1}},{}],114:[function(e,t,r){var n,a,o,i;o=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={align:n(),color:"#444444",decoration:a(),family:o(),secondary:{align:n(),color:"#444444",decoration:a(),family:o(),size:12,spacing:0,transform:i(),weight:200},size:12,spacing:0,transform:i(),weight:200}},{"../../core/methods/font/align.coffee":81,"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],115:[function(e,t,r){var n,a,o,i;n=e("../../number/format.coffee"),a=e("../../core/locale/locale.coffee"),o=e("../../object/merge.coffee"),i=e("../../string/title.coffee"),t.exports={accepted:[Function,String],affixes:{accepted:[Object],objectAccess:!1,value:{}},deprecates:["number_format","text_format"],locale:{accepted:function(){return d3.keys(a)},process:function(e){var t,r;return t="en_US",r=a[t],e!==t&&(r=o(r,a[e])),this.language=e,r},value:"en_US"},number:{accepted:[!1,Function],value:!1},process:function(e,t){if("string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},text:{accepted:[!1,Function],value:!1},value:function(e,t){var r,a,o;return t||(t={}),o=t.vars||{},o.time&&o.time.value&&t.key===o.time.value?(a=e.constructor===Date?e:new Date(e),o.data.time.format(a)):"number"==typeof e?(r=this.number.value||n)(e,t):"string"==typeof e?(r=this.text.value||i)(e,t):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":78,"../../number/format.coffee":169,"../../object/merge.coffee":170,"../../string/title.coffee":175}],116:[function(e,t,r){t.exports={accepted:[!1,Number],max:600,secondary:!1,value:!1}},{}],117:[function(e,t,r){t.exports={back:function(){return this.states.length?this.states.pop()():void 0},chain:[],reset:function(){var e;for(e=[];this.states.length;)e.push(this.states.pop()());return e},states:[]}},{}],118:[function(e,t,r){t.exports={accepted:[Boolean,Number,String],value:!1}},{}],119:[function(e,t,r){var n;n=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:n,rotate:0,value:"fa-angle-left"},button:{accepted:[!1,String],fallback:!1,opacity:1,process:n,rotate:0,value:!1},drop:{accepted:[!1,String],fallback:"❯",opacity:1,process:n,rotate:0,value:"fa-angle-down"},next:{accepted:[!1,String],fallback:"❯",opacity:1,process:n,rotate:0,value:"fa-angle-right"},select:{accepted:[!1,String],fallback:"✓",opacity:1,process:n,rotate:0,value:"fa-check"},style:{accepted:[Object,String],value:"default"},value:"icon"}},{"../../core/methods/process/icon.coffee":88}],120:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,mute:n(!0),nesting:["value"],solo:n(!0),value:"value"}},{"../../core/methods/filter.coffee":80}],121:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],mute:n(!0),solo:n(!0),value:"keywords"}},{"../../core/methods/filter.coffee":80}],122:[function(e,t,r){var n;n=e("../../core/methods/process/margin.coffee"),t.exports={accepted:[Number,Object,String],process:function(e){var t;return void 0===e&&(e=this.value),t=e,n(e,this),t},value:0}},{"../../core/methods/process/margin.coffee":89}],123:[function(e,t,r){t.exports={accepted:[Boolean],flipped:{accepted:[Boolean],value:!1},value:!1}},{}],124:[function(e,t,r){t.exports={accepted:[!1,Function,String],sort:{accepted:["asc","desc"],deprecates:["sort"],value:"asc"},value:!1}},{}],125:[function(e,t,r){t.exports={accepted:void 0,process:function(e,t){this.initialized&&t.container.value.remove()},value:void 0}},{}],126:[function(e,t,r){t.exports={accepted:["auto",Boolean],process:function(e){return"Boolean"==typeof e&&(this.enabled=e),e},term:"",value:"auto"}},{}],127:[function(e,t,r){t.exports={accepted:[String],chainable:!1,process:function(e,t){var r;return r=t.container.value,r&&e?r.select(e):e},value:void 0}},{}],128:[function(e,t,r){t.exports={accepted:[String],chainable:!1,process:function(e,t){var r;return r=t.container.value,r&&e?r.selectAll(e):e},value:void 0}},{}],129:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,String],nesting:!0,mute:n(!0),solo:n(!0),secondary:{accepted:[!1,String],nesting:!0,value:!1},value:!1}},{"../../core/methods/filter.coffee":80}],130:[function(e,t,r){t.exports={mouseevents:60,ui:200}},{}],131:[function(e,t,r){var n,a,o,i;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),i=e("../../core/methods/font/transform.coffee"),o=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:n(),family:a(),size:16,transform:i(),weight:400},link:!1,process:function(e,t){var r;return 0===t.container.id.indexOf("default")&&e&&(r=o(e).toLowerCase(),t.self.container({id:r})),e},value:!1}},{"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85,"../../string/strip.js":174}],132:[function(e,t,r){t.exports={accepted:function(e){return d3.keys(e.types)},value:"auto"}},{}],133:[function(e,t,r){var n,a,o,i,s;o=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/process/margin.coffee"),s=e("../../core/methods/font/transform.coffee"),t.exports={align:n("center"),border:1,color:{primary:{process:function(e,t){var r;return r=this.value,t.ui.color.secondary.value||(t.ui.color.secondary.value=d3.rgb(r).darker(.75).toString()),e},value:"#ffffff"},secondary:{value:!1}},display:{acceped:["block","inline-block"],value:"inline-block"},font:{align:n("center"),color:"#444",decoration:a(),family:o(),size:11,transform:s(),weight:200},margin:{process:function(e){var t;return void 0===e&&(e=this.value),t=e,i(e,this),t},value:5},padding:{process:function(e){var t;return void 0===e&&(e=this.value),t=e,i(e,this),t},value:5}}},{"../../core/methods/font/align.coffee":81,"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85,"../../core/methods/process/margin.coffee":89}],134:[function(e,t,r){t.exports={accepted:[!1,Number],secondary:!1,value:!1}},{}],135:[function(e,t,r){t.exports=function(e){var t=e.data.value.length;1===t?e.self.type("button").draw():5>t?e.self.type("toggle").draw():e.self.type("drop").draw()}},{}],136:[function(e,t,r){t.exports=function(t){var r,n,a,o,i,s,l,u;return s=e("../../../core/console/print.coffee"),a=e("./functions/color.coffee"),o=e("./functions/icons.js"),i=e("./functions/mouseevents.coffee"),l=e("./functions/style.js"),r=t.container.ui.selectAll("div.d3plus_node").data(t.data.viz,function(e){return e[t.id.value]}),t.dev.value&&s.time("enter"),r.enter().append("div").attr("class","d3plus_node").call(a,t).call(l,t).call(o,t).call(i,t),t.dev.value&&s.timeEnd("enter"),t.draw.update||t.draw.timing?(t.dev.value&&s.time("ordering"),r.order(),t.dev.value&&s.timeEnd("ordering"),u=r):(n=[t.focus.previous,t.focus.value,t.hover.previous,t.hover.value].filter(function(e){return e}),u=r.filter(function(e){return n.indexOf(e[t.id.value])>=0})),t.dev.value&&s.time("update"),u.classed("d3plus_button_active",function(e){return t.focus.value===e[t.id.value]}),t.draw.timing?u.transition().duration(t.draw.timing).call(a,t).call(l,t):u.call(a,t).call(l,t),u.call(o,t).call(i,t),t.dev.value&&s.timeEnd("update"),r.exit().remove()}},{"../../../core/console/print.coffee":52,"./functions/color.coffee":137,"./functions/icons.js":138,"./functions/mouseevents.coffee":139,"./functions/style.js":140}],137:[function(e,t,r){t.exports=function(t,r){var n,a,o;return n=e("../../../../color/legible.coffee"),a=e("../../../../color/lighter.coffee"),o=e("../../../../color/text.coffee"),t.style("background-color",function(e){var t;return t=r.focus.value===e[r.id.value]?r.ui.color.secondary.value:r.ui.color.primary.value,r.hover.value===e[r.id.value]&&(t=d3.rgb(t).darker(.15).toString()),t}).style("color",function(e){var t,a,i,s;return s=r.focus.value===e[r.id.value]?.75:1,i=e[r.icon.value]&&r.data.viz.length<r.data.large,!i&&e[r.color.value]?a=n(e[r.color.value]):(t=r.focus.value===e[r.id.value]?r.ui.color.secondary.value:r.ui.color.primary.value,r.hover.value===e[r.id.value]&&(t=d3.rgb(t).darker(.15).toString()),a=o(t)),a=d3.rgb(a),"rgba("+a.r+","+a.g+","+a.b+","+s+")"}).style("border-color",r.ui.color.secondary.value)}},{"../../../../color/legible.coffee":44,"../../../../color/lighter.coffee":45,"../../../../color/text.coffee":50}],138:[function(e,t,r){var n=e("../../../../client/prefix.coffee"),a=e("../../../../client/rtl.coffee");t.exports=function(e,t){var r="right"===t.font.align.value&&!a||a&&"right"===t.font.align.value;e.each(function(e,o){var i=["label"];e[t.icon.value]&&t.data.viz.length<=t.data.large&&i.push("icon");var s=t.icon.button.value;e[t.id.value]===t.focus.value&&t.icon.select.value?(s=t.icon.select.value,i.push("selected")):s&&e.d3plus.icon!==!1&&i.push("selected");var l=0,u=d3.select(this).selectAll("div.d3plus_button_element").data(i,function(e){return e});u.enter().append("div").style("display",function(e){return"label"===e?"block":"absolute"}),u.order().attr("class",function(e){var t="";return"selected"===e&&0===s.indexOf("fa-")&&(t=" fa "+s),"d3plus_button_element d3plus_button_"+e+t}).html(function(r){if("label"===r){var n=t.text.value&&t.text.value in e&&!(e[t.text.value]instanceof Array)?t.text.value:t.id.value;return t.format.value(e[n])}return"selected"===r&&s.indexOf("fa-")<0?s:""}).style("background-image",function(r){return"icon"===r?"url('"+e[t.icon.value]+"')":"none"}).style("background-color",function(r){return"icon"===r&&"knockout"===e.style?e[t.color.value]||t.ui.color.primary.value:"transparent"}).style("background-size","100%").style("text-align",function(e){return"label"===e?t.font.align.value:"center"}).style("position",function(e){return"label"==e?"static":"absolute"}).style("width",function(e){return"label"===e?"auto":(l=t.height.value?t.height.value-(t.ui.padding.top+t.ui.padding.bottom)-2*t.ui.border:t.font.size+t.ui.border,l+"px")}).style("height",function(e){return"icon"===e?l+"px":"auto"}).style("margin-top",function(e){if("label"===e)return"0px";if(this.offsetHeight||this.getBoundingClientRect().height)var r=this.offsetHeight||this.getBoundingClientRect().height;else if("selected"===e)var r=t.font.size;else var r=l;return-r/2+"px"}).style("top",function(e){return"label"===e?"auto":"50%"}).style("left",function(e){return"icon"===e&&!r||"selected"===e&&r?t.ui.padding.left+"px":"auto"}).style("right",function(e){return"icon"===e&&r||"selected"===e&&!r?t.ui.padding.right+"px":"auto"}).style(n()+"transition",function(e){return"selected"===e?t.draw.timing/1e3+"s":"none"}).style(n()+"transform",function(e){var r="selected"===e?t.icon.select.rotate:"none";return"string"==typeof r?r:"rotate("+r+"deg)"}).style("opacity",function(e){return"selected"===e?t.icon.select.opacity:1}),u.exit().remove();var c=d3.select(this).selectAll(".d3plus_button_label");if(l>0){var d=t.ui.padding;d=3===i.length?d.top+"px "+(2*d.right+l)+"px "+d.bottom+"px "+(2*d.left+l)+"px":i.indexOf("icon")>=0&&!a||i.indexOf("selected")>=0&&a?d.top+"px "+d.right+"px "+d.bottom+"px "+(2*d.left+l)+"px":d.top+"px "+(2*d.right+l)+"px "+d.bottom+"px "+d.left+"px",c.style("padding",d)}else c.style("padding",t.ui.padding.css);if("number"==typeof t.width.value){var f=t.width.value;f-=parseFloat(c.style("padding-left"),10),f-=parseFloat(c.style("padding-right"),10),f-=2*t.ui.border,f+="px"}else var f="auto";c.style("width",f)})}},{"../../../../client/prefix.coffee":39,"../../../../client/rtl.coffee":40}],139:[function(e,t,r){t.exports=function(t,r,n){var a,o;return n=e("./color.coffee"),a=e("../../../../client/pointer.coffee"),o=e("../../../../client/ie.js"),t.on(a.over,function(e,t){return r.self.hover(e[r.id.value]),o||!r.draw.timing?d3.select(this).style("cursor","pointer").call(n,r):d3.select(this).style("cursor","pointer").transition().duration(r.timing.mouseevents).call(n,r)}).on(a.out,function(e){return r.self.hover(!1),o||!r.draw.timing?d3.select(this).style("cursor","auto").call(n,r):d3.select(this).style("cursor","auto").transition().duration(r.timing.mouseevents).call(n,r)}).on(a.click,function(e){return r.focus.value!==!1?r.self.focus(e[r.id.value]).draw():r.focus.callback?r.focus.callback(e,r.self):void 0})}},{"../../../../client/ie.js":37,"../../../../client/pointer.coffee":38,"./color.coffee":137}],140:[function(e,t,r){t.exports=function(e,t){e.style("position","relative").style("margin",t.ui.margin.css).style("display",t.ui.display.value).style("border-style","solid").style("border-width",t.ui.border+"px").style("font-family",t.font.family.value).style("font-size",t.font.size+"px").style("font-weight",t.font.weight).style("letter-spacing",t.font.spacing+"px")}},{}],141:[function(e,t,r){t.exports=function(t){var r,n,a,o,i,s,l,u,c,d,f;return a=e("./functions/element.coffee"),o=e("./functions/keyboard.coffee"),f=e("./functions/window.js"),d=e("./functions/width.js"),r=e("./functions/button.js"),l=e("./functions/selector.js"),u=e("./functions/title.js"),s=e("./functions/search.js"),i=e("./functions/list.js"),n=e("./functions/data.js"),c=e("./functions/update.js"),t.margin.top=0,t.margin.title=0,a(t),o(t),f(t),d(t),r(t),l(t),u(t),s(t),i(t),n(t),c(t)}},{"./functions/button.js":144,"./functions/data.js":145,"./functions/element.coffee":146,"./functions/keyboard.coffee":149,"./functions/list.js":150,"./functions/search.js":152,"./functions/selector.js":153,"./functions/title.js":154,"./functions/update.js":155,"./functions/width.js":156,"./functions/window.js":157}],142:[function(e,t,r){t.exports=function(e,t,r){var n=[],r=r||e.active.value;if(r instanceof Array)for(var a=0;a<r.length;a++)n.push(this(e,t,r[a]));else{var o=typeof r;"number"===o?n.push(e.depth.value===r):"function"===o?n.push(r(t)):n.push(t===r)}return n.indexOf(!0)>=0}},{}],143:[function(e,t,r){var n=e("../../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&n.time("rotating arrow");var t="❯"===e.icon.drop.value?90:0;if(e.open.value!=e.open.flipped.value)var r=180+t;else var r=t;e.container.button.icon({select:{opacity:e.open.value?.5:1,rotate:r}}).draw(),e.dev.value&&n.timeEnd("rotating arrow")}},{"../../../../core/console/print.coffee":52}],144:[function(e,t,r){var n=e("../../../../util/copy.coffee"),a=e("../../../../client/pointer.coffee"),o=e("../../../form.js"),i=e("../../../../core/console/print.coffee");t.exports=function(e){if("button"in e.container||(e.dev.value&&i.time("creating main button"),e.container.button=o().container(e.container.ui).type("button").ui({margin:0}),e.dev.value&&i.timeEnd("creating main button")),e.focus.changed||e.data.changed||e.depth.changed){var t=e.depth.value,r=n(e.data.value.filter(function(r){for(var n=!1,a=0;a<e.id.nesting.length;a++){var o=e.id.nesting[a];if(n=o in r&&r[o]===e.focus.value){t=a;break}}return n})[0]);r||(r=e.container.button.data()[0]||e.data.viz[0]),e.container.button.data([r]).id(e.id.nesting).depth(t)}var s=e.hover.value===!0?e.focus.value:!1;e.container.button.draw({update:e.draw.update}).focus("").font(e.font).format(e.format).hover(s).icon({button:e.icon.drop.value,select:e.icon.drop.value,value:e.icon.value}).text(e.text.value).timing({ui:e.draw.timing}).ui({border:e.ui.border,color:e.ui.color,padding:e.ui.padding.css}).width(e.width.value).draw();var l=e.container.button.container(Object).ui;e.margin.top+=l.node().offsetHeight||l.node().getBoundingClientRect().height,l.on(a.click,function(){e.self.open(!e.open.value).draw()})}},{"../../../../client/pointer.coffee":38,"../../../../core/console/print.coffee":52,"../../../../util/copy.coffee":206,"../../../form.js":103}],145:[function(e,t,r){var n=e("../../../../string/format.js"),a=e("../../../../string/strip.js");t.exports=function(e){if(e.data.url&&!e.data.loaded){var t={};t[e.text.value||e.id.value]=e.format.value(e.format.locale.value.ui.loading),e.data.filtered=[t],e.data.changed="loading"!==e.data.lastFilter,e.data.lastFilter="loading"}else if(e.open.value)if(e.search.term){var r=a(e.search.term).split("_"),o=[e.id.value,e.text.value,e.alt.value,e.keywords.value];o=o.filter(function(e){return e}),r=r.filter(function(e){return""!==e});var i=[],s=[],l=[],u=[];if(e.id.nesting.forEach(function(t){u=u.concat(e.data.nested.all[t])}),u.forEach(function(t){var n=!1;o.forEach(function(o){if(!n&&o in t&&"string"==typeof t[o]){var u=t[o].toLowerCase();if([e.text.value,e.id.value].indexOf(o)>=0&&0===u.indexOf(e.search.term))i.push(t),n=!0;else if(u.indexOf(e.search.term)>=0)s.push(t),n=!0;else{var c=a(u).split("_");for(var d in c){if(n)break;for(var f in r)if(0===c[d].indexOf(r[f])){l.push(t),n=!0;break}}}}})}),e.data.filtered=d3.merge([i,s,l]),e.data.filtered.forEach(function(e,t){e.d3plus_order=t}),e.data.changed=!0,e.data.lastFilter="search",0===e.data.filtered.length){var c={},d=e.format.value(e.format.locale.value.ui.noResults);c[e.text.value||e.id.value]=n(d,'"'+e.search.term+'"'),e.data.filtered=[c]}}else e.data.filtered=e.data.viz,e.data.changed="viz"!==e.data.lastFilter,e.data.lastFilter="viz",e.id.nesting.length>1&&e.depth.value<e.id.nesting.length-1&&(e.data.filtered=e.data.filtered.filter(function(t){return"endPoint"in t.d3plus&&t.d3plus.endPoint===e.depth.value&&(t.d3plus.icon=!1),!0}),e.data.changed="depth"!==e.data.lastFilter,e.data.lastFilter="depth");else e.data.filtered=[]}},{"../../../../string/format.js":172,"../../../../string/strip.js":174}],146:[function(e,t,r){t.exports=function(e){return e.data.element.value?(e.data.element.value.on("focus."+e.container.id,function(){return e.self.hover(!0).draw()}),e.data.element.value.on("blur."+e.container.id,function(){var t;return t=e.search.enabled?d3.event.relatedTarget!==e.container.value.select("input").node():!0,t?e.self.open(!1).hover(!1).draw():void 0}),e.data.element.value.on("change."+e.container.id,function(){return e.self.focus(this.value).draw()}),e.data.element.value.on("keydown.cancel_"+e.container.id,function(){return 9!==d3.event.keyCode?d3.event.preventDefault():void 0})):void 0}},{}],147:[function(e,t,r){t.exports=function(e){var t=e.height.secondary,r=e.container.button.container().node().getBoundingClientRect(),n=window.innerHeight-r.bottom-2*e.ui.border-e.ui.margin.top-e.ui.margin.bottom-e.ui.padding.top-e.ui.padding.bottom;n<3*r.height&&(n=r.top-10,e.self.open({flipped:!0})),"number"!=typeof t&&(t=n),t>e.height.max&&(t=e.height.max),e.self.height({secondary:t})}},{}],148:[function(e,t,r){var n,a,o,i;n=e("./active.js"),a=e("../../../../util/copy.coffee"),o=e("../../../form.js"),i=e("../../../../core/console/print.coffee"),t.exports=function(e){var t,r,s;e.open.value&&(e.dev.value&&i.time("updating list items"),"items"in e.container||(e.container.items=o().container(e.container.list).type("button").ui({border:0,display:"block",margin:0}).width(!1)),r=e.draw.timing?e.data.large:1,s=a(e.order),s.value=e.search.term.length?"d3plus_order":e.order.value,t=e.depth.value===e.id.nesting.length-1,(e.focus.changed||e.container.items.focus()===!1)&&e.container.items.focus(e.focus.value,function(t){var r,a,o,i;a=e.data.filtered.filter(function(r){return r[e.id.value]===t})[0],e.depth.value<e.id.nesting.length-1&&e.id.nesting[e.depth.value+1]in a?(o=e.depth.value,i=e.id.solo.value,e.history.states.push(function(){return e.self.depth(o).id({solo:i}).draw()}),e.self.depth(e.depth.value+1).id({solo:[t]}).draw()):(e.depth.changed||e.self.open(!1),r=t!==e.focus.value,r&&e.active.value&&(r=n(e,t)),r&&e.self.focus(t).draw())}),e.container.items.active(e.active.value).data({large:r,sort:e.data.sort.value,value:e.data.filtered}).draw({update:e.draw.update}).font(e.font.secondary).format(e.format).hover(e.hover.value).id(e.id.value).icon({button:t?!1:e.icon.next,select:t?e.icon.select:!1,value:e.icon.value}).order(s).text(e.text.secondary.value||e.text.value).timing({ui:e.draw.timing}).ui({color:{primary:1===e.id.nesting.length?e.ui.color.primary.value:e.ui.color.secondary.value,secondary:e.ui.color.secondary.value},padding:e.ui.padding.css}).draw(),e.dev.value&&i.timeEnd("updating list items"))}},{"../../../../core/console/print.coffee":52,"../../../../util/copy.coffee":206,"../../../form.js":103,"./active.js":142}],149:[function(e,t,r){t.exports=function(e){return d3.select(window).on("keydown."+e.container.id,function(){var t,r,n,a,o,i,s,l,u,c,d,f,p;if(u=d3.event.keyCode,e.open.value||e.hover.value===!0){for(d=e.hover.value===!0?"focus":"hover",s=!1,f=e.data.filtered,i=l=0,c=f.length;c>l;i=++l)if(t=f[i],t[e.id.value]===e[d].value){s=i;break}if(9===u&&e.open.value&&(!e.search.enabled||e.search.enabled&&!d3.event.shiftKey))return e.self.open(!1).hover(!1).draw();if([38,40].indexOf(u)>=0)return s===!1?s=0:38===u?e.open.value&&(0>=s?s=e.data.filtered.length-1:s-=1):40===u&&e.open.value&&(s>=e.data.filtered.length-1?s=0:s+=1),o="boolean"!=typeof e.hover.value?e.data.filtered[s][e.id.value]:e.focus.value,e.self.hover(o).open(!0).draw();if(13===u)return"boolean"!=typeof e.hover.value?(r=e.data.filtered.filter(function(t){return t[e.id.value]===e.hover.value})[0],n=e.depth.value,n<e.id.nesting.length-1&&e.id.nesting[n+1]in r?(p=e.id.solo.value,a=function(){return e.self.depth(n).id({solo:p}).draw()},e.history.states.push(a),e.self.depth(e.depth.value+1).id({solo:[e.hover.value]}).draw()):e.self.focus(e.hover.value).hover(!0).draw()):e.self.hover(e.focus.value).open(!0).draw();if(27===u){if(e.open.value)return e.self.open(!1).hover(!0).draw();if(e.hover.value===!0)return e.self.hover(!1).draw()}}})}},{}],150:[function(e,t,r){var n=e("../../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&n.time("populating list"),e.container.list=e.container.selector.selectAll("div.d3plus_drop_list").data(["list"]),e.container.list.enter().append("div").attr("class","d3plus_drop_list").attr("id","d3plus_drop_list_"+e.container.id).style("overflow-y","auto").style("overflow-x","hidden"),e.dev.value&&n.timeEnd("populating list")}},{"../../../../core/console/print.coffee":52}],151:[function(e,t,r){var n=e("../../../../core/console/print.coffee");t.exports=function(e){if(e.open.value){e.dev.value&&n.time("calculating height");var t=!1;if("none"==e.container.selector.style("display"))var t=!0;t&&e.container.selector.style("display","block");var r=e.container.selector.style("height"),a=e.container.selector.property("scrollTop"),o=e.container.list.style("max-height"),i=e.container.list.property("scrollTop");e.container.selector.style("height","auto"),e.container.list.style("max-height","200000px"),e.container.listHeight=parseFloat(e.container.selector.style("height"),10),e.container.list.style("max-height",o).property("scrollTop",i),e.container.selector.style("height",r).property("scrollTop",a);var s=!1;if(e.container.listHeight>e.height.secondary&&(e.container.listHeight=e.height.secondary,s=!0),t&&e.container.selector.style("display","none"),e.dev.value&&n.timeEnd("calculating height"),s){e.dev.value&&n.time("calculating scroll position");var l=e.container.list.select("div").selectAll("div.d3plus_node"),u=l[0][0],c="boolean"!=typeof e.hover.value?e.hover.value:e.focus.value;l.each(function(t,r){t[e.id.value]===c&&(u=this)});var t=!1;"none"===e.container.selector.style("display")&&(t=!0,e.container.selector.style("display","block"));var d=u.offsetTop,f=u.offsetHeight||u.getBoundingClientRect().height,p=e.container.list.property("scrollTop");t&&e.container.selector.style("display","none"),t||e.data.changed||e.depth.changed?e.container.listScroll=d:(e.container.listScroll=p,p>d?e.container.listScroll=d:d+f>p+e.height.secondary-e.search.height&&(e.container.listScroll=d-(e.height.secondary-f-e.search.height))),e.dev.value&&n.timeEnd("calculating scroll position")}else e.container.listScroll=0}else e.container.listScroll=e.container.list.property("scrollTop"),e.container.listHeight=0}},{"../../../../core/console/print.coffee":52}],152:[function(e,t,r){var n=e("../../../../client/prefix.coffee"),a=e("../../../../core/console/print.coffee");t.exports=function(t){function r(e){e.style("padding",t.ui.padding.css).style("display","block").style("background-color",d3.rgb(t.ui.color.primary.value).darker(.15).toString())}function o(e){var r=t.width.secondary-2*t.ui.padding.left-2*t.ui.padding.right+2*t.ui.border;e.style("padding",t.ui.padding.left/2+t.ui.padding.right/2+"px").style("width",r+"px").style("border-width","0px").style("font-family",t.font.secondary.family.value).style("font-size",t.font.secondary.size+"px").style("font-weight",t.font.secondary.weight).style("text-align",t.font.secondary.align).style("outline","none").style(n()+"border-radius","0").attr("placeholder",t.format.value(t.format.locale.value.method.search))}t.dev.value&&a.time("creating search");var i=e("./data.js"),s=e("./items.coffee"),l=e("./update.js");t.container.search=t.container.selector.selectAll("div.d3plus_drop_search").data(t.search.enabled?["search"]:[]),t.draw.timing?(t.container.search.transition().duration(t.draw.timing).call(r),t.container.search.select("input").transition().duration(t.draw.timing).call(o)):(t.container.search.call(r),t.container.search.select("input").call(o)),t.container.search.enter().insert("div","#d3plus_drop_list_"+t.container.id).attr("class","d3plus_drop_search").attr("id","d3plus_drop_search_"+t.container.id).call(r).append("input").attr("id","d3plus_drop_input_"+t.container.id).style("-webkit-appearance","none").call(o),t.container.search.select("input").on("keyup."+t.container.id,function(e){var r=this.value;t.search.term!==r&&(t.search.term=r,i(t),s(t),l(t))}),t.container.search.exit().remove();var u=t.container.selector.style("display");t.container.selector.style("display","block"),t.search.height=t.search.enabled?t.container.search.node().offsetHeight||t.container.search.node().getBoundingClientRect().height:0,t.container.selector.style("display",u),t.search.enabled&&(t.margin.title+=t.search.height),t.dev.value&&a.timeEnd("creating search")}},{"../../../../client/prefix.coffee":39,"../../../../core/console/print.coffee":52,"./data.js":145,"./items.coffee":148,"./update.js":155}],153:[function(e,t,r){t.exports=function(e){e.container.selector=e.container.ui.selectAll("div.d3plus_drop_selector").data(["selector"]),e.container.selector.enter().append("div").attr("class","d3plus_drop_selector").style("position","absolute").style("top","0px").style("z-index","-1").style("overflow","hidden"),e.container.selector.style("padding",e.ui.border+"px")}},{}],154:[function(e,t,r){var n=e("../../../../client/pointer.coffee"),a=e("../../../../color/lighter.coffee"),o=e("../../../../core/console/print.coffee"),i=e("../../../../color/text.coffee");t.exports=function(e){function t(t){t.style("padding",e.ui.padding.css).style("display","block").style("background-color",e.ui.color.secondary.value).style("font-family",e.font.secondary.family.value).style("font-size",e.font.secondary.size+"px").style("font-weight",e.font.secondary.weight).style("text-align",e.font.secondary.align).style("color",i(e.ui.color.secondary.value))}function r(t){if(!t.empty()){var r=0===e.icon.back.value.indexOf("fa-")?" fa "+e.icon.back.value:"";r="d3plus_drop_back"+r;var n=0===e.icon.back.value.indexOf("fa-")?"":e.icon.back.value;t.style("position","absolute").attr("class",r).style("top",e.ui.padding.top+e.font.secondary.size/2/2.5+"px").html(n)}}function s(t){var r=u?e.focus.value:e.format.locale.value.ui.back;t.text(e.format.value(r)).style("padding","0px "+(e.ui.padding.left+e.ui.padding.right)+"px")}if(e.open.value){e.dev.value&&o.time("creating title and back button");var l=1===e.id.solo.value.length&&e.depth.value>0,u=l,c=e.container.button.data(Object).viz[0];u=!0;for(var d=0;d<e.id.nesting.length;d++){var f=e.id.nesting[d];if(f in c&&c[f]===e.focus.value){u=!1;break}}e.container.title=e.container.selector.selectAll("div.d3plus_drop_title").data(l?["title"]:[]),e.draw.timing?(e.container.title.transition().duration(e.draw.timing).call(t),e.container.title.select("div.d3plus_drop_title_text").transition().duration(e.draw.timing).call(s)):(e.container.title.call(t),e.container.title.select("div.d3plus_drop_title_text").call(s)),e.container.title.select("span.d3plus_drop_back").call(r);var p=e.container.title.enter().insert("div","#d3plus_drop_list_"+e.container.id).attr("class","d3plus_drop_title").attr("id","d3plus_drop_title_"+e.container.id).call(t);p.append("span").attr("id","d3plus_drop_back_"+e.container.id).attr("class","d3plus_drop_back").call(r),p.append("div").attr("id","d3plus_drop_title_text_"+e.container.id).attr("class","d3plus_drop_title_text").call(s),e.container.title.on(n.over,function(t,r){var n=a(e.ui.color.secondary.value);d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).style("background-color",n).style("color",i(n))}).on(n.out,function(t){var r=e.ui.color.secondary.value;d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("background-color",r).style("color",i(r))}).on(n.click,function(t){e.history.back()}),e.container.title.exit().remove(),l&&(e.margin.title+=e.container.title.node().offsetHeight||e.container.title.node().getBoundingClientRect().height),
e.dev.value&&o.timeEnd("creating title and back button")}}},{"../../../../client/pointer.coffee":38,"../../../../color/lighter.coffee":45,"../../../../color/text.coffee":50,"../../../../core/console/print.coffee":52}],155:[function(e,t,r){var n=e("./items.coffee"),a=e("./height.js"),o=e("../../../../core/console/print.coffee"),i=e("./scroll.js"),s=e("./arrow.js");t.exports=function(e){function t(t){var r=e.open.flipped.value;t.style("top",function(){return r?"auto":e.margin.top-e.ui.border+"px"}).style("bottom",function(){return r?e.margin.top+e.ui.border+"px":"auto"})}function r(r){r.style("left",function(){return"left"===e.font.align.value?e.margin.left+"px":"center"===e.font.align.value?e.margin.left-(e.width.secondary-e.width.value)/2+"px":"auto"}).style("right",function(){return"right"===e.font.align.value?"0px":"auto"}).style("height",e.container.listHeight+"px").style("padding",e.ui.border+"px").style("background-color",e.ui.color.secondary.value).style("z-index",function(){return e.open.value?"9999":"-1"}).style("width",e.width.secondary-2*e.ui.border+"px").style("opacity",e.open.value?1:0).call(t)}function l(r){r.style("display",e.open.value?null:"none").call(t),e.search.enabled&&e.open.value&&e.container.selector.select("div.d3plus_drop_search input").node().focus()}function u(e){return function(){var t=d3.interpolateNumber(this.scrollTop,e);return function(e){this.scrollTop=t(e)}}}e.draw.timing?e.container.ui.transition().duration(e.draw.timing).each("start",function(){e.open.value&&d3.select(this).style("z-index",9999)}).style("margin",e.ui.margin.css).each("end",function(){e.open.value||d3.select(this).style("z-index","auto")}):e.container.ui.style("margin",e.ui.margin.css).style("z-index",function(){return e.open.value?9999:"auto"}),n(e),a(e),i(e),s(e),e.dev.value&&o.time("drawing list");var c=e.open.value?e.height.secondary-e.margin.title:0;e.draw.timing?(e.container.selector.transition().duration(e.draw.timing).each("start",function(){d3.select(this).style("display",e.open.value?"block":null)}).call(r).each("end",function(){d3.select(this).transition().duration(e.draw.timing).call(l)}),e.container.list.transition().duration(e.draw.timing).style("width",e.width.secondary-2*e.ui.border+"px").style("max-height",c+"px").tween("scroll",u(e.container.listScroll))):(e.container.selector.call(r).call(l),e.container.list.style("width",e.width.secondary-2*e.ui.border+"px").style("max-height",c+"px").property("scrollTop",e.container.listScroll)),e.dev.value&&o.timeEnd("drawing list")}},{"../../../../core/console/print.coffee":52,"./arrow.js":143,"./height.js":147,"./items.coffee":148,"./scroll.js":151}],156:[function(e,t,r){var n=e("../../../../util/copy.coffee"),a=e("../../../../core/font/tester.coffee"),o=e("../../../form.js"),i=e("../../../../core/console/print.coffee"),s=e("../../../../object/validate.coffee");t.exports=function(e){function t(t){var n="primary"===t?"value":t,s="value"===n?e.icon.drop.value:e.icon.select.value||e.icon.drop.value,l="value"===n?e.text.value:e.text.secondary.value||e.text.value,u="value"===n?e.font:e.font.secondary;e.dev.value&&i.time("calculating "+t+" width");var c=o().container(a()).data({large:9999,value:r}).draw({update:!1}).font(u).format(e.format).icon({button:s,value:e.icon.value}).id(e.id.value).timing({ui:0}).text(l||e.id.value).type("button").ui({border:"primary"===t?e.ui.border:0,display:"inline-block",margin:0,padding:e.ui.padding.css}).width(!1).draw(),d=[];c.selectAll("div.d3plus_node").each(function(e){d.push(this.offsetWidth+1)}).remove();var f={};f[n]=d3.max(d),e.self.width(f),e.dev.value&&i.timeEnd("calculating "+t+" width")}var r=[];for(var l in e.data.nested.all){var u=e.data.nested.all[l],c=s(e.text.nesting)&&l in e.text.nesting?e.text.nesting[l][0]:l;[e.id.value,e.text.value].indexOf(c)<0&&(u=n(u),u.forEach(function(t){t[e.text.value||e.id.value]=t[c]})),r=r.concat(u)}"number"!=typeof e.width.value&&t("primary"),"number"!=typeof e.width.secondary&&(e.text.secondary.value&&e.text.value!==e.text.secondary.value?t("secondary"):e.self.width({secondary:e.width.value}))}},{"../../../../core/console/print.coffee":52,"../../../../core/font/tester.coffee":68,"../../../../object/validate.coffee":171,"../../../../util/copy.coffee":206,"../../../form.js":103}],157:[function(e,t,r){var n=e("../../../../util/child.coffee"),a=function(e,t){if(void 0===t)var t=window;d3.select(t).on("click."+e.container.id,function(){var t=d3.event.target||d3.event.toElement,r=t.parentNode;r&&["d3plus_node","d3plus_drop_title"].indexOf(r.className)>=0&&(t=r.parentNode),t&&r&&!n(e.container.ui,t)&&(e.open.value||e.hover.value)&&e.self.open(!1).hover(!1).draw()});try{var r=window.parent.location.host===window.location.host}catch(o){var r=!1}r&&t.self!==window.top&&a(e,t.parent)};t.exports=a},{"../../../../util/child.coffee":204}],158:[function(e,t,r){var n=e("../form.js");t.exports=function(e){"buttons"in e.container||(e.container.buttons=n().container(e.container.ui).type("button"));var t=e.data.viz.length,r=e.width.value?e.width.value/t:!1,a=e.container.ui.selectAll("div.d3plus_toggle").data(e.data.viz,function(t){return t[e.id.value]});a.exit().remove(),a.enter().append("div").attr("class","d3plus_toggle").style("display","inline-block").style("vertical-align","top"),a.order().each(function(t){"form"in t.d3plus||(t.d3plus.form=n().container(d3.select(this)));var a=e.id.nesting.length>e.depth.value?e.id.nesting[e.depth.value+1]:e.id.value;t[a]instanceof Array?t.d3plus.form.container({id:e.container.id+"_"+t[e.id.value]}).data(t[a]).id(e.id.nesting.slice(1)).type("drop"):t.d3plus.form.data([t]).id(e.id.value).type("button"),t.d3plus.form.color(e.color).focus(e.focus.value,function(t){t!==e.focus.value&&e.self.focus(t).draw()}).hover(e.hover.value).icon({select:!1,value:e.icon.value}).font(e.font).format(e.format).order(e.order).text(e.text.value).ui({border:e.ui.border,color:e.ui.color,display:"inline-block",margin:0,padding:e.ui.padding.css}).width(r).draw()}),e.data.element.value&&e.data.element.value.on("focus."+e.container.id,function(){e.self.focus(this.value).hover(this.value).draw()}).on("blur."+e.container.id,function(){e.self.hover(!1).draw()})}},{"../form.js":103}],159:[function(e,t,r){var n,a,o,i,s,l,u,c,d,f,p;f=e("simplify-js"),t.exports=function(e,t){var r,a,i,l,u,d,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H,X,G,W,Q,J,K,Z,$,ee,te,re,ne,ae,oe,ie,se,le,ue,ce,de,fe,pe,he,ve,ge,me,ye,xe,be;if(e.length<3)return null;if(w=[],v=.5,u=5,null==t&&(t={}),null==t.maxAspectRatio&&(t.maxAspectRatio=15),null==t.minWidth&&(t.minWidth=0),null==t.minHeight&&(t.minHeight=0),null==t.tolerance&&(t.tolerance=.02),null==t.nTries&&(t.nTries=20),null!=t.angle&&(t.angle instanceof Array?d=t.angle:"number"==typeof t.angle?d=[t.angle]:"string"!=typeof t.angle||isNaN(t.angle)||(d=[Number(t.angle)])),null==d&&(d=d3.range(-90,90+u,u)),null!=t.aspectRatio&&(t.aspectRatio instanceof Array?g=t.aspectRatio:"number"==typeof t.aspectRatio?g=[t.aspectRatio]:"string"!=typeof t.aspectRatio||isNaN(t.aspectRatio)||(g=[Number(t.aspectRatio)])),null!=t.origin&&t.origin instanceof Array&&(Q=t.origin[0]instanceof Array?t.origin:[t.origin]),h=Math.abs(d3.geom.polygon(e).area()),0===h)return null;if(re=d3.extent(e,function(e){return e[0]}),Y=re[0],V=re[1],ne=d3.extent(e,function(e){return e[1]}),H=ne[0],R=ne[1],ge=Math.min(V-Y,R-H)*t.tolerance,ve=function(){var t,r,n;for(n=[],t=0,r=e.length;r>t;t++)J=e[t],n.push({x:J[0],y:J[1]});return n}(),ge>0&&(ve=f(ve,ge),e=function(){var e,t,r;for(r=[],e=0,t=ve.length;t>e;e++)J=ve[e],r.push([J.x,J.y]);return r}()),t.vdebug&&w.push({type:"simplify",poly:e}),ae=d3.extent(e,function(e){return e[0]}),Y=ae[0],V=ae[1],oe=d3.extent(e,function(e){return e[1]}),H=oe[0],R=oe[1],m=[[Y,H],[V,H],[V,R],[Y,R]],ie=[V-Y,R-H],x=ie[0],y=ie[1],ye=Math.min(x,y)/50,null==Q)for(Q=[],b=d3.geom.polygon(e).centroid(),o(b,e)&&Q.push(b);Q.length<t.nTries;)pe=Math.random()*x+Y,he=Math.random()*y+H,fe=[pe,he],o(fe,e)&&Q.push(fe);for(t.vdebug&&w.push({type:"origins",points:Q}),B=0,I=null,A=0,E=d.length;E>A;A++)for(i=d[A],l=-i*Math.PI/180,t.vdebug&&w.push({type:"angle",angle:i}),k=j=0,F=Q.length;F>j;k=++j)for(G=Q[k],se=n(e,G,l),Z=se[0],ee=se[1],le=n(e,G,l+Math.PI/2),K=le[0],$=le[1],X=[],null!=Z&&null!=ee&&X.push([(Z[0]+ee[0])/2,(Z[1]+ee[1])/2]),null!=K&&null!=$&&X.push([(K[0]+$[0])/2,(K[1]+$[1])/2]),t.vdebug&&w.push({type:"modifOrigin",idx:k,p1W:Z,p2W:ee,p1H:K,p2H:$,modifOrigins:X}),M=0,S=X.length;S>M;M++)if(W=X[M],t.vdebug&&w.push({type:"origin",cx:W[0],cy:W[1]}),ue=n(e,W,l),Z=ue[0],ee=ue[1],null!==Z&&null!==ee&&(L=Math.min(p(W,Z),p(W,ee)),q=2*Math.sqrt(L),ce=n(e,W,l+Math.PI/2),K=ce[0],$=ce[1],null!==K&&null!==$&&(U=Math.min(p(W,K),p(W,$)),P=2*Math.sqrt(U),!(B>q*P))))for(null!=g?a=g:(D=Math.max(1,t.minWidth/P,B/(P*P)),N=Math.min(t.maxAspectRatio,q/t.minHeight,q*q/B),a=d3.range(D,N+v,v)),C=0,T=a.length;T>C;C++)if(r=a[C],O=Math.max(t.minWidth,Math.sqrt(B*r)),de=Math.min(q,P*r),!(B>de*P))for(de-O>=ye&&t.vdebug&&w.push({type:"aRatio",aRatio:r});de-O>=ye;)me=(O+de)/2,_=me/r,xe=W[0],be=W[1],te=[[xe-me/2,be-_/2],[xe+me/2,be-_/2],[xe+me/2,be+_/2],[xe-me/2,be+_/2]],te=c(te,l,W),s(te,e)?(z=!0,B=me*_,I={cx:xe,cy:be,width:me,height:_,angle:i},O=me):(z=!1,de=me),t.vdebug&&w.push({type:"rectangle",cx:xe,cy:be,width:me,height:_,areaFraction:me*_/h,angle:i,insidePoly:z});return[I,B,w]},p=function(e,t){var r,n;return r=t[0]-e[0],n=t[1]-e[1],r*r+n*n},l=function(e,t,r){var n,a,o,i,s;return s=t[1]<r[1]?[t,r]:[r,t],n=s[0],a=s[1],(e[1]===a[1]||e[1]===n[1])&&(e[1]+=Number.MIN_VALUE),e[1]>a[1]||e[1]<n[1]?!1:e[0]>n[0]&&e[0]>a[0]?!1:e[0]<n[0]&&e[0]<a[0]?!0:(o=(a[1]-n[1])/(a[0]-n[0]),i=(e[1]-n[1])/(e[0]-n[0]),i>o)},o=function(e,t){var r,n,a,o,i;for(o=-1,i=t.length,n=t[i-1],a=0;++o<i;)r=n,n=t[o],l(e,r,n)&&a++;return a%2!==0},i=function(e,t,r){var n,a,o;return n=1e-9,a=e[0],o=e[1],a<Math.min(t[0],r[0])-n||a>Math.max(t[0],r[0])+n||o<Math.min(t[1],r[1])-n||o>Math.max(t[1],r[1])+n?!1:!0},a=function(e,t,r,n){var a,o,i,s,l,u,c,d,f,p;return d=1e-9,s=e[0]-t[0],u=e[1]-t[1],l=r[0]-n[0],c=r[1]-n[1],i=s*c-u*l,Math.abs(i)<d?null:(a=e[0]*t[1]-e[1]*t[0],o=r[0]*n[1]-r[1]*n[0],f=(a*l-o*s)/i,p=(a*c-o*u)/i,[f,p])},d=function(e,t,r,n){var o;return o=a(e,t,r,n),null==o?!1:i(o,e,t)&&i(o,r,n)},s=function(e,t){var r,n,a,i,s,l,u,c;for(s=-1,u=e.length,c=t.length,a=e[u-1];++s<u;)for(r=a,a=e[s],l=-1,i=t[c-1];++l<c;)if(n=i,i=t[l],d(r,a,n,i))return!1;return o(e[0],t)},u=function(e,t,r){var n,a,o,i;return null==r&&(r=[0,0]),o=e[0]-r[0],i=e[1]-r[1],n=Math.cos(t),a=Math.sin(t),[n*o-a*i+r[0],a*o+n*i+r[1]]},c=function(e,t,r){var n,a,o,i;for(i=[],n=0,a=e.length;a>n;n++)o=e[n],i.push(u(o,t,r));return i},n=function(e,t,r){var n,o,s,l,u,c,d,f,h,v,g,m,y,x,b;for(u=1e-9,t=[t[0]+u*Math.cos(r),t[1]+u*Math.sin(r)],x=t[0],b=t[1],m=[x+Math.cos(r),b+Math.sin(r)],d=0,Math.abs(m[0]-x)<u&&(d=1),c=-1,v=e.length,o=e[v-1],f=Number.MAX_VALUE,h=Number.MAX_VALUE,s=null,l=null;++c<v;)n=o,o=e[c],g=a(t,m,n,o),null!=g&&i(g,n,o)&&(y=p(t,g),g[d]<t[d]?f>y&&(f=y,s=g):g[d]>t[d]&&h>y&&(h=y,l=g));return[s,l]}},{"simplify-js":8}],160:[function(e,t,r){t.exports=function(e,t,r){var n,a,o,i;return a={x:0,y:0},0>e&&(e=2*Math.PI+e),"square"===r?(o=45*(Math.PI/180),e<=Math.PI?e<Math.PI/2?o>e?(a.x+=t,i=Math.tan(e)*t,a.y+=i):(a.y+=t,n=t/Math.tan(e),a.x+=n):e<Math.PI-o?(a.y+=t,n=t/Math.tan(Math.PI-e),a.x-=n):(a.x-=t,i=Math.tan(Math.PI-e)*t,a.y+=i):e<3*Math.PI/2?e<o+Math.PI?(a.x-=t,i=Math.tan(e-Math.PI)*t,a.y-=i):(a.y-=t,n=t/Math.tan(e-Math.PI),a.x-=n):e<2*Math.PI-o?(a.y-=t,n=t/Math.tan(2*Math.PI-e),a.x+=n):(a.x+=t,i=Math.tan(2*Math.PI-e)*t,a.y-=i)):(a.x+=t*Math.cos(e),a.y+=t*Math.sin(e)),a}},{}],161:[function(e,t,r){var n;n=e("../geom/offset.coffee"),t.exports=function(e){var t,r,a,o,i,s,l,u,c,d,f,p,h,v,g,m;if(!e)return[];for(e=e.slice(1).slice(0,-1).split(/L|A/),d=[],a=0,i=e.length;i>a;a++)if(c=e[a],c=c.split(" "),1===c.length)d.push(c[0].split(",").map(function(e){return parseFloat(e)}));else{for(f=d[d.length-1],o=c.pop().split(",").map(function(e){return parseFloat(e)}),p=parseFloat(c.shift().split(",")[0]),m=Math.sqrt(Math.pow(o[0]-f[0],2)+Math.pow(o[1]-f[1],2)),t=Math.acos((p*p+p*p-m*m)/(2*p*p)),u="1"===c[1].split(",")[0],u&&(t=2*Math.PI-t),s=t/(2*Math.PI)*(p*Math.PI*2),h=s/5,v=Math.atan2(-f[1],-f[0])-Math.PI,g=t/h,r=g;t>r;)l=n(v+r,p),d.push([l.x,l.y]),r+=g;d.push(o)}return d}},{"../geom/offset.coffee":160}],162:[function(e,t,r){var n,a,o;n={},"undefined"!=typeof window&&(window.d3plus=n),t.exports=n,n.version="1.9.0 - Cornflower",n.repo="https:/alexandersimoes/d3plus/",n.array={comparator:e("./array/comparator.coffee"),contains:e("./array/contains.coffee"),sort:e("./array/sort.coffee"),update:e("./array/update.coffee")},n.client={css:e("./client/css.coffee"),ie:e("./client/ie.js"),pointer:e("./client/pointer.coffee"),prefix:e("./client/prefix.coffee"),rtl:e("./client/rtl.coffee"),scroll:e("./client/scroll.js"),scrollbar:e("./client/scrollbar.coffee"),touch:e("./client/touch.coffee")},n.color={legible:e("./color/legible.coffee"),lighter:e("./color/lighter.coffee"),mix:e("./color/mix.coffee"),random:e("./color/random.coffee"),scale:e("./color/scale.coffee"),sort:e("./color/sort.coffee"),text:e("./color/text.coffee"),validate:e("./color/validate.coffee")},n.data={bestRegress:e("./data/bestRegress.coffee"),lof:e("./data/lof.coffee"),mad:e("./data/mad.coffee")},n.font={sizes:e("./font/sizes.coffee"),validate:e("./font/validate.coffee")},n.form=e("./form/form.js"),n.geom={largestRect:e("./geom/largestRect.coffee"),offset:e("./geom/offset.coffee"),path2poly:e("./geom/path2poly.coffee")},n.network={cluster:e("./network/cluster.coffee"),distance:e("./network/distance.coffee"),normalize:e("./network/normalize.coffee"),shortestPath:e("./network/shortestPath.coffee"),smallestGap:e("./network/smallestGap.coffee"),subgraph:e("./network/subgraph.coffee")},n.number={format:e("./number/format.coffee")},n.object={merge:e("./object/merge.coffee"),validate:e("./object/validate.coffee")},n.string={format:e("./string/format.js"),list:e("./string/list.coffee"),strip:e("./string/strip.js"),title:e("./string/title.coffee")},n.textwrap=e("./textwrap/textwrap.coffee"),n.tooltip={create:e("./tooltip/create.js"),move:e("./tooltip/move.coffee"),remove:e("./tooltip/remove.coffee")},n.util={buckets:e("./util/buckets.coffee"),child:e("./util/child.coffee"),closest:e("./util/closest.coffee"),copy:e("./util/copy.coffee"),d3selection:e("./util/d3selection.coffee"),dataurl:e("./util/dataURL.coffee"),uniques:e("./util/uniques.coffee")},n.viz=e("./viz/viz.coffee"),o=e("./client/css.coffee"),a=e("./core/console/print.coffee"),o("d3plus.css")&&a.warning("d3plus.css has been deprecated, you do not need to load this file.",n.repo+"releases/tag/v1.4.0")},{"./array/comparator.coffee":32,"./array/contains.coffee":33,"./array/sort.coffee":34,"./array/update.coffee":35,"./client/css.coffee":36,"./client/ie.js":37,"./client/pointer.coffee":38,"./client/prefix.coffee":39,"./client/rtl.coffee":40,"./client/scroll.js":41,"./client/scrollbar.coffee":42,"./client/touch.coffee":43,"./color/legible.coffee":44,"./color/lighter.coffee":45,"./color/mix.coffee":46,"./color/random.coffee":47,"./color/scale.coffee":48,"./color/sort.coffee":49,"./color/text.coffee":50,"./color/validate.coffee":51,"./core/console/print.coffee":52,"./data/bestRegress.coffee":98,"./data/lof.coffee":99,"./data/mad.coffee":100,"./font/sizes.coffee":101,"./font/validate.coffee":102,"./form/form.js":103,"./geom/largestRect.coffee":159,"./geom/offset.coffee":160,"./geom/path2poly.coffee":161,"./network/cluster.coffee":163,"./network/distance.coffee":164,"./network/normalize.coffee":165,"./network/shortestPath.coffee":166,"./network/smallestGap.coffee":167,"./network/subgraph.coffee":168,"./number/format.coffee":169,"./object/merge.coffee":170,"./object/validate.coffee":171,"./string/format.js":172,"./string/list.coffee":173,"./string/strip.js":174,"./string/title.coffee":175,"./textwrap/textwrap.coffee":199,"./tooltip/create.js":200,"./tooltip/move.coffee":201,"./tooltip/remove.coffee":202,"./util/buckets.coffee":203,"./util/child.coffee":204,"./util/closest.coffee":205,"./util/copy.coffee":206,"./util/d3selection.coffee":207,"./util/dataURL.coffee":208,"./util/uniques.coffee":209,"./viz/viz.coffee":331}],163:[function(e,t,r){var n;n=e("./normalize.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B;if(v=[],null==t&&(t={}),(null==t.nodes||"object"!=typeof t.nodes)&&(S=n(e,t),e=S[0],t=S[1],null===t))return null;f=t.distance,O=t.nodeid,B=t.startpoint,h=t.endpoint,E=t.nodes,F={};for(m in E)F[m]={node:E[m].node,degree:0};for(z=0,k={},g=0,w=e.length;w>g;g++)p=e[g],a=O(B(p)),o=O(h(p)),a in k||(k[a]={}),o in k||(k[o]={}),o in k[a]||(k[a][o]=0,k[o][a]=0,z++,F[a].degree+=1,F[o].degree+=1);u={},r=0;for(m in F)M=F[m],u[m]={score:M.degree/(2*z),nodes:[m]};for(a in k)for(o in k[a])k[a][o]=1/(2*z)-F[a].degree*F[o].degree/(4*z*z);for(y=0;1e3>y;){d=-1,A=void 0,j=void 0;for(a in k)for(o in k[a])k[a][o]>d&&(d=k[a][o],A=a,j=o);if(0>d)break;for(b in k[A])b!==j&&(b in k[j]?k[j][b]+=k[A][b]:k[j][b]=k[A][b]-2*u[j].score*u[b].score,k[b][j]=k[j][b]),delete k[b][A];for(b in k[j])b in k[A]||b===j||(k[j][b]-=2*u[A].score*u[b].score,k[b][j]=k[j][b]);for(T=u[A].nodes,x=0,_=T.length;_>x;x++)M=T[x],u[j].nodes.push(M);u[j].score+=u[A].score,t.vdebug&&v.push({type:"merge",father:j,child:A,nodes:u[j].nodes}),delete u[A],delete k[A],r+=d,y++}return l=function(){var e;e=[];for(i in u)c=u[i],e.push([i,c.nodes.length]);return e}(),l.sort(function(e,t){return t[1]-e[1]}),C=function(){var e,t,r;for(r=[],e=0,t=l.length;t>e;e++)s=l[e],r.push(u[s[0]].nodes);return r}(),[C,v]}},{"./normalize.coffee":165}],164:[function(e,t,r){t.exports=function(e,t){var r,n;return e instanceof Array||(e=[e.x,e.y]),t instanceof Array||(t=[t.x,t.y]),r=Math.abs(e[0]-t[0]),n=Math.abs(e[1]-t[1]),Math.sqrt(r*r+n*n)}},{}],165:[function(e,t,r){var n;n=e("../core/console/print.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C;if(F=t.source,T=t.target,i=t.directed,s=t.distance,j=t.nodeid,S=t.startpoint,c=t.endpoint,r=t.K,C=t.vdebug,i||(i=!1),null==r&&(r=1),null==j?j=function(e){return e}:"string"==typeof j&&(j=function(e){return function(t){return t[e]}}(j)),null!=F&&"object"==typeof F&&(F=j(F)),null!=T&&"object"==typeof T&&(T=j(T)),null==S?S=function(e){return e.source}:"string"==typeof S&&(S=function(e){return function(t){return t[e]}}(S)),null==c?c=function(e){return e.target}:"string"==typeof c&&(c=function(e){return function(t){return t[e]}}(c)),null==s)s=function(e){return 1};else if("number"==typeof s)s=function(e){return function(t){return e}}(s);else if("string"==typeof s)s=function(e){return function(t){return t[e]}}(s);else if(s instanceof Array){for(u={},f=m=0,b=e.length;b>m;f=++m)l=e[f],a=j(S(l)),o=j(c(l)),u[a+"_"+o]=s[f];s=function(e){return a=j(S(e)),o=j(c(e)),u[a+"_"+o]}}for(M={},y=0,w=e.length;w>y;y++){for(l=e[y],z=S(l),A=c(l),v=j(z),g=j(A),O=[z,A],x=0,_=O.length;_>x;x++)k=O[x],p=j(k),p in M||(M[p]={node:k,outedges:[]});M[v].outedges.push(l),i||M[g].outedges.push(l)}return d=null,0===e.length?d="The length of edges is 0":0>r?d="K can not have negative value":null==s(e[0])?d="Check the distance function/attribute":null==S(e[0])?d="Check the startpoint function/attribute":null==c(e[0])?d="Check the endpoint function/attribute":(h=j(S(e[0])),null==h||"string"!=(E=typeof h)&&"number"!==E?d="Check the nodeid function/attribute":null==F||F in M?null==T||T in M||(d="The target is not in the graph"):d="The source is not in the graph"),null!=d?(n.error(d),null):[e,{source:F,target:T,directed:i,distance:s,nodeid:j,startpoint:S,endpoint:c,K:r,nodes:M,vdebug:C}]}},{"../core/console/print.coffee":52}],166:[function(e,t,r){var n,a;n=e("heap"),a=e("./normalize.coffee"),t.exports=function(e,t,r){var o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C;if(null==r&&(r={}),r.source=t,(null==r.nodes||"object"!=typeof r.nodes)&&(A=a(e,r),e=A[0],r=A[1],null===r))return null;t=r.source,S=r.target,u=r.directed,c=r.distance,_=r.nodeid,F=r.startpoint,f=r.endpoint,o=r.K,k=r.nodes;for(g in k)w=k[g],w.count=0;for(h=new n(function(e,t){return e.distance-t.distance}),C={},null==S&&(C[t]=!0),h.push({edge:null,target:t,distance:0}),b=0,E=[];!h.empty()&&(b=Math.max(b,h.size()),z=h.pop(),T=z.target,k[T].count++,null==S?E.push(z):T===S&&E.push(z),E.length!==o);)if(k[T].count<=o)for(j=k[T].outedges,v=0,y=j.length;y>v;v++){if(d=j[v],i=_(F(d)),l=_(f(d)),u||l!==T||(M=[l,i],i=M[0],l=M[1]),null==S){if(C[l])continue;C[l]=!0}s=z.distance+c(d),h.push({edge:d,previous:z,target:l,distance:s})}for(p=function(t){for(e=[];null!=t.edge;)e.push(t.edge),t=t.previous;return e.reverse()},m=0,x=E.length;x>m;m++)O=E[m],null!=S&&(delete O.target,O.edges=p(O)),delete O.edge,delete O.previous;return E}},{"./normalize.coffee":165,heap:5}],167:[function(e,t,r){var n;n=e("./distance.coffee"),t.exports=function(e,t){var r,a;return t||(t={}),r=[],a=d3.geom.quadtree().x(function(e){return t.accessor?t.accessor(e)[0]:e[0]}).y(function(e){return t.accessor?t.accessor(e)[1]:e[1]}),a(e).visit(function(e){var a,o,i,s,l,u,c,d;if(!e.leaf)for(c=e.nodes,a=0,i=c.length;i>a;a++)if(l=c[a],l&&l.point)if(t.origin)r.push(n(l,t));else for(d=e.nodes,o=0,s=d.length;s>o;o++)u=d[o],u&&u.point&&u.point!==l.point&&r.push(n(l,u));return!1}),t.all?r.sort(function(e,t){return e-t}):d3.min(r)}},{"./distance.coffee":164}],168:[function(e,t,r){var n;n=e("./normalize.coffee"),t.exports=function(e,t,r){var a,o,i,s,l,u,c,d,f,p,h,v;return null==r&&(r={}),r.source=t,null!=r.nodes&&"object"==typeof r.nodes||(p=n(e,r),e=p[0],r=p[1],null!==r)?(t=r.source,i=r.directed,s=r.distance,d=r.nodeid,h=r.startpoint,u=r.endpoint,a=r.K,f=r.nodes,v={},v[t]=!0,o=function(e,t){var r,n,l,c,p,g,m,y,x;for(m=f[e].outedges,x=[],c=0,p=m.length;p>c;c++)l=m[c],r=d(h(l)),n=d(u(l)),i||n!==e||(y=[n,r],r=y[0],n=y[1]),n in v?x.push(void 0):(g=t+s(l),a>=g?(v[n]=!0,x.push(o(n,g))):x.push(void 0));return x},o(t,0),{nodes:function(){var e;e=[];for(c in v)e.push(f[c].node);return e}(),edges:function(){var t,r,n;for(n=[],t=0,r=e.length;r>t;t++)l=e[t],d(h(l))in v&&d(u(l))in v&&n.push(l);return n}()}):null}},{"./normalize.coffee":165}],169:[function(e,t,r){var n;n=e("../core/locale/languages/en_US.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,d,f,p,h;return t||(t={}),l="locale"in t?t.locale:n,f=l.time.slice(),a=d3.locale(l.format),t||(t={}),p=t.vars||{},o=t.key,i="labels"in t?t.labels:!0,s=e.toString().split(".")[0].length,p.time&&p.time.value&&f.push(p.time.value),"string"==typeof o&&f.indexOf(o.toLowerCase())>=0?u=e:"share"===o?(u=0===e?0:e>=100?a.numberFormat(",f")(e):e>99?a.numberFormat(".3g")(e):a.numberFormat(".2g")(e),u+="%"):10>e&&e>-10?(s=e.toString().split("."),c=1,s.length>1&&(c=d3.min([parseFloat(s[1]).toString().length,2]),e>-1&&1>e||(h=s[1].length-parseFloat(s[1]).toString().length,c+=1+h)),u=a.numberFormat("."+c+"g")(e)):s>3?(d=d3.formatPrefix(e).symbol,d=d.replace("G","B"),e=d3.formatPrefix(e).scale(e),e=a.numberFormat(".3g")(e),e=e.replace(l.format.decimal,"."),e=parseFloat(e)+"",e=e.replace(".",l.format.decimal),u=e+d):u=3===s?a.numberFormat(",f")(e):0===e?0:e===parseInt(e,10)?a.numberFormat(".2")(e):a.numberFormat(".3g")(e),u.length>2&&""+u.indexOf(".0")===u.length-2&&(u=u.slice(0,u.length-2)),i&&o&&"format"in p&&o in p.format.affixes.value?(r=p.format.affixes.value[o],r[0]+u+r[1]):u}},{"../core/locale/languages/en_US.coffee":69}],170:[function(e,t,r){var n,a;n=e("../util/d3selection.coffee"),a=e("./validate.coffee"),t.exports=function(e,t){var r,o;return r=function(e,t,o){var i,s,l;s=[];for(i in e)l=e[i],"undefined"!=typeof l?!o&&a(l)?("object"!=typeof t[i]&&(t[i]={}),s.push(r(l,t[i],0===i.indexOf("d3plus")))):!n(l)&&l instanceof Array?s.push(t[i]=l.slice(0)):s.push(t[i]=l):s.push(void 0);return s},o={},e&&r(e,o),t&&r(t,o),o}},{"../util/d3selection.coffee":207,"./validate.coffee":171}],171:[function(e,t,r){t.exports=function(e){return e&&e.constructor===Object}},{}],172:[function(e,t,r){t.exports=function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return t.unkeyed_index=0,t.replace(/\{(\w*)\}/g,function(r,n){if(""===n&&(n=t.unkeyed_index,t.unkeyed_index++),n==+n)return"undefined"!==e[n]?e[n]:r;for(var a=0;a<e.length;a++)if("object"==typeof e[a]&&"undefined"!=typeof e[a][n])return e[a][n];return r}.bind(t))}},{}],173:[function(e,t,r){var n,a;n=e("./format.js"),a=e("../core/locale/languages/en_US.coffee").ui,t.exports=function(e,t,r,o){var i;return e instanceof Array?(e=e.slice(0),t||(t=a.and),o||(o=a.moreText),2===e.length?e.join(" "+t+" "):(r&&e.length>r&&(i=e.length-r+1,e=e.slice(0,r-1),e[r-1]=n(o,i)),e.length>1&&(e[e.length-1]=t+" "+e[e.length-1]),e.join(", "))):e}},{"../core/locale/languages/en_US.coffee":69,"./format.js":172}],174:[function(e,t,r){t.exports=function(e){var t=["!","@","#","$","%","^","&","*","(",")","[","]","{","}",".",",","/","\\","|","'",'"',";",":","<",">","?","=","+"],r=[[/[\300-\306]/g,"A"],[/[\340-\346]/g,"a"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\322-\330]/g,"O"],[/[\362-\370]/g,"o"],[/[\331-\334]/g,"U"],[/[\371-\374]/g,"u"],[/[\321]/g,"N"],[/[\361]/g,"n"],[/[\307]/g,"C"],[/[\347]/g,"c"]];return e+="",""+e.replace(/[^A-Za-z0-9\-_]/g,function(e){if(" "===e)return"_";if(t.indexOf(e)>=0)return"";for(var n=e,a=0;a<r.length;a++)if(new RegExp(r[a][0]).test(e)){n=r[a][1];break}return n})}},{}],175:[function(e,t,r){var n;n=e("../core/locale/languages/en_US.coffee"),t.exports=function(e,t){var r,a,o,i,s;return e?(t||(t={}),o=t.key,"."===e.charAt(e.length-1)?e.charAt(0).toUpperCase()+e.substr(1):(i="locale"in this?this.locale.value:n,s=i.lowercase.map(function(e){return e.toLowerCase()}),a=i.uppercase,a=a.concat(a.map(function(e){return e+"s"})),r=a.map(function(e){return e.toLowerCase()}),e.replace(/[^\s!-#%&(-\x2A,-:;\x3F@\x5B-\x5D_\x7B}\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]*/g,function(t,n){var o,i;return t?(o=r.indexOf(t.toLowerCase()),i=o>=0?a[o]:s.indexOf(t.toLowerCase())>=0&&0!==n&&n!==e.length-1?t.toLowerCase():t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()):""}))):""}},{"../core/locale/languages/en_US.coffee":69}],176:[function(e,t,r){var n,a;n=e("./foreign.coffee"),a=e("./tspan.coffee"),t.exports=function(e){e.text.html.value?n(e):a(e)}},{"./foreign.coffee":177,"./tspan.coffee":180}],177:[function(e,t,r){t.exports=function(e){var t,r,n,a,o;o=e.container.value,n=o.attr("font-family")||o.style("font-family"),t=e.align.value||o.attr("text-anchor")||o.style("text-anchor"),r=o.attr("fill")||o.style("fill"),a=o.attr("opacity")||o.style("opacity"),t="end"===t?"right":"middle"===t?"center":"left",d3.select(o.node().parentNode).append("foreignObject").attr("width",e.width.value+"px").attr("height",e.height.value+"px").attr("x","0px").attr("y","0px").append("xhtml:div").style("font-family",n).style("font-size",e.size.value[1]+"px").style("color",r).style("text-align",t).style("opacity",a).text(e.text.current)}},{}],178:[function(e,t,r){t.exports=function(e){var t,r,n,a,o,i,s,l,u,c;return r=e.container.value,a=r.node().previousElementSibling,i=a?a.tagName.toLowerCase():"",a&&(a=d3.select(a)),e.container.x=e.x.value||parseFloat(r.attr("x"),10),e.container.y=e.y.value||parseFloat(r.attr("y"),10),a&&(e.shape.accepted.indexOf(i)>=0&&e.self.shape(i),"rect"===i?(u=parseFloat(a.attr("x"),10)||0,c=parseFloat(a.attr("y"),10)||0,e.padding.value===!1&&(t=Math.abs(u-e.container.x),t&&e.self.padding(t)),e.container.x||(e.container.x=u+e.padding.value),e.container.y||(e.container.y=c+e.padding.value),e.width.value||(l=parseFloat(a.attr("width")),e.self.width(l)),e.height.value||(n=parseFloat(a.attr("height")),e.self.height(n))):"circle"===i?(o=parseFloat(a.attr("r"),10),u=parseFloat(a.attr("cx"),10)||0,u-=o,c=parseFloat(a.attr("cy"),10)||0,c-=o,e.padding.value===!1&&(t=Math.abs(u-e.container.x),t&&e.self.padding(t)),e.container.x||(e.container.x=u+e.padding.value),e.container.y||(e.container.y=c+e.padding.value),e.width.value||e.self.width(2*o,10),e.height.value||e.self.height(2*o,10)):(e.width.value||e.self.width(500),e.height.value||e.self.height(500))),e.container.x||(e.container.x=0),e.container.y||(e.container.y=0),e.width.inner=e.width.value-2*e.padding.value,e.height.inner=e.height.value-2*e.padding.value,s=r.attr("font-size")||r.style("font-size"),s=parseFloat(s,10),e.container.fontSize=s,e.container.dy=parseFloat(r.attr("dy"),10),e.size.value?void 0:e.resize.value?e.self.size([4,80]):e.self.size([s/2,s])}},{}],179:[function(e,t,r){t.exports=function(e){var t;return e.text.value||(t=e.container.value.text(),t&&(t.indexOf("tspan")>=0&&(t.replace(/\<\/tspan\>\<tspan\>/g," "),t.replace(/\<\/tspan\>/g,""),t.replace(/\<tspan\>/g,"")),t=t.replace(/(\r\n|\n|\r)/gm,""),t=t.replace(/^\s+|\s+$/g,""),e.self.text(t))),e.text.value instanceof Array?e.text.phrases=e.text.value.filter(function(e){return["string","number"].indexOf(typeof e)>=0}):e.text.phrases=[e.text.value+""],e.align.value?void 0:e.container.align=e.container.value.style("text-anchor")||e.container.value.attr("text-anchor")}},{}],180:[function(e,t,r){var n;n=e("../../client/rtl.coffee"),t.exports=function(e){var t,r,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T;return f=function(t){var n;return n=!v||t?e.container.value.append("tspan"):e.container.value.insert("tspan","tspan"),n.attr("x",E+"px").attr("dy",r+"px").style("baseline-shift","0%").attr("dominant-baseline","alphabetic")},d=-90===e.rotate.value||90===e.rotate.value,j=d?e.height.inner:e.width.inner,s=d?e.width.inner:e.height.inner,t="circle"===e.shape.value?"middle":e.align.value||e.container.align||"start",F="end"===t||"start"===t&&n?j:"middle"===t?j/2:0,A=e.valign.value||"top",E=e.container.x+F,o=e.resize.value?e.size.value[1]:e.container.fontSize||e.size.value[0],r=e.container.dy||1.1*o,_=null,h=null,M=null,v=!1,T=0,"circle"===e.shape.value&&("middle"===A?T=s/r%1*r/2:"end"===A&&(T=s/r%1*r)),e.container.value.attr("text-anchor",t).attr("font-size",o+"px").style("font-size",o+"px").attr("x",e.container.x).attr("y",e.container.y),z=function(){return _.remove(),v?(l++,_=e.container.value.select("tspan")):(l--,_=d3.select(e.container.value.node().lastChild)),_.empty()?void 0:(M=_.text().match(/[^\s-]+-?/g),a())},u=function(){var t;return"circle"===e.shape.value?(t=(l-1)*r+T,t>s/2&&(t+=r),2*Math.sqrt(t*(2*(j/2)-t))):j},a=function(){var t,r;return M&&M.length?(r=M.pop(),t=r.charAt(r.length-1),1===r.length&&e.text.split.value.indexOf(r)>=0?a():(e.text.split.value.indexOf(t)>=0&&(r=r.substr(0,r.length-1)),_.text(M.join(" ")+" "+r+"..."),_.node().getComputedTextLength()>u()?a():void 0)):z()},p=function(t){var r,n,a;return r=_.text(),a="",v?(a=e.text.current.charAt(e.text.current.length-h.length-1),n=" "===a?" ":"",h=t+n+h,_.text(t+n+r)):(a=e.text.current.charAt(h.length),
n=" "===a?" ":"",h+=n+t,_.text(r+n+t)),Math.floor(_.node().getComputedTextLength())>u()||"\n"===a?(_.text(r),r.length&&(_=f()),_.text(t),v?l--:l++):void 0},w=1,l=null,c=null,O=function(){var t,n,a,o,i;for(e.container.value.text("").html(""),M=e.text.words.slice(),v&&M.reverse(),h="",_=f(!0),l=w,t=0,n=M.length;n>t;t++){if(i=M[t],l*r>s){z();break}for(p(i),o=!0;o;)a=e.text.current.charAt(h.length+1),o=e.text.split.value.indexOf(a)>=0,o&&p(a)}return l*r>s&&z(),c=Math.abs(l-w)+1},O(),c=0,e.container.value.selectAll("tspan").each(function(){return d3.select(this).text().length?c++:void 0}),"circle"===e.shape.value&&(b=s-c*r,b>r&&("middle"===A?(w=(b/r/2>>0)+1,O()):"bottom"===A&&(v=!0,w=s/r>>0,O()))),c=0,e.container.value.selectAll("tspan").each(function(){return d3.select(this).text().length?c++:void 0}),"top"===A?S=0:(i=c*r,S="middle"===A?s/2-i/2:s-i),S-=.2*r,k="translate(0,"+S+")",180===e.rotate.value||-180===e.rotate.value?(y=e.container.x+j/2,x=e.container.y+s/2):(g=e.rotate.value<0?j:s,y=e.container.x+g/2,x=e.container.y+g/2),m="rotate("+e.rotate.value+", "+y+", "+x+")",e.container.value.attr("transform",m+k)}},{"../../client/rtl.coffee":40}],181:[function(e,t,r){var n,a,o,i;n=e("./flow.coffee"),a=e("../../font/sizes.coffee"),i=function(e){var t;e.text.phrases.length&&(e.text.current=e.text.phrases.shift()+"",e.text.words=e.text.current.match(e.text["break"]),t=e.text.current.charAt(0),t!==e.text.words[0].charAt(0)&&(e.text.words[0]=t+e.text.words[0]),e.container.value.html(""),e.resize.value?o(e):n(e))},t.exports=i,o=function(e){var t,r,o,s,l,u,c,d,f,p,h,v,g,m,y,x,b;for(b=[],c=0;c<e.text.words.length;)t=c===e.text.words.length-1?"":" ",b.push(e.text.words[c]+t),c++;p=-90===e.rotate.value||90===e.rotate.value,y=p?e.height.inner:e.width.inner,l=p?e.width.inner:e.height.inner,h=Math.floor(e.size.value[1]),d="circle"===e.shape.value?.75*y:y,g=a(b,{"font-size":h+"px"},{parent:e.container.value}),f=d3.max(g,function(e){return e.width}),r=1.165+y/l*.11,m=d3.sum(g,function(t){var r;return r=e.container.dy||1.2*h,t.width*r})*r,s="circle"===e.shape.value?Math.PI*Math.pow(y/2,2):d*l,(f>d||m>s)&&(o=Math.sqrt(s/m),x=d/f,v=d3.min([o,x]),h=d3.max([e.size.value[0],Math.floor(h*v)])),u=Math.floor(.8*l),h>u&&(h=u),f*(h/e.size.value[1])<=d?(h!==e.size.value[1]&&e.self.size([e.size.value[0],h]),n(e)):i(e)}},{"../../font/sizes.coffee":101,"./flow.coffee":176}],182:[function(e,t,r){t.exports={accepted:[!1,"start","middle","end","left","center","right"],process:function(e){var t;return t=["left","center","right"].indexOf(e),t>=0&&(e=this.accepted[t+1]),e},value:!1}},{}],183:[function(e,t,r){arguments[4][107][0].apply(r,arguments)},{dup:107}],184:[function(e,t,r){var n;n=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],element:!1,id:"default",process:function(e){return e===!1?!1:n(e)?e:e instanceof Array?d3.select(e[0][0]):d3.select(e)},value:!1}},{"../../util/d3selection.coffee":207}],185:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],186:[function(e,t,r){var n,a;n=e("../../core/console/print.coffee"),a=e("../../string/format.js"),t.exports={accepted:[void 0],process:function(e,t){var r;return this.initialized===!1?e:(t.container.value===!1?(r=t.format.locale.value.dev.setContainer,n.warning(r,"container")):t.container.value.empty()?(r=t.format.locale.value.dev.noContainer,n.warning(a(r,'"'+t.container.value+'"'),"container")):(t.dev.value&&n.time("total draw time"),t.container.value.call(t.self)),e)},value:void 0}},{"../../core/console/print.coffee":52,"../../string/format.js":172}],187:[function(e,t,r){var n,a;n=e("../../core/locale/locale.coffee"),a=e("../../object/merge.coffee"),t.exports={accepted:[Function,String],locale:{accepted:function(){return d3.keys(n)},process:function(e){var t,r;return t="en_US",r=n[t],e!==t&&(r=a(r,n[e])),this.language=e,r},value:"en_US"},process:function(e,t){if(this.initialized&&"string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},value:"en_US"}},{"../../core/locale/locale.coffee":78,"../../object/merge.coffee":170}],188:[function(e,t,r){t.exports={accepted:[!1,Number],value:!1}},{}],189:[function(e,t,r){arguments[4][188][0].apply(r,arguments)},{dup:188}],190:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],191:[function(e,t,r){t.exports={accepted:[-180,-90,0,90,180],value:0}},{}],192:[function(e,t,r){t.exports={accepted:["circle","square"],value:!1}},{}],193:[function(e,t,r){t.exports={accepted:[Array,!1],value:!1}},{}],194:[function(e,t,r){t.exports={accepted:[!1,Array,Number,String],html:{accepted:[Boolean],value:!1},init:function(e){var t;return t=this.split.value,this["break"]=new RegExp("[^\\s\\"+t.join("\\")+"]+\\"+t.join("?\\")+"?","g"),!1},split:{accepted:[Array],process:function(e){return this["break"]=new RegExp("[^\\s\\"+e.join("\\")+"]+\\"+e.join("?\\")+"?","g"),e},value:["-","/",";",":","&","."]}}},{}],195:[function(e,t,r){t.exports={accepted:[!1,"top","middle","bottom"],value:!1}},{}],196:[function(e,t,r){arguments[4][188][0].apply(r,arguments)},{dup:188}],197:[function(e,t,r){arguments[4][188][0].apply(r,arguments)},{dup:188}],198:[function(e,t,r){arguments[4][188][0].apply(r,arguments)},{dup:188}],199:[function(e,t,r){var n,a,o,i,s;n=e("../core/methods/attach.coffee"),o=e("./helpers/parseSize.coffee"),a=e("../core/console/print.coffee"),i=e("./helpers/parseText.coffee"),s=e("./helpers/wrap.coffee"),t.exports=function(){var t;return t={self:function(e){return e.each(function(){o(t),t.size.value[0]<=t.height.inner?(i(t),s(t)):t.container.value.html(""),t.dev.value&&a.timeEnd("total draw time")}),t.self}},n(t,{align:e("./methods/align.coffee"),config:e("./methods/config.coffee"),container:e("./methods/container.coffee"),dev:e("./methods/dev.coffee"),draw:e("./methods/draw.coffee"),format:e("./methods/format.coffee"),height:e("./methods/height.coffee"),padding:e("./methods/padding.coffee"),resize:e("./methods/resize.coffee"),rotate:e("./methods/rotate.coffee"),text:e("./methods/text.coffee"),shape:e("./methods/shape.coffee"),size:e("./methods/size.coffee"),valign:e("./methods/valign.coffee"),width:e("./methods/width.coffee"),x:e("./methods/x.coffee"),y:e("./methods/y.coffee")}),t.self}},{"../core/console/print.coffee":52,"../core/methods/attach.coffee":79,"./helpers/parseSize.coffee":178,"./helpers/parseText.coffee":179,"./helpers/wrap.coffee":181,"./methods/align.coffee":182,"./methods/config.coffee":183,"./methods/container.coffee":184,"./methods/dev.coffee":185,"./methods/draw.coffee":186,"./methods/format.coffee":187,"./methods/height.coffee":188,"./methods/padding.coffee":189,"./methods/resize.coffee":190,"./methods/rotate.coffee":191,"./methods/shape.coffee":192,"./methods/size.coffee":193,"./methods/text.coffee":194,"./methods/valign.coffee":195,"./methods/width.coffee":196,"./methods/x.coffee":197,"./methods/y.coffee":198}],200:[function(e,t,r){function n(){d3.selectAll("div.d3plus_tooltip_data_desc").style("height","0px"),d3.selectAll("div.d3plus_tooltip_data_help").style("background-color","#ccc")}var a=e("../core/locale/languages/en_US.coffee"),o=e("../client/pointer.coffee"),i=e("../color/legible.coffee"),s=e("./move.coffee"),l=e("../client/prefix.coffee"),u=e("../client/rtl.coffee"),c=e("./remove.coffee"),d=e("../client/scroll.js"),f=e("../string/list.coffee"),p=e("../color/text.coffee");t.exports=function(e){var t=e.fullscreen?250:200,r=l();e.width=e.width||t,e.max_width=e.max_width||386,e.id=e.id||"default",e.size=e.fullscreen||e.html?"large":"small",e.offset=e.offset||0,e.arrow_offset=e.arrow?8:0,e.x=e.x||0,e.y=e.y||0,e.parent=e.parent||d3.select("body"),e.curtain=e.curtain||"#fff",e.curtainopacity=e.curtainopacity||.8,e.background=e.background||"#fff",e.fontcolor=e.fontcolor||"#444",e.fontfamily=e.fontfamily||"sans-serif",e.fontweight=e.fontweight||"normal",e.fontsize=e.fontsize||"12px",e.style=e.style||"default",e.zindex="small"==e.size?2e3:500,e.locale=e.locale||a,e.stacked=e.stacked||!1;var h=e.parent?e.parent.node().offsetHeight||e.parent.node().getBoundingClientRect().height:0;if(e.iconsize||(e.iconsize="small"==e.size?22:50),e.parent.node()===document.body?e.limit=[window.innerWidth+d.x(),window.innerHeight+d.y()]:e.limit=[parseFloat(e.parent.style("width"),10),parseFloat(e.parent.style("height"),10)],e.title instanceof Array){var v=e.locale.ui.and,g=e.locale.ui.more;e.title=f(e.title,v,3,g)}if(c(e.id),e.anchor={},e.fullscreen)e.anchor.x="center",e.anchor.y="center",e.x=e.parent?e.parent.node().offsetWidth/2:window.innerWidth/2,e.y=e.parent?h/2:window.innerHeight/2;else if(e.align){var m=e.align.split(" ");e.anchor.y=m[0],m[1]?e.anchor.x=m[1]:e.anchor.x="center"}else e.anchor.x="center",e.anchor.y="top";var y=e.width-30;if(e.fullscreen){e.parent.append("div").attr("id","d3plus_tooltip_curtain_"+e.id).attr("class","d3plus_tooltip_curtain").style("background-color",e.curtain).style("opacity",e.curtainopacity).style("position","absolute").style("z-index",499).style("top","0px").style("right","0px").style("bottom","0px").style("left","0px").on(o.click,function(){c(e.id)})}var x=e.parent.append("div").datum(e).attr("id","d3plus_tooltip_id_"+e.id).attr("class","d3plus_tooltip d3plus_tooltip_"+e.size).style("color",e.fontcolor).style("font-family",e.fontfamily).style("font-weight",e.fontweight).style("font-size",e.fontsize+"px").style(r+"box-shadow","0px 1px 3px rgba(0, 0, 0, 0.25)").style("position","absolute").on(o.out,n);e.max_height&&x.style("max-height",e.max_height+"px"),e.fixed?(x.style("z-index",500),e.mouseevents=!0):x.style("z-index",2e3);var b=x.append("div").datum(e).attr("class","d3plus_tooltip_container").style("background-color",e.background).style("padding","6px");if(e.fullscreen&&e.html&&!e.stacked){_=e.parent?.75*e.parent.node().offsetWidth:.75*window.innerWidth,N=e.parent?.75*h:.75*window.innerHeight,b.style("width",_+"px").style("height",N+"px");var w=b.append("div").attr("class","d3plus_tooltip_body").style("padding-right","6px").style("display","inline-block").style("z-index",1).style("width",e.width+"px")}else{if("auto"==e.width){var _="auto";b.style("max-width",e.max_width+"px")}else var _=e.width-14+"px";var w=b.style("width",_)}if(e.title||e.icon)var k=w.append("div").attr("class","d3plus_tooltip_header").style("position","relative").style("z-index",1);if(e.fullscreen){x.append("div").attr("class","d3plus_tooltip_close").style("background-color",e.color).style("color",p(e.color)).style("position","absolute").style(r+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.25)").style("font-size","20px").style("height","18px").style("line-height","14px").style("text-align","center").style("right","16px").style("top","-10px").style("width","18px").style("z-index",10).html("×").on(o.over,function(){d3.select(this).style("cursor","pointer").style(r+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.5)")}).on(o.out,function(){d3.select(this).style("cursor","auto").style(r+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.25)")}).on(o.click,function(){c(e.id)});d3.select("body").on("keydown.esc_"+e.id,function(){27===d3.event.keyCode&&(c(e.id),d3.select("body").on("keydown.esc_"+e.id,null))})}if(e.mouseevents){if(e.mouseevents!==!0){var z=d3.select(e.mouseevents).on(o.out),A=function(){var t=d3.event.toElement||d3.event.relatedTarget;if(t)var r="string"==typeof t.className?t.className:t.className.baseVal,a=0==r.indexOf("d3plus_tooltip");else var a=!1;t&&(j(x.node(),t)||j(e.mouseevents,t)||a)||(z(d3.select(e.mouseevents).datum()),n(),d3.select(e.mouseevents).on(o.out,z))},j=function(e,t){for(var r=t.parentNode;null!==r;){if(r==e)return!0;r=r.parentNode}return!1};d3.select(e.mouseevents).on(o.out,A),x.on(o.out,A);var M=d3.select(e.mouseevents).on(o.move);M&&x.on(o.move,M)}}else x.style("pointer-events","none");if(e.arrow){x.append("div").attr("class","d3plus_tooltip_arrow").style("background-color",e.background).style(r+"box-shadow","0px 1px 3px rgba(0, 0, 0, 0.25)").style("position","absolute").style("bottom","-5px").style("height","10px").style("left","50%").style("margin-left","-5px").style("width","10px").style(r+"transform","rotate(45deg)").style("z-index",-1)}if(e.icon){var O=k.append("div").attr("class","d3plus_tooltip_icon").style("width",e.iconsize+"px").style("height",e.iconsize+"px").style("z-index",1).style("background-position","50%").style("background-size","100%").style("background-image","url("+e.icon+")").style("display","inline-block").style("margin","0px 3px 3px 0px");"knockout"==e.style&&O.style("background-color",e.color),y-=O.node().offsetWidth}if(e.title){var E=e.max_width-6;e.icon&&(E-=e.iconsize+6),E+="px";k.append("div").attr("class","d3plus_tooltip_title").style("max-width",E).style("color",e.icon?e.fontcolor:i(e.color)).style("vertical-align","top").style("width",y+"px").style("display","inline-block").style("overflow","hidden").style("text-overflow","ellipsis").style("word-wrap","break-word").style("z-index",1).style("font-size","large"===e.size?"18px":"16px").style("line-height","large"===e.size?"20px":"17px").style("padding","large"===e.size?"3px 6px":"3px").text(e.title)}if(e.description){w.append("div").attr("class","d3plus_tooltip_description").style("font-size","12px").style("padding","6px").text(e.description)}if(e.data||e.html&&!e.fullscreen)var F=w.append("div").attr("class","d3plus_tooltip_data_container").style("overflow-y","auto").style("z-index",-1);if(e.data){var S=0,T={},C=null;e.data.forEach(function(t,a){t.group&&C!=t.group&&(C=t.group,F.append("div").attr("class","d3plus_tooltip_data_title").style("font-size","12px").style("font-weight","bold").style("padding","6px 3px 0px 3px").text(t.group));var s=F.append("div").attr("class","d3plus_tooltip_data_block").style("font-size","12px").style("padding","3px 6px").style("position","relative").datum(t);t.highlight===!0?s.style("color",i(e.color)):(t.allColors||t.highlight!==e.color)&&s.style("color",i(t.highlight));var c=s.append("div").attr("class","d3plus_tooltip_data_name").style("display","inline-block").html(t.name).on(o.out,function(){d3.event.stopPropagation()});if(t.link&&c.style("cursor","pointer").on(o.click,t.link),t.value instanceof Array){var d=e.locale.ui.and,f=e.locale.ui.more;t.value=list(t.value,d,3,f)}var p=s.append("div").attr("class","d3plus_tooltip_data_value").style("display","block").style("position","absolute").style("text-align","right").style("top","3px").html(t.value).on(o.out,function(){d3.event.stopPropagation()});if(u?p.style("left","6px"):p.style("right","6px"),e.mouseevents&&t.desc){var h=s.append("div").attr("class","d3plus_tooltip_data_desc").style("color","#888").style("overflow","hidden").style(r+"transition","height 0.5s").style("width","85%").text(t.desc).on(o.out,function(){d3.event.stopPropagation()}),v=h.node().offsetHeight||h.node().getBoundingClientRect().height;h.style("height","0px");var g=c.append("div").attr("class","d3plus_tooltip_data_help").style("background-color","#ccc").style(r+"border-radius","5px").style("color","#fff").style("cursor","pointer").style("display","inline-block").style("font-size","8px").style("font-weight","bold").style("height","10px").style("margin","3px 0px 0px 3px").style("padding-right","1px").style("text-align","center").style("width","10px").style("vertical-align","top").style(l+"transition","background-color 0.5s").text("?").on(o.over,function(){var e=d3.select(this.parentNode.parentNode).style("color");d3.select(this).style("background-color",e),h.style("height",v+"px")}).on(o.out,function(){d3.event.stopPropagation()});c.style("cursor","pointer").on(o.over,function(){n();var e=d3.select(this.parentNode).style("color");g.style("background-color",e),h.style("height",v+"px")}),s.on(o.out,function(){d3.event.stopPropagation(),n()})}var m=parseFloat(p.style("width"),10);m>e.width/2&&(m=e.width/2),m>S&&(S=m),a!=e.data.length-1&&(t.group&&t.group==e.data[a+1].group||!t.group&&!e.data[a+1].group)&&F.append("div").attr("class","d3plus_tooltip_data_seperator").style("background-color","#ddd").style("display","block").style("height","1px").style("margin","0px 3px")}),F.selectAll(".d3plus_tooltip_data_name").style("width",function(){var e=parseFloat(d3.select(this.parentNode).style("width"),10);return e-S-30+"px"}),F.selectAll(".d3plus_tooltip_data_value").style("width",S+"px").each(function(e){var t=parseFloat(d3.select(this).style("height"),10);T[e.name]=t}),F.selectAll(".d3plus_tooltip_data_name").style("min-height",function(e){return T[e.name]+"px"})}!e.html||e.fullscreen&&!e.stacked||(F.append("div").html(e.html),e.js&&e.js(b));var B=w.append("div").attr("class","d3plus_tooltip_footer").style("font-size","10px").style("position","relative").style("text-align","center");if(e.footer&&B.html(e.footer),e.height=x.node().offsetHeight||x.node().getBoundingClientRect().height,e.html&&e.fullscreen&&!e.stacked){var N=e.height-12,_=x.node().offsetWidth-e.width-44;b.append("div").attr("class","d3plus_tooltip_html").style("width",_+"px").style("height",N+"px").style("display","inline-block").style("vertical-align","top").style("overflow-y","auto").style("padding","0px 12px").style("position","absolute").html(e.html),e.js&&e.js(b)}if(e.width=x.node().offsetWidth,"center"!=e.anchor.y?e.height+=e.arrow_offset:e.width+=e.arrow_offset,e.data||(!e.fullscreen||e.stacked)&&e.html){if(!e.fullscreen||e.stacked)var P=e.fixed?h-e.y-10:h-10,N=e.height<P?e.height:P;else var N=e.height;N-=parseFloat(b.style("padding-top"),10),N-=parseFloat(b.style("padding-bottom"),10),k&&(N-=k.node().offsetHeight||k.node().getBoundingClientRect().height,N-=parseFloat(k.style("padding-top"),10),N-=parseFloat(k.style("padding-bottom"),10)),B&&(N-=B.node().offsetHeight||B.node().getBoundingClientRect().height,N-=parseFloat(B.style("padding-top"),10),N-=parseFloat(B.style("padding-bottom"),10)),F.style("max-height",N+"px")}e.height=x.node().offsetHeight||x.node().getBoundingClientRect().height,s(e.x,e.y,e.id)}},{"../client/pointer.coffee":38,"../client/prefix.coffee":39,"../client/rtl.coffee":40,"../client/scroll.js":41,"../color/legible.coffee":44,"../color/text.coffee":50,"../core/locale/languages/en_US.coffee":69,"../string/list.coffee":173,"./move.coffee":201,"./remove.coffee":202}],201:[function(e,t,r){var n,a;a=e("../client/scroll.js"),t.exports=function(e,t,r){var o,i,s;return r||(r="default"),s=d3.select("div#d3plus_tooltip_id_"+r),s.node()&&(o=s.datum(),o.cx=e,o.cy=t,o.fixed||(i="body"===o.parent.node().tagName.toLowerCase()?[a.x(),a.y()]:[0,0],"center"!==o.anchor.y?("right"===o.anchor.x?o.x=o.cx-o.arrow_offset-4:"center"===o.anchor.x?o.x=o.cx-o.width/2:"left"===o.anchor.x&&(o.x=o.cx-o.width+o.arrow_offset+2),"bottom"===o.anchor.y?o.flip=o.cy+o.height+o.offset<=o.limit[1]:"top"===o.anchor.y&&(o.flip=o.cy-o.height-o.offset<i[1]),o.flip?o.y=o.cy+o.offset+o.arrow_offset:o.y=o.cy-o.height-o.offset-o.arrow_offset):(o.y=o.cy-o.height/2,"right"===o.anchor.x?o.flip=o.cx+o.width+o.offset<=o.limit[0]:"left"===o.anchor.x&&(o.flip=o.cx-o.width-o.offset<i[0]),"center"===o.anchor.x?(o.flip=!1,o.x=o.cx-o.width/2):o.flip?o.x=o.cx+o.offset+o.arrow_offset:o.x=o.cx-o.width-o.offset),o.x<i[0]?o.x=i[0]:o.x+o.width>o.limit[0]&&(o.x=o.limit[0]-o.width),o.y<i[1]?o.y=i[1]:o.y+o.height>o.limit[1]&&(o.y=o.limit[1]-o.height)),s.style("top",o.y+"px").style("left",o.x+"px"),o.arrow&&s.selectAll(".d3plus_tooltip_arrow").call(n)),s},n=function(e){return e.style("bottom",function(e){return"center"===e.anchor.y||e.flip?"auto":"-5px"}).style("right",function(e){return"center"!==e.anchor.y||e.flip?"auto":"-5px"}).style("top",function(e){return"center"!==e.anchor.y&&e.flip?"-5px":"center"===e.anchor.y?"50%":"auto"}).style("left",function(e){return"center"===e.anchor.y&&e.flip?"-5px":"center"!==e.anchor.y?"50%":"auto"}).style("margin-left",function(e){var t;return"center"===e.anchor.y?"auto":(t="right"===e.anchor.x?-e.width/2+e.arrow_offset/2:"left"===e.anchor.x?e.width/2-2*e.arrow_offset-5:-5,e.cx-e.width/2-5<t?(t=e.cx-e.width/2-5,t<2-e.width/2&&(t=2-e.width/2)):-(e.limit[0]-e.cx-e.width/2+5)>t&&(t=-(e.limit[0]-e.cx-e.width/2+5),t>e.width/2-11&&(t=e.width/2-11)),t+"px")}).style("margin-top",function(e){var t;return"center"!==e.anchor.y?"auto":(t="bottom"===e.anchor.y?-e.height/2+e.arrow_offset/2-1:"top"===e.anchor.y?e.height/2-2*e.arrow_offset-2:-9,e.cy-e.height/2-e.arrow_offset<t?(t=e.cy-e.height/2-e.arrow_offset,t<4-e.height/2&&(t=4-e.height/2)):-(e.limit[1]-e.cy-e.height/2+e.arrow_offset)>t&&(t=-(e.limit[1]-e.cy-e.height/2+e.arrow_offset),t>e.height/2-22&&(t=e.height/2-22)),t+"px")})}},{"../client/scroll.js":41}],202:[function(e,t,r){t.exports=function(e){return e?(d3.selectAll("div#d3plus_tooltip_curtain_"+e).remove(),d3.selectAll("div#d3plus_tooltip_id_"+e).remove()):(d3.selectAll("div.d3plus_tooltip_curtain").remove(),d3.selectAll("div.d3plus_tooltip").remove())}},{}],203:[function(e,t,r){t.exports=function(e,t){var r,n;return r=[],n=1/(t-1)*(e[1]-e[0]),d3.range(e[0],e[1]+n,n)}},{}],204:[function(e,t,r){var n;n=e("./d3selection.coffee"),t.exports=function(e,t){var r;if(!e||!t)return!1;for(n(e)&&(e=e.node()),n(e)&&(t=t.node()),r=t.parentNode;null!==r;){if(r===e)return!0;r=r.parentNode}return!1}},{"./d3selection.coffee":207}],205:[function(e,t,r){t.exports=function(e,t){var r,n;return t.constructor===String?(n=e.indexOf(t),n>-1?e[n]:e[0]):(r=e[0],e.forEach(function(e){return Math.abs(t-e)<Math.abs(t-r)?r=e:void 0}),r)}},{}],206:[function(e,t,r){var n,a,o;a=e("../object/merge.coffee"),o=e("../object/validate.coffee"),n=function(e){var t;return o(e)?a(e):e instanceof Array?(t=[],e.forEach(function(e){return t.push(n(e))}),t):e},t.exports=n},{"../object/merge.coffee":170,"../object/validate.coffee":171}],207:[function(e,t,r){var n;n=e("../client/ie.js"),t.exports=function(e){return n?"object"==typeof e&&e instanceof Array&&"size"in e&&"select"in e:e instanceof d3.selection}},{"../client/ie.js":37}],208:[function(e,t,r){t.exports=function(e,t){var r;r=new Image,r.src=e,r.crossOrigin="Anonymous",r.onload=function(){var e,r;e=document.createElement("canvas"),e.width=this.width,e.height=this.height,r=e.getContext("2d"),r.drawImage(this,0,0),t.call(this,e.toDataURL("image/png")),e=null}}},{}],209:[function(e,t,r){var n,a;n=e("../object/validate.coffee"),a=function(e,t,r,o,i,s){var l,u,c,d,f,p,h,v,g,m,y,x,b,w;if(void 0===e)return[];if(o&&void 0===i&&(i=o.id.value),s=!0===s&&void 0===s,e instanceof Array||(e=[e]),m=[],void 0===t)return e.reduce(function(e,t){var r;return r=JSON.stringify(t),m.indexOf(r)<0&&(e.indexOf(t)<0&&e.push(t),m.push(r)),e},[]);if(w=[],l=function(e){var t;return void 0!==e&&null!==e&&(t=JSON.stringify(e),m.indexOf(t)<0)?(w.push(e),m.push(t)):void 0},"function"==typeof r&&o)for(c=0,p=e.length;p>c;c++)for(u=e[c],b=a(r(o,u,t,i)),d=0,h=b.length;h>d;d++)x=b[d],l(x);else if("function"==typeof t)for(f=0,v=e.length;v>f;f++)u=e[f],b=t(u),l(b);else for(y=0,g=e.length;g>y;y++)u=e[y],n(u)&&(b=u[t],l(b));return s?w.sort(function(e,t){return e-t}):w},t.exports=a},{"../object/validate.coffee":171}],210:[function(e,t,r){t.exports=function(e){var t,r,n,a,o;for(e.container.value.style("position",function(){var e,t;return e=d3.select(this).style("position"),t=["absolute","fixed"].indexOf(e)>=0,t?e:"relative"}).html(""),a=["width","height"],r=0,n=a.length;n>r;r++)o=a[r],e[o].value||(t=function(r){var n,a;return void 0===r.tagName||["BODY","HTML"].indexOf(r.tagName)>=0?(a=window["inner"+o.charAt(0).toUpperCase()+o.slice(1)],n=document!==r?d3.select(r):!1,n&&("width"===o?(a-=parseFloat(n.style("margin-left"),10),a-=parseFloat(n.style("margin-right"),10),a-=parseFloat(n.style("padding-left"),10),a-=parseFloat(n.style("padding-right"),10)):(a-=parseFloat(n.style("margin-top"),10),a-=parseFloat(n.style("margin-bottom"),10),a-=parseFloat(n.style("padding-top"),10),a-=parseFloat(n.style("padding-bottom"),10))),e[o].value=20>=a?e[o].small:a):(a=parseFloat(d3.select(r).style(o),10),"number"==typeof a&&a>0?e[o].value=a:"BODY"!==r.tagName?t(r.parentNode):void 0)},t(e.container.value.node()),1===d3.selectAll("body > *:not(script)").size()&&d3.select("body").style("overflow","hidden"));e.container.value.style("width",e.width.value+"px").style("height",e.height.value+"px")}},{}],211:[function(e,t,r){var n=e("../../core/data/format.js"),a=e("../../core/data/color.js"),o=e("../../core/data/keys.coffee"),i=e("../../core/data/load.coffee"),s=e("./ui/drawer.js"),l=e("./ui/legend.js"),u=e("./ui/timeline.coffee"),c=e("./errorCheck.js"),d=e("../../core/fetch/data.js"),f=e("./finish.js"),p=e("./focus/tooltip.coffee"),h=e("./ui/history.coffee"),v=e("../../core/parse/edges.js"),g=e("../../core/parse/nodes.js"),m=e("../../core/console/print.coffee"),y=e("../../tooltip/remove.coffee"),x=e("./types/run.coffee"),b=e("./shapes/draw.js"),w=e("../../string/format.js"),_=e("./svg/enter.js"),k=e("./svg/update.js"),z=e("./ui/titles.js"),A=e("../../object/validate.coffee");t.exports=function(e){var t=[],r=e.type.value,j=e.format.locale.value,M=j.message.ui,O=j.message.draw,E=["data","attrs","coords","nodes","edges"];if(E.forEach(function(r){e.error.value||e[r].loaded||!e[r].url||t.push({"function":function(e,t){i(e,r,t)},message:j.message.loading,wait:!0})}),e.draw.update){var F=j.visualization[r]||r,S=e.types[r].setup||!1,T=e.types[r].requirements||[],C=w(j.message.initializing,F),B=j.message.data;T instanceof Array||(T=[T]),F=F.toLowerCase(),e.error.value||"function"!=typeof S||t.push({"function":function(e){if(e.dev.value){var t="running "+F+" setup";m.time(t)}S(e),e.dev.value&&m.timeEnd(t)},message:C}),e.container.changed&&t.push({"function":_,message:C}),r in e.g.apps||t.push({"function":function(e){if(e.dev.value){var t="creating "+F+" group";m.time(t)}e.g.apps[r]=e.g.app.append("g").attr("id",r).attr("opacity",0),e.dev.value&&m.timeEnd(t)},message:C}),e.data.changed&&t.push({"function":function(e){e.data.cache={},delete e.nodes.restricted,delete e.edges.restricted,o(e,"data")},message:B}),e.attrs.changed&&t.push({"function":function(e){o(e,"attrs")},message:B}),t.push({"function":function(e){if(!e.color.type||e.color.changed||e.data.changed||e.attrs.changed||e.id.changed||e.depth.changed||e.time.fixed.value&&(e.time.solo.changed||e.time.mute.changed)){if(e.color.valueScale=!1,e.dev.value){var t="checking color type";m.time(t)}if(e.color.type=!1,e.color.value){var r=e.color.value;A(r)&&(r=r[e.id.value]?r[e.id.value]:r[d3.keys(r)[0]]),e.data.keys&&r in e.data.keys?e.color.type=e.data.keys[r]:e.attrs.keys&&r in e.attrs.keys&&(e.color.type=e.attrs.keys[r])}else e.data.keys&&(e.color.type=e.data.keys[e.id.value]);e.dev.value&&m.timeEnd(t)}},message:B}),T.indexOf("edges")>=0&&e.edges.value&&(!e.edges.linked||e.edges.changed)&&t.push({"function":v,message:B}),T.indexOf("nodes")>=0&&e.edges.value&&(!e.nodes.positions||e.nodes.changed||e.type.changed)&&t.push({"function":g,message:B}),(e.data.changed||e.time.changed||e.time.format.changed||e.id.changed||e.x.scale.changed&&[e.x.scale.value,e.x.scale.previous].indexOf("discrete")>=0||e.y.scale.changed&&[e.y.scale.value,e.y.scale.previous].indexOf("discrete")>=0)&&t.push({"function":n,message:B}),e.error.value||t.push({"function":function(e){var t=e.time.fixed.value?null:["all"];if(e.dev.value){var r=t?"fetching pool data":"fetching data";m.time(r)}e.data.pool=d(e,t),e.dev.value&&m.timeEnd(r),t?(e.dev.value&&m.time("fetching data for current year"),e.data.viz=d(e),e.dev.value&&m.timeEnd("fetching data for current year")):e.data.viz=e.data.pool,e.draw.timing=e.data.viz.length<e.data.large?e.timing.transitions:0},message:B}),e.error.value||t.push({check:function(e){return e.color.value&&"number"===e.color.type&&e.color.valueScale===!1},"function":a,message:B})}return t.push({"function":function(e){if(e.dev.value){var t=e.format.locale.value.message.tooltipReset;m.time(t)}e.type.previous&&r!==e.type.previous&&y(e.type.previous),y(r),e.dev.value&&m.timeEnd(t)},message:M}),e.error.value||t.push({"function":c,message:M}),t.push({"function":function(e){if(e.margin.process(),z(e),!e.error.value)if(e.draw.update)s(e),u(e),l(e);else{e.dev.value&&m.time("calculating margins");var t=e.container.value.select("div#d3plus_drawer").node().offsetHeight||e.container.value.select("div#d3plus_drawer").node().getBoundingClientRect().height,r=e.g.timeline.node().getBBox();r=e.timeline.value?r.height+e.ui.padding:0;var n=e.g.legend.node().getBBox();n=e.legend.value?n.height+e.ui.padding:0,e.margin.bottom+=t+r+n,e.dev.value&&m.timeEnd("calculating margins")}h(e),e.height.viz-=e.margin.top+e.margin.bottom,e.width.viz-=e.margin.left+e.margin.right},message:M}),e.error.value||t.push({"function":p,message:M}),t.push({"function":k,message:O}),!e.error.value&&e.draw.update&&t.push({"function":[x,b],message:O}),t.push({"function":f,message:O}),t}},{"../../core/console/print.coffee":52,"../../core/data/color.js":54,"../../core/data/format.js":56,"../../core/data/keys.coffee":58,"../../core/data/load.coffee":59,"../../core/fetch/data.js":64,"../../core/parse/edges.js":94,"../../core/parse/nodes.js":97,"../../object/validate.coffee":171,"../../string/format.js":172,"../../tooltip/remove.coffee":202,"./errorCheck.js":212,"./finish.js":213,"./focus/tooltip.coffee":214,"./shapes/draw.js":224,"./svg/enter.js":237,"./svg/update.js":238,"./types/run.coffee":241,"./ui/drawer.js":242,"./ui/history.coffee":243,"./ui/legend.js":244,"./ui/timeline.coffee":246,"./ui/titles.js":247}],212:[function(e,t,r){var n=e("../../core/fetch/text.js"),a=e("../../core/console/print.coffee"),o=e("../../core/methods/rejected.coffee"),i=e("../../string/format.js"),s=e("../../string/list.coffee");t.exports=function(e){e.dev.value&&a.time("checking for errors");var t=["id"],r=e.types[e.type.value].requirements;r&&(r instanceof Array?t=t.concat(e.types[e.type.value].requirements):t.push(r));var l=[];if(t.forEach(function(t){if("string"==typeof t)e[t].value||l.push('"'+t+'"');else if("function"==typeof t){var r=t(e);!r.status&&r.text&&l.push('"'+r.text+'"')}}),l.length>1){var u=e.format.locale.value.error.methods,c=e.format.locale.value.visualization[e.type.value]||e.type.value,d=e.format.locale.value.ui.and;l=s(l,d),e.error.internal=i(u,c,l)}else if(1===l.length){var u=e.format.locale.value.error.method,c=e.format.locale.value.visualization[e.type.value]||e.type.value;e.error.internal=i(u,c,l[0])}if(!e.error.internal&&t.indexOf("edges")>=0&&t.indexOf("focus")>=0){var f=e.edges.connections(e.focus.value[0],e.id.value);if(0==f.length){var p=n(e,e.focus.value[0],e.depth.value),u=e.format.locale.value.error.connections;e.error.internal=i(u,'"'+p+'"')}}var t=["d3"];e.types[e.type.value].libs&&(t=t.concat(e.types[e.type.value].libs));var l=[];if(t.forEach(function(e){window[e]||l.push('"'+e+'"')}),l.length>1){var u=e.format.locale.value.error.libs,c=e.format.locale.value.visualization[e.type.value],d=e.format.locale.value.ui.and;l=s(l,d),e.error.internal=i(u,c,l)}else if(1===l.length){var u=e.format.locale.value.error.lib,c=e.format.locale.value.visualization[e.type.value];e.error.internal=i(u,c,l[0])}var h=e.shape.accepted(e);h instanceof Array||(h=[h]);var v=e.shape.value;if((!v||o(e,h,v,"shape"))&&e.self.shape(h[0]),"modes"in e.types[e.type.value]){var g=e.types[e.type.value].modes;g instanceof Array||(g=[g]);var m=e.type.mode.value;(!m||o(e,g,m,"mode"))&&e.self.type({mode:g[0]})}e.dev.value&&a.timeEnd("checking for errors")}},{"../../core/console/print.coffee":52,"../../core/fetch/text.js":66,"../../core/methods/rejected.coffee":90,"../../string/format.js":172,"../../string/list.coffee":173}],213:[function(e,t,r){var n=e("./shapes/edges.js"),a=e("./shapes/paths.js"),o=e("./ui/message.js"),i=e("./focus/viz.js"),s=e("../../core/methods/reset.coffee"),l=e("../../core/console/print.coffee"),u=e("./shapes/labels.js"),c=e("../../string/title.coffee"),d=e("./zoom/bounds.coffee"),f=e("./zoom/labels.coffee"),p=e("./zoom/mouse.coffee");t.exports=function(e){if(e.draw.first?setTimeout(function(){i(e)},e.draw.timing):i(e),!e.error.value){var t=e.zoom.viewport||e.zoom.bounds;e.types[e.type.value].zoom&&e.zoom.value&&t?(e.dev.value&&l.time("calculating zoom"),
e.draw.first||e.zoom.reset?d(e,t,0):(e.type.changed||e.focus.changed||e.height.changed||e.width.changed||e.nodes.changed||e.legend.changed||e.timeline.changed||e.ui.changed)&&d(e,t),e.dev.value&&l.timeEnd("calculating zoom")):(e.zoom.bounds=[[0,0],[e.width.viz,e.height.viz]],e.zoom.scale=1,d(e))}var r=e.zoom.size?e.zoom.size.width:e.width.viz,h=e.zoom.size?e.zoom.size.height:e.height.viz,v=e.zoom.bounds?e.zoom.bounds[0][0]:0,g=e.zoom.bounds?e.zoom.bounds[0][1]:0;if(e.g.overlay.attr("width",r).attr("height",h).attr("x",v).attr("y",g),e.error.value||(e.draw.update?(e.edges.path?a(e):n(e),u(e,"data"),e.edges.label&&!e.edges.path&&setTimeout(function(){u(e,"edges")},e.draw.timing+200)):(e.labels.value||e.labels.changed)&&e.types[e.type.value].zoom&&e.zoom.value&&e.draw.timing&&setTimeout(function(){f(e)},e.draw.timing)),!e.error.value){var m=e.types[e.type.value].requirements||[];m instanceof Array||(m=[m]);var y=m.indexOf("data")>=0;e.error.internal||e.data.viz&&e.returned.nodes.length||!y||(e.error.internal=e.format.locale.value.error.data)}var x=e.type.previous;if(x&&e.type.value!=x&&e.g.apps[x]&&(e.dev.value&&l.time('hiding "'+x+'"'),e.draw.timing?e.g.apps[x].transition().duration(e.draw.timing).attr("opacity",0):e.g.apps[x].attr("opacity",0),e.dev.value&&l.timeEnd()),!e.error.value){var b=y&&0===e.data.viz.length||e.error.internal||e.error.value?0:e.focus.value.length&&e.types[e.type.value].zoom&&e.zoom.value?1-e.tooltip.curtain.opacity:1,w=e.draw.timing;e.group.transition().duration(w).attr("opacity",b),e.g.data.transition().duration(w).attr("opacity",b),e.g.edges.transition().duration(w).attr("opacity",b)}e.error.value?o(e,e.error.value):e.error.internal?(e.error.internal=c(e.error.internal),l.warning(e.error.internal),o(e,e.error.internal),e.error.internal=null):o(e),setTimeout(function(){s(e),e.types[e.type.value].zoom&&e.zoom.value?(e.g.zoom.datum(e).call(e.zoom.behavior.on("zoom",p)),e.zoom.scroll.value||e.g.zoom.on("mousewheel.zoom",null).on("MozMousePixelScroll.zoom",null).on("wheel.zoom",null),e.zoom.click.value||e.g.zoom.on("dblclick.zoom",null),e.zoom.pan.value||e.g.zoom.on("mousedown.zoom",null).on("mousemove.zoom",null)):e.g.zoom.call(e.zoom.behavior.on("zoom",null)).on("dblclick.zoom",null).on("mousedown.zoom",null).on("mousemove.zoom",null).on("mousewheel.zoom",null).on("MozMousePixelScroll.zoom",null).on("touchstart.zoom",null).on("wheel.zoom",null)},e.draw.timing)}},{"../../core/console/print.coffee":52,"../../core/methods/reset.coffee":92,"../../string/title.coffee":175,"./focus/viz.js":215,"./shapes/edges.js":225,"./shapes/labels.js":227,"./shapes/paths.js":229,"./ui/message.js":245,"./zoom/bounds.coffee":248,"./zoom/labels.coffee":250,"./zoom/mouse.coffee":251}],214:[function(e,t,r){var n,a,o,i;n=e("../tooltip/create.js"),a=e("../../../core/fetch/value.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../tooltip/remove.coffee"),t.exports=function(e){var t,r,s;r=e.focus,!e.error.internal&&1===r.value.length&&r.value.length&&!e.small&&r.tooltip.value?(e.dev.value&&o.time("drawing focus tooltip"),t=e.data.pool.filter(function(t){return a(e,t,e.id.value)===r.value[0]}),t.length>=1?t=t[0]:(t={},t[e.id.value]=r.value[0]),s=e.labels.padding,n({anchor:"top left",arrow:!1,data:t,fullscreen:!1,id:"visualization_focus",length:"long",maxheight:e.height.viz-2*s,mouseevents:!0,offset:0,vars:e,width:e.tooltip.large,x:e.width.value-e.margin.right-s,y:e.margin.top+s}),e.width.viz-=e.tooltip.large+2*s,e.dev.value&&o.timeEnd("drawing focus tooltip")):i("visualization_focus")}},{"../../../core/console/print.coffee":52,"../../../core/fetch/value.coffee":67,"../../../tooltip/remove.coffee":202,"../tooltip/create.js":239}],215:[function(t,r,n){var a=t("../../../client/pointer.coffee"),o=t("../../../client/ie.js"),i=t("../../../core/fetch/value.coffee"),s=t("../../../core/console/print.coffee"),l=t("../../../util/uniques.coffee");r.exports=function(t){if(t.g.edge_focus.selectAll("g").remove(),t.g.data_focus.selectAll("g").remove(),t.focus.value.length&&t.types[t.type.value].zoom&&t.zoom.value){t.dev.value&&s.time("drawing focus elements");var r=t.g.edges.selectAll("g");if(r.size()>0){r.each(function(e){var r=e[t.edges.source][t.id.value],n=e[t.edges.target][t.id.value];if(r==t.focus.value[0]||n==t.focus.value[0]){var a=t.g.edge_focus.node().appendChild(this.cloneNode(!0));d3.select(a).datum(e).attr("opacity",1).selectAll("line, path").datum(e)}});var n=t.edges.arrows.value;t.g.edge_focus.selectAll("line, path").attr("vector-effect","non-scaling-stroke").style("stroke",t.color.focus).style("stroke-width",function(){return o&&t.types[t.type.value].zoom?0:t.edges.size.value?d3.select(this).style("stroke-width"):2*t.data.stroke.width}).attr("marker-start",function(e){var r=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var a="_"+e.d3plus.bucket;else var a="";return"source"==r&&n?"url(#d3plus_edge_marker_focus"+a+")":"none"}).attr("marker-end",function(e){var r=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var a="_"+e.d3plus.bucket;else var a="";return"target"==r&&n?"url(#d3plus_edge_marker_focus"+a+")":"none"}),t.g.edge_focus.selectAll("text").style("fill",t.color.focus)}var u=l(t.edges.connections(t.focus.value[0],t.id.value,!0),t.id.value,i,t);u.push(t.focus.value[0]);var c=[],d=[],f=[0],p=[0];t.g.data.selectAll("g").each(function(r){if(u.indexOf(r[t.id.value])>=0){var n=t.g.data_focus.node().appendChild(this.cloneNode(!0)),n=d3.select(n).datum(r).attr("opacity",1);"coordinates"==t.shape.value?t.zoom.viewport=t.path.bounds(t.zoom.coords[r.d3plus.id]):"d3plus"in r&&("x"in r.d3plus&&c.push(r.d3plus.x),"y"in r.d3plus&&d.push(r.d3plus.y),"r"in r.d3plus?(f.push(r.d3plus.r),p.push(r.d3plus.r)):("width"in r.d3plus&&f.push(r.d3plus.width/2),"height"in r.d3plus&&p.push(r.d3plus.height/2)));for(e in a){var o=d3.select(this).on(a[e]);o&&n.on(a[e],o)}}});if(c.length&&d.length){var h=d3.extent(c),v=d3.extent(d),g=d3.max(f),m=d3.max(p);t.zoom.viewport=[[h[0]-g,v[0]-m],[h[1]+g,v[1]+m]]}t.g.data_focus.selectAll("path").style("stroke-width",o&&t.types[t.type.value].zoom?0:2*t.data.stroke.width),t.dev.value&&s.timeEnd("drawing focus elements")}else t.zoom.viewport=!1}},{"../../../client/ie.js":37,"../../../client/pointer.coffee":38,"../../../core/console/print.coffee":52,"../../../core/fetch/value.coffee":67,"../../../util/uniques.coffee":209}],216:[function(e,t,r){var n,a,o,i;i=e("./style.coffee"),a=e("../../../geom/largestRect.coffee"),o=e("../../../geom/path2poly.coffee"),n={start:{},end:{}},t.exports=function(e,t,r,s){var l,u,c,d;l=d3.svg.arc().innerRadius(0).outerRadius(function(e){return e.d3plus.r}).startAngle(function(e){return e.d3plus.startAngle}).endAngle(function(e){return e.d3plus.endAngle}),c=function(t){var r,n;return e.labels.value&&(t.d3plus.label?t.d3plus_label=t.d3plus.label:(r=o(l(t)),n=a(r,{angle:0}),n[0]?t.d3plus_label={w:n[0].width,h:n[0].height,x:n[0].cx,y:n[0].cy}:delete t.d3plus_label)),[t]},e.draw.timing?(d=d3.svg.arc().innerRadius(0).outerRadius(function(e){return e.d3plus.r}).startAngle(function(e){return void 0===n.start[e.d3plus.id]&&(n.start[e.d3plus.id]=0),isNaN(n.start[e.d3plus.id])&&(n.start[e.d3plus.id]=e.d3plus.startAngle),n.start[e.d3plus.id]}).endAngle(function(e){return void 0===n.end[e.d3plus.id]&&(n.end[e.d3plus.id]=0),isNaN(n.end[e.d3plus.id])&&(n.end[e.d3plus.id]=e.d3plus.endAngle),n.end[e.d3plus.id]}),u=function(e,t){return e.attrTween("d",function(e){var r,a,o,i;return void 0===t?(i=e.d3plus.startAngle,r=e.d3plus.endAngle):0===t&&(i=0,r=0),o=d3.interpolate(n.start[e.d3plus.id],i),a=d3.interpolate(n.end[e.d3plus.id],r),function(t){return n.start[e.d3plus.id]=o(t),n.end[e.d3plus.id]=a(t),d(e)}})},r.append("path").attr("class","d3plus_data").call(i,e).attr("d",d),t.selectAll("path.d3plus_data").data(c).transition().duration(e.draw.timing).call(i,e).call(u),s.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(u,0)):(r.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(c).call(i,e).attr("d",l))}},{"../../../geom/largestRect.coffee":159,"../../../geom/path2poly.coffee":161,"./style.coffee":233}],217:[function(e,t,r){var n=e("../../../core/fetch/text.js"),a=e("../../../font/sizes.coffee"),o=e("../../../geom/largestRect.coffee"),i=e("./style.coffee");t.exports=function(e,t,r,s){var l=d3.svg.area().x(function(e){return e.d3plus.x}).y0(function(e){return e.d3plus.y0}).y1(function(e){return e.d3plus.y}).interpolate(e.shape.interpolate.value),u=d3.svg.area().x(function(e){return e.d3plus.x}).y0(function(e){return e.d3plus.y0}).y1(function(e){return e.d3plus.y0}).interpolate(e.shape.interpolate.value);r.append("path").attr("class","d3plus_data").attr("d",function(e){return u(e.values)}).call(i,e);var c={"font-weight":e.labels.font.weight,"font-family":e.labels.font.family.value};t.selectAll("path.d3plus_data").data(function(t){if(e.labels.value&&t.values.length>1){var r=d3.max(t.values,function(e){return e.d3plus.y0-e.d3plus.y}),i=!1;if(r>e.labels.font.size){var s=[],l=[],u=n(e,t);t.values.forEach(function(e){s.push([e.d3plus.x,e.d3plus.y]),l.push([e.d3plus.x,e.d3plus.y0])}),s=s.concat(l.reverse());var d=null;if(u.length){var f=a(u[0],c);d=f[0].width/f[0].height}i=o(s,{angle:d3.range(-70,71,1),aspectRatio:d,tolerance:0})}if(i&&i[0]){var p={w:~~i[0].width,h:~~i[0].height,x:~~i[0].cx,y:~~i[0].cy,angle:-1*i[0].angle,padding:2,names:u};0!==i[0].angle?p.translate={x:p.x,y:p.y}:p.translate=!1,p.w>=10&&p.h>=10&&(t.d3plus_label=p)}}return[t]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).attr("d",function(e){return l(e.values)}).call(i,e):t.selectAll("path.d3plus_data").attr("d",function(e){return l(e.values)}).call(i,e)}},{"../../../core/fetch/text.js":66,"../../../font/sizes.coffee":101,"../../../geom/largestRect.coffee":159,"./style.coffee":233}],218:[function(e,t,r){var n=(e("../../../core/fetch/text.js"),e("../../../geom/largestRect.coffee"),e("./style.coffee"));t.exports=function(e,t,r,a){function o(e){e.attr("transform","scale(1)")}function i(e){e.attr("transform",function(e){var t=Math.min(e.d3plus.width,e.d3plus.height),r=Math.floor(t/16);return"scale("+r+")"})}r.append("path").attr("class","d3plus_data").attr("d","M5-6.844L3.594-5.407L-2,0.188l-1.594-1.594L-5-2.844L-7.844,0l1.438,1.406l3,3L-2,5.843l1.406-1.438l7-7L7.844-4L5-6.844z").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"../../../core/fetch/text.js":66,"../../../geom/largestRect.coffee":159,"./style.coffee":233}],219:[function(e,t,r){var n,a,o,i;a=e("../../../core/fetch/value.coffee"),n=e("../../../core/fetch/color.coffee"),o=e("../../../color/lighter.coffee"),i=e("./segments.coffee"),t.exports=function(e,t,r){var a,s,l,u;return s=e.d3plus.shape||t.shape.value,"line"===t.shape.value&&"circle"!==s?"none":"area"===t.shape.value||"active"===s||"line"===t.shape.value?n(t,e):"temp"===s?r?n(t,e):"url(#d3plus_hatch_"+e.d3plus.id+")":e.d3plus["static"]?o(n(t,e),.75):(a=i(t,e,"active"),l=i(t,e,"temp"),u=i(t,e,"total"),!t.active.value&&!t.temp.value||a===!0||a&&u&&a>=u&&!l||a&&!u?n(t,e):t.active.spotlight.value?t.color.missing:o(n(t,e),.75))}},{"../../../color/lighter.coffee":45,"../../../core/fetch/color.coffee":63,"../../../core/fetch/value.coffee":67,"./segments.coffee":232}],220:[function(e,t,r){var n,a,o,i,s,l,u,c;n=e("../../../util/copy.coffee"),a=e("../../../network/distance.coffee"),o=e("../../../core/fetch/text.js"),i=e("../../../font/sizes.coffee"),l=e("../../../geom/largestRect.coffee"),u=e("../../../geom/path2poly.coffee"),c=e("./style.coffee"),s={},t.exports=function(e,t,r,d){var f,p;return f=d3.geo[e.coords.projection.value](),f.center&&f.center(e.coords.center),e.zoom.scale||(e.zoom.scale=1),e.zoom.area=1/e.zoom.scale/e.zoom.scale,e.path=d3.geo.path().projection(f),e.draw.timing?t.selectAll("path.d3plus_data").attr("d",e.path).transition().duration(e.draw.timing).call(c,e):t.selectAll("path.d3plus_data").attr("d",e.path).call(c,e),r.append("path").attr("id",function(e){return e.id}).attr("class","d3plus_data").attr("d",e.path).call(c,e),p=e.old_height!==e.height.viz||e.height.changed||e.old_width!==e.width.viz||e.width.changed,e.old_height=e.height.viz,e.old_width=e.width.viz,e.coords.changed||p||e.coords.mute.changed||e.coords.solo.changed||e.type.changed||e.text.changed||e.coords.projection.changed||e.labels.changed?(e.zoom.bounds=null,e.zoom.reset=!0,e.zoom.coords={},t.each(function(t){var r,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E;if(e.coords.simplify.value&&t.geometry.coordinates.length>1){for(m=[],c=[],r=0,b=n(t),j=n(t),t.geometry.coordinates=t.geometry.coordinates.filter(function(t,n){var a;return j.geometry.coordinates=[t],a=e.path.area(j),a>0?(c.push(a),a>r&&(b.geometry.coordinates=[t],r=a),!0):!1}),p=e.path.centroid(b),M=t.geometry.coordinates,y=x=0,w=M.length;w>x;y=++x)f=M[y],j.geometry.coordinates=[f],m.push(a(e.path.centroid(j),p));g=m.reduce(function(e,t,r){return t&&e.push(c[r]/t),e},[]),v=d3.quantile(g,e.coords.threshold.value),j.geometry.coordinates=t.geometry.coordinates.filter(function(e,t){var r,n;return n=m[t],r=c[t],0===n||r/n>=v}),h=b.geometry.coordinates[0],h&&"MultiPolygon"===b.geometry.type&&(h=h[0],b.geometry.coordinates[0]=h,b.geometry.type="Polygon")}else j=t,b=t,h=t.geometry.coordinates[0];return e.zoom.coords[t.d3plus.id]=j,delete t.d3plus_label,e.labels.value&&(_=o(e,t),h&&_.length&&(k=u(e.path(b)),E={"font-weight":e.labels.font.weight,"font-family":e.labels.font.family.value},z=null,1===_[0].split(" ").length&&(O=i(_[0],E)[0],z=O.width/O.height),A=l(k,{angle:0,aspectRatio:z}),A&&(A=A[0],t.d3plus_label={anchor:"middle",valign:"center",h:A.height,w:A.width,x:A.cx,y:A.cy,names:_}))),s[t.id]=t.d3plus_label,d=e.path.bounds(j),e.zoom.bounds?(e.zoom.bounds[0][0]>d[0][0]&&(e.zoom.bounds[0][0]=d[0][0]),e.zoom.bounds[0][1]>d[0][1]&&(e.zoom.bounds[0][1]=d[0][1]),e.zoom.bounds[1][0]<d[1][0]&&(e.zoom.bounds[1][0]=d[1][0]),e.zoom.bounds[1][1]<d[1][1]?e.zoom.bounds[1][1]=d[1][1]:void 0):e.zoom.bounds=d})):e.focus.value.length?void 0:(e.zoom.viewport=!1,t.each(function(e){return e.d3plus_label=s[e.id]}))}},{"../../../core/fetch/text.js":66,"../../../font/sizes.coffee":101,"../../../geom/largestRect.coffee":159,"../../../geom/path2poly.coffee":161,"../../../network/distance.coffee":164,"../../../util/copy.coffee":206,"./style.coffee":233}],221:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("cross").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("cross").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":233}],222:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("diamond").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("diamond").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":233}],223:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(t,r,n,a){if(!r)var r=0;if("number"!=typeof n)var n=void 0;if("number"!=typeof a)var a=void 0;t.attrTween("d",function(t){if(void 0==n)var o=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var o=n;if(void 0==a)var i=t.d3plus.segments[t.d3plus.shape];else var i=a;e.arcs[t.d3plus.shape][t.d3plus.id]||(e.arcs[t.d3plus.shape][t.d3plus.id]={r:0},e.arcs[t.d3plus.shape][t.d3plus.id].a=2*Math.PI);var l=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].r,o+r),u=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,i);return function(r){return e.arcs[t.d3plus.shape][t.d3plus.id].r=l(r),e.arcs[t.d3plus.shape][t.d3plus.id].a=u(r),s(t)}})}function i(e){return e.d3plus.label?e.d3plus_label=e.d3plus.label:delete e.d3plus_label,[e]}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var s=d3.svg.arc().startAngle(0).endAngle(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].a;return r>2*Math.PI?2*Math.PI:r}).innerRadius(function(t){if(t.d3plus["static"])return 0;var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return r*e.data.donut.size}).outerRadius(function(t){return e.arcs[t.d3plus.shape][t.d3plus.id].r});e.draw.timing?(a.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(o,0,0).each("end",function(t){delete e.arcs[t.d3plus.shape][t.d3plus.id]}),t.selectAll("path.d3plus_data").data(i).transition().duration(e.draw.timing).call(o).call(n,e),r.append("path").attr("class","d3plus_data").transition().duration(0).call(o,0,0).call(n,e).transition().duration(e.draw.timing).call(o).call(n,e)):(a.selectAll("path.d3plus_data").each(function(t){delete e.arcs[t.d3plus.shape][t.d3plus.id]}),r.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(i).call(o).call(n,e))}},{"./style.coffee":233}],224:[function(e,t,r){var n=e("../../../util/child.coffee"),a=e("../../../util/closest.coffee"),o=e("../tooltip/create.js"),i=e("../../../client/pointer.coffee"),s=e("../../../core/fetch/value.coffee"),l=e("../../../core/fetch/color.coffee"),u=e("../../../core/fetch/text.js"),c=e("../../../color/legible.coffee"),d=e("../../../core/console/print.coffee"),f=e("../../../tooltip/remove.coffee"),p=e("./segments.coffee"),h=e("./fill.js"),v=e("../../../string/strip.js"),g=e("../../../client/touch.coffee"),m=e("../zoom/propagation.coffee"),y=e("../../../util/uniques.coffee"),x=e("../../../object/validate.coffee"),b=e("../zoom/direction.coffee"),w={arc:e("./arc.coffee"),area:e("./area.js"),check:e("./check.js"),coordinates:e("./coordinates.coffee"),cross:e("./cross.js"),diamond:e("./diamond.js"),donut:e("./donut.js"),line:e("./line.js"),radial:e("./radial.coffee"),rect:e("./rect.coffee"),triangle_down:e("./triangle_down.js"),triangle_up:e("./triangle_up.js"),whisker:e("./whisker.coffee")};t.exports=function(e){function t(t){if(!t.d3plus.id){t.d3plus.id="";for(var r=0;r<=e.depth.value;r++)t.d3plus.id+=s(e,t,e.id.nesting[r])+"_";t.d3plus.id+=F,["x","y","x2","y2"].forEach(function(r){if("discrete"==e[r].scale.value){var n=s(e,t,e[r].value);n.constructor===Date&&(n=n.getTime()),t.d3plus.id+="_"+n}}),t.d3plus.suffix&&(t.d3plus.id+="_"+t.d3plus.suffix),t.d3plus.id=v(t.d3plus.id)}return t}function r(t,r){var n=e.types[e.type.value].scale,a=1;n&&(x[n]&&e.shape.value in n?a=n[e.shape.value]:"function"==typeof n?a=n(e,e.shape.value):"number"==typeof n&&(a=n)),a=r?a:1,t.attr("transform",function(e){if(["line","area","coordinates"].indexOf(F)<0){var t=e.d3plus.x||0,r=e.d3plus.y||0;return"translate("+t+","+r+")scale("+a+")"}return"scale("+a+")"})}function _(t){t.attr("class",function(t){var r=e["class"].value?" "+s(e,t,e["class"].value):"";return"d3plus_"+F+r})}function k(t){if(t&&e.g.edges.selectAll("g").size()>0){e.g.edge_hover.selectAll("*").remove(),e.g.edges.selectAll("g").each(function(r){var n=t[e.id.value],a=r[e.edges.source][e.id.value],o=r[e.edges.target][e.id.value];if(a==n||a=="left_"+n||a=="right_"+n||o==n||o=="left_"+n||o=="right_"+n){var i=e.g.edge_hover.node().appendChild(this.cloneNode(!0));d3.select(i).datum(r).attr("opacity",1).selectAll("line, path").datum(r)}});var r=e.edges.arrows.value;e.g.edge_hover.attr("opacity",0).selectAll("line, path").style("stroke",e.color.primary).style("stroke-width",function(t){return e.edges.path&&t.dy?Math.max(1,t.dy):e.edges.size.value?d3.select(this).style("stroke-width"):2*e.data.stroke.width}).attr("marker-start",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==n&&r?"url(#d3plus_edge_marker_highlight"+a+")":"none"}).attr("marker-end",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==n&&r?"url(#d3plus_edge_marker_highlight"+a+")":"none"}),e.g.edge_hover.selectAll("text").style("fill",e.color.primary),e.draw.timing?(e.g.edge_hover.transition().duration(e.timing.mouseevents).attr("opacity",1),e.g.edges.transition().duration(e.timing.mouseevents).attr("opacity",.5)):e.g.edge_hover.attr("opacity",1)}else e.draw.timing?(e.g.edge_hover.transition().duration(e.timing.mouseevents).attr("opacity",0).transition().selectAll("*").remove(),e.g.edges.transition().duration(e.timing.mouseevents).attr("opacity",1)):e.g.edge_hover.selectAll("*").remove()}var z=e.returned.nodes||[],A=e.returned.edges||[];e.draw.timing=z.length<e.data.large&&A.length<e.edges.large?e.timing.transitions:0;var j={arc:"arc",area:"area",check:"check",circle:"rect",coordinates:"coordinates",cross:"cross",donut:"donut",diamond:"diamond",line:"line",plus:"cross",radial:"radial",rect:"rect",square:"rect",triangle_down:"triangle_down",triangle:"triangle_up",triangle_up:"triangle_up",whisker:"whisker"},M={};z.forEach(function(t){var r=t.d3plus&&t.d3plus.shape?t.d3plus.shape:e.shape.value;r in j&&(t.d3plus&&(t.d3plus.shape=r),r=j[r],M[r]||(M[r]=[]),M[r].push(t))});for(var O in j)if(!(j[O]in M)||0===d3.keys(M).length){var E=e.g.data.selectAll("g.d3plus_"+j[O]);e.draw.timing?E.transition().duration(e.draw.timing).attr("opacity",0).remove():E.remove()}for(var F in M){var S=e.g.data.selectAll("g.d3plus_"+F).data(M[F],function(r){if(r.d3plus||(r.d3plus={}),"coordinates"===F)return r.d3plus.id=r.id,r.id;if(!r.d3plus.id)if(r.values)r.values.forEach(function(e){e=t(e),e.d3plus.shape="circle"}),r.d3plus.id=r.key;else if(r=t(r),!r.d3plus.segments){r.d3plus.segments={donut:2*Math.PI};var n=p(e,r,"active"),a=p(e,r,"temp"),o=p(e,r,"total");o&&(n?r.d3plus.segments.active=n/o*(2*Math.PI):r.d3plus.segments.active=0,a?r.d3plus.segments.temp=a/o*(2*Math.PI)+r.d3plus.segments.active:r.d3plus.segments.temp=0)}return r.d3plus?r.d3plus.id:!1});if(e.draw.timing)var T=S.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();else var T=S.exit().remove();e.draw.timing?S.transition().duration(e.draw.timing).call(r).call(_):S.call(r).call(_);var C=e.draw.timing?0:1,B=S.enter().append("g").attr("opacity",C).call(r).call(_);e.draw.timing&&B.transition().duration(e.draw.timing).attr("opacity",1),S.order(),e.dev.value&&d.time('drawing "'+F+'" shapes'),w[F](e,S,B,T,r),e.dev.value&&d.timeEnd('drawing "'+F+'" shapes'),["rect","donut"].indexOf(F)>=0&&e.types[e.type.value].fill&&(e.dev.value&&d.time('filling "'+F+'" shapes'),h(e,S,B,T,r),e.dev.value&&d.timeEnd('filling "'+F+'" shapes'))}if(k(),e.tooltip.value)e.g.data.selectAll("g").on(i.over,function(t){if(g&&m(e,d3.event),d3.event.buttons||!e.mouse.value||!e.mouse.over.value||e.draw.frozen||t.d3plus&&t.d3plus["static"])f(e.type.value);else if("function"==typeof e.mouse.over.value)e.mouse.over.value(t,e.self);else{if(d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).call(r,!0),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",1),e.covered=!1,t.values&&e.axes.discrete){var n="x"===e.axes.discrete?0:1,s=d3.mouse(e.container.value.node())[n],l=y(t.values,function(t){return t.d3plus[e.axes.discrete]}),u=a(l,s);t.d3plus_data=t.values[l.indexOf(u)],t.d3plus=t.values[l.indexOf(u)].d3plus}var c=t.d3plus_data?t.d3plus_data:t;o({vars:e,data:c}),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.over]&&e.mouse.viz[i.over](t.d3plus_data||t,e),k(t)}}).on(i.move,function(t){if(g&&m(e,d3.event),d3.event.buttons||!e.mouse.value||!e.mouse.move.value||e.draw.frozen||t.d3plus&&t.d3plus["static"])f(e.type.value);else if("function"==typeof e.mouse.move.value)e.mouse.move.value(t,e.self);else{e.types[e.type.value].tooltip||"follow";if(t.values&&e.axes.discrete){var r="x"===e.axes.discrete?0:1,n=d3.mouse(e.container.value.node())[r],s=y(t.values,function(t){return t.d3plus[e.axes.discrete]}),l=a(s,n);t.d3plus_data=t.values[s.indexOf(l)],t.d3plus=t.values[s.indexOf(l)].d3plus}var u=t.d3plus_data?t.d3plus_data:t;o({vars:e,data:u}),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.move]&&e.mouse.viz[i.move](t.d3plus_data||t,e)}}).on(i.out,function(t){if(g&&m(e,d3.event),!d3.event.buttons&&e.mouse.value&&e.mouse.out.value)if("function"==typeof e.mouse.out.value)e.mouse.out.value(t,e.self);else{var a=n(this,d3.event.toElement);a||e.draw.frozen||t.d3plus&&t.d3plus["static"]||(d3.select(this).transition().duration(e.timing.mouseevents).call(r),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",e.data.opacity),e.covered||f(e.type.value),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.out]&&e.mouse.viz[i.out](t.d3plus_data||t,e),k())}else f(e.type.value)});else{var N=function(){m(e,d3.event)};e.g.data.selectAll("g").on(i.over,N).on(i.move,N).on(i.out,N)}d3.select(window).on("scroll.d3plus",function(){f(e.type.value)}),e.g.data.selectAll("g").on(i.click,function(t){if((!e.mouse.viz||e.mouse.viz.click!==!1)&&e.mouse.value&&e.mouse.click.value&&!d3.event.defaultPrevented&&!e.draw.frozen&&(!t.d3plus||!t.d3plus["static"]))if("function"==typeof e.mouse.click.value)e.mouse.click.value(t,e.self);else{if(t.values&&e.axes.discrete){var n="x"===e.axes.discrete?0:1,d=d3.mouse(e.container.value.node())[n],p=y(t.values,function(t){return t.d3plus[e.axes.discrete]}),h=a(p,d);t.d3plus_data=t.values[p.indexOf(h)],t.d3plus=t.values[p.indexOf(h)].d3plus}"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.out]?e.mouse.viz[i.out](t.d3plus_data||t,e):e.mouse.viz[i.click]&&e.mouse.viz[i.click](t.d3plus_data||t,e);var v=b(t.d3plus_data||t,e),g=e.id.solo.value,m=u(e,t)[0],x=c(l(e,t)),w=e.title.sub.value||!1,_=e.title.sub.font.color,z=e.title.total.font.color;if(t.d3plus.threshold&&t.d3plus.merged&&e.zoom.value)e.history.states.push(function(){e.self.id({solo:g}).title({sub:{font:{color:_},value:w},total:{font:{color:z}}}).draw()}),e.self.id({solo:g.concat(y(t.d3plus.merged,e.id.value,s,e))}).title({sub:{font:{color:x},value:m},total:{font:{color:x}}}).draw();else if(1===v&&e.zoom.value){var A=s(e,t.d3plus_data||t,e.id.value);e.history.states.push(function(){e.self.depth(e.depth.value-1).id({solo:g}).title({sub:{font:{color:_},value:w},total:{font:{color:z}}}).draw()}),e.self.depth(e.depth.value+1).id({solo:g.concat(A)}).title({sub:{font:{color:x},value:m},total:{font:{color:x}}}).draw()}else if(-1===v&&e.zoom.value&&e.history.states.length&&!e.tooltip.value["long"])e.history.back();else if(e.types[e.type.value].zoom&&e.zoom.value)k(),d3.select(this).transition().duration(e.timing.mouseevents).call(r),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",e.data.opacity),f(e.type.value),e.draw.update=!1,t&&t[e.id.value]!=e.focus.value[0]?e.self.focus(t[e.id.value]).draw():e.self.focus(!1).draw();else if(e.types[e.type.value].requirements.indexOf("focus")<0){k();var j=t.d3plus_data?t.d3plus_data:t;o({vars:e,data:j})}}})}},{"../../../client/pointer.coffee":38,"../../../client/touch.coffee":43,"../../../color/legible.coffee":44,"../../../core/console/print.coffee":52,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/validate.coffee":171,"../../../string/strip.js":174,"../../../tooltip/remove.coffee":202,"../../../util/child.coffee":204,"../../../util/closest.coffee":205,"../../../util/uniques.coffee":209,"../tooltip/create.js":239,"../zoom/direction.coffee":249,"../zoom/propagation.coffee":252,"./arc.coffee":216,"./area.js":217,"./check.js":218,"./coordinates.coffee":220,"./cross.js":221,"./diamond.js":222,"./donut.js":223,"./fill.js":226,"./line.js":228,"./radial.coffee":230,"./rect.coffee":231,"./segments.coffee":232,"./triangle_down.js":234,"./triangle_up.js":235,"./whisker.coffee":236}],225:[function(e,t,r){var n=e("../../../util/buckets.coffee"),a=e("../../../geom/offset.coffee");t.exports=function(e){function t(t){t.attr("opacity",0).style("stroke-width",0).style("stroke",e.background.value).style("fill","none")}function r(t){var r=e.edges.arrows.value;t.attr("opacity",function(t){return"number"===h?p:"function"===h?p(t,e):e.edges.opacity.scale.value(t[p])}).style("stroke-width",function(t){return e.edges.scale(t[e.edges.size.value])}).style("stroke",e.edges.color).attr("marker-start",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==n&&r?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("marker-end",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==n&&r?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("vector-effect","non-scaling-stroke").attr("pointer-events","none")}function o(t){t.attr("x1",function(t){return t[e.edges.source].d3plus.edges[t[e.edges.target][e.id.value]].x}).attr("y1",function(t){return t[e.edges.source].d3plus.edges[t[e.edges.target][e.id.value]].y}).attr("x2",function(t){return t[e.edges.target].d3plus.edges[t[e.edges.source][e.id.value]].x}).attr("y2",function(t){return t[e.edges.target].d3plus.edges[t[e.edges.source][e.id.value]].y})}function i(e){e.attr("d",function(e){return v(e.d3plus.spline)})}function s(t){if(delete t.d3plus_label,e.g.edges.selectAll("line, path").size()<e.edges.large&&e.edges.label&&t[e.edges.label]){if("spline"in t.d3plus)var r=this.getTotalLength(),n=this.getPointAtLength(r/2),a=this.getPointAtLength(r/2-.1*r),o=this.getPointAtLength(r/2+.1*r),i=Math.atan2(o.y-a.y,o.x-a.x),s=i*(180/Math.PI),l=(this.parentNode.getBBox(),.8*r),u=n.x,c=n.y;else var d=(this.getBBox(),t[e.edges.source]),f=t[e.edges.target],p={x:d.d3plus.edges[f[e.id.value]].x,y:d.d3plus.edges[f[e.id.value]].y},h={x:f.d3plus.edges[d[e.id.value]].x,y:f.d3plus.edges[d[e.id.value]].y},v=h.x-p.x,g=h.y-p.y,n={x:h.x-v/2,y:h.y-g/2},i=Math.atan2(g,v),s=i*(180/Math.PI),r=Math.sqrt(v*v+g*g),l=r,u=n.x,c=n.y;l+=2*e.labels.padding;var m=0;e.edges.arrows.value&&(m="number"==typeof e.edges.arrows.value?e.edges.arrows.value:8,m/=e.zoom.behavior.scaleExtent()[1],l-=2*m),(-90>s||s>90)&&(s-=180),l*e.zoom.behavior.scaleExtent()[0]>20&&(t.d3plus_label={x:u,y:c,translate:{x:u,y:c},w:l,h:15+2*e.labels.padding,angle:s,anchor:"middle",valign:"center",color:e.edges.color,resize:!1,names:[e.format.value(t[e.edges.label])],background:1})}}var l=e.returned.edges||[],u=e.zoom.behavior.scaleExtent()[0];if("string"==typeof e.edges.size.value){var c=d3.extent(l,function(t){return t[e.edges.size.value]}),d=d3.min(e.returned.nodes||[],function(e){return e.d3plus.r})*(2*e.edges.size.scale);e.edges.scale=d3.scale.sqrt().domain(c).range([e.edges.size.min,d*u])}else{var f="number"==typeof e.edges.size.value?e.edges.size.value:e.edges.size.min;e.edges.scale=function(){return f}}var p=e.edges.opacity.value,h=typeof p;e.edges.opacity.changed&&"string"===h&&e.edges.opacity.scale.value.domain(d3.extent(l,function(e){return e[p]})).range([e.edges.opacity.min.value,1]);var v=d3.svg.line().interpolate(e.edges.interpolate.value),g=e.edges.arrows.value?"string"==typeof e.edges.size.value?["default_0","default_1","default_2","highlight_0","highlight_1","highlight_2","focus_0","focus_1","focus_2"]:["default","highlight","focus"]:[];if("string"==typeof e.edges.size.value)for(var m=n(e.edges.scale.range(),4),y=[],x=0;3>x;x++)y.push(m[x+1]+(m[1]-m[0])*(x+2)*2);else var b="number"==typeof e.edges.arrows.value?e.edges.arrows.value:8,y="number"==typeof e.edges.size.value?e.edges.size.value/b:b;
var w=e.defs.selectAll(".d3plus_edge_marker").data(g,String),_=function(t){t.attr("d",function(t){var r=t.split("_");if(2==r.length&&e.edges.scale){r=parseInt(r[1]);var n=y[r]}else var n=y;return"target"==e.edges.arrows.direction.value?"M 0,-"+n/2+" L "+.85*n+",0 L 0,"+n/2+" L 0,-"+n/2:"M 0,-"+n/2+" L -"+.85*n+",0 L 0,"+n/2+" L 0,-"+n/2}).attr("fill",function(t){var r=t.split("_")[0];return"default"==r?e.edges.color:"focus"==r?e.color.focus:e.color.primary}).attr("transform","scale("+1/u+")")};e.draw.timing?(w.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),w.select("path").transition().duration(e.draw.timing).attr("opacity",1).call(_)):(w.exit().remove(),w.select("path").attr("opacity",1).call(_));var k=e.draw.timing?0:1,z=w.enter().append("marker").attr("id",function(e){return"d3plus_edge_marker_"+e}).attr("class","d3plus_edge_marker").attr("orient","auto").attr("markerUnits","userSpaceOnUse").style("overflow","visible").append("path").attr("opacity",k).attr("vector-effect","non-scaling-stroke").call(_);e.draw.timing&&z.transition().duration(e.draw.timing).attr("opacity",1);var A="string"==typeof e.edges.size.value?n(e.edges.scale.domain(),4):null,j=e.edges.arrows.direction.value,M=l.filter(function(t){if(t.d3plus||(t.d3plus={}),t.d3plus.id="edge_"+t[e.edges.source][e.id.value]+"_"+t[e.edges.target][e.id.value],t.d3plus.spline!==!0){if(A){var r=t[e.edges.size.value];t.d3plus.bucket=r<A[1]?0:r<A[2]?1:2;var n=.85*y[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;var n=.85*y/u}var o=t[e.edges.source],i=t[e.edges.target];if(!o.d3plus||!i.d3plus)return!1;var s=Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x),l=Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x),c="source"==j&&e.edges.arrows.value?o.d3plus.r+n:o.d3plus.r,d="target"==j&&e.edges.arrows.value?i.d3plus.r+n:i.d3plus.r,f=a(s,c,e.shape.value),p=a(l,d,e.shape.value);return"edges"in o.d3plus||(o.d3plus.edges={}),o.d3plus.edges[i[e.id.value]]={x:o.d3plus.x-f.x,y:o.d3plus.y-f.y},"edges"in i.d3plus||(i.d3plus.edges={}),i.d3plus.edges[o[e.id.value]]={x:i.d3plus.x-p.x,y:i.d3plus.y-p.y},!0}return!1}),O=e.g.edges.selectAll("g.d3plus_edge_line").data(M,function(e){return e.d3plus.id}),E=l.filter(function(t){if(t.d3plus.spline){if(A){var r=t[e.edges.size.value];t.d3plus.bucket=r<A[1]?0:r<A[2]?1:2;var n=.85*y[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;var n=.85*y/u}var o=t[e.edges.source],i=t[e.edges.target],s=o.d3plus.edges?o.d3plus.edges[i[e.id.value]]||{}:{},l=i.d3plus.edges?i.d3plus.edges[o[e.id.value]]||{}:{},c=e.edges.arrows.value&&"source"==j?n:0,d=e.edges.arrows.value&&"target"==j?n:0,f=.1,p=o.d3plus.x>i.d3plus.x?1-f:1+f,h=o.d3plus.x>i.d3plus.x?1+f:1-f,v="number"==typeof s.angle?s.angle:Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x)*p,g=a(v,o.d3plus.r+c,e.shape.value),m="number"==typeof l.angle?l.angle:Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x)*h,x=a(m,i.d3plus.r+d,e.shape.value),b=[o.d3plus.x-g.x,o.d3plus.y-g.y],w=s.offset?a(v,s.offset):!1,_=w?[b[0]-w.x,b[1]-w.y]:b,k=[i.d3plus.x-x.x,i.d3plus.y-x.y],z=l.offset?a(m,l.offset):!1,M=z?[k[0]-z.x,k[1]-z.y]:k,O=M[0]-_[0],E=M[1]-_[1],F="number"==typeof s.radius?s.radius:Math.sqrt(O*O+E*E)/4,S="number"==typeof l.radius?l.radius:Math.sqrt(O*O+E*E)/4,T=a(v,F-o.d3plus.r-2*c),C=a(m,S-i.d3plus.r-2*d);t.d3plus.spline=[b,k];var B=Math.abs(Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x)).toFixed(5),N=Math.abs(v).toFixed(5),P=Math.abs(m-Math.PI).toFixed(5);return(N!==P||[N,P].indexOf(B)<0)&&(t.d3plus.spline.splice(1,0,[_[0]-T.x,_[1]-T.y],[M[0]-C.x,M[1]-C.y]),w&&t.d3plus.spline.splice(1,0,_),z&&t.d3plus.spline.splice(t.d3plus.spline.length-1,0,M)),!0}return!1}),F=e.g.edges.selectAll("g.d3plus_edge_path").data(E,function(e){return e.d3plus.id});e.draw.timing?(O.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),F.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),O.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),F.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),O.selectAll("line").data(function(e){return[e]}).transition().duration(e.draw.timing).call(o).call(r).each("end",s),F.selectAll("path").data(function(e){return[e]}).transition().duration(e.draw.timing).call(i).call(r).each("end",s),O.enter().append("g").attr("class","d3plus_edge_line").append("line").call(o).call(t).transition().duration(e.draw.timing).call(r).each("end",s),F.enter().append("g").attr("class","d3plus_edge_path").append("path").call(i).call(t).transition().duration(e.draw.timing).call(r).each("end",s)):(O.exit().remove(),F.exit().remove(),O.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),F.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),O.selectAll("line").data(function(e){return[e]}).call(o).call(r).call(s),F.selectAll("path").data(function(e){return[e]}).call(i).call(r).call(s),O.enter().append("g").attr("class","d3plus_edge_line").append("line").call(o).call(t).call(r).call(s),F.enter().append("g").attr("class","d3plus_edge_path").append("path").call(i).call(t).call(r).call(s))}},{"../../../geom/offset.coffee":160,"../../../util/buckets.coffee":203}],226:[function(e,t,r){var n=e("../../../util/copy.coffee"),a=e("../../../core/fetch/color.coffee"),o=(e("../../../core/fetch/value.coffee"),e("./segments.coffee")),i=e("./style.coffee");t.exports=function(e,t,r,s){function l(e){e.attr("x",0).attr("y",0).attr("width",0).attr("height",0)}function u(t,r){r||(r=0),t.attr("x",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return-t/2-r/2}).attr("y",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return-t/2-r/2}).attr("width",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return t+r}).attr("height",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return t+r}).attr("rx",function(t){var n=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(n+r)/2:0}).attr("ry",function(t){var n=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(n+r)/2:0}).attr("shape-rendering",function(t){return["square"].indexOf(e.shape.value)>=0?e.shape.rendering.value:"auto"})}function c(t,r,n,a){r||(r=0),"number"!=typeof n&&(n=void 0),"number"!=typeof a&&(a=void 0),t.attrTween("d",function(t){if(void 0===n)var o=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var o=n;if(void 0===a)var i=t.d3plus.segments[t.d3plus.shape];else var i=a;e.arcs[t.d3plus.shape][t.d3plus.id]||(e.arcs[t.d3plus.shape][t.d3plus.id]={r:0},e.arcs[t.d3plus.shape][t.d3plus.id].a="donut"===t.d3plus.shape?2*Math.PI:0);var s=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].r,o+r),l=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,i);return function(r){return e.arcs[t.d3plus.shape][t.d3plus.id].r=s(r),e.arcs[t.d3plus.shape][t.d3plus.id].a=l(r),d(t)}})}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var d=d3.svg.arc().startAngle(0).endAngle(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].a;return r>2*Math.PI?2*Math.PI:r}).innerRadius(function(t){if(t.d3plus["static"]||"donut"!==e.shape.value)return 0;var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return r*e.data.donut.size}).outerRadius(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return"donut"===e.shape.value?r:2*r});t.each(function(t){function r(t){t.attr("stroke",h).attr("stroke-width",1).attr("shape-rendering",e.shape.rendering.value)}var s=o(e,t,"active"),d=o(e,t,"temp"),f=o(e,t,"total"),p=d3.select(this),h=a(e,t),v=[],g=[];if(f&&e.types[e.type.value].fill){if(d){var m=n(t);m.d3plus.shape="temp",v.push(m),g=["temp"]}if(s&&(f>s||d)){var m=n(t);m.d3plus.shape="active",v.push(m)}}var y=e.defs.selectAll("pattern#d3plus_hatch_"+t.d3plus.id).data(g);e.draw.timing?(y.selectAll("rect").transition().duration(e.draw.timing).style("fill",h),y.selectAll("line").transition().duration(e.draw.timing).style("stroke",h)):(y.selectAll("rect").style("fill",h),y.selectAll("line").style("stroke",h));var x=y.enter().append("pattern").attr("id","d3plus_hatch_"+t.d3plus.id).attr("patternUnits","userSpaceOnUse").attr("x","0").attr("y","0").attr("width","10").attr("height","10").append("g");x.append("rect").attr("x","0").attr("y","0").attr("width","10").attr("height","10").attr("fill",h).attr("fill-opacity",.25),x.append("line").attr("x1","0").attr("x2","10").attr("y1","0").attr("y2","10").call(r),x.append("line").attr("x1","-1").attr("x2","1").attr("y1","9").attr("y2","11").call(r),x.append("line").attr("x1","9").attr("x2","11").attr("y1","-1").attr("y2","1").call(r);var b=v.length?[t]:[],w=p.selectAll("#d3plus_clip_"+t.d3plus.id).data(b);w.enter().insert("clipPath",".d3plus_mouse").attr("id","d3plus_clip_"+t.d3plus.id).append("rect").attr("class","d3plus_clipping").call(l),e.draw.timing?(w.selectAll("rect").transition().duration(e.draw.timing).call(u),w.exit().transition().delay(e.draw.timing).remove()):(w.selectAll("rect").call(u),w.exit().remove());var _=p.selectAll("path.d3plus_fill").data(v);_.transition().duration(e.draw.timing).call(i,e).call(c),_.enter().insert("path","rect.d3plus_mouse").attr("class","d3plus_fill").attr("clip-path","url(#d3plus_clip_"+t.d3plus.id+")").transition().duration(0).call(i,e).call(c,0,void 0,0).transition().duration(e.draw.timing).call(c).call(i,e),_.exit().transition().duration(e.draw.timing).call(c,0,void 0,0).remove()})}},{"../../../core/fetch/color.coffee":63,"../../../core/fetch/value.coffee":67,"../../../util/copy.coffee":206,"./segments.coffee":232,"./style.coffee":233}],227:[function(e,t,r){var n=(e("../../../util/copy.coffee"),e("../../../core/fetch/text.js")),a=e("../../../core/fetch/value.coffee"),o=e("../../../color/mix.coffee"),i=e("../../../core/console/print.coffee"),s=(e("../../../client/rtl.coffee"),e("./segments.coffee")),l=e("./color.coffee"),u=e("../../../string/list.coffee"),c=e("../../../color/text.coffee"),d=e("../../../textwrap/textwrap.coffee");t.exports=function(e,t){var r=e.types[e.type.value].zoom?e.zoom.behavior.scaleExtent():[1,1],f=e.g[t].selectAll("g"),p=function(t){t.attr("opacity",function(t){var n=parseFloat(d3.select(this).attr("font-size"),10);return t.visible=n*(e.zoom.scale/r[1])>=2,t.visible?1:0})},h=function(t){e.draw.timing?t.transition().duration(e.draw.timing).attr("opacity",0).remove():t.remove()},v=function(t){var n="bottom"===e.labels.valign.value?"top":"bottom";t.attr("font-weight",e.labels.font.weight).attr("font-family",e.labels.font.family.value).attr("pointer-events",function(e){return e.mouse?"auto":"none"}).attr("fill",function(t){if(t.color)return t.color;var r=l(t.parent,e),n=c(r),a=t.text?.15:1;return o(r,n,.2,a)}).each(function(t){if(t.resize instanceof Array){t.resize[0],t.resize[1]}var a=t.resize,o=!0;if(t.text){a instanceof Array||(a=[9,50],o=t.resize);var i=t.y-t.h*r[1]/2+t.padding/2;"bottom"===n&&(i+=t.h*r[1]/2),d().align("center").container(d3.select(this)).height(t.h*r[1]/2).padding(t.padding/2).resize(o).size(a).text(e.format.value(100*t.text,{key:"share",vars:e})).width(t.w*r[1]).valign(n).x(t.x-t.w*r[1]/2+t.padding/2).y(i).draw()}else{t.resize instanceof Array||(a=[7,40*(r[1]/r[0])],o=t.resize);var s="bottom"===e.labels.valign.value?t.share:0;d().align(t.anchor||e.labels.align.value).container(d3.select(this)).height(t.h*r[1]-t.share).padding(t.padding/2).resize(o).size(a).shape(t.shape||"square").text(t.names).valign(e.labels.valign.value).width(t.w*r[1]).x(t.x-t.w*r[1]/2+t.padding/2).y(t.y-t.h*r[1]/2+t.padding/2+s).draw()}}).attr("transform",function(e){var t=d3.select(this).attr("transform")||"",n=e.angle||0,a=e.translate&&e.translate.x?e.translate.x:0,o=e.translate&&e.translate.y?e.translate.y:0;return t.length&&(t=t.split(")").slice(-3).join(")")),"rotate("+n+","+a+","+o+")scale("+1/r[1]+")translate("+(e.x*r[1]-e.x)+","+(e.y*r[1]-e.y)+")"+t})};if("edges"===t||e.labels.value){if(e.dev.value){var g="drawing "+t+" labels";i.time(g)}f.each(function(t){function o(t){var r="string"==typeof l.background?l.background:"none"===e.background.value?"#ffffff":e.background.value,n="string"==typeof l.background?l.background:r,a=_.attr("transform").split(")");a.pop(),a.pop(),a.push(""),a=a.join(")"),t.attr("fill",n).attr(E).attr("transform",a)}var i=t.d3plus&&"label"in t.d3plus&&!t.d3plus.label,l=t.d3plus_label||null,c=t.d3plus_share,d=t.d3plus.text?t.d3plus.text:l&&l.names?l.names:e.labels.text.value?a(e,t,e.labels.text.value):n(e,t),f=l&&"group"in l?l.group:d3.select(this),g=0,m=e.types[e.type.value].fill;if(d instanceof Array||(d=[d]),l)if(["line","area"].indexOf(e.shape.value)>=0)var y=!0;else if(t&&"d3plus"in t)var x=s(e,t,"active"),b=s(e,t,"temp"),w=s(e,t,"total"),y=!b&&!x||x>=w||!x&&b>=w;if(i||!(l&&l.force||y)&&m)delete t.d3plus_label,d3.select(this).selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h),e.g.labels.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h);else{if(c&&t.d3plus.share&&c.w-2*e.labels.padding>=10&&c.h-2*e.labels.padding>=10&&"middle"!=e.labels.valign.value){c.resize=e.labels.resize.value===!1?!1:c&&"resize"in c?c.resize:!0,c.padding=e.labels.padding,c.text=t.d3plus.share,c.parent=t;var _=f.selectAll("text#d3plus_share_"+t.d3plus.id).data([c],function(e){return e.w+""+e.h+e.text});e.draw.timing&&1===e.zoom.scale?(_.transition().duration(e.draw.timing/2).call(v),_.enter().append("text").attr("id","d3plus_share_"+t.d3plus.id).attr("class","d3plus_share").attr("opacity",0).call(v).transition().duration(e.draw.timing/2).delay(e.draw.timing/2).attr("opacity",1)):(_.attr("opacity",1).call(v),_.enter().append("text").attr("id","d3plus_share_"+t.d3plus.id).attr("class","d3plus_share").attr("opacity",1).call(v)),g=_.node().getBBox().height+e.labels.padding,_.exit().call(h)}else f.selectAll("text.d3plus_share").call(h);if(l&&(l.resize=e.labels.resize.value===!1?!1:l&&"resize"in l?l.resize:!0,l.padding="number"==typeof l.padding?l.padding:e.labels.padding),l&&l.w*r[1]-l.padding>=20&&l.h*r[1]-l.padding>=10&&d.length){for(var k=e.format.locale.value.ui.and,z=e.format.locale.value.ui.more,A=0;A<d.length;A++)d[A]instanceof Array&&(d[A]=u(d[A],k,3,z));l.names=d,l.share=g,l.parent=t;var _=f.selectAll("text#d3plus_label_"+t.d3plus.id).data([l],function(e){return e?e.w+"_"+e.h+"_"+e.x+"_"+e.y+"_"+e.names.join("_"):!1}),j=l.resize?void 0:e.labels.font.size*r[0]+"px";if(e.draw.timing&&1===e.zoom.scale?(_.transition().duration(e.draw.timing/2).call(v).call(p),_.enter().append("text").attr("font-size",j).attr("id","d3plus_label_"+t.d3plus.id).attr("class","d3plus_label").attr("opacity",0).call(v).transition().duration(e.draw.timing/2).delay(e.draw.timing/2).call(p)):(_.attr("opacity",1).call(v).call(p),_.enter().append("text").attr("font-size",j).attr("id","d3plus_label_"+t.d3plus.id).attr("class","d3plus_label").call(v).call(p)),_.exit().call(h),0===_.size()||0===_.selectAll("tspan").size())delete t.d3plus_label,d3.select(this).selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h),e.g.labels.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h);else{if(l.background){var M=["background"],O=_.node().getBBox(),E={height:O.height,width:O.width,x:O.x,y:O.y};E.width+=e.labels.padding*r[0],E.height+=e.labels.padding*r[0],E.x-=e.labels.padding*r[0]/2,E.y-=e.labels.padding*r[0]/2;var F=_.attr("transform").split(")");E.y+=parseFloat(F[F.length-2].split(",")[1])}else var M=[],E={};var S=f.selectAll("rect#d3plus_label_bg_"+t.d3plus.id).data(M),T="number"==typeof l.background?l.background:"string"==typeof l.background?1:.6;e.draw.timing?(S.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),S.transition().duration(e.draw.timing).attr("opacity",T).call(o),S.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg").attr("opacity",0).call(o).transition().duration(e.draw.timing).attr("opacity",T)):(S.exit().remove(),S.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg"),S.attr("opacity",T).call(o))}}else delete t.d3plus_label,d3.select(this).selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h),e.g.labels.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h)}}),e.dev.value&&i.timeEnd(g)}else{if(e.dev.value){var g="removing "+t+" labels";i.time(g)}f.selectAll("text.d3plus_label, rect.d3plus_label_bg").call(h),e.g.labels.selectAll("text.d3plus_label, rect.d3plus_label_bg").call(h),e.dev.value&&i.timeEnd(g)}}},{"../../../client/rtl.coffee":40,"../../../color/mix.coffee":46,"../../../color/text.coffee":50,"../../../core/console/print.coffee":52,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../string/list.coffee":173,"../../../textwrap/textwrap.coffee":199,"../../../util/copy.coffee":206,"./color.coffee":219,"./segments.coffee":232}],228:[function(e,t,r){function n(e){e.attr("x",function(e){return e.d3plus.x}).attr("y",function(e){return e.d3plus.y}).attr("width",0).attr("height",0)}function a(e,t){void 0===t&&(t=0),e.attr("x",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return e.d3plus.x-(r/2+t/2)}).attr("y",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return e.d3plus.y-(r/2+t/2)}).attr("width",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return r+t}).attr("height",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return r+t}).attr("rx",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return(r+t)/2}).attr("ry",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return(r+t)/2})}function o(e,t,r,n){var o=e.draw.timing?e.timing.mouseevents:0;void 0===n&&(n=0),o?(d3.select(t.parentNode).selectAll("path.d3plus_line").transition().duration(o).style("stroke-width",function(t){var a=r;if(a.constructor!==Number){var o=c(e,t,r);a=o&&o.length?d3.max(o):e.data.stroke.width}return a+n}),d3.select(t.parentNode).selectAll("rect").transition().duration(o).style("stroke-width",function(t){var n=r;if(n.constructor!==Number){var a=c(e,t,r);n=a&&a.length?d3.max(a):e.data.stroke.width}return n}).call(a,n)):(d3.select(t.parentNode).selectAll("path.d3plus_line").style("stroke-width",function(t){var a=r;if(a.constructor!==Number){var o=c(e,t,r);a=o&&o.length?d3.max(o):e.data.stroke.width}return a+n}),d3.select(t.parentNode).selectAll("rect").style("stroke-width",function(t){var n=r;if(n.constructor!==Number){var a=c(e,t,r);n=a&&a.length?d3.max(a):e.data.stroke.width}return n}).call(a,n))}var i=e("../../../util/copy.coffee"),s=e("../../../util/closest.coffee"),l=e("../../../client/pointer.coffee"),u=e("./style.coffee"),c=e("../../../core/fetch/value.coffee");t.exports=function(e,t,r,d){var f=d3.svg.line().x(function(e){return e.d3plus.x}).y(function(e){return e.d3plus.y}).interpolate(e.shape.interpolate.value),p=e.size.value||2*e.data.stroke.width,h=e[e.axes.discrete],v=function(t){var r=p;if(r.constructor!==Number){var n=c(e,t,p);r=n&&n.length?d3.max(n):e.data.stroke.width}return 15>r?15:r},g=h.ticks.values.map(function(e){return e.constructor===Date?e.getTime():e});t.each(function(t){var r=!1,d=[],m=[],y=i(t),x=d3.select(this);y.values=[],y.segment_key=y.key,t.values.forEach(function(n,a,o){var l=c(e,n,h.value);l.constructor===Date&&(l=l.getTime());var u=g.indexOf(s(g,l));r===!1||r===u-1?(y.values.push(n),y.segment_key+="_"+u):(y.values.length>1?d.push(y):m.push(y.values[0]),y=i(t),y.values=[n]),a===o.length-1&&(y.values.length>1?d.push(y):m.push(y.values[0])),r=u});var b=x.selectAll("path.d3plus_line").data(d,function(e){return e.d3plus||(e.d3plus={}),e.d3plus.shape="line",e.segment_key}),w=x.selectAll("rect.d3plus_anchor").data(m,function(t){return t.d3plus||(t.d3plus={}),t.d3plus.r=2*e.data.stroke.width,t.d3plus.id});e.draw.timing?(b.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),b.transition().duration(e.draw.timing).attr("d",function(e){return f(e.values)}).call(u,e),b.enter().append("path").attr("class","d3plus_line").style("stroke-linecap","round").attr("d",function(e){return f(e.values)}).call(u,e).attr("opacity",0).transition().duration(e.draw.timing).attr("opacity",1),w.enter().append("rect").attr("class","d3plus_anchor").attr("id",function(e){return e.d3plus.id}).call(n).call(u,e),w.transition().duration(e.draw.timing).call(a).call(u,e),w.exit().transition().duration(e.draw.timing).call(n).remove()):(b.exit().remove(),b.enter().append("path").attr("class","d3plus_line").style("stroke-linecap","round"),b.attr("d",function(e){return f(e.values)}).call(u,e),w.enter().append("rect").attr("class","d3plus_anchor").attr("id",function(e){return e.d3plus.id}),w.exit().remove(),w.call(a).call(u,e));var _=x.selectAll("path.d3plus_mouse").data(d,function(e){return e.segment_key});_.enter().append("path").attr("class","d3plus_mouse").attr("d",function(e){return f(e.values)}).style("stroke","black").style("stroke-width",v).style("fill","none").style("stroke-linecap","round").attr("opacity",0),_.on(l.over,function(t){e.draw.frozen||o(e,this,p,2)}).on(l.out,function(t){e.draw.frozen||o(e,this,p,0)}),e.draw.timing?_.transition().duration(e.draw.timing).attr("d",function(e){return f(e.values)}).style("stroke-width",v):_.attr("d",function(e){return f(e.values)}).style("stroke-width",v),_.exit().remove()})}},{"../../../client/pointer.coffee":38,"../../../core/fetch/value.coffee":67,"../../../util/closest.coffee":205,"../../../util/copy.coffee":206,"./style.coffee":233}],229:[function(e,t,r){t.exports=function(e){function t(t){t.attr("d",e.edges.path).style("stroke-width",function(e){return Math.max(1,e.dy)}).style("stroke","#ddd").style("fill","none").attr("transform",function(e){return"translate("+e.d3plus.x+","+e.d3plus.y+")"})}var r=e.returned.edges||[],n=e.g.edges.selectAll("g.d3plus_edge_path").data(r,function(t){return t.d3plus.id="path_"+t[e.edges.source][e.id.value]+"_"+t[e.edges.target][e.id.value],t.d3plus.id});e.draw.timing?(n.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),n.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),n.selectAll("path").data(function(e){return[e]}).transition().duration(e.draw.timing).call(t),n.enter().append("g").attr("class","d3plus_edge_path").append("path").style("stroke-width",0).transition().duration(e.draw.timing).call(t)):(n.exit().remove(),n.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),n.selectAll("path").data(function(e){return[e]}).call(t),n.enter().append("g").attr("class","d3plus_edge_path").append("path").call(t))}},{}],230:[function(e,t,r){var n,a,o,i;i=e("./style.coffee"),o={},n={},a={r:{},a:{}},t.exports=function(e,t,r,s){var l,u,c,d,f;c=e.id.nesting[e.depth.value+1],d=d3.svg.line.radial().interpolate("linear-closed").radius(function(e){return e.d3plus.r}).angle(function(e){return e.d3plus.a}),l=function(t){return e.labels.value&&(t.d3plus.label?t.d3plus_label=t.d3plus.label:delete t.d3plus_label),[t]},e.draw.timing?(t.each(function(t){var r,n,a,o,i;for(o=t[c],i=[],n=0,a=o.length;a>n;n++)r=o[n],i.push(r.d3plus.id=r[e.id.value]+"_"+r[c]);return i}),u=d3.svg.line.radial().interpolate("linear-closed").radius(function(e,t){return void 0===o[e.d3plus.id]&&(o[e.d3plus.id]=0),isNaN(o[e.d3plus.id])&&(o[e.d3plus.id]=e.d3plus.r),o[e.d3plus.id]}).angle(function(e,t){return void 0===n[e.d3plus.id]&&(n[e.d3plus.id]=e.d3plus.a),isNaN(n[e.d3plus.id])&&(n[e.d3plus.id]=e.d3plus.a),n[e.d3plus.id]}),f=function(e,t){return e.attrTween("d",function(e){var r,i,s,l,d,f,p;for(p=e[c],s=l=0,d=p.length;d>l;s=++l)i=p[s],r=i.d3plus.a,void 0===t?f=i.d3plus.r:0===t&&(f=0),a.a[i.d3plus.id]=d3.interpolate(n[i.d3plus.id],r),a.r[i.d3plus.id]=d3.interpolate(o[i.d3plus.id],f);return function(t){var r,l,d;for(d=e[c],s=r=0,l=d.length;l>r;s=++r)i=d[s],n[i.d3plus.id]=a.a[i.d3plus.id](t),o[i.d3plus.id]=a.r[i.d3plus.id](t);return u(e[c])}})},r.append("path").attr("class","d3plus_data").call(i,e).attr("d",function(e){return u(e[c])}),t.selectAll("path.d3plus_data").data(l).transition().duration(e.draw.timing).call(i,e).call(f),s.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(f,0)):(r.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(l).call(i,e).attr("d",function(e){return d(e[c])}))}},{"./style.coffee":233}],231:[function(e,t,r){var n;n=e("./style.coffee"),t.exports=function(e,t,r,a){var o,i,s;return o=function(t){var r,n;return e.labels.value&&!t.d3plus.label?(n=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,r=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,t.d3plus_label={w:n,h:r,x:0,y:0},t.d3plus_share={w:n,h:r,x:0,y:0},t.d3plus_label.shape="circle"===t.d3plus.shape?"circle":"square"):t.d3plus.label?t.d3plus_label=t.d3plus.label:delete t.d3plus_label,[t]},i=function(e){return e.attr("x",function(e){return e.d3plus.init&&"x"in e.d3plus.init?e.d3plus.init.x:e.d3plus.init&&"width"in e.d3plus.init?-e.d3plus.width/2:0}).attr("y",function(e){return e.d3plus.init&&"y"in e.d3plus.init?e.d3plus.init.y:e.d3plus.init&&"height"in e.d3plus.init?-e.d3plus.height/2:0}).attr("width",function(e){return e.d3plus.init&&"width"in e.d3plus.init?e.d3plus.init.width:0}).attr("height",function(e){return e.d3plus.init&&"height"in e.d3plus.init?e.d3plus.init.height:0})},s=function(t){return t.attr("x",function(e){var t;return t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width,-t/2}).attr("y",function(e){var t;return t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height,-t/2}).attr("width",function(e){return e.d3plus.r?2*e.d3plus.r:e.d3plus.width}).attr("height",function(e){return e.d3plus.r?2*e.d3plus.r:e.d3plus.height}).attr("rx",function(e){var t,r;return t="circle"===e.d3plus.shape,r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width,t?(r+2)/2:0}).attr("ry",function(e){var t,r;return r="circle"===e.d3plus.shape,t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height,r?(t+2)/2:0}).attr("transform",function(e){return"rotate"in e.d3plus?"rotate("+e.d3plus.rotate+")":""}).attr("shape-rendering",function(t){return"square"!==t.d3plus.shape||"rotate"in t.d3plus?"auto":e.shape.rendering.value})},e.draw.timing?(r.append("rect").attr("class","d3plus_data").call(i).call(n,e),t.selectAll("rect.d3plus_data").data(o).transition().duration(e.draw.timing).call(s).call(n,e),a.selectAll("rect.d3plus_data").transition().duration(e.draw.timing).call(i)):(r.append("rect").attr("class","d3plus_data"),t.selectAll("rect.d3plus_data").data(o).call(s).call(n,e))}},{"./style.coffee":233}],232:[function(e,t,r){var n;n=e("../../../core/fetch/value.coffee"),t.exports=function(e,t,r){var a;return a=e[r].value,a?r in t.d3plus?t.d3plus[r]:n(e,t,a):t.d3plus[r]}},{"../../../core/fetch/value.coffee":67}],233:[function(e,t,r){var n,a,o;n=e("./color.coffee"),a=e("../../../client/ie.js"),o=e("../../../core/fetch/value.coffee"),t.exports=function(e,t){return e.attr("fill",function(e){return e.d3plus&&e.d3plus.spline?"none":n(e,t)}).style("stroke",function(e){var r;return e.d3plus&&e.d3plus.stroke?e.d3plus.stroke:(r=e.values?n(e.values[0],t):n(e,t,!0),d3.rgb(r).darker(.6))}).style("stroke-width",function(e){var r;if(a&&t.types[t.type.value].zoom)return 0;if("line"===e.d3plus.shape&&t.size.value){if(t.size.value.constructor===Number)return t.size.value;if(r=o(t,e,t.size.value),r&&r.length)return d3.max(r)}return t.data.stroke.width}).attr("opacity",t.data.opacity).attr("vector-effect","non-scaling-stroke")}},{"../../../client/ie.js":37,"../../../core/fetch/value.coffee":67,"./color.coffee":219}],234:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("triangle-down").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("triangle-down").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":233}],235:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("triangle-up").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("triangle-up").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":233}],236:[function(e,t,r){t.exports=function(e,t,r,n){var a,o,i,s,l,u,c,d,f;o=function(e){return e.d3plus.text?e.d3plus_label={w:d,h:d,x:0,y:0,background:"#fff",resize:!1,angle:["left","right"].indexOf(e.d3plus.position)>=0?90:0}:e.d3plus.label?e.d3plus_label=e.d3plus.label:delete e.d3plus_label,[e]},f=function(t){return t.style("stroke-width",e.data.stroke.width).style("stroke","#444").attr("fill","none").attr("shape-rendering",e.shape.rendering.value)},i=function(e){return e.attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",0)},c=function(e){return e.attr("x1",function(e){var t,r,n;return["top","bottom"].indexOf(e.d3plus.position)>=0?0:(t=e.d3plus.offset||0,r=e.d3plus.width||0,n=0>t?-r:r,n+t)}).attr("x2",function(e){return["top","bottom"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("y1",function(e){var t,r,n;return["left","right"].indexOf(e.d3plus.position)>=0?0:(r=e.d3plus.offset||0,t=e.d3plus.height||0,n=0>r?-t:t,n+r)}).attr("y2",function(e){return["left","right"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("marker-start","url(#d3plus_whisker_marker)")},s=e.defs.selectAll("#d3plus_whisker_marker").data([0]),s.enter().append("marker").attr("id","d3plus_whisker_marker").attr("markerUnits","userSpaceOnUse").style("overflow","visible").append("line"),a=t.datum(),a?(u=a.d3plus.position,l=["top","bottom"].indexOf(u)>=0?"horizontal":"vertical",d="horizontal"===l?a.d3plus.width:a.d3plus.height):(l="horizontal",d=0),s.select("line").attr("x1","horizontal"===l?-d/2:0).attr("x2","horizontal"===l?d/2:0).attr("y1","vertical"===l?-d/2:0).attr("y2","vertical"===l?d/2:0).call(f).style("stroke-width",2*e.data.stroke.width),e.draw.timing?(r.append("line").attr("class","d3plus_data").call(f).call(i),t.selectAll("line.d3plus_data").data(o).transition().duration(e.draw.timing).call(f).call(c),n.selectAll("line.d3plus_data").transition().duration(e.draw.timing).call(i)):(r.append("line").attr("class","d3plus_data"),t.selectAll("line.d3plus_data").data(o).call(f).call(c))}},{}],237:[function(e,t,r){var n=e("../../../client/pointer.coffee"),a=e("../../../client/prefix.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../client/touch.coffee"),s=e("../zoom/propagation.coffee");t.exports=function(e){e.dev.value&&o.time("creating SVG elements"),e.svg=e.container.value.selectAll("svg#d3plus").data([0]),e.svg.enter().insert("svg","#d3plus_message").attr("id","d3plus").attr("width",e.width.value).attr("height",e.height.value).attr("xmlns","http://www.w3.org/2000/svg").attr("xmlns:xlink","http://www.w3.org/1999/xlink"),e.g.bg=e.svg.selectAll("rect#bg").data(["bg"]),e.g.bg.enter().append("rect").attr("id","bg").attr("fill",e.background.value).attr("width",e.width.value).attr("height",e.height.value),e.g.timeline=e.svg.selectAll("g#timeline").data(["timeline"]),e.g.timeline.enter().append("g").attr("id","timeline").attr("transform","translate(0,"+e.height.value+")"),e.g.legend=e.svg.selectAll("g#key").data(["key"]),e.g.legend.enter().append("g").attr("id","key").attr("transform","translate(0,"+e.height.value+")"),e.g.footer=e.svg.selectAll("g#footer").data(["footer"]),e.g.footer.enter().append("g").attr("id","footer").attr("transform","translate(0,"+e.height.value+")");
var t="clipping_"+e.container.id;e.g.clipping=e.svg.selectAll("#clipping").data(["clipping"]),e.g.clipping.enter().append("clipPath").attr("id",t).append("rect").attr("width",e.width.viz).attr("height",e.height.viz),e.g.container=e.svg.selectAll("g#container").data(["container"]),e.g.container.enter().append("g").attr("id","container").attr("clip-path","url(#"+t+")").attr("transform","translate("+e.margin.left+","+e.margin.top+")"),e.g.zoom=e.g.container.selectAll("g#zoom").data(["zoom"]),e.g.zoom.enter().append("g").attr("id","zoom"),e.g.viz=e.g.zoom.selectAll("g#d3plus_viz").data(["d3plus_viz"]),e.g.viz.enter().append("g").attr("id","d3plus_viz"),e.g.overlay=e.g.viz.selectAll("rect#d3plus_overlay").data([{id:"d3plus_overlay"}]),e.g.overlay.enter().append("rect").attr("id","d3plus_overlay").attr("width",e.width.value).attr("height",e.height.value).attr("opacity",0),e.g.overlay.on(n.move,function(t){i&&s(e,d3.event),e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",a()+"grab"):d3.select(this).style("cursor","auto")}).on(n.up,function(t){i&&s(e,d3.event),e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",a()+"grab"):d3.select(this).style("cursor","auto")}).on(n.down,function(t){i&&s(e,d3.event),e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",a()+"grabbing"):d3.select(this).style("cursor","auto")}),e.g.app=e.g.viz.selectAll("g#app").data(["app"]),e.g.app.enter().append("g").attr("id","app"),e.g.edges=e.g.viz.selectAll("g#edges").data(["edges"]),e.g.edges.enter().append("g").attr("id","edges").attr("opacity",0),e.g.edge_focus=e.g.viz.selectAll("g#focus").data(["focus"]),e.g.edge_focus.enter().append("g").attr("id","focus"),e.g.edge_hover=e.g.viz.selectAll("g#edge_hover").data(["edge_hover"]),e.g.edge_hover.enter().append("g").attr("id","edge_hover").attr("opacity",0),e.g.data=e.g.viz.selectAll("g#data").data(["data"]),e.g.data.enter().append("g").attr("id","data").attr("opacity",0),e.g.data_focus=e.g.viz.selectAll("g#data_focus").data(["data_focus"]),e.g.data_focus.enter().append("g").attr("id","data_focus"),e.g.labels=e.g.viz.selectAll("g#d3plus_labels").data(["d3plus_labels"]),e.g.labels.enter().append("g").attr("id","d3plus_labels"),e.defs=e.svg.selectAll("defs").data(["defs"]),e.defs.enter().append("defs"),e.dev.value&&o.timeEnd("creating SVG elements")}},{"../../../client/pointer.coffee":38,"../../../client/prefix.coffee":39,"../../../client/touch.coffee":43,"../../../core/console/print.coffee":52,"../zoom/propagation.coffee":252}],238:[function(e,t,r){var n=e("../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&n.time("updating SVG elements"),e.draw.timing?(e.container.value.transition().duration(e.draw.timing).style("width",e.width.value+"px").style("height",e.height.value+"px"),e.svg.transition().duration(e.draw.timing).attr("width",e.width.value).attr("height",e.height.value),e.g.bg.transition().duration(e.draw.timing).attr("width",e.width.value).attr("height",e.height.value).attr("fill",e.background.value),e.g.clipping.select("rect").transition().duration(e.draw.timing).attr("width",e.width.viz).attr("height",e.height.viz),e.g.container.transition().duration(e.draw.timing).attr("transform","translate("+e.margin.left+","+e.margin.top+")")):(e.container.value.style("width",e.width.value+"px").style("height",e.height.value+"px"),e.svg.attr("width",e.width.value).attr("height",e.height.value),e.g.bg.attr("width",e.width.value).attr("height",e.height.value).attr("fill",e.background.value),e.g.clipping.select("rect").attr("width",e.width.viz).attr("height",e.height.viz),e.g.container.attr("transform","translate("+e.margin.left+","+e.margin.top+")")),e.dev.value&&n.timeEnd("updating SVG elements")}},{"../../../core/console/print.coffee":52}],239:[function(e,t,r){var n=e("../../../array/sort.coffee"),a=e("../../../tooltip/create.js"),o=e("../../../core/data/nest.js"),i=e("./data.js"),s=e("../../../core/fetch/color.coffee"),l=e("../../../core/fetch/text.js"),u=e("../../../core/fetch/value.coffee"),c=e("../../../object/merge.coffee"),d=e("../../../tooltip/remove.coffee"),f=e("../shapes/segments.coffee"),p=e("../../../client/scroll.js"),h=e("../../../util/uniques.coffee"),v=e("../../../object/validate.coffee"),g=e("../zoom/direction.coffee");t.exports=function(e){function t(t){function p(e){return"string"==typeof r[e].value?r[e].value:r.format.locale.value.method[e]}var g,w="depth"in e?e.depth:y,j={},M=r.id.nesting[w+1]in m?w+1:w,O=r.id.nesting[M],C="merged"in m.d3plus?m.d3plus.merged:m[O];C instanceof Array||(C=[C]);var B=u(r,m,r.size.value);if(r.tooltip.children.value){if(C=C.slice(0),C.length>1&&v(C[0])&&(C=o(r,C,[O])),r.size.value&&v(C[0])){var N=[],P=C.filter(function(e){var t=u(r,e,r.size.value);return null===t||"d3plus"in e&&e.d3plus.merged?void N.push(e):!0});n(P,r.size.value,"desc",[],r),C=P.concat(N)}var I="short"===A?3:r.data.large,q=C.length,V=d3.min([q,I]);g={values:[]};for(var R=0;V>R&&C.length;R++){var D=C.shift(),U=l(r,D,M)[0],L=v(D)?u(r,D,O,M):D;if(L!==m[r.id.nesting[w]]&&U&&!g[U]){var Y=v(D)?u(r,D,r.size.value,O):null,H=s(r,D,O);g[U]=!Y||Y instanceof Array?"":r.format.value(Y,{key:r.size.value,vars:r,data:D});var X={};X[U]=g[U],g.values.push(X),H&&(g.d3plus_colors||(g.d3plus_colors={}),g.d3plus_colors[U]=H)}else R--}q>V&&(g.d3plusMore=q-V)}m.d3plus.tooltip&&(j=c(j,m.d3plus.tooltip)),r.tooltip.size.value&&(B&&"number"!=typeof r.size.value&&(j[p("size")]=B),r.axes.opposite&&r[r.axes.opposite].value!==r.size.value&&(j[p(r.axes.opposite)]=u(r,m,r[r.axes.opposite].value)),r.axes.opposite&&r[r.axes.opposite+"2"].value!==r.size.value&&(j[p(r.axes.opposite+"2")]=u(r,m,r[r.axes.opposite+"2"].value)),r.color.valueScale&&(j[p("color")]=u(r,m,r.color.value)));var G=f(r,m,"active"),W=f(r,m,"temp"),Q=f(r,m,"total");"number"==typeof G&&G>0&&Q&&(j[p("active")]=G+"/"+Q+" ("+r.format.value(G/Q*100,{key:"share",vars:r,data:m})+")"),"number"==typeof W&&W>0&&Q&&(j[p("temp")]=W+"/"+Q+" ("+r.format.value(W/Q*100,{key:"share",vars:r,data:m})+")"),r.tooltip.share.value&&m.d3plus.share&&(j.share=r.format.value(100*m.d3plus.share,{key:"share",vars:r,data:m}));var M="depth"in e?e.depth:y,J=e.title||l(r,m,M)[0],K=h(m,r.icon.value,u,r,r.id.nesting[M]),Z=i(r,m,A,j,g,M);if(K=1===K.length&&"string"==typeof K[0]?K[0]:!1,Z.length>0||E||!m.d3plus_label&&"short"==A&&J||m.d3plus_label&&(!("visible"in m.d3plus_label)||"visible"in m.d3plus_label&&m.d3plus_label.visible===!1)){J||(J=r.format.value(L,{key:r.id.value,vars:r}));var M="d3plus"in m&&"merged"in m.d3plus?y-1:"depth"in e?e.depth:y;if(0>M&&(M=0),M=r.id.nesting[M],"string"==typeof r.icon.style.value)var $=r.icon.style.value;else if("object"==typeof r.icon.style.value&&r.icon.style.value[M])var $=r.icon.style.value[M];else var $="default";var ee=r.tooltip.small;e.width?ee=e.width:k&&(ee=r.tooltip.large);var te=!k&&"long"!==e.length||k&&r.tooltip.fullscreen.value?d3.select("body"):r.container.value;!e.description&&m&&r.tooltip.sub.value&&(e.description=u(r,m,r.tooltip.sub.value)),a({align:z,arrow:b,locale:r.format.locale.value,background:r.tooltip.background,curtain:r.tooltip.curtain.color,curtainopacity:r.tooltip.curtain.opacity,fontcolor:r.tooltip.font.color,fontfamily:r.tooltip.font.family.value,fontsize:r.tooltip.font.size,fontweight:r.tooltip.font.weight,data:Z,color:s(r,m),allColors:!0,footer:e.footer===!1?e.footer:E,fullscreen:k,html:t,js:e.js,icon:K,id:_,max_height:e.maxheight,max_width:ee,mouseevents:x,offset:T,parent:te,stacked:r.tooltip.stacked.value,style:$,title:J,description:e.description,width:e.width||k||0!=Z.length?ee:"auto",x:F,y:S})}else d(_)}"d3plus"in e.data||(e.data.d3plus={});var r=e.vars,m=e.data,y="d3plus"in m&&"depth"in m.d3plus?m.d3plus.depth:r.depth.value,x=(e.ex,e.mouseevents?e.mouseevents:!1),b="arrow"in e?e.arrow:!0,w=u(r,m,r.id.value),_=e.id||r.type.value;if(!d3.event||"click"!=d3.event.type||!r.tooltip.html.value&&!r.tooltip.value["long"]||"fullscreen"in e){var k=!1,z=e.anchor||r.tooltip.anchor,A=e.length||"short",j=g(m,r);if(-1===j){var M=r.id.nesting[y-1];u(r,w,M)}var O="";if(r.mouse.click.value&&(!r.mouse.viz||r.mouse.viz.click!==!1))if(1===j&&r.zoom.value)var O=r.format.value(r.format.locale.value.ui.expand);else if(-1===j&&r.zoom.value&&r.history.states.length&&!r.tooltip.value["long"])var O=r.format.value(r.format.locale.value.ui.collapse);else if(r.small||"short"!=A||!r.tooltip.html.value&&!r.tooltip.value["long"]||1===r.focus.value.length&&r.focus.value[0]==w){if("long"==A)var O=r.footer.value||""}else var O=r.format.locale.value.ui.moreInfo;var E=O.length?r.format.value(O,{key:"footer",vars:r}):!1}else{var k=!0,b=!1,x=!0,A="long",E=r.footer.value;r.covered=!0}if("x"in e)var F=e.x;else if("static"===r.types[r.type.value].tooltip){var F=m.d3plus.x;r.zoom.translate&&r.zoom.scale&&(F=r.zoom.translate[0]+F*r.zoom.scale),F+=r.margin.left,"long"!==e.length&&(S+=p.x(),F+=r.container.value.node().getBoundingClientRect().left,F+=parseFloat(r.container.value.style("padding-left"),10))}else var F=d3.mouse(d3.select("html").node())[0];if("y"in e)var S=e.y;else if("static"==r.types[r.type.value].tooltip){var S=m.d3plus.y;r.zoom.translate&&r.zoom.scale&&(S=r.zoom.translate[1]+S*r.zoom.scale),S+=r.margin.top,"long"!==e.length&&(S+=p.y(),S+=r.container.value.node().getBoundingClientRect().top,S+=parseFloat(r.container.value.style("padding-top"),10))}else var S=d3.mouse(d3.select("html").node())[1];if("offset"in e)var T=e.offset;else if("static"==r.types[r.type.value].tooltip){var T=m.d3plus.r?m.d3plus.r:m.d3plus.height/2;r.zoom.scale&&(T*=r.zoom.scale)}else var T=3;if(k||"long"===e.length)if("string"==typeof r.tooltip.html.value)t(r.tooltip.html.value);else if("function"==typeof r.tooltip.html.value)t(r.tooltip.html.value(w));else if(r.tooltip.html.value&&"object"==typeof r.tooltip.html.value&&r.tooltip.html.value.url){var C=r.tooltip.html.value.url;"function"==typeof C&&(C=C(w)),d3.json(C,function(e){var n=r.tooltip.html.value.callback?r.tooltip.html.value.callback(e):e;t(n)})}else t(e.html);else t(e.html)}},{"../../../array/sort.coffee":34,"../../../client/scroll.js":41,"../../../core/data/nest.js":60,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/merge.coffee":170,"../../../object/validate.coffee":171,"../../../tooltip/create.js":200,"../../../tooltip/remove.coffee":202,"../../../util/uniques.coffee":209,"../shapes/segments.coffee":232,"../zoom/direction.coffee":249,"./data.js":240}],240:[function(e,t,r){var n=e("../../../util/copy.coffee"),a=e("../../../core/fetch/value.coffee"),o=e("../../../core/fetch/color.coffee"),i=e("../../../core/fetch/text.js"),s=e("../../../color/legible.coffee"),l=e("../../../object/merge.coffee"),u=e("../../../client/prefix.coffee"),c=e("../../../string/format.js"),d=e("../../../object/validate.coffee");t.exports=function(e,t,r,f,p,h){function v(r,n){if(e.attrs.value[n])var o=n;else var o=null;n&&(n=e.format.value(n));var i=m[r]||a(e,t,r,o);if(d(i))w.push({name:e.format.value(r),value:e.format.value(i.value,{key:i.key,vars:e}),group:n});else if(null!=i&&"undefined"!=i&&!(i instanceof Array)&&("string"==typeof i&&i.indexOf("d3plus_other")<0||"string"!=typeof i)){var s=e.format.locale.value.ui[r]?e.format.value(e.format.locale.value.ui[r]):e.format.value(r),l=x.indexOf(r)>=0;i instanceof Array?i.forEach(function(n){n=e.format.value(n,{key:r,vars:e,data:t})}):i=e.format.value(i,{key:r,vars:e,data:t});var u={name:s,value:i,highlight:l,group:n};if(e.descs.value)if("function"==typeof e.descs.value){var c=e.descs.value(r);"string"==typeof c&&(u.desc=c)}else r in e.descs.value&&(u.desc=e.descs.value[r]);w.push(u)}}if(e.small)return[];if(!r)var r="long";if("long"==r)var g="short";else var g="long";var m={};if(f&&"string"==typeof f)f=[f];else if(f&&"object"==typeof f){m=l(m,f);var f=[];for(var y in m)f.push(y)}else if(!f)var f=[];var x=[];if(e.tooltip.value instanceof Array)var b=e.tooltip.value;else if("string"==typeof e.tooltip.value)var b=[e.tooltip.value];else{if(e.tooltip.value[e.id.nesting[h]])var b=e.tooltip.value[e.id.nesting[h]];else var b=e.tooltip.value;b instanceof Array||(b=b[r]?b[r]:b[g]?[]:l({"":[]},b)),"string"==typeof b?b=[b]:b instanceof Array||(b=l({"":[]},b))}var w=[];if(b.constructor===Array&&(b={"":b}),e.id.nesting.length&&h<e.id.nesting.length-1){var b=n(b);e.id.nesting.forEach(function(e,t){t>h&&b[e]&&delete b[e]})}for(var _ in b){b[_].constructor!==Array&&(b[_]=[b[_]]);for(var k=f.length;k>0;k--)b[_].indexOf(f[k-1])>=0&&f.splice(k-1,1)}if(e.tooltip.value["long"]&&"object"==typeof e.tooltip.value["long"]){for(var _ in e.tooltip.value["long"])for(var k=f.length;k>0;k--){var z=f[k-1];e.tooltip.value["long"][_].indexOf(z)>=0&&(b[_]||(b[_]=[]),b[_].push(z),f.splice(k-1,1))}}f.length&&(b[""]||(b[""]=[]),b[""]=b[""].concat(f));for(var _ in b)b[_].forEach(function(e){v(e,_)});if(p){var A=e.format.locale.value.ui.including,j=p.d3plus_colors;p.values.forEach(function(t){var r=d3.keys(t)[0];w.push({group:e.format.value(A),highlight:j&&j[r]?j[r]:!1,name:r,value:t[r]})}),p.d3plusMore&&w.push({group:e.format.value(A),highlight:!0,name:c(e.format.locale.value.ui.more,p.d3plusMore),value:""})}if(e.tooltip.connections.value&&"long"===r){var M=e.edges.connections(t[e.id.value],e.id.value,!0);M.length&&M.forEach(function(t){var r=e.data.viz.filter(function(r){return r[e.id.value]===t[e.id.value]}),r=r.length?r[0]:t,n=i(e,r)[0],a=o(e,r),l=e.tooltip.font.size,c="square"==e.shape.value?0:l;styles=["background-color: "+a,"border-color: "+s(a),"border-style: solid","border-width: "+e.data.stroke.width+"px","display: inline-block","height: "+l+"px","left: 0px","position: absolute","width: "+l+"px","top: 0px",u()+"border-radius: "+c+"px"],node="<div style='"+styles.join("; ")+";'></div>";var d=function(){e.self.focus([r[e.id.value]]).draw()};w.push({group:e.format.value(e.format.locale.value.ui.primary),highlight:!1,link:d,name:"<div id='d3plustooltipfocuslink_"+r[e.id.value]+"' class='d3plus_tooltip_focus_link' style='position:relative;padding-left:"+1.5*l+"px;'>"+node+n+"</div>"})})}return w}},{"../../../client/prefix.coffee":39,"../../../color/legible.coffee":44,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/merge.coffee":170,"../../../object/validate.coffee":171,"../../../string/format.js":172,"../../../util/copy.coffee":206}],241:[function(e,t,r){var n;n=e("../../../core/console/print.coffee"),t.exports=function(e){var t,r,a,o,i,s,l,u,c,d;if(e.group=e.g.apps[e.type.value],e.mouse.viz=!1,e.edges.path=!1,d=e.types[e.type.value],u=d.requirements||[],a=u.indexOf("data")>=0,o=!a||a&&e.data.viz.length,!e.error.internal&&o){for(t=e.format.locale.value.visualization[e.type.value],e.dev.value&&n.time("running "+t),l=e.data.viz,i=0,s=l.length;s>i;i++)r=l[i],r.d3plus&&(delete r.d3plus.shape,delete r.d3plus.label,delete r.d3plus.rotate,delete r.d3plus.share);c=d(e),e.dev.value&&n.timeEnd("running "+t)}else c=null;e.returned={nodes:[],edges:null},c instanceof Array?e.returned.nodes=c:c&&(c.nodes&&(e.returned.nodes=c.nodes),c.edges&&(e.returned.edges=c.edges))}},{"../../../core/console/print.coffee":52}],242:[function(e,t,r){var n=e("../../../util/copy.coffee"),a=e("../../../form/form.js"),o=e("../../../core/console/print.coffee"),i=e("../../../object/validate.coffee");t.exports=function(e){var t=e.ui.value&&e.ui.value.length,r=e.ui.position.value;e.dev.value&&t&&o.time("drawing custom UI elements");var s=e.container.value.selectAll("div#d3plus_drawer").data(["d3plus_drawer"]);s.enter().append("div").attr("id","d3plus_drawer");var l={};e.ui.position.accepted.forEach(function(t){l[t]=t==r?e.margin.bottom+"px":"auto"}),s.style("text-align",e.ui.align.value).style("position","absolute").style("width",e.width.value-2*e.ui.padding+"px").style("height","auto").style(l);var u=s.selectAll("div.d3plus_drawer_ui").data(t?e.ui.value:[],function(e){return e.method||!1});u.exit().remove(),u.enter().append("div").attr("class","d3plus_drawer_ui").style("display","inline-block"),u.style("padding",e.ui.padding+"px").each(function(t){t.form||(t.form=a().container(d3.select(this)).data({sort:!1}).id("id").text("text"));var r,o;"string"==typeof t.method&&t.method in e?(r=e[t.method].value,o=function(r){r!==e[t.method].value&&e.self[t.method](r).draw()}):(r=t.value[0],i(r)&&(r=r[d3.keys(r)[0]]),"function"==typeof t.method&&(o=function(r){t.method(r,e.self)}));var s,l=[];t.label?s=t.label:"string"==typeof t.method&&t.method in e&&(s=e.format.locale.value.method[t.method]||t.method),t.value.forEach(function(t){var r={};i(t)?(r.id=t[d3.keys(t)[0]],r.text=e.format.value(d3.keys(t)[0])):(r.id=t,r.text=e.format.value(t)),l.push(r)});var u=n(e.ui.font);u.align=n(e.font.align),u.secondary=n(u),t.form.data(l).font(u).focus(t.value.length>1?r:!1).focus({callback:o}).format(e.format.locale.language).format({number:e.format.number.value,text:e.format.text.value}).title(e.format.value(s)).type(t.type||"auto").ui({align:e.ui.align.value,border:e.ui.border,color:{primary:e.ui.color.primary.value,secondary:e.ui.color.secondary.value},padding:e.ui.padding,margin:0}).width(t.width||!1).draw()});var c=s.node().offsetHeight||s.node().getBoundingClientRect().height;c&&(e.margin[r]+=c),e.dev.value&&t&&o.timeEnd("drawing custom UI elements")}},{"../../../core/console/print.coffee":52,"../../../form/form.js":103,"../../../object/validate.coffee":171,"../../../util/copy.coffee":206}],243:[function(e,t,r){var n,a,o,i;n=e("../../../client/pointer.coffee"),a=e("../../../color/lighter.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../client/css.coffee"),t.exports=function(e){var t,r,s,l,u,c,d,f,p,h,v,g,m,y,x;return!e.small&&e.history.states.length>0?(e.dev.value&&o.time("drawing back button"),t=e.container.value.selectAll("div#d3plus_back_button").data(["d3plus_back_button"]).style("position","relative").style("z-index",1900),p=e.title.sub.font.size,r=e.title.sub.font.color,u=e.title.sub.font.family.value,x=e.title.sub.font.weight,f=e.title.sub.padding,g=!1,e.title.sub.value&&["start","left"].indexOf(e.title.sub.font.align)<0?g="sub":e.title.total.value&&["start","left"].indexOf(e.title.total.font.align)<0?g="total":e.title.value&&["start","left"].indexOf(e.title.font.align)<0&&(g="title"),g?(h=function(e){var t;return t=e.attr("transform").split(","),t=t[t.length-1],parseFloat(t.substring(0,t.length-1))},m=e.svg.select(".d3plus_title."+g),y=h(m)+h(m.select("text"))):(y=e.margin.top-e.title.padding,d=p+2*f,e.margin.top+=d),s=parseFloat(e.container.value.style("padding-top"),10),y+=s,s=parseFloat(e.container.value.style("padding-left"),10),c=e.margin.left+p/2+s,v=function(e){return e.style("position","absolute").style("left",c+"px").style("top",y+"px").style("color",r).style("font-family",u).style("font-weight",x).style("font-size",p+"px")},l=t.enter().append("div").attr("id","d3plus_back_button").style("opacity",0).call(v).html(function(){var t;return i("font-awesome")&&0===e.icon.back.value.indexOf("fa-")?(t="<i class='fa "+e.icon.back.value,t+="' style='margin-top:2px;margin-right:4px;'></i>"):t=e.icon.back.value+" ",t+e.format.value(e.format.locale.value.ui.back)}),t.on(n.over,function(){return!e.small&&e.history.states.length>0?d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).style("color",a(r,.25)):void 0}).on(n.out,function(){return!e.small&&e.history.states.length>0?d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("color",r):void 0}).on(n.click,function(){return e.history.back()}).transition().duration(e.draw.timing).style("opacity",1).call(v),e.dev.value?o.timeEnd("drawing back button"):void 0):e.container.value.selectAll("div#d3plus_back_button").transition().duration(e.draw.timing).style("opacity",0).remove()}},{"../../../client/css.coffee":36,"../../../client/pointer.coffee":38,"../../../color/lighter.coffee":45,"../../../core/console/print.coffee":52}],244:[function(e,t,r){var n=e("../../../array/sort.coffee"),a=e("../../../util/buckets.coffee"),o=e("../../../util/copy.coffee"),i=e("../tooltip/create.js"),s=e("../../../core/data/nest.js"),l=e("../../../util/dataURL.coffee"),u=e("../../../client/pointer.coffee"),c=e("../../../core/fetch/value.coffee"),d=e("../../../core/fetch/color.coffee"),f=e("../../../core/fetch/text.js"),p=e("../../../core/console/print.coffee"),h=e("../../../tooltip/remove.coffee"),v=e("../../../color/text.coffee"),g=e("../../../util/uniques.coffee"),m=e("../../../client/scroll.js"),y=e("../../../string/strip.js"),x=e("../../../textwrap/textwrap.coffee"),b=(e("../../../client/touch.coffee"),e("../../../object/validate.coffee"));t.exports=function(e){function t(t){t.attr("transform",function(t,r){var n=T+r*(e.ui.padding+_);return"translate("+n+","+e.ui.padding+")"})}function r(t){t.attr("width",_).attr("height",_).attr("fill",function(t){d3.select(this.parentNode).select("text").remove();var r=g(t,e.icon.value,c,e,V),n=d(e,t,V);if(e.legend.icons.value&&1===r.length&&"string"==typeof r[0]){r=r[0];var a,o=y(r+"_"+n),i=e.icon.style.value,s=e.defs.selectAll("pattern#"+o).data([o]);a="string"==typeof i?e.icon.style.value:b(i)&&i[V]?i[V]:"default",n="knockout"==a?n:"none",s.select("rect").transition().duration(e.draw.timing).attr("fill",n).attr("width",_).attr("height",_),s.select("image").transition().duration(e.draw.timing).attr("width",_).attr("height",_);var u=s.enter().append("pattern").attr("id",o).attr("width",_).attr("height",_);return u.append("rect").attr("fill",n).attr("width",_).attr("height",_),u.append("image").attr("xlink:href",r).attr("width",_).attr("height",_).each(function(e){0===r.indexOf("/")||r.indexOf(window.location.hostname)>=0?l(r,function(e){s.select("image").attr("xlink:href",e)}):s.select("image").attr("xlink:href",r)}),"url(#"+o+")"}if(e.legend.labels.value){var p;if(p=e.legend.text.value?[c(e,t,e.legend.text.value,q)]:f(e,t,q),1===p.length&&!(p[0]instanceof Array)&&p[0].length){var h=d3.select(this.parentNode).append("text"),m=e.legend.font.size;m instanceof Array||(m=[m]),h.attr("font-size",m[m.length-1]+"px").attr("font-weight",e.legend.font.weight).attr("font-family",e.legend.font.family.value).attr("fill",v(n)).attr("x",0).attr("y",0).each(function(t){x().align("middle").container(d3.select(this)).height(_).padding(e.ui.padding).resize(m.length>1).size(m).text(p[0]).width(_).valign("middle").draw()}),h.select("tspan").empty()&&h.remove()}}return n})}var w=!0,_=0;if(!e.error.internal&&e.color.value&&!e.small&&e.legend.value)if(e.color.valueScale)if(e.color.valueScale){e.dev.value&&p.time("drawing color scale"),e.g.legend.selectAll("g.d3plus_color").transition().duration(e.draw.timing).attr("opacity",0).remove();var k=e.color.valueScale.domain(),z=e.color.valueScale.range();k.length<=2&&(k=a(k,6));var A=e.g.legend.selectAll("g.d3plus_scale").data(["scale"]);A.enter().append("g").attr("class","d3plus_scale").attr("opacity",0);var j=A.selectAll("#d3plus_legend_heatmap").data(["heatmap"]);j.enter().append("linearGradient").attr("id","d3plus_legend_heatmap").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").attr("spreadMethod","pad");var M=j.selectAll("stop").data(d3.range(0,z.length));M.enter().append("stop").attr("stop-opacity",1),M.attr("offset",function(e){return Math.round(e/(z.length-1)*100)+"%"}).attr("stop-color",function(e){return z[e]}),M.exit().remove();var O=A.selectAll("rect#gradient").data(["gradient"]);O.enter().append("rect").attr("id","gradient").attr("x",function(t){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",e.ui.padding).attr("width",0).attr("height",e.legend.gradient.height).attr("stroke",e.legend.font.color).attr("stroke-width",1).style("fill","url(#d3plus_legend_heatmap)");var E=A.selectAll("text.d3plus_tick").data(d3.range(0,k.length));E.enter().append("text").attr("class","d3plus_tick").attr("x",function(t){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",function(t){return this.getBBox().height+e.legend.gradient.height+2*e.ui.padding});var F=0;E.order().attr("font-weight",e.legend.font.weight).attr("font-family",e.legend.font.family.value).attr("font-size",e.legend.font.size+"px").style("text-anchor",e.legend.font.align).attr("fill",e.legend.font.color).text(function(t){return e.format.value(k[t],{key:e.color.value,vars:e})}).attr("y",function(t){return this.getBBox().height+e.legend.gradient.height+2*e.ui.padding}).each(function(e){var t=this.offsetWidth;t>F&&(F=t)}),F+=2*e.labels.padding;var S=F*(k.length-1);if(S+F<e.width.value){S+F<e.width.value/2&&(S=e.width.value/2,F=S/k.length,S-=F);var T;T="start"==e.legend.align?e.ui.padding:"end"==e.legend.align?e.width.value-e.ui.padding-S:e.width.value/2-S/2,E.transition().duration(e.draw.timing).attr("x",function(e){return T+F*e}),E.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();var C=A.selectAll("rect.d3plus_tick").data(d3.range(0,k.length));C.enter().append("rect").attr("class","d3plus_tick").attr("x",function(t){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",e.ui.padding).attr("width",0).attr("height",e.ui.padding+e.legend.gradient.height).attr("fill",e.legend.font.color),C.transition().duration(e.draw.timing).attr("x",function(e){var t=0===e?1:0;return T+F*e-t}).attr("y",e.ui.padding).attr("width",1).attr("height",e.ui.padding+e.legend.gradient.height).attr("fill",e.legend.font.color),C.exit().transition().duration(e.draw.timing).attr("width",0).remove(),O.transition().duration(e.draw.timing).attr("x",function(t){return"middle"==e.legend.align?e.width.value/2-S/2:"end"==e.legend.align?e.width.value-S-e.ui.padding:e.ui.padding}).attr("y",e.ui.padding).attr("width",S).attr("height",e.legend.gradient.height),A.transition().duration(e.draw.timing).attr("opacity",1),e.dev.value&&p.timeEnd("drawing color scale")}else w=!1}else w=!1;else{e.dev.value&&p.time("grouping data by colors");var B;if(e.nodes.value&&e.types[e.type.value].requirements.indexOf("nodes")>=0){if(B=o(e.nodes.restriced||e.nodes.value),e.data.viz.length)for(var N=0;N<B.length;N++){var P=e.data.viz.filter(function(t){return t[e.id.value]===B[N][e.id.value]});P.length&&(B[N]=P[0])}}else B=e.data.viz;B.length&&"key"in B[0]&&"values"in B[0]&&(B=d3.merge(B.map(function(e){return e.values})));var I=function(t){return d(e,t,q)},q=0,V=e.id.value,R=e.id.nesting.indexOf(e.color.value);if(R>=0)q=R,V=e.id.nesting[R];else for(var D=0;D<=e.depth.value;D++){q=D,V=e.id.nesting[D];var U=g(B,function(t){return c(e,t,V)}),L=g(B,I);if(U.length>=L.length&&L.length>1)break}var Y=[e.color.value],z=s(e,B,Y,!1);e.dev.value&&p.timeEnd("grouping data by color");var H=e.width.value;_=e.legend.size;var S=_*z.length+e.ui.padding*(z.length+1);if(_ instanceof Array){e.dev.value&&p.time("calculating legend size");for(var N=_[1];N>=_[0];N--)if(S=N*z.length+e.ui.padding*(z.length+1),H>=S){_=N;break}e.dev.value&&p.timeEnd("calculating legend size")}else"number"!=typeof _&&_!==!1&&(_=30);if(S>H||1==z.length)w=!1;else{S-=2*e.ui.padding,e.dev.value&&p.time("sorting legend");var X=e[e.legend.order.value].value,G=e.color.value;X?"color"!==e.legend.order.value&&(G=[]):X=e[e.color.value].value,n(z,X,e.legend.order.sort.value,G,e,q),e.dev.value&&p.timeEnd("sorting legend"),e.dev.value&&p.time("drawing legend");var T;T="start"==e.legend.align?e.ui.padding:"end"==e.legend.align?H-e.ui.padding-S:H/2-S/2,e.g.legend.selectAll("g.d3plus_scale").transition().duration(e.draw.timing).attr("opacity",0).remove();var W={},Q=e.g.legend.selectAll("g.d3plus_color").data(z,function(t){var r=d(e,t,V);return r in W||(W[r]=-1),W[r]++,W[r]+"_"+r});Q.enter().append("g").attr("class","d3plus_color").attr("opacity",0).call(t).append("rect").attr("class","d3plus_color").call(r),Q.order().transition().duration(e.draw.timing).call(t).attr("opacity",1).selectAll("rect.d3plus_color").call(r),Q.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.legend.tooltip.value&&Q.on(u.over,function(t,r){d3.select(this).style("cursor","pointer");var n,a,o=this.getBoundingClientRect(),s=o.left+_/2+m.x(),l=o.top+_/2+m.y()+5,d=c(e,t,V),p=e.id.nesting.indexOf(V),h=p>=0?f(e,t,p)[0]:e.format.value(c(e,t,e.color.value,V),{key:e.color.value,vars:e,data:t});if(e.legend.filters.value&&!(d instanceof Array)){n="<div style='text-align:center;'>";var v=e.format.locale.value;n+="<div class='mute'>"+e.format.value(v.method.mute)+"</div>",n+="<div class='solo'>"+e.format.value(v.method.solo)+"</div>",n+="</div>",a=function(t){var r={border:"1px solid #ccc",display:"inline-block",margin:"1px 2px",padding:"3px 5px"};t.select(".mute").style(r).on(u.over,function(){d3.select(this).style("cursor","pointer")}).on(u.click,function(){var t=e.id.mute.value;e.history.states.push(function(){e.self.id({mute:t}).draw()}),e.self.id({mute:d}).draw()}),t.select(".solo").style(r).on(u.over,function(){d3.select(this).style("cursor","pointer")}).on(u.click,function(){var t=e.id.solo.value;e.history.states.push(function(){e.self.id({solo:t}).draw()}),e.self.id({solo:d}).draw()})}}i({data:t,html:n,js:a,depth:q,footer:!1,vars:e,x:s,y:l,mouseevents:this,title:h,offset:.4*_})}).on(u.out,function(t){h(e.type.value)}),e.dev.value&&p.timeEnd("drawing legend")}}else w=!1;if(e.legend.value&&key&&w){if(e.dev.value&&p.time("positioning legend"),_)var J=_+e.ui.padding;else var K=e.g.legend.node().getBBox(),J=K.height+K.y;0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding),e.margin.bottom+=J,e.g.legend.transition().duration(e.draw.timing).attr("transform","translate(0,"+(e.height.value-e.margin.bottom)+")"),e.dev.value&&p.timeEnd("positioning legend")}else e.dev.value&&p.time("hiding legend"),e.g.legend.transition().duration(e.draw.timing).attr("transform","translate(0,"+e.height.value+")"),e.dev.value&&p.timeEnd("hiding legend")}},{"../../../array/sort.coffee":34,"../../../client/pointer.coffee":38,"../../../client/scroll.js":41,"../../../client/touch.coffee":43,"../../../color/text.coffee":50,"../../../core/console/print.coffee":52,"../../../core/data/nest.js":60,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/validate.coffee":171,"../../../string/strip.js":174,"../../../textwrap/textwrap.coffee":199,"../../../tooltip/remove.coffee":202,"../../../util/buckets.coffee":203,"../../../util/copy.coffee":206,"../../../util/dataURL.coffee":208,"../../../util/uniques.coffee":209,"../tooltip/create.js":239}],245:[function(e,t,r){var n=e("../../../client/pointer.coffee"),a=e("../../../color/text.coffee");t.exports=function(e,t){function r(t){t.style(i).style("position","absolute").style("background-color",l).style("text-align","center").style("left",function(){return"center"==s?"50%":"0px"}).style("width",function(){return"center"==s?"auto":e.width.value+"px"}).style("margin-left",function(){return"center"==s?-(this.offsetWidth/2)+"px":"0px"}).style("top",function(){return"center"==s?"50%":"top"==s?"0px":"auto"}).style("bottom",function(){return"bottom"==s?"0px":"auto"}).style("margin-top",function(){if("large"==o){var e=this.offsetHeight||this.getBoundingClientRect().height;return-e/2+"px"}return"0px"})}t=e.messages.value?t:null;var o=e.messages.style.value||(t===e.error.internal?"large":e.messages.style.backup);if("large"===o)var i=e.messages,s="center";else{if(e.footer.value)var i=e.footer;else if(e.title.value)var i=e.title;else if(e.title.sub.value)var i=e.title.sub;else if(e.title.total.value)var i=e.title.total;else var i=e.title.sub;var s=i.position}var i={color:i.font.color,"font-family":i.font.family.value,"font-weight":i.font.weight,"font-size":i.font.size+"px",padding:i.padding+"px"},l=e.messages.background.value;l||(l=e.background.value,
("none"===l||"transparent"===l)&&(l=a(i.color))),e.g.message=e.container.value.selectAll("div#d3plus_message").data(["message"]);var u=e.g.message.enter().append("div").attr("id","d3plus_message").attr("opacity",0);u.append("div").attr("class","d3plus_message_text").style("display","block"),e.g.message.select(".d3plus_message_text").text(t?t:e.g.message.text());var c=navigator.onLine,d=75,f=e.g.message.selectAll(".d3plus_message_branding").data(e.messages.branding.value&&"center"===s?[0]:[]);f.enter().append("div").attr("class","d3plus_message_branding").style("margin-top","15px").style("padding-top","0px").style("display","block").style("font-size","11px").style("background-size",d+"px").style("background-position","center 10px").style("background-repeat","no-repeat").style("cursor","pointer").on(n.click,function(){window.open("http://www.d3plus.org/","_blank")});var p=d3.hsl(l).l<.5?e.messages.branding.image.dark:e.messages.branding.image.light;f.text(c?"Powered by:":"Powered by D3plus").style("background-color",c?l:"transparent").style("background-image",c?"url('"+p+"')":"none").style("min-width",c?d+"px":"auto").style("height",c?d+"px":"auto"),f.exit().remove(),e.g.message.style("display",t?"inline-block":"none").call(r).style("opacity",t?1:0)}},{"../../../client/pointer.coffee":38,"../../../color/text.coffee":50}],246:[function(e,t,r){var n,a,o,i,s,l,u,c,d,f;n=e("../../../util/closest.coffee"),a=e("../../../client/css.coffee"),i=e("../../../font/sizes.coffee"),o=e("../../../client/pointer.coffee"),s=e("../../../color/mix.coffee"),u=e("../../../client/prefix.coffee"),c=e("../../../core/console/print.coffee"),d=e("../../../color/text.coffee"),f=e("../../../core/data/time.coffee"),l=!1,t.exports=function(e){var t,r,i,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H,X,G,W,Q,J,K,Z,$,ee,te,re,ne,ae,oe,ie;if(!e.timeline.value||e.error.internal&&e.data.missing||e.small||!e.data.time||!(e.data.time.values.length>1))return e.g.timeline.transition().duration(e.draw.timing).attr("transform","translate(0,"+e.height.value+")");if(e.dev.value&&c.time("drawing timeline"),H={"font-weight":e.ui.font.weight,"font-family":e.ui.font.family.value,"font-size":e.ui.font.size+"px","text-anchor":"middle"},ie=e.data.time.ticks.map(function(e){return new Date(e)}),J=f(e,{values:ie,style:H}),te=J.values.map(Number),Q=J.format,e.time.solo.value.length)for(w=d3.extent(e.time.solo.value),b=_=0,A=w.length;A>_;b=++_)m=w[b],m.constructor!==Date&&(m+="",4===m.length&&parseInt(m)+""===m&&(m+="/01/01"),m=new Date(m),w[b]=m);else w=d3.extent(ie);if(oe=ie.slice(),ne=d3.max(J.sizes.map(function(e){return e.height})),k=~~d3.max(J.sizes.map(function(e){return e.width}))+1,k+=2*e.ui.padding,Z=e.timeline.height.value||ne+2*e.ui.padding,ee=k*ie.length,P=Z,U=Z-2*e.ui.padding>=ne,t=e.width.value-2*e.ui.padding,U&&e.timeline.play.value&&(t-=P+e.ui.padding),!U||te.length<ie.length||t<k*te.length){for(E=k,k=(t-k)/ie.length,ee=k*ie.length,$=1,G=~~(E/(ee/te.length))+1;G<te.length-1&&(te.length-1)%G!==0;)G++;te=te.filter(function(e,t){return t%G===0})}else $=0,M=new Date(ie[0]),R=e.data.time.stepType,M["set"+R](M["get"+R]()+ie.length),oe.push(M);return q=new Date(w[0]),q=n(oe,q),y=new Date(w[1]),$||y["set"+e.data.time.stepType](y["get"+e.data.time.stepType]()+1),y=n(oe,y),ae=oe.map(Number),O=ae.indexOf(+q),j=ae.indexOf(+y),p=[q,y],V="start"===e.timeline.align?e.ui.padding:"end"===e.timeline.align?e.width.value-e.ui.padding-ee:e.width.value/2-ee/2,U&&e.timeline.play.value&&(V+=(P+e.ui.padding)/2),D=function(){return clearInterval(l),l=!1,S.call(T,"icon")},v=function(){var e,t,r;if(null!==d3.event.sourceEvent){if(l&&D(),p=i.extent(),r=n(oe,p[0]),t=n(oe,p[1]),r===t&&(O=ae.indexOf(+r),r<p[0]||0===O?t=oe[O+1]:r=oe[O-1]),O=ae.indexOf(+r),j=ae.indexOf(+t),j-O>=1)e=[r,t];else if(O+1<=ie.length)e=[r,oe[O+1]];else{for(e=[r],b=1;1>=b;)O+b<=ie.length?e.push(oe[O+b]):e.unshift(oe[O-(O+b-ie.length)]),b++;e=[e[0],e[e.length-1]]}return p=e,L.attr("fill",Y),d3.select(this).call(i.extent(e))}},I=function(){var t;return j-O===ie.length-$?t=[]:(t=ae.filter(function(e,t){return t>=O&&j+$>t}),t=t.map(function(e){return new Date(e)})),N(),e.self.time({solo:t}).draw()},g=function(){var t,r,a,o;return null!==d3.event.sourceEvent&&(e.time.solo.value.length?(o=d3.extent(e.time.solo.value),a=ae.indexOf(+n(oe,o[0])),r=ae.indexOf(+n(oe,o[1])),t=a!==O||r!==j):t=j-O!==ie.length-$,t)?I():void 0},F=e.g.timeline.selectAll("rect.d3plus_timeline_play").data(U&&e.timeline.play.value?[0]:[]),B=function(t){return t.attr("width",P+1).attr("height",Z+1).attr("fill",e.ui.color.primary.value).attr("stroke",e.ui.color.primary.value).attr("stroke-width",1).attr("x",V-P-1-e.ui.padding).attr("y",e.ui.padding)},F.enter().append("rect").attr("class","d3plus_timeline_play").attr("shape-rendering","crispEdges").attr("opacity",0).call(B),F.transition().duration(e.draw.timing).call(B),F.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),S=e.g.timeline.selectAll("text.d3plus_timeline_playIcon").data(U&&e.timeline.play.value?[0]:[]),T=function(t,r){var n;return r=e.timeline.play[r],a("font-awesome")?(r=r.awesome,n="FontAwesome"):(r=r.fallback,n="inherit"),t.style("font-family",n).text(r)},C=function(t){var r;return r=Z/2+e.ui.padding+1,t.attr("fill",d(e.ui.color.primary.value)).attr(H).attr("x",V-(P-1)/2-e.ui.padding).attr("y",r).attr("dy","0.5ex").call(T,l?"pause":"icon")},S.enter().append("text").attr("class","d3plus_timeline_playIcon").call(C).style("pointer-events","none").attr("opacity",0),S.call(C).transition().duration(e.draw.timing).attr("opacity",1),S.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),N=function(){return j-O===ie.length-$?(F.on(o.hover,null).on(o.click,null).transition().duration(e.draw.timing).attr("opacity",.3),S.transition().duration(e.draw.timing).attr("opacity",.3)):(F.on(o.over,function(){return d3.select(this).style("cursor","pointer")}).on(o.out,function(){return d3.select(this).style("cursor","auto")}).on(o.click,function(){return l?D():(S.call(T,"pause"),j===ie.length?(j-=O,O=0):(O++,j++),I(),l=setInterval(function(){return j===ie.length-$?D():(O++,j++,I())},e.timeline.play.timing.value))}).transition().duration(e.draw.timing).attr("opacity",1),S.transition().duration(e.draw.timing).attr("opacity",1))},N(),Y=function(t){var r,n,a;return n=$?t<=p[1]:t<p[1],t>=p[0]&&n?(a=1,r=d(e.ui.color.secondary.value)):(a=.5,r=d(e.ui.color.primary.value)),$&&e.background.value&&"none"!==e.background.value&&(r=d3.rgb(d(e.background.value))),r=d3.rgb(r),"rgba("+r.r+","+r.g+","+r.b+","+a+")"},r=e.g.timeline.selectAll("rect.d3plus_timeline_background").data(["background"]),r.enter().append("rect").attr("class","d3plus_timeline_background").attr("shape-rendering","crispEdges").attr("width",ee+2).attr("height",Z+2).attr("fill",e.ui.color.primary.value).attr("x",V-1).attr("y",e.ui.padding),r.transition().duration(e.draw.timing).attr("width",ee+2).attr("height",Z+2).attr("fill",e.ui.color.primary.value).attr("x",V-1).attr("y",e.ui.padding),W=e.g.timeline.selectAll("g#ticks").data(["ticks"]),W.enter().append("g").attr("id","ticks").attr("transform","translate("+e.width.value/2+","+e.ui.padding+")"),h=e.g.timeline.selectAll("g#brush").data(["brush"]),h.enter().append("g").attr("id","brush"),z=e.g.timeline.selectAll("g#labels").data(["labels"]),z.enter().append("g").attr("id","labels"),L=z.selectAll("text").data(ie,function(e,t){return t}),L.enter().append("text").attr("y",0).attr("dy","0.5ex").attr("x",0),re=d3.time.scale().domain(d3.extent(oe)).rangeRound([0,ee]),L.order().attr(H).text(function(e,t){return te.indexOf(+e)>=0?Q(e):""}).attr("opacity",function(t,r){return e.data.time.dataSteps.indexOf(r)>=0?1:.4}).attr("fill",Y).attr("transform",function(t,r){var n,a;return n=V+re(t),$||(n+=k/2),a=Z/2+e.ui.padding+1,$&&(a+=Z/2+ne),"translate("+Math.round(n)+","+Math.round(a)+")"}),L.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),i=d3.svg.brush().x(re).extent(p).on("brush",v).on("brushend",g),X=e.axes.discrete&&e[e.axes.discrete].value===e.time.value?e[e.axes.discrete].ticks.color:e.x.ticks.color,W.attr("transform","translate("+V+","+(e.ui.padding+1)+")").transition().duration(e.draw.timing).call(d3.svg.axis().scale(re).orient("top").ticks(function(){return oe}).tickFormat("").tickSize(-Z).tickPadding(0)).selectAll("line").attr("stroke-width",1).attr("shape-rendering","crispEdges").attr("stroke",function(t){return te.indexOf(+t)>=0?X:s(X,e.background.value,.4,1)}),W.selectAll("path").attr("fill","none"),h.attr("transform","translate("+V+","+(e.ui.padding+1)+")").attr("opacity",1).call(i),L.attr("pointer-events","none"),h.selectAll("rect.background").attr("fill","none").style("visibility","visible").attr("height",Z).attr("shape-rendering","crispEdges").on(o.move,function(){var t;return t=e.timeline.hover.value,["grab","grabbing"].indexOf(t)>=0&&(t=u()+t),d3.select(this).style("cursor",t)}),h.selectAll("rect.extent").attr("opacity",.75).attr("height",Z).attr("fill",e.ui.color.secondary.value).attr("shape-rendering","crispEdges").on(o.move,function(){var t;return t=e.timeline.hover.value,["grab","grabbing"].indexOf(t)>=0&&(t=u()+t),d3.select(this).style("cursor",t)}),e.timeline.handles.value?(x=h.selectAll("g.resize").selectAll("rect.d3plus_handle").data(["d3plus_handle"]),x.enter().insert("rect","rect").attr("class","d3plus_handle"),x.attr("fill",e.timeline.handles.color).attr("transform",function(t){var r;return r="resize e"===this.parentNode.className.baseVal?-e.timeline.handles.size:0,"translate("+r+",0)"}).attr("width",e.timeline.handles.size).style("visibility","visible").attr("shape-rendering","crispEdges").attr("opacity",e.timeline.handles.opacity),h.selectAll("g.resize").selectAll("rect").attr("height",Z)):h.selectAll("g.resize").remove(),K=e.g.timeline.node().getBBox(),0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding),e.margin.bottom+=K.height+K.y,e.g.timeline.transition().duration(e.draw.timing).attr("transform","translate(0,"+Math.round(e.height.value-e.margin.bottom-e.ui.padding/2)+")"),e.margin.bottom+=e.ui.padding,e.dev.value?c.time("drawing timeline"):void 0}},{"../../../client/css.coffee":36,"../../../client/pointer.coffee":38,"../../../client/prefix.coffee":39,"../../../color/mix.coffee":46,"../../../color/text.coffee":50,"../../../core/console/print.coffee":52,"../../../core/data/time.coffee":62,"../../../font/sizes.coffee":101,"../../../util/closest.coffee":205}],247:[function(e,t,r){var n=e("../../../client/pointer.coffee"),a=e("../../../core/fetch/value.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../client/rtl.coffee"),s=e("../../../textwrap/textwrap.coffee");t.exports=function(e){function t(t){t.attr("font-size",function(e){return e.style.font.size}).attr("fill",function(t){return t.link?e.links.font.color:t.style.font.color}).attr("font-family",function(t){return t.link?e.links.font.family.value:t.style.font.family.value}).attr("font-weight",function(t){return t.link?e.links.font.weight:t.style.font.weight}).style("text-decoration",function(t){return t.link?e.links.font.decoration.value:t.style.font.decoration.value}).style("text-transform",function(t){return t.link?e.links.font.transform.value:t.style.font.transform.value})}function r(e){var t=e.style.font.align;return"center"==t?"middle":"left"==t&&!i||"right"==t&&i?"start":"left"==t&&i||"right"==t&&!i?"end":t}var l=e.size.value?e.size.value:"number"===e.color.type?e.color.value:!1;if(e.data.viz&&e.title.total.value&&!e.small)if(l){e.dev.value&&o.time("calculating total value");var u=e.data.pool;e.focus.value.length&&(u=e.data.viz.filter(function(t){return t[e.id.value]==e.focus.value[0]}));var c,d=e.aggs.value[l]||"sum";if(d.constructor===Function?c=d(u):(u=u.reduce(function(t,r){var n=a(e,r,l);return n instanceof Array?t=t.concat(n):t.push(n),t},[]),c=d3[d](u)),(0===c||null===c||void 0===c)&&(c=!1),"number"==typeof c){var f="";if(e.data.mute.length||e.data.solo.length||e.focus.value.length){var p=d3.sum(e.data.value,function(t){if(e.time.solo.value.length>0)var r=e.time.solo.value.indexOf(a(e,t,e.time.value))>=0;else if(e.time.mute.value.length>0)var r=e.time.solo.value.indexOf(a(e,t,e.time.value))<0;else var r=!0;return r?a(e,t,l):void 0});if(p>c){var f=c/p*100,h=e.format.value(p,{key:e.size.value,vars:e});f=" ("+e.format.value(f,{key:"share",vars:e})+" of "+h+")"}}c=e.format.value(c,{key:e.size.value,vars:e});var v=e.title.total.value,g=v.prefix||e.format.value(e.format.locale.value.ui.total)+": ";c=g+c,v.suffix?c+=v.suffix:null,c+=f}e.dev.value&&o.timeEnd("calculating total value")}else var c=!1;else var c=!1;var m=[];if(e.footer.value&&m.push({link:e.footer.link,style:e.footer,type:"footer",value:e.footer.value}),!e.small){if(e.title.value){var y=e.title.value;"function"==typeof y&&(y=y(e.self)),m.push({link:e.title.link,style:e.title,type:"title",value:y})}if(e.title.sub.value){var y=e.title.sub.value;"function"==typeof y&&(y=y(e.self)),m.push({link:e.title.sub.link,style:e.title.sub,type:"sub",value:y})}e.title.total.value&&c&&m.push({link:e.title.total.link,style:e.title.total,type:"total",value:c})}e.dev.value&&o.time("drawing titles");var x=e.svg.selectAll("g.d3plus_title").data(m,function(e){return e.type}),b=e.title.width||e.width.value-e.margin.left-e.margin.right;x.enter().append("g").attr("class",function(e){return"d3plus_title "+e.type}).attr("opacity",0).append("text").call(t),x.each(function(n){var a=d3.select(this).select("text").call(t),o=r(n);s().align(o).container(a).height(e.height.value/8).size(!1).text(n.value).width(b).draw(),n.y=e.margin[n.style.position],e.margin[n.style.position]+=this.getBBox().height+2*n.style.padding}).on(n.over,function(t){t.link&&d3.select(this).transition().duration(e.timing.mouseevents).style("cursor","pointer").select("text").attr("fill",e.links.hover.color).attr("font-family",e.links.hover.family.value).attr("font-weight",e.links.hover.weight).style("text-decoration",e.links.hover.decoration.value).style("text-transform",e.links.hover.transform.value)}).on(n.out,function(r){r.link&&d3.select(this).transition().duration(e.timing.mouseevents).style("cursor","auto").select("text").call(t)}).on(n.click,function(e){if(e.link){var t="/"!=e.link.charAt(0)?"_blank":"_self";window.open(e.link,t)}}).attr("opacity",1).attr("transform",function(t){var n=t.style.position,a="top"==n?0+t.y:e.height.value-t.y;"bottom"==n?a-=this.getBBox().height+t.style.padding:a+=t.style.padding;var o=r(t);if("start"===o)var i=e.margin.left+e.title.padding;else{d3.select(this).select("text").node().getBBox().width;i="middle"===o?e.width.value/2-b/2:e.width.value-b-e.margin.right-e.title.padding}return"translate("+i+","+a+")"}),x.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.margin.top>0&&(e.margin.top+=e.title.padding),e.margin.bottom>0&&(e.margin.bottom+=e.title.padding);var w=e.title.height;w&&e.margin[e.title.position]<w&&(e.margin[e.title.position]=w),e.dev.value&&o.timeEnd("drawing titles")}},{"../../../client/pointer.coffee":38,"../../../client/rtl.coffee":40,"../../../core/console/print.coffee":52,"../../../core/fetch/value.coffee":67,"../../../textwrap/textwrap.coffee":199}],248:[function(e,t,r){var n,a;n=e("./labels.coffee"),a=e("./transform.coffee"),t.exports=function(e,t,r){var o,i,s,l,u,c,d,f,p;return t||(t=e.zoom.bounds),"number"!=typeof r&&(r=e.timing.transitions),e.zoom.size={height:t[1][1]-t[0][1],width:t[1][0]-t[0][0]},p=e.types[e.type.value],s=e.coords.fit.value,o="auto"===s||p.requirements.indexOf("coords")<0?d3.max([e.zoom.size.width/e.width.viz,e.zoom.size.height/e.height.viz]):e.zoom.size[s]/e["app_"+s],u=d3.min([e.width.viz,e.height.viz]),c=p.zoom?2*e.coords.padding:0,d=(u-c)/u/o,i=e.zoom.behavior.scaleExtent(),(i[0]===i[1]||t===e.zoom.bounds)&&e.zoom.behavior.scaleExtent([d,16*d]),l=e.zoom.behavior.scaleExtent()[1],d>l&&(d=l),e.zoom.scale=d,f=[e.width.viz/2-e.zoom.size.width*d/2-t[0][0]*d,e.height.viz/2-e.zoom.size.height*d/2-t[0][1]*d],e.zoom.translate=f,e.zoom.behavior.translate(f).scale(d),e.zoom.size={height:e.zoom.bounds[1][1]-e.zoom.bounds[0][1],width:e.zoom.bounds[1][0]-e.zoom.bounds[0][0]},e.zoom.reset=!1,(e.labels.value||e.labels.changed)&&n(e),a(e,r)}},{"./labels.coffee":250,"./transform.coffee":253}],249:[function(e,t,r){t.exports=function(e,t){var r,n,a;return n=t.id.nesting.length-1,r=t.depth.value,a=t.id.nesting[t.depth.value+1],t.types[t.type.value].nesting===!1?0:(e.d3plus.merged||a in e&&n>r)&&(!e||a in e)?1:r!==n&&(!e||a in e)||!t.small&&t.tooltip.html.value?0:-1}},{}],250:[function(e,t,r){var n;n=e("../../../core/console/print.coffee"),t.exports=function(e){var t,r;return e.dev.value&&n.time("determining label visibility"),r=e.zoom.behavior.scaleExtent(),t=function(t){return t.attr("opacity",function(t){var n;return t||(t={}),n=parseFloat(d3.select(this).attr("font-size"),10),t.visible=n*(e.zoom.scale/r[1])>=2,t.visible?1:0})},e.draw.timing?e.g.viz.selectAll("text.d3plus_label").transition().duration(e.draw.timing).call(t):e.g.viz.selectAll("text.d3plus_label").call(t),e.dev.value?n.timeEnd("determining label visibility"):void 0}},{"../../../core/console/print.coffee":52}],251:[function(e,t,r){var n,a,o;n=e("./labels.coffee"),a=e("../../../tooltip/remove.coffee"),o=e("./transform.coffee"),t.exports=function(e){var t,r,i,s,l,u,c,d,f,p,h;return r=d3.event.sourceEvent?d3.event.sourceEvent.type:null,l=d3.event.translate,s=d3.event.scale,i=e.zoom.bounds,d=(e.width.viz-e.zoom.size.width*s)/2,c=d>0?d:0,u=d>0?e.width.viz-d:e.width.viz,h=(e.height.viz-e.zoom.size.height*s)/2,p=h>0?h:0,f=h>0?e.height.viz-h:e.height.viz,l[0]+i[0][0]*s>c?l[0]=-i[0][0]*s+c:l[0]+i[1][0]*s<u&&(l[0]=u-i[1][0]*s),l[1]+i[0][1]*s>p?l[1]=-i[0][1]*s+p:l[1]+i[1][1]*s<f&&(l[1]=f-i[1][1]*s),e.zoom.behavior.translate(l).scale(s),e.zoom.translate=l,e.zoom.scale=s,"wheel"===r&&a(e.type.value),(e.labels.value||e.labels.changed)&&("wheel"===r?(t=e.draw.timing?100:250,clearTimeout(e.zoom.wheel),e.zoom.wheel=setTimeout(function(){return n(e)},t)):n(e)),"dblclick"===r?o(e,e.timing.transitions):o(e,0)}},{"../../../tooltip/remove.coffee":202,"./labels.coffee":250,"./transform.coffee":253}],252:[function(e,t,r){t.exports=function(e,t){var r,n,a,o;n=e.zoom,t||(t=d3.event),o=n.scale>n.behavior.scaleExtent()[0],r=e.types[e.type.value].zoom&&n.value&&n.scroll.value,a=t.touches&&t.touches.length>1&&r,a||o||t.stopPropagation()}},{}],253:[function(e,t,r){t.exports=function(e,t){var r;return"number"!=typeof t&&(t=e.timing.transitions),r="translate("+e.zoom.translate+")",r+="scale("+e.zoom.scale+")",t?e.g.viz.transition().duration(t).attr("transform",r):e.g.viz.attr("transform",r)}},{}],254:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:"active_var",mute:n(!0),solo:n(!0),spotlight:{accepted:[Boolean],deprecates:"spotlight",value:!1},value:!1}},{"../../core/methods/filter.coffee":80}],255:[function(e,t,r){t.exports={accepted:[Object],deprecated:"nesting_aggs",objectAccess:!1,value:{}}},{}],256:[function(e,t,r){var n;n=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Object,String],delimiter:{accepted:String,value:"|"},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},keys:{},process:n,value:!1}},{"../../core/methods/process/data.coffee":86}],257:[function(e,t,r){var n;n=e("../../core/methods/rendering.coffee"),t.exports={background:{color:"#fafafa",rendering:n(),stroke:{color:"#ccc",width:1}},mirror:{accepted:[Boolean],deprecates:["mirror_axis","mirror_axes"],value:!1},ticks:{accepted:[Boolean],value:!0}}},{"../../core/methods/rendering.coffee":91}],258:[function(e,t,r){t.exports={accepted:[String],value:"#ffffff"}},{}],259:[function(e,t,r){t.exports={accepted:[Function,String],value:!1}},{}],260:[function(e,t,r){var n,a;n=e("../../core/methods/filter.coffee"),a=e("../../color/scale.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],deprecates:"color_var",focus:"#444444",heatmap:["#282F6B","#419391","#AFD5E8","#EACE3F","#B35C1E","#B22200"],missing:"#eeeeee",mute:n(!0),primary:"#d74b03",range:["#B22200","#FFEE8D","#759143"],scale:{accepted:[Array,Function,"d3plus","category10","category20","category20b","category20c"],process:function(e){return e instanceof Array?d3.scale.ordinal().range(e):"d3plus"===e?a:"string"==typeof e?d3.scale[e]():e},value:"d3plus"},solo:n(!0),secondary:"#e5b3bb",value:!1}},{"../../color/scale.coffee":48,"../../core/methods/filter.coffee":80}],261:[function(e,t,r){t.exports={accepted:[Array,Function,String],index:{accepted:[Boolean],value:!0},process:function(e,t){return"string"==typeof e&&(e=[e]),e},value:!1}},{}],262:[function(e,t,r){arguments[4][107][0].apply(r,arguments)},{dup:107}],263:[function(e,t,r){var n;n=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],id:"default",process:function(e,t){return e===!1?!1:("default"===t.container.id&&t.self.container({id:"d3plus_"+ +new Date}),n(e)?e:e instanceof Array?d3.select(e[0][0]):d3.select(e))},value:!1}},{"../../util/d3selection.coffee":207}],264:[function(e,t,r){var n,a;n=e("../../core/methods/filter.coffee"),a=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],center:[0,0],filetype:{accepted:["json"],value:"json"},fit:{accepted:["auto","height","width"],value:"auto"},key:!1,mute:n(!1),padding:20,process:a,projection:{accepted:["albers","albersUsa","azimuthalEqualArea","azimuthalEquidistant","conicConformal","conicEqualArea","conicEquidistant","equirectangular","gnomonic","mercator","orthographic","stereographic","transverseMercator",Function],value:"mercator"},simplify:{accepted:[Boolean],value:!0},solo:n(!1),threshold:{accepted:[Number],value:.9},value:!1}},{"../../core/methods/filter.coffee":80,"../../core/methods/process/data.coffee":86}],265:[function(e,t,r){var n,a,o;n=e("../../core/fetch/value.coffee"),a=e("../../client/ie.js"),o=e("../../string/strip.js"),t.exports={accepted:[void 0,!0,Array,String],chainable:!1,data:[],process:function(e,t){var r,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R;if(void 0===t.returned)return[];if(e=e||t.cols.value,e instanceof Array?l=e:"string"==typeof e&&(l=[e]),c=[],V=[],t.title.value?(q=t.title.value,"function"==typeof q&&(q=q(t.self)),q=o(q),O=250,q=q.substr(0,O)):q="D3plus Visualization Data",e===!0)for(l=d3.keys(t.data.keys),c.push(l),B=t.data.value,v=0,y=B.length;y>v;v++){for(d=B[v],I=[],g=0,x=l.length;x>g;g++)i=l[g],R=d[i],"string"===t.data.keys[i]&&(R='"'+R+'"'),I.push(R);c.push(I)}else{for(l||(l=[t.id.value],t.time.value&&l.push(t.time.value),t.size.value&&l.push(t.size.value),t.text.value&&l.push(t.text.value)),m=0,b=l.length;b>m;m++)i=l[m],V.push(t.format.value(i));for(c.push(V),N=t.returned.nodes,M=0,w=N.length;w>M;M++)if(F=N[M],null!=F.values&&F.values instanceof Array)for(P=F.values,E=0,_=P.length;_>E;E++){for(R=P[E],I=[],S=0,k=l.length;k>S;S++)s=l[S],R=n(t,R,s),"string"==typeof R&&(R='"'+R+'"'),I.push(R);c.push(I)}else{for(I=[],T=0,z=l.length;z>T;T++)s=l[T],I.push(n(t,F,s));c.push(I)}}for(u="data:text/csv;charset=utf-8,",h=C=0,A=c.length;A>C;h=++C)i=c[h],f=i.join(","),u+=h<c.length?f+"\n":f;return a?(r=new Blob([u],{type:"text/csv;charset=utf-8;"}),navigator.msSaveBlob(r,q+".csv")):(p=encodeURI(u),j=document.createElement("a"),j.setAttribute("href",p),j.setAttribute("download",q+".csv"),j.click()),this.data=c,l},value:void 0}},{"../../client/ie.js":37,"../../core/fetch/value.coffee":67,"../../string/strip.js":174}],266:[function(e,t,r){var n;n=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Function,String],cache:{},delimiter:{accepted:[String],value:"|"},donut:{size:.35},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},filters:[],keys:{},mute:[],large:400,opacity:.9,padding:{accepted:[Number],value:1},process:function(e,t){return n(e,t,this)},solo:[],stroke:{width:1},value:!1}},{"../../core/methods/process/data.coffee":86}],267:[function(e,t,r){t.exports={accepted:[Function,Number],value:0}},{}],268:[function(e,t,r){t.exports={accepted:[!1,Function,Object],value:!1}},{}],269:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],270:[function(e,t,r){var n=e("../../core/console/print.coffee"),a=e("../../string/format.js");t.exports={accepted:[void 0,Function],first:!0,frozen:!1,process:function(e,t){if(this.initialized===!1)return this.initialized=!0,e;if(void 0===e&&"function"==typeof this.value&&(e=this.value),t.container.value===!1){var r=t.format.locale.value.dev.setContainer;n.warning(r,"container")}else if(t.container.value.empty()){var r=t.format.locale.value.dev.noContainer;n.warning(a(r,'"'+t.container.value+'"'),"container")}else t.dev.value&&n.time("total draw time"),t.container.value.call(t.self);if("function"==typeof e&&t.history.chain.length){var o={};changes.forEach(function(e){var t=e.method;delete e.method,o[t]=e}),e(o),t.history.chain=[]}return e},update:!0,value:void 0}},{"../../core/console/print.coffee":52,"../../string/format.js":172}],271:[function(e,t,r){var n=e("../../core/methods/process/data.coffee");t.exports={accepted:[!1,Array,Function,String],arrows:{accepted:[Boolean,Number],direction:{accepted:["source","target"],value:"target"},value:!1},color:"#d0d0d0",connections:function(e,t,r){var n=this;if(!n.value)return[];if(!t)var t="id";var a=n.restricted||n.value,o=[];if(!e)return a;var i=a.filter(function(a){var i=!1;return a[n.source][t]==e?(i=!0,r&&o.push(a[n.target])):a[n.target][t]==e&&(i=!0,r&&o.push(a[n.source])),i});return r?o:i},delimiter:{accepted:[String],value:"|"},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},interpolate:{accepted:["basis","cardinal","linear","monotone","step"],value:"basis"},label:!1,large:100,limit:{accepted:[!1,Function,Number],value:!1},opacity:{accepted:[Function,Number,String],min:{accepted:[Number],value:.25},scale:{accepted:[Function],value:d3.scale.linear()},value:1},process:n,size:{accepted:[!1,Number,String],min:1,scale:.5,value:!1},source:"source",strength:{accepted:[!1,Function,Number,String],value:!1},target:"target",value:!1}},{"../../core/methods/process/data.coffee":86}],272:[function(e,t,r){t.exports={accepted:[Boolean,String],value:!1}},{}],273:[function(e,t,r){t.exports={accepted:[!1,Array,Function,Number,String],deprecates:"highlight",process:function(e){return e===!1?[]:e instanceof Array?e:[e]},tooltip:{accepted:[Boolean],value:!0},value:[]}},{}],274:[function(e,t,r){var n,a,o,i;n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/family.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={align:n(),color:"#444444",decoration:a(),family:o(),secondary:{align:n(),color:"#444444",decoration:a(),family:o(),size:12,spacing:0,transform:i(),weight:200},size:12,spacing:0,transform:i(),weight:200}},{"../../core/methods/font/align.coffee":81,"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],275:[function(e,t,r){var n,a,o;a=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[!1,Number,String],font:{align:"center",color:"#444",decoration:n(),family:a(),size:11,transform:o(),weight:200},link:!1,padding:0,position:"bottom",value:!1}},{"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],276:[function(e,t,r){var n,a,o,i;n=e("../../number/format.coffee"),a=e("../../core/locale/locale.coffee"),o=e("../../object/merge.coffee"),i=e("../../string/title.coffee"),t.exports={accepted:[Function,String],affixes:{accepted:[Object],objectAccess:!1,value:{}},deprecates:["number_format","text_format"],locale:{accepted:function(){return d3.keys(a)},process:function(e){var t,r;return t="en_US",r=a[t],e!==t&&(r=o(r,a[e])),this.language=e,r},value:"en_US"},number:{accepted:[!1,Function],value:!1},process:function(e,t){if("string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},text:{accepted:[!1,Function],value:!1},value:function(e,t){var r,a,o;return t||(t={}),t.locale||(t.locale=this.locale.value),o=t.vars||{},o.time&&o.time.value&&t.key===o.time.value?(a=e.constructor===Date?e:new Date(e),o.data.time.format(a)):"number"==typeof e?(r=this.number.value||n)(e,t):"string"==typeof e?(r=this.text.value||i)(e,t):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":78,"../../number/format.coffee":169,"../../object/merge.coffee":170,"../../string/title.coffee":175}],277:[function(e,t,r){t.exports={accepted:[!1,Number],max:600,secondary:!1,small:200,value:!1}},{}],278:[function(e,t,r){var n,a,o,i,s,l,u,c;n=e("../../../core/methods/font/align.coffee"),a=e("../../../core/methods/font/decoration.coffee"),o=e("../../../core/methods/font/family.coffee"),i=e("../../../core/methods/filter.coffee"),l=e("../../../core/methods/font/position.coffee"),u=e("../../../core/methods/rendering.coffee"),c=e("../../../core/methods/font/transform.coffee"),s={x:"bottom",x2:"top",y:"left",y2:"right"},t.exports=function(e){return{accepted:[Array,Boolean,Function,Object,String],affixes:{accepted:[Boolean],separator:{accepted:[Boolean,Array],value:!0},value:!1},axis:{accepted:[Boolean],color:"#444",font:{color:!1,decoration:a(!1),family:o(""),size:!1,spacing:0,transform:c(!1),weight:!1},rendering:u(),value:!0},dataFilter:!0,deprecates:[e+"axis",e+"axis_val",e+"axis_var"],domain:{accepted:[!1,Array],value:!1},grid:{accepted:[Boolean],color:"#ccc",rendering:u(),value:!0},label:{accepted:[Boolean,String],fetch:function(t){return this.value===!0?t.format.value(t[e].value,{key:e,vars:t}):this.value},font:{color:"#444",decoration:a(),family:o(),size:12,spacing:0,transform:c(),weight:200},padding:3,value:!0},lines:{accept:[!1,Array,Number,Object],dasharray:{accepted:[Array,String],process:function(e){return e instanceof Array&&(e=e.filter(function(e){return!isNaN(e)}),e=e.length?e.join(", "):"none"),e},value:"10, 10"},color:"#888",font:{align:n("right"),color:"#444",background:{accepted:[Boolean],value:!0},decoration:a(),family:o(),padding:{accepted:[Number],value:10},position:l("middle"),size:12,transform:c(),weight:200},process:Array,rendering:u(),width:1,value:[]},mouse:{accept:[Boolean],dasharray:{accepted:[Array,String],process:function(e){return e instanceof Array&&(e=e.filter(function(e){return!isNaN(e)}),e=e.length?e.join(", "):"none"),e},value:"none"},rendering:u(),width:2,value:!0},mute:i(!0),orient:{accepted:["top","right","bottom","left"],value:s[e]},padding:{accepted:[Number],value:.1},persist:{position:{accepted:[Boolean],value:!1},size:{accepted:[Boolean],value:!0}},range:{accepted:[!1,Array],value:!1},scale:{accepted:["linear","log","discrete","share"],deprecates:["layout","unique_axis",e+"axis_scale"],process:function(t,r){var n,a,o,i;for(o=["log","discrete","share"],n=0,a=o.length;a>n;n++)i=o[n],i===t?r.axes[i]=e:r.axes[i]===e&&(r.axes[i]=!1);return"discrete"===t&&(r.axes.opposite=0===e.indexOf("x")?"y":"x"),t},value:"linear"},solo:i(!0),stacked:{accepted:[Boolean],process:function(t,r){return t||r.axes.stacked!==e?t&&(r.axes.stacked=e):r.axes.stacked=!1,t},value:!1},ticks:{accepted:[!1,Array],color:"#ccc",font:{color:"#666",decoration:a(),family:o(),size:10,spacing:0,transform:c(),weight:200},labels:{accepted:[Boolean,Array],value:!0},rendering:u(),size:10,width:1,value:!1},value:!1,zerofill:{accepted:[Boolean],value:!1}}}},{"../../../core/methods/filter.coffee":80,"../../../core/methods/font/align.coffee":81,"../../../core/methods/font/decoration.coffee":82,"../../../core/methods/font/family.coffee":83,"../../../core/methods/font/position.coffee":84,"../../../core/methods/font/transform.coffee":85,"../../../core/methods/rendering.coffee":91}],279:[function(e,t,r){t.exports={
accepted:[Boolean],back:function(){return this.states.length?this.states.pop()():void 0},chain:[],reset:function(){var e;for(e=[];this.states.length;)e.push(this.states.pop()());return e},states:[],value:!0}},{}],280:[function(e,t,r){var n;n=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:n,rotate:0,value:"fa-angle-left"},deprecates:"icon_var",style:{accepted:[Object,String],deprecates:"icon_style",value:"default"},value:!1}},{"../../core/methods/process/icon.coffee":88}],281:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,deprecates:["id_var","nesting"],grouping:{accepted:[Boolean],value:!0},mute:n(!0),nesting:["id"],solo:n(!0),value:"id"}},{"../../core/methods/filter.coffee":80}],282:[function(e,t,r){var n,a,o;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean],align:{accepted:["start","middle","end","left","center","right"],process:function(e){var t;return t=["left","center","right"].indexOf(e),t>=0&&(e=this.accepted[t]),e},value:"middle"},color:{accepted:[!1,String],value:!1},font:{decoration:n(),family:a(),size:11,transform:o(),weight:200},padding:7,resize:{accepted:[Boolean],value:!0},text:{accepted:[!1,Function,String],value:!1},segments:2,valign:{accepted:[!1,"top","middle","bottom"],value:"middle"},value:!0}},{"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],283:[function(e,t,r){var n;n=e("../../core/methods/font/family.coffee"),t.exports={accepted:[Boolean],align:"middle",filters:{accepted:[Boolean],value:!1},font:{align:"middle",color:"#444444",family:n(),size:[8,14],weight:200},gradient:{height:10},icons:{accepted:[Boolean],value:!0},labels:{accepted:[Boolean],value:!0},order:{accepted:["color","id","size","text"],sort:{accepted:["asc","desc"],value:"asc"},value:"color"},size:[8,30],tooltip:{accepted:[Boolean],value:!0},text:{accepted:[!1,Function,String],value:!1},value:!0}},{"../../core/methods/font/family.coffee":83}],284:[function(e,t,r){var n,a,o;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={font:{color:"#444444",decoration:n(),family:a(),transform:o(),weight:200},hover:{color:"#444444",decoration:n(),family:a(),transform:o(),weight:200}}},{"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],285:[function(e,t,r){arguments[4][122][0].apply(r,arguments)},{"../../core/methods/process/margin.coffee":89,dup:122}],286:[function(e,t,r){var n,a,o;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean,String],background:{accepted:[!1,String],value:!1},branding:{accepted:[Boolean],image:{dark:"http://d3plus.org/assets/img/icon-transparent-invert.png",light:"http://d3plus.org/assets/img/icon-transparent.png"},value:!1},font:{color:"#444",decoration:n(),family:a(),size:16,transform:o(),weight:200},padding:5,style:{accepted:[!1,"small","large"],value:!1},value:!0}},{"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],287:[function(e,t,r){t.exports={accepted:[Boolean],click:{accepted:[Boolean,Function],value:!0},move:{accepted:[Boolean,Function],value:!0},out:{accepted:[Boolean,Function],value:!0},over:{accepted:[Boolean,Function],value:!0},value:!0}},{}],288:[function(e,t,r){var n;n=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Function,String],delimiter:{accepted:[String],value:"|"},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},overlap:.6,process:n,value:!1}},{"../../core/methods/process/data.coffee":86}],289:[function(e,t,r){t.exports={accepted:[Boolean,Function,String],agg:{accepted:[!1,Function,"sum","min","max","mean","median"],value:!1},deprecates:["sort"],sort:{accepted:["asc","desc"],value:"desc"},value:!1}},{}],290:[function(e,t,r){var n;n=e("../../core/methods/rendering.coffee"),t.exports={accepted:function(e){var t;return t=e.types[e.type.value].shapes,!t||t instanceof Array||(t=[t]),t.length?t:["square"]},interpolate:{accepted:["basis","basis-open","cardinal","cardinal-open","linear","monotone","step","step-before","step-after"],deprecates:"stack_type",value:"linear"},rendering:n(),value:!1}},{"../../core/methods/rendering.coffee":91}],291:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Number,Object,String],dataFilter:!0,deprecates:["value","value_var"],mute:n(!0),scale:{accepted:[Function],deprecates:"size_scale",max:{accepted:[Function,Number],value:function(e){return Math.floor(d3.max([d3.min([e.width.viz,e.height.viz])/15,6]))}},min:{accepted:[Function,Number],value:3},value:d3.scale.sqrt()},solo:n(!0),threshold:{accepted:[Boolean,Function,Number],value:!1},value:!1}},{"../../core/methods/filter.coffee":80}],292:[function(e,t,r){t.exports={value:!1}},{}],293:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:["else_var","else"],mute:n(!0),solo:n(!0),value:!1}},{"../../core/methods/filter.coffee":80}],294:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,Boolean,Function,Object,String],deprecates:["name_array","text_var"],nesting:!0,mute:n(!0),solo:n(!0),value:!1}},{"../../core/methods/filter.coffee":80}],295:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,Boolean,Function,Object,String],dataFilter:!0,deprecates:["year","year_var"],fixed:{accepted:[Boolean],deprecates:["static_axis","static_axes"],value:!0},format:{accepted:[!1,Array,Function,String],value:!1},mute:n(!1),solo:n(!1),value:!1}},{"../../core/methods/filter.coffee":80}],296:[function(e,t,r){t.exports={accepted:[Boolean],align:"middle",hover:{accepted:["all-scroll","col-resize","crosshair","default","grab","grabbing","move","pointer"],value:"pointer"},handles:{accepted:[Boolean],color:"#666",opacity:1,size:3,stroke:"#666",value:!0},height:{accepted:[!1,Number],value:!1},play:{accepted:[Boolean],icon:{accepted:[!1,String],awesome:"",fallback:"►"},pause:{accepted:[!1,String],awesome:"",fallback:"❚❚"},timing:{accepted:[Number],value:1500},value:!0},value:!0}},{}],297:[function(e,t,r){t.exports={mouseevents:60,transitions:600,ui:200}},{}],298:[function(e,t,r){var n,a,o,i;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),i=e("../../core/methods/font/transform.coffee"),o=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:n(),family:a(),size:16,transform:i(),weight:400},height:!1,link:!1,padding:2,position:"top",process:function(e,t){var r;return 0===t.container.id.indexOf("default")&&e&&(r=o(e).toLowerCase(),t.self.container({id:r})),e},sub:{accepted:[!1,Function,String],deprecates:"sub_title",font:{align:"center",color:"#444444",decoration:n(),family:a(),size:12,transform:i(),weight:200},link:!1,padding:1,position:"top",value:!1},total:{accepted:[Boolean,Object],deprecates:"total_bar",font:{align:"center",color:"#444444",decoration:n(),family:a(),size:12,transform:i(),weight:200,value:!1},link:!1,padding:1,position:"top",value:!1},width:!1,value:!1}},{"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85,"../../string/strip.js":174}],299:[function(e,t,r){var n,a;n=e("../../core/methods/font/family.coffee"),a=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean,Array,Function,Object,String],anchor:"top center",background:"#ffffff",children:{accepted:[Boolean],value:!0},connections:{accepted:[Boolean],value:!0},curtain:{color:"#ffffff",opacity:.8},deprecates:"tooltip_info",extent:{accepted:[Boolean],value:!0},font:{color:"#444",family:n(),size:12,transform:a(),weight:200},fullscreen:{accepted:[Boolean],value:!1},html:{accepted:[!1,Function,Object,String],deprecates:"click_function",value:!1},iqr:{accepted:[Boolean],value:!0},large:250,share:{accepted:[Boolean],value:!0},size:{accepted:[Boolean],value:!0},small:225,stacked:{accepted:[Boolean],value:!1},sub:{accepted:[!1,Function,String],value:!1},value:!0}},{"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],300:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:["total_var"],mute:n(!0),solo:n(!0),value:!1}},{"../../core/methods/filter.coffee":80}],301:[function(e,t,r){t.exports={accepted:function(e){return d3.keys(e.types)},mode:{accepted:function(e){return e.types[e.type.value].modes||[!1]},value:!1},value:"tree_map"}},{}],302:[function(e,t,r){var n,a,o,i;o=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Array,Boolean],align:n("center"),border:1,color:{primary:{process:function(e,t){var r;return r=this.value,t.ui.color.secondary.value||(t.ui.color.secondary.value=d3.rgb(r).darker(.75).toString()),e},value:"#ffffff"},secondary:{value:!1}},display:{acceped:["block","inline-block"],value:"inline-block"},font:{align:"center",color:"#444",decoration:a(),family:o(),size:11,transform:i(),weight:200},margin:5,padding:5,position:{accepted:["top","right","bottom","left"],value:"bottom"},value:!1}},{"../../core/methods/font/align.coffee":81,"../../core/methods/font/decoration.coffee":82,"../../core/methods/font/family.coffee":83,"../../core/methods/font/transform.coffee":85}],303:[function(e,t,r){t.exports={accepted:[!1,Number],secondary:!1,small:200,value:!1}},{}],304:[function(e,t,r){t.exports={accepted:[Boolean],behavior:d3.behavior.zoom().scaleExtent([1,1]).duration(0),click:{accepted:[Boolean],value:!0},pan:{accepted:[Boolean],value:!0},scroll:{accepted:[Boolean],deprecates:"scroll_zoom",value:!0},value:!0}},{}],305:[function(e,t,r){var n,a,o,i,s,l,u,c=[].indexOf||function(e){for(var t=0,r=this.length;r>t;t++)if(t in this&&this[t]===e)return t;return-1};a=e("../../util/buckets.coffee"),o=e("../../core/fetch/value.coffee"),i=e("./helpers/graph/draw.coffee"),s=e("./helpers/graph/nest.coffee"),l=e("./helpers/graph/stack.coffee"),u=e("../../util/uniques.coffee"),n=function(e){var t,r,n,s,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H;if(f=e.axes.discrete,g="x"===f?"height":"width",L="x"===f?"width":"height",N=e.axes.opposite,n="x"===f?"left":"top",S="x"===f?"top":"left",i(e,{buffer:!0,zero:N}),v=e.x.domain.viz.concat(e.y.domain.viz),v.indexOf(void 0)>=0)return[];if(E=e.data.viz,e.axes.stacked)for(x=0,_=E.length;_>x;x++)q=E[x],l(e,q.values);for(D=e.axes[L]/e[e.axes.discrete].ticks.values.length,I=e[e.axes.discrete].padding.value,1>I&&(I*=D),2*I>D&&(I=.1*D),M=D-2*I,e.axes.stacked||(e[f].persist.position.value?(V=e[f].value,h=c.call(e.id.nesting,V)>=0?d3.max(E,function(e){return e.values.length}):u(E,e.id.value,o,e).length,M/=h,T=D/2-M/2-I,Y=d3.scale.ordinal(),1===h?Y.domain([0]).range([0]):Y.domain([0,h-1]).range([-T,T])):Y=d3.scale.linear()),d=[],H=0,e[f].persist.position.value&&!e.axes.stacked&&(y=u(d3.merge(E.map(function(e){return e.values})),e.id.value,o,e,e.id.value,!1),Y.domain(y),1===y.length?Y.range([0]):Y.range(a(Y.range(),y.length))),j=d3.max(E,function(e){return e.values.length}),b=0,k=E.length;k>b;b++)for(P=E[b],e.axes.stacked?(t=1,F=M):e[f].persist.position.value?(t=h,F=M):(t=P.values.length,e[f].persist.size.value?(F=M/j,T=D/2-(j-t)*(F/2)-F/2-I):(F=M/t,T=D/2-F/2-I),Y.domain([0,t-1]),Y.range([-T,T])),R=P.values,m=w=0,z=R.length;z>w;m=++w){if(s=R[m],O=e.axes.stacked?0:Y(e[f].persist.position.value?o(e,s,e.id.value):m%t),C=e[N],e.axes.stacked)U=s.d3plus[N],r=s.d3plus[N+"0"];else{if(B=o(e,s,C.value),null===B&&(C=e[N+"2"],B=o(e,s,C.value)),0===B)continue;"log"===C.scale.value&&(H=0>B?-1:1),U=C.scale.viz(B),r=C.scale.viz(H)}p=o(e,s,e[f].value),s.d3plus[f]=e[f].scale.viz(p),s.d3plus[f]+=e.axes.margin[n]+O,A=r-U,s.d3plus[N]=r-A/2,e.axes.stacked||(s.d3plus[N]+=e.axes.margin[S]),delete s.d3plus.r,s.d3plus[L]=F,s.d3plus[g]=Math.abs(A),s.d3plus.init={},s.d3plus.init[N]=C.scale.viz(H),s.d3plus.init[N]-=s.d3plus[N],s.d3plus.init[N]+=e.axes.margin[S],s.d3plus.init[L]=s.d3plus[L],e.text.value?delete s.d3plus.label:s.d3plus.label=!1,d.push(s)}return d},n.filter=function(e,t){return s(e,t,e[e.axes.discrete].value)},n.requirements=["data","x","y"],n.setup=function(e){var t,r,n;return e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"})),n=e[e.axes.opposite],r=e.size,!n.value&&r.value||r.changed&&r.previous===n.value?e.self[e.axes.opposite](r.value):!r.value&&n.value||n.changed&&n.previous===r.value?e.self.size(n.value):void 0},n.shapes=["square"],t.exports=n},{"../../core/fetch/value.coffee":67,"../../util/buckets.coffee":203,"../../util/uniques.coffee":209,"./helpers/graph/draw.coffee":311,"./helpers/graph/nest.coffee":317,"./helpers/graph/stack.coffee":318}],306:[function(e,t,r){var n,a,o,i,s;a=e("../../core/fetch/value.coffee"),o=e("./helpers/graph/draw.coffee"),i=e("../../string/strip.js"),s=e("../../util/uniques.coffee"),n=function(e){var t,r,n,l,u,c,d,f,p,h,v,g,m,y;return o(e,{buffer:!0,mouse:!0}),n=e.x.domain.viz.concat(e.y.domain.viz),n.indexOf(void 0)>=0?[]:(r=e.axes.discrete,h=e.axes.opposite,t="x"===r?e.axes.margin.left:e.axes.margin.top,p="x"===h?e.axes.margin.left:e.axes.margin.top,l="x"===r?"height":"width",y="x"===r?"width":"height",m=e.axes[y]/e[r].ticks.values.length,g=e.size.value,g="number"==typeof g?g:100,m=d3.min([m-2*e.labels.padding,g]),d=e.type.mode.value,d instanceof Array||(d=[d,d]),c=function(t){var r,n,o;n={};for(r in e.data.keys)o=s(t,r,a,e),n[r]=1===o.length?o[0]:o;return n},f=!1,u=[],v=[],d3.nest().key(function(t){return a(e,t,e[r].value)}).rollup(function(n){var o,g,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H,X,G,W;for(q=e[h].scale.viz,X=n.map(function(t){return a(e,t,e[h].value)}),X.sort(function(e,t){return e-t}),Y=s(X),z=d3.quantile(X,.25),T=d3.quantile(X,.5),V=d3.quantile(X,.75),R={},"tukey"===d[1]?(j=z-V,D=V-1.5*j,U="top tukey"):"extent"===d[1]?(D=d3.max(X),U="maximum"):"number"==typeof d[1]&&(D=d3.quantile(X,(100-d[1])/100),U=d[1]+" percentile"),D=d3.min([d3.max(X),D]),e.tooltip.extent.value&&(R[U]={key:e[h].value,value:D}),e.tooltip.iqr.value&&(R["third quartile"]={key:e[h].value,value:V},R.median={key:e[h].value,value:T},R["first quartile"]={key:e[h].value,value:z}),"tukey"===d[0]?(j=z-V,o=z+1.5*j,g="bottom tukey"):"extent"===d[0]?(o=d3.min(X),g="minimum"):"number"==typeof d[0]&&(o=d3.quantile(X,d[0]/100),g=d[0]+" percentile"),o=d3.max([d3.min(X),o]),e.tooltip.extent.value&&(R[g]={key:e[h].value,value:o}),b=[],x=[],L=[],I=[],A=0,F=n.length;F>A;A++)w=n[A],H=a(e,w,e[h].value),H>=z&&V>=H?b.push(w):H>=o&&z>H?x.push(w):D>=H&&H>V?L.push(w):I.push(w);for(O=a(e,n[0],e[r].value),G=e[r].scale.viz(O),G+=t,E=e.format.value(O,{key:e[r].value,vars:e}),O.constructor===Date&&(O=O.getTime()),O=i(O),b=c(b),b.d3plus={color:"white",id:"box_"+O,init:{},label:!1,shape:"square",stroke:"#444",text:"Interquartile Range for "+E},b.d3plus[y]=m,b.d3plus.init[y]=m,b.d3plus[l]=Math.abs(q(z)-q(V)),b.d3plus[r]=G,W=d3.min([q(z),q(V)])+b.d3plus[l]/2,W+=p,b.d3plus[h]=W,b.d3plus.tooltip=R,v.push(b),B={d3plus:{id:"median_line_"+O,position:"height"===l?"top":"right",shape:"whisker","static":!0}},P=e.format.value(T,{key:e[h].value,vars:e}),E={background:"#fff",names:[P],padding:0,resize:!1,x:0,y:0},_=Math.abs(q(T)-q(z)),k=Math.abs(q(T)-q(V)),N=2*d3.min([_,k]),C=2*e.data.stroke.width+2*e.labels.padding,E["width"===y?"w":"h"]=m-C,E["width"===l?"w":"h"]=N-C,B.d3plus.label=E,B.d3plus[y]=m,B.d3plus[r]=G,B.d3plus[h]=q(T)+p,v.push(B),x=c(x),x.d3plus={id:"bottom_whisker_line_"+O,offset:b.d3plus[l]/2,position:"height"===l?"bottom":"left",shape:"whisker","static":!0},"x"===h&&(x.d3plus.offset*=-1),x.d3plus[l]=Math.abs(q(o)-q(z)),x.d3plus[y]=m,x.d3plus[r]=G,x.d3plus[h]=W,v.push(x),L=c(L),L.d3plus={id:"top_whisker_line_"+O,offset:b.d3plus[l]/2,position:"height"===l?"top":"right",shape:"whisker","static":!0},"y"===h&&(L.d3plus.offset*=-1),L.d3plus[l]=Math.abs(q(D)-q(V)),L.d3plus[y]=m,L.d3plus[r]=G,L.d3plus[h]=W,v.push(L),M=0,S=I.length;S>M;M++)w=I[M],w.d3plus[r]=G,w.d3plus[h]=q(a(e,w,e.y.value)),w.d3plus[h]+=p,w.d3plus.r=4,w.d3plus.shape=e.shape.value;return f=!I.length&&D-o===0,u.push(T),v=v.concat(I),n}).entries(e.data.viz),f&&1===s(u).length?[]:v)},n.modes=["tukey","extent",Array,Number],n.requirements=["data","x","y"],n.shapes=["circle","check","cross","diamond","square","triangle","triangle_up","triangle_down"],n.setup=function(e){var t;return e.axes.discrete?void 0:(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"}))},t.exports=n},{"../../core/fetch/value.coffee":67,"../../string/strip.js":174,"../../util/uniques.coffee":209,"./helpers/graph/draw.coffee":311}],307:[function(e,t,r){var n,a,o,i,s,l,u;n=e("../../array/sort.coffee"),s=e("../../core/fetch/value.coffee"),o=e("../../core/fetch/color.coffee"),i=e("../../core/fetch/text.js"),u=e("../../color/legible.coffee"),l=e("../../core/data/group.coffee"),a=function(e){var t,r,a,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D;if(m=l(e,e.data.viz),m=n(m,null,null,null,e),f=m.length,4>f?(a=f,F=1):(S=e.width.viz/e.height.viz,a=Math.ceil(Math.sqrt(f*S)),F=Math.ceil(Math.sqrt(f/S))),f>0)for(;(F-1)*a>=f;)F--;for(r=e.width.viz/a,t=e.height.viz/F,e.size.value?(v=d3.min(e.data.viz,function(t){return s(e,t,e.size.value,e.id.value,"min")}),h=d3.max(e.data.viz,function(t){return s(e,t,e.size.value,e.id.value)}),p=[v,h]):p=[0,0],O=5,C=d3.min([r,t])/2-2*O,_=e.labels.value&&!e.small&&C>=40?d3.max([20,d3.min([.25*C,50])]):0,C-=_,B=d3.min([C,e.size.scale.min.value]),T=e.size.scale.value.domain(p).rangeRound([B,C]),M=d3.layout.pack().children(function(e){return e.values}).padding(O).radius(function(e){return T(e)}).size([r-2*O,t-2*O-_]).value(function(e){return e.value}),d=[],E=0,y=x=0,k=m.length;k>x;y=++x){for(c=m[y],P=M.nodes(c),q=r*y%e.width.viz,D=t*E,b=0,z=P.length;z>b;b++)N=P[b],N.children?(j={d3plus:{}},j[e.id.value]=N.key):j=N.d3plus,j.d3plus.depth=e.id.grouping.value?N.depth:e.depth.value,j.d3plus.x=N.x,j.d3plus.xOffset=q,j.d3plus.y=N.y,j.d3plus.yOffset=D+_,j.d3plus.r=N.r,d.push(j);(y+1)%a===0&&E++}for(g=C/d3.max(d,function(e){return e.d3plus.r}),I=M.size()[0]/2,R=M.size()[1]/2,w=0,A=d.length;A>w;w++)c=d[w],c.d3plus.x=(c.d3plus.x-I)*g+I+c.d3plus.xOffset,c.d3plus.y=(c.d3plus.y-R)*g+R+c.d3plus.yOffset,c.d3plus.r=c.d3plus.r*g,delete c.d3plus.xOffset,delete c.d3plus.yOffset,c.d3plus["static"]=c.d3plus.depth<e.depth.value&&e.id.grouping.value,!_||0!==c.d3plus.depth&&e.id.grouping.value!==!1?delete c.d3plus.label:(c.d3plus.text=i(e,c[e.id.value],c.d3plus.depth),V=_>3*e.labels.padding?e.labels.padding:0,c.d3plus.label={x:0,y:-(C+V+_/2),w:2*C,h:_-V,padding:0,resize:!0,color:u(o(e,c,c.d3plus.depth)),force:!0});return d.sort(function(e,t){return e.d3plus.depth-t.d3plus.depth})},a.fill=!0,a.requirements=["data"],a.scale=1.05,a.shapes=["circle","donut"],t.exports=a},{"../../array/sort.coffee":34,"../../color/legible.coffee":44,"../../core/data/group.coffee":57,"../../core/fetch/color.coffee":63,"../../core/fetch/text.js":66,"../../core/fetch/value.coffee":67}],308:[function(e,t,r){var n,a;a=e("../../../core/console/print.coffee"),n=function(e){var t,r;r={circle:"scatter",donut:"scatter",line:"line",square:"scatter",area:"stacked"},t=r[e.shape.value],a.warning('The "chart" visualization type has been deprecated and will be removed in version 2.0. Please use the "'+t+'" visualization type.'),e.self.type(t).draw()},n.shapes=["circle","donut","line","square","area"],t.exports=n},{"../../../core/console/print.coffee":52}],309:[function(e,t,r){var n;n=function(e){var t,r,n,a,o,i;return t=e.coords.value,n=e.coords.key||d3.keys(t.objects)[0],i=topojson.feature(t,t.objects[n]),r=i.features,o=e.coords.solo.value,a=e.coords.mute.value,r=r.filter(function(t){return t[e.id.value]=t.id,o.length?o.indexOf(t.id)>=0:a.length?a.indexOf(t.id)<0:!0})},n.libs=["topojson"],n.nesting=!1,n.requirements=["coords"],n.scale=1,n.shapes=["coordinates"],n.zoom=!0,t.exports=n},{}],310:[function(e,t,r){var n,a,o;n=e("../../../../core/fetch/color.coffee"),a=e("../../../../color/legible.coffee"),o=e("../../../../core/console/print.coffee"),t.exports=function(e){var t,r,i,s,l,u,c,d,f,p,h;for(t=e.axes,s=t.stacked||!t.ticks.value?[]:e.data.viz,h=2*s.length>e.data.large?0:e.draw.timing,d=function(r,o){return 0===o.indexOf("y")?r.attr("x1",-2).attr("x2",-8).attr("y1",function(e){return e.d3plus.y-t.margin.top}).attr("y2",function(e){return e.d3plus.y-t.margin.top}):r.attr("x1",function(e){return e.d3plus.x-t.margin.left}).attr("x2",function(e){return e.d3plus.x-t.margin.left}).attr("y1",t.height+2).attr("y2",t.height+8),r.style("stroke",function(t){return a(n(e,t))}).style("stroke-width",e.data.stroke.width).attr("shape-rendering",e.shape.rendering.value)},e.dev.value&&o.time("creating axis tick groups"),p=e.group.select("g#d3plus_graph_plane").selectAll("g.d3plus_data_tick").data(s,function(r){var n;return n=t.discrete?"_"+r.d3plus[t.discrete]:"","tick_"+r[e.id.value]+"_"+r.d3plus.depth+n}),p.enter().append("g").attr("class","d3plus_data_tick").attr("opacity",0),e.dev.value&&o.timeEnd("creating axis tick groups"),c=["x","y"],l=0,u=c.length;u>l;l++)r=c[l],e.dev.value&&h&&o.time("creating "+r+" ticks"),i=h&&r!==t.discrete?s:[],f=p.selectAll("line.d3plus_data_"+r).data(i,function(t){return"tick_"+t[e.id.value]+"_"+t.d3plus.depth}),e.dev.value&&h&&o.timeEnd("creating "+r+" ticks"),e.dev.value&&h&&o.time("styling "+r+" ticks"),h>0?f.transition().duration(h).call(d,r):f.call(d,r),f.enter().append("line").attr("class","d3plus_data_"+r).call(d,r),e.dev.value&&h&&o.timeEnd("styling "+r+" ticks");h>0?(p.transition().duration(h).attr("opacity",1),p.exit().transition().duration(h).attr("opacity",0).remove()):(p.attr("opacity",1),p.exit().remove())}},{"../../../../color/legible.coffee":44,"../../../../core/console/print.coffee":52,"../../../../core/fetch/color.coffee":63}],311:[function(e,t,r){var n,a,o,i;n=e("./includes/axes.coffee"),a=e("./includes/svg.coffee"),o=e("./includes/mouse.coffee"),i=e("./includes/plot.coffee"),t.exports=function(e,t){void 0===t&&(t={}),n(e,t),i(e,t),a(e,t),e.mouse.viz=t.mouse===!0?o:!1}},{"./includes/axes.coffee":312,"./includes/mouse.coffee":314,"./includes/plot.coffee":315,"./includes/svg.coffee":316}],312:[function(e,t,r){var n,a,o,i,s,l,u,c,d,f,p,h;n=e("../../../../../array/sort.coffee"),i=e("./buffer.coffee"),o=e("../../../../../util/buckets.coffee"),l=e("../../../../../core/fetch/data.js"),u=e("../../../../../core/fetch/value.coffee"),f=e("../../../../../core/console/print.coffee"),h=e("../../../../../util/uniques.coffee"),t.exports=function(e,t){var r,n,o,l,v,g,m,y,x,b,w,_;for(o=s(e),(o||!e.axes.dataset)&&(e.axes.dataset=c(e)),e.axes.scale=t.buffer&&t.buffer!==!0?p(e,t.buffer):!1,r=e.width.viz>e.height.viz?["y","y2","x","x2"]:["x","x2","y","y2"],v=0,m=r.length;m>v;v++)n=r[v],x=0===n.indexOf("x")?"y":"x",w=e.order.changed||e.order.sort.changed||e.order.value===!0&&e[x].changed,e[n].value&&(!e[n].ticks.values||o||w)&&(e.dev.value&&f.time("calculating "+n+" axis"),e[n].reset=!0,e[n].ticks.values=!1,n===e.axes.discrete&&e[n].value!==e.time.value&&(e[n].ticks.values=h(e.axes.dataset,e[n].value,u,e)),_=t.zero===!0||0===n.indexOf(t.zero)?!0:!1,b=a(e,n,_),0===n.indexOf("y")&&(b=b.reverse()),e[n].scale.viz=d(e,n,b),e[n].domain.viz=b,e.dev.value&&f.timeEnd("calculating "+n+" axis"));if(e.axes.mirror.value&&(l=d3.extent(e.y.domain.viz.concat(e.x.domain.viz)),e.x.domain.viz=l,e.x.scale.viz.domain(l),l=l.slice().reverse(),e.y.domain.viz=l,e.y.scale.viz.domain(l)),t.buffer)for(g=0,y=r.length;y>g;g++)n=r[g],n!==e.axes.discrete&&i(e,n,t.buffer)},s=function(e){var t,r,n,a,o,i,s,l,u,c,d,f,p;if(r=e.time.fixed.value&&(e.time.solo.changed||e.time.mute.changed),r||(r=e.id.solo.changed||e.id.mute.changed),r)return r;for(n=["data","time","id","depth","type","x","y","x2","y2"],a=0,l=n.length;l>a;a++)if(i=n[a],e[i].changed){r=!0;break}if(r)return r;for(p=["mute","range","scale","solo","stacked","zerofill"],d=["x","y","x2","y2"],o=0,u=d.length;u>o;o++)for(t=d[o],s=0,c=p.length;c>s;s++)if(f=p[s],e[t][f].changed){r=!0;break}return r},c=function(e){var t,r;return e.time.fixed.value?e.data.viz:(r=d3.range(0,e.id.nesting.length),d3.merge([function(){var n,a,o;for(o=[],n=0,a=r.length;a>n;n++)t=r[n],o.push(l(e,"all",t));return o}()]))},a=function(e,t,r,a){var o,i,s,l,c,d,f,p,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N;if(A=0===t.indexOf("x")?"y":"x",e[t].range.value&&2===e[t].range.value.length)return e[t].range.value.slice();if("share"===e[t].scale.value)return e[t].ticks.values=d3.range(0,1.1,.1),[0,1];if(e[t].stacked.value){for(T=[],j=e.axes.dataset,v=0,x=j.length;x>v;v++)f=j[v],f.values?T=T.concat(f.values):T.push(f);return c=d3.nest().key(function(t){return u(e,t,e[A].value)}).rollup(function(r){var n,a;return a=d3.sum(r,function(r){var n;return n=u(e,r,e[t].value),n>0?n:0}),n=d3.sum(r,function(r){var n;return n=u(e,r,e[t].value),0>n?n:0}),[n,a]}).entries(T),N=d3.merge(c.map(function(e){return e.values})),d3.extent(N)}if(e[t].value===e.time.value)return e.time.solo.value.length?d3.extent(e.time.solo.value).map(function(e){return e.constructor!==Date?(e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),new Date(e)):e}):d3.extent(e.data.time.ticks);for(N=[],M=e.axes.dataset,g=0,b=M.length;b>g;g++)f=M[g],B=u(e,f,e[t].value),B instanceof Array?N=N.concat(B):N.push(B);if(N=N.filter(function(e){return null!==e}),t===e.axes.discrete){if(S=e.order.value===!0?e[A].value:e.order.value){for(F=e.order.sort.value,o=e.order.agg.value||e.aggs.value[S]||"max",i=typeof o,d=N.reduce(function(e,t){return e[t]=[],e},{}),O=e.axes.dataset,y=0,w=O.length;w>y;y++)if(f=O[y],f.values)for(E=f.values,k=0,_=E.length;_>k;k++)C=E[k],p=u(e,C,e[t].value),d[p].push(u(e,C,S));else p=u(e,f,e[t].value),d[p].push(u(e,f,S));for(m in d)C=d[m],"string"===i?d[m]=d3[o](C):"function"===i&&(d[m]=o(C,S));return d=n(d3.entries(d),"value",F),d=d.reduce(function(e,t){return e.push(t.key),e},[])}return h(N).sort()}return N.sort(function(e,t){return e-t}),"log"===e[t].scale.value&&(0===N[0]&&(N[0]=1),0===N[N.length-1]&&(N[N.length-1]=-1)),r&&(l=N.every(function(e){return e>0}),s=N.every(function(e){return 0>e}),(l||s)&&(z=l?1:-1,N.push("log"===e[t].scale.value?z:0))),d3.extent(N)},d=function(e,t,r){var n,a,i,s;return a=0===t.indexOf("x")?e.width.viz:e.height.viz,i=e[t].scale.value,["discrete","share"].indexOf(i)>=0&&(i="linear"),s=10,"string"==typeof r[0]?(i="ordinal",n=o([0,a],r.length)):(n=[0,a],"linear"===e[t].scale.value&&(s=Math.floor(a/(4*e[t].ticks.font.size)))),e[t].scale.ticks=s,d3.scale[i]().domain(r).range(n)},p=function(e,t){var r,n,a;return t===!0&&(t="size"),t in e&&(t=e[t].value),a=e.size.scale.min.value,"function"==typeof a&&(a=a(e)),n=e.size.scale.max.value,"function"==typeof n&&(n=n(e)),t===!1?e.size.scale.value.rangeRound([n,n]):"number"==typeof t?e.size.scale.value.rangeRound([t,t]):t?(e.dev.value&&f.time("calculating buffer scale"),r=d3.extent(e.axes.dataset,function(r){var n;return n=u(e,r,t),n?n:0}),r[0]===r[1]&&(a=n),e.dev.value&&f.timeEnd("calculating buffer scale"),e.size.scale.value.domain(r).rangeRound([a,n])):void 0}},{"../../../../../array/sort.coffee":34,"../../../../../core/console/print.coffee":52,"../../../../../core/fetch/data.js":64,"../../../../../core/fetch/value.coffee":67,"../../../../../util/buckets.coffee":203,"../../../../../util/uniques.coffee":209,"./buffer.coffee":313}],313:[function(e,t,r){var n,a;n=e("../../../../../util/buckets.coffee"),a=e("../../../../../util/closest.coffee"),t.exports=function(e,t,r){var o,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N;if("share"!==e[t].scale.value&&!e[t].range.value&&e[t].reset){if(t===e.axes.discrete){if(h=e[t].scale.viz.domain(),"string"==typeof h[0]){for(y=h.length;y>=0;)h.splice(y,0,"d3plus_buffer_"+y),y--;return j=e[t].scale.viz.range(),j=n(d3.extent(j),h.length),e[t].scale.viz.domain(h).range(j)}if(0===t.indexOf("y")&&(h=h.slice().reverse()),1===e[t].ticks.values.length)e[t].value===e.time.value&&1!==e.data.time.ticks.length?(u=a(e.data.time.ticks,h[0]),F=e.data.time.ticks.indexOf(u),F>0?h[0]=e.data.time.ticks[F-1]:(f=e.data.time.ticks[F+1]-u,h[0]=new Date(u.getTime()-f)),F<e.data.time.ticks.length-1?h[1]=e.data.time.ticks[F+1]:(f=u-e.data.time.ticks[F-1],h[1]=new Date(u.getTime()+f))):(h[0]-=1,h[1]+=1);else if(e.axes.scale)p=Math.abs(h[1]-h[0]),i=p/(e[t].ticks.values.length-1),i/=2,M=e[t].scale.viz.range()[1],k=1.5*e.axes.scale.range()[1],m=e[t].scale.viz.invert(-k),g=e[t].scale.viz.invert(M+k),h[0]-i<m?(h[0]=h[0]-i,h[1]=h[1]+i):(h=[m,g],0===t.indexOf("y")&&(h=h.reverse()),v=e[t].scale.viz.domain(),v=v[1]-v[0],v||(h[0]-=1,h[1]+=1));else if(e[t].value===e.time.value)p=Math.abs(h[1]-h[0]),i=p/(e[t].ticks.values.length-1),i/=2,h[0]=h[0]-i,h[1]=h[1]+i;else{for(p=Math.abs(h[1]-h[0]),o=p/2,y=h.length,A=h.slice();y>=0;)d=y?A[y-1]+o:A[y]-o,h.splice(y,0,d),y--;j=e[t].scale.viz.range(),j=n(d3.extent(j),h.length),e[t].scale.viz.domain(h).range(j)}return 0===t.indexOf("y")&&(h=h.reverse()),e[t].scale.viz.domain(h)}if("x"===r&&0===t.indexOf("x")||"y"===r&&0===t.indexOf("y")||r===!0)return h=e[t].scale.viz.domain(),l=h[0]>=0&&h[1]>=0,s=h[0]<=0&&h[1]<=0,"log"===e[t].scale.value?(N=l?1:-1,l&&0===t.indexOf("y")&&(h=h.slice().reverse()),w=Math.pow(10,parseInt(Math.abs(h[0])).toString().length-1)*N,b=h[0]%w,x=b,b&&.1>=x/w&&(x+=w*N),_=0===b?w:x,h[0]-=_,0===h[0]&&(h[0]=N),C=Math.pow(10,parseInt(Math.abs(h[1])).toString().length-1)*N,T=h[1]%C,S=Math.abs(C-T),T&&.1>=S/C&&(S+=C*N),B=0===T?C:S,h[1]+=B,0===h[1]&&(h[1]=N),l&&0===t.indexOf("y")&&(h=h.reverse())):(N=0,0===t.indexOf("y")&&(h=h.slice().reverse()),E=h.filter(function(e){return e.constructor===String}),i=.05*Math.abs(h[1]-h[0])||1,E.length||(h[0]=h[0]-i,h[1]=h[1]+i,(l&&h[0]<N||s&&h[0]>N)&&(h[0]=N),(l&&h[1]<N||s&&h[1]>N)&&(h[1]=N)),0===t.indexOf("y")&&(h=h.reverse())),e[t].scale.viz.domain(h);if(e.axes.scale)return c=!1,e.axes.mirror.value&&(z=0===t.indexOf("y")?"x":"y",c=e[z].scale.viz,O=e.width.viz>e.height.viz?"x":"y"),t===O&&c?h=c.domain().slice().reverse():(M=e[t].scale.viz.range()[1],k=e.axes.scale.range()[1],m=e[t].scale.viz.invert(1.5*-k),g=e[t].scale.viz.invert(M+1.5*k),h=[m,g],0===t.indexOf("y")&&(h=h.reverse()),v=e[t].scale.viz.domain(),v=v[1]-v[0],v||(h[0]-=1,h[1]+=1),0===t.indexOf("y")&&(h=h.reverse())),e[t].scale.viz.domain(h)}}},{"../../../../../util/buckets.coffee":203,"../../../../../util/closest.coffee":205}],314:[function(e,t,r){var n,a,o,i,s,l;n=e("../../../../../util/copy.coffee"),a=e("../../../../../client/pointer.coffee"),o=e("../../../../../core/fetch/color.coffee"),i=e("../../../../../core/fetch/value.coffee"),s=e("../../../../../color/legible.coffee"),l=e("../../../../../color/text.coffee"),t.exports=function(e,t){var r,n,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z;return r=d3.event.type===a.click&&(t.tooltip.value["long"]||t.tooltip.html.value),u=[a.over,a.move].indexOf(d3.event.type)>=0,k=e.d3plus.x,z=e.d3plus.y,g=e.d3plus.r||0,x=t.types[t.type.value].scale||1,g*=x,c=t.axes,_=t.draw.timing?t.timing.mouseevents:0,!r&&u?(n=s(o(t,e)),d=["x","y","x2","y2"].filter(function(r){var n;return n=i(t,e,t[r].value),n&&!(n instanceof Array)&&r!==t.axes.stacked&&t[r].mouse.value&&r!==t.axes.discrete})):d=[],f=function(e){return e.attr("x1",function(e){return 0===e.indexOf("x")?k:k-g}).attr("y1",function(e){return 0===e.indexOf("y")?z:z+g;
}).attr("x2",function(e){return 0===e.indexOf("x")?k:k-g}).attr("y2",function(e){return 0===e.indexOf("y")?z:z+g}).attr("opacity",0)},p=function(e){return e.style("stroke",function(e){return"area"===t.shape.value?"white":n}).attr("stroke-dasharray",function(e){return t[e].mouse.dasharray.value}).attr("shape-rendering",function(e){return t[e].mouse.rendering.value}).style("stroke-width",function(e){return t[e].mouse.width})},h=function(r){return r.attr("x1",function(e){return 0===e.indexOf("x")?k:k-g}).attr("y1",function(e){return 0===e.indexOf("y")?z:z+g}).attr("x2",function(r){return 0===r.indexOf("x")?k:e.d3plus.x0?e.d3plus.x0:"y"===r?c.margin.left-t[r].ticks.size:c.margin.left+c.width+t[r].ticks.size}).attr("y2",function(r){return 0===r.indexOf("y")?z:e.d3plus.y0?e.d3plus.y0:"x"===r?c.height+c.margin.top+t[r].ticks.size:c.margin.top-t[r].ticks.size}).style("opacity",1)},v=t.g.labels.selectAll("line.d3plus_mouse_axis_label").data(d),_?(v.enter().append("line").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").call(f).call(p),v.transition().duration(_).call(h).call(p),v.exit().transition().duration(_).call(f).remove()):(v.call(h).call(p),v.enter().append("line").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").call(f).call(p),v.exit().remove()),b=function(r){return r.attr("font-size",function(e){return t[e].ticks.font.size+"px"}).attr("font-family",function(e){return t[e].ticks.font.family.value}).attr("font-weight",function(e){return t[e].ticks.font.weight}).attr("x",function(e){return 0===e.indexOf("x")?k:"y"===e?c.margin.left-5-t[e].ticks.size:c.margin.left+c.width+5+t[e].ticks.size}).attr("y",function(r){return 0===r.indexOf("y")?z:e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+c.margin.top-6:"x"===r?c.height+c.margin.top+5+t[r].ticks.size:c.margin.top-5-t[r].ticks.size-1.35*t[r].ticks.font.size}).attr("fill","area"===t.shape.value?"white":l(n))},w=t.g.labels.selectAll("text.d3plus_mouse_axis_label").data(d),w.enter().append("text").attr("class","d3plus_mouse_axis_label").attr("id",function(e){return e+"_d3plusmouseaxislabel"}).attr("dy",function(e){return 0===e.indexOf("y")?.35*t[e].ticks.font.size:t[e].ticks.font.size}).style("text-anchor",function(e){return"y"===e?"end":"y2"===e?"start":"middle"}).attr("opacity",0).attr("pointer-events","none").call(b),w.text(function(r){var n,a;return n=t.axes.stacked||r,a=i(t,e,t[n].value),t.format.value(a,{key:t[n].value,vars:t,labels:t[n].affixes.value})}),_?(w.transition().duration(_).delay(_).attr("opacity",1).call(b),w.exit().transition().duration(_).attr("opacity",0).remove()):(w.attr("opacity",1).call(b),w.exit().remove()),m=function(r){var a;return a=function(e){var t;return t=d3.select("text#"+e+"_d3plusmouseaxislabel"),t.size()?t.node().getBBox():{width:0,height:0}},r.attr("x",function(e){var r;return r=a(e).width,0===e.indexOf("x")?k-r/2-5:"y"===e?c.margin.left-t[e].ticks.size-r-10:c.margin.left+c.width+t[e].ticks.size}).attr("y",function(r){var n;return n=a(r).height,0===r.indexOf("y")?z-(n/2+5):e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+c.margin.top-(n/2+5):"x"===r?c.height+c.margin.top+t[r].ticks.size:c.margin.top-t[r].ticks.size-n-10}).attr("width",function(e){return a(e).width+10}).attr("height",function(e){return a(e).height+10}).style("stroke","area"===t.shape.value?"transparent":n).attr("fill",n).attr("shape-rendering",function(e){return t[e].mouse.rendering.value}).style("stroke-width",function(e){return t[e].mouse.width})},y=t.g.labels.selectAll("rect.d3plus_mouse_axis_label").data(d),_?(y.enter().insert("rect","text.d3plus_mouse_axis_label").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").attr("opacity",0).call(m),y.transition().duration(_).delay(_).attr("opacity",1).call(m),y.exit().transition().duration(_).attr("opacity",0).remove()):(y.attr("opacity",1).call(m),y.enter().insert("rect","text.d3plus_mouse_axis_label").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").call(m),y.exit().remove())}},{"../../../../../client/pointer.coffee":38,"../../../../../color/legible.coffee":44,"../../../../../color/text.coffee":50,"../../../../../core/fetch/color.coffee":63,"../../../../../core/fetch/value.coffee":67,"../../../../../util/copy.coffee":206}],315:[function(e,t,r){var n,a,o,i,s,l,u,c,d,f,p,h;n=e("../../../../../util/buckets.coffee"),a=e("./buffer.coffee"),i=e("../../../../../core/fetch/value.coffee"),s=e("../../../../../font/sizes.coffee"),f=e("../../../../../textwrap/textwrap.coffee"),p=e("../../../../../core/data/time.coffee"),h=e("../../../../../util/uniques.coffee"),t.exports=function(e,t){var r,n,s,l,d,f,h,v,g,m,y,x,b,w,_,k,z,A;for(e.axes.margin=c(e),e.axes.height=e.height.viz,e.axes.width=e.width.viz,r=e.width.viz>e.height.viz?["y","y2","x","x2"]:["x","x2","y","y2"],d=0,h=r.length;h>d;d++)if(n=r[d],e[n].value){if(e[n].ticks.values===!1)if(e[n].value===e.time.value){for(k=e.time.solo.value,k=k.length?k.map(function(e){return e.constructor!==Date&&(e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),e=new Date(e)),e}):e.data.time.values,l=d3.extent(k),b=e.data.time.stepType,k=[l[0]],_=l[0];_<l[1];)g=new Date(_),_=new Date(g["set"+b](g["get"+b]()+1)),k.push(_);e[n].ticks.values=k}else 1===n.indexOf("2")?(y=e[n.slice(0,1)].scale.viz,x=e[n].scale.viz,k=e[n.slice(0,1)].scale.ticks,e[n].ticks.values=y.ticks(k).map(function(e){return parseFloat(d3.format(".5f")(x.invert(y(e))))})):e[n].ticks.values=e[n].scale.viz.ticks(e[n].scale.ticks);e[n].ticks.values.length||(A=i(e,e.data.viz,e[n].value),A instanceof Array||(A=[A]),e[n].ticks.values=A),m=0===n.indexOf("x")?"y":"x",(1===e[n].ticks.values.length||t.buffer&&t.buffer!==m&&n===e.axes.discrete&&e[n].reset===!0)&&a(e,n,t.buffer),e[n].reset=!1,e[n].value===e.time.value?(s={"font-family":e[n].ticks.font.family.value,"font-weight":e[n].ticks.font.weight,"font-size":e[n].ticks.font.size+"px","text-transform":e[n].ticks.font.transform.value,"letter-spacing":e[n].ticks.font.spacing+"px"},z=p(e,{values:e[n].ticks.values,limit:e.width.viz,style:s}),e[n].ticks.value?e[n].ticks.visible=e[n].ticks.value.map(Number):e[n].ticks.labels.value.constructor===Array?e[n].ticks.visible=e[n].ticks.labels.value.map(Number):e[n].ticks.visible=z.values.map(Number),e[n].ticks.format=z.format):e[n].ticks.value?(e[n].ticks.values=e[n].ticks.value,e[n].ticks.labels.value.constructor===Array?e[n].ticks.visible=e[n].ticks.labels.value:e[n].ticks.visible=e[n].ticks.value):e[n].ticks.labels.value.constructor===Array?e[n].ticks.visible=e[n].ticks.labels.value:"log"===e[n].scale.value?(k=e[n].ticks.values,w=k.filter(function(e){return"1"===Math.abs(e).toString().charAt(0)}),w.length<3?e[n].ticks.visible=k:e[n].ticks.visible=w):e[n].ticks.visible=e[n].ticks.values}for(e.small||u(e),f=0,v=r.length;v>f;f++)n=r[f],e[n].axis.svg=o(e,n)},c=function(e){return e.small?{top:0,right:0,bottom:0,left:0}:{top:10,right:10,bottom:10,left:10}},u=function(e){var t,r,a,o,i,u,c,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B;for(b=e.x.scale.viz.domain(),F=e.y.scale.viz.domain(),e.x2.value&&(g=e.x2.scale.viz.domain()),e.y2.value&&(M=e.y2.scale.viz.domain()),d=["y","y2"],r=0,i=d.length;i>r;r++)t=d[r],e[t].value&&(c="y"===t?"left":"right",O={"font-size":e[t].ticks.font.size+"px","font-family":e[t].ticks.font.family.value,"font-weight":e[t].ticks.font.weight,"text-transform":e[t].ticks.font.transform.value,"letter-spacing":e[t].ticks.font.spacing+"px"},B=e[t].ticks.visible,"log"===e[t].scale.value?C=B.map(function(e){return l(e)}):"share"===e[t].scale.value?C=B.map(function(t){return e.format.value(100*t,{key:"share",vars:e})}):e[t].value===e.time.value?C=B.map(function(r,n){return e[t].ticks.format(new Date(r))}):("string"==typeof B[0]&&(B=e[t].scale.viz.domain().filter(function(e){return 0!==e.indexOf("d3plus_buffer_")})),C=B.map(function(r){return e.format.value(r,{key:e[t].value,vars:e,labels:e[t].affixes.value})})),e[t].ticks.labels.value?(e[t].ticks.hidden=!1,E=d3.max(s(C,O),function(e){return e.width}),E=Math.ceil(E+e.labels.padding),e.axes.margin[c]+=E):e[t].ticks.hidden=!0,S=e[t].label.fetch(e),S?(T={"font-family":e[t].label.font.family.value,"font-weight":e[t].label.font.weight,"font-size":e[t].label.font.size+"px","text-transform":e[t].label.font.transform.value,"letter-spacing":e[t].label.font.spacing+"px"},e[t].label.height=s([S],T)[0].height):e[t].label.height=0,e[t].label.value&&(e.axes.margin[c]+=e[t].label.height,e.axes.margin[c]+=2*e[t].label.padding));for(e.axes.width-=e.axes.margin.left+e.axes.margin.right,e.x.scale.viz.range(n([0,e.axes.width],b.length)),g&&e.x2.scale.viz.range(n([0,e.axes.width],g.length)),p=["x","x2"],a=0,u=p.length;u>a;a++)t=p[a],e[t].value&&(c="x"===t?"bottom":"top",e[t].ticks.labels.value?(e[t].ticks.hidden=!1,m={"font-size":e[t].ticks.font.size+"px","font-family":e[t].ticks.font.family.value,"font-weight":e[t].ticks.font.weight,"text-transform":e[t].ticks.font.transform.value,"letter-spacing":e[t].ticks.font.spacing+"px"},j=e[t].ticks.visible,"log"===e[t].scale.value?A=j.map(function(e){return l(e)}):"share"===e[t].scale.value?A=j.map(function(t){return e.format.value(100*t,{key:"share",vars:e})}):e[t].value===e.time.value?A=j.map(function(r,n){return e[t].ticks.format(new Date(r))}):("string"==typeof j[0]&&(j=e[t].scale.viz.domain().filter(function(e){return 0!==e.indexOf("d3plus_buffer_")})),A=j.map(function(r){return e.format.value(r,{key:e[t].value,vars:e,labels:e[t].affixes.value})})),z=s(A,m),x=d3.max(z,function(e){return e.width}),y=d3.max(z,function(e){return e.height}),1===j.length?k=e.axes.width:(k=e[t].scale.viz(j[1])-e[t].scale.viz(j[0]),k=Math.abs(k)),x>k&&A.join("").indexOf(" ")>0?(e[t].ticks.wrap=!0,z=s(A,m,{mod:function(t){return f().container(d3.select(t)).height(e.axes.height/2).width(k).draw()}}),x=d3.max(z,function(e){return e.width}),y=d3.max(z,function(e){return e.height})):e[t].ticks.wrap=!1,e[t].ticks.baseline="auto",k>=x?e[t].ticks.rotate=0:x<e.axes.height/2?(z=s(A,m,{mod:function(t){return f().container(d3.select(t)).width(e.axes.height/2).height(k).draw()}}),y=d3.max(z,function(e){return e.width}),x=d3.max(z,function(e){return e.height}),e[t].ticks.rotate=-90):(x=0,y=0),x&&y||(e[t].ticks.hidden=!0,e[t].ticks.rotate=0),x=Math.ceil(x),y=Math.ceil(y),e[t].ticks.maxHeight=y,e[t].ticks.maxWidth=x,e.axes.margin[c]+=y+e.labels.padding,o=e[t].ticks.visible[e[t].ticks.visible.length-1],h=e[t].scale.viz(o),h+=x/2+e.axes.margin.left,h>e.width.value&&(v=h-e.width.value+e.axes.margin.right,e.axes.width-=v,e.axes.margin.right+=v)):e[t].ticks.hidden=!0,w=e[t].label.fetch(e),w?(_={"font-family":e[t].label.font.family.value,"font-weight":e[t].label.font.weight,"font-size":e[t].label.font.size+"px","text-transform":e[t].label.font.transform.value,"letter-spacing":e[t].label.font.spacing+"px"},e[t].label.height=s([w],_)[0].height):e[t].label.height=0,e[t].label.value&&(e.axes.margin[c]+=e[t].label.height,e.axes.margin[c]+=2*e[t].label.padding));return e.axes.height-=e.axes.margin.top+e.axes.margin.bottom,e.x.scale.viz.range(n([0,e.axes.width],b.length)),g&&e.x2.scale.viz.range(n([0,e.axes.width],g.length)),e.y.scale.viz.range(n([0,e.axes.height],F.length)),M?e.y2.scale.viz.range(n([0,e.axes.height],M.length)):void 0},o=function(e,t){return d3.svg.axis().tickSize(e[t].ticks.size).tickPadding(5).orient(e[t].orient.value).scale(e[t].scale.viz).tickValues(e[t].ticks.values).tickFormat(function(r,n){var a,o;return e[t].ticks.hidden?null:(o=e[t].scale.value,a=r.constructor===Date?+r:r,e[t].ticks.visible.indexOf(a)>=0?"share"===o?e.format.value(100*r,{key:"share",vars:e,labels:e[t].affixes.value}):r.constructor===Date?e[t].ticks.format(r):"log"===o?l(r):e.format.value(r,{key:e[t].value,vars:e,labels:e[t].affixes.value}):null)})},d="⁰¹²³⁴⁵⁶⁷⁸⁹",l=function(e){var t,r,n;return r=Math.round(Math.log(Math.abs(e))/Math.LN10),n=Math.abs(e).toString().charAt(0),t="10 "+(r+"").split("").map(function(e){return d[e]}).join(""),"1"!==n&&(t=n+" x "+t),0>e?"-"+t:t}},{"../../../../../core/data/time.coffee":62,"../../../../../core/fetch/value.coffee":67,"../../../../../font/sizes.coffee":101,"../../../../../textwrap/textwrap.coffee":199,"../../../../../util/buckets.coffee":203,"../../../../../util/uniques.coffee":209,"./buffer.coffee":313}],316:[function(e,t,r){var n,a,o;n=e("../../../../../color/mix.coffee"),a=e("../../../../../textwrap/textwrap.coffee"),o=e("../../../../../object/validate.coffee"),t.exports=function(e){var t,r,i,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H,X,G,W,Q,J,K,Z,$,ee,te,re,ne,ae,oe,ie,se,le,ue,ce;if(h=e.x.domain.viz.concat(e.y.domain.viz),h.indexOf(void 0)>=0)return null;for(d={width:e.axes.width,height:e.axes.height,fill:e.axes.background.color,stroke:e.axes.background.stroke.color,"stroke-width":e.axes.background.stroke.width,"shape-rendering":e.axes.background.rendering.value},r={left:"start",center:"middle",right:"end"},s=e.small?[]:[0],oe=function(t,r){return t.attr("x1",function(t){return 0===r.indexOf("x")?e.x.scale.viz(t):0}).attr("x2",function(t){return 0===r.indexOf("x")?e.x.scale.viz(t):e.axes.width}).attr("y1",function(t){return 0===r.indexOf("y")?e.y.scale.viz(t):0}).attr("y2",function(t){return 0===r.indexOf("y")?e.y.scale.viz(t):e.axes.height})},ie=function(t,r,a){var o,i;return o=a?e[r].grid.color:e[r].ticks.color,i="log"===e[r].scale.value,t.attr("stroke",function(t){var s;return 0===t?e[r].axis.color:(t.constructor===Date&&(t=+t),s=e[r].ticks.visible.indexOf(t)>=0,!s||i&&"1"!==Math.abs(t).toString().charAt(0)?a&&"transparent"!==e.axes.background.color?n(o,e.axes.background.color,.4,1):"transparent"!==e.background.value?n(o,e.background.value,.4,1):n(o,"white",.4,1):o)}).attr("stroke-width",e[r].ticks.width).attr("shape-rendering",e[r].ticks.rendering.value)},v=function(t,r,n){var a;return a=0===r?"axis":"ticks",r=e[t][a].font[n],r&&(r.length||"number"==typeof r)?r:e[t].ticks.font[n]},ae=function(t,r){var a;return a="log"===e[r].scale.value,t.attr("font-size",function(e){return v(r,e,"size")+"px"}).attr("fill",function(t){var o;return o=v(r,t,"color"),a&&"1"!==Math.abs(t).toString().charAt(0)?n(o,e.background.value,.4,1):o}).attr("font-family",function(e){return v(r,e,"family").value}).attr("font-weight",function(e){return v(r,e,"weight")}).style("text-transform",function(e){return v(r,e,"transform").value}).style("letter-spacing",function(e){return v(r,e,"spacing")+"px"})},N=function(t,r){var n,a;return n=0===r.indexOf("x")?"height":"width",a=0===r.indexOf("x")?"y":"x",t.attr(a+"1",0).attr(a+"2",e.axes[n]).attr(r+"1",function(e){return e.coords.line}).attr(r+"2",function(e){return e.coords.line}).attr("stroke",function(t){return t.color||e[r].lines.color}).attr("stroke-width",e[r].lines.width).attr("shape-rendering",e[r].lines.rendering.value).attr("stroke-dasharray",e[r].lines.dasharray.value)},T=function(t,n){var a;return a=0===n.indexOf("x")?"y":"x",t.attr(a,function(e){return e.coords.text[a]+"px"}).attr(n,function(e){return e.coords.text[n]+"px"}).attr("dy",e[n].lines.font.position.value).attr("text-anchor",r[e[n].lines.font.align.value]).attr("transform",function(e){return e.transform}).attr("font-size",e[n].lines.font.size+"px").attr("fill",function(t){return t.color||e[n].lines.color}).attr("font-family",e[n].lines.font.family.value).attr("font-weight",e[n].lines.font.weight)},L="translate("+e.axes.margin.left+","+e.axes.margin.top+")",U=e.group.selectAll("g#d3plus_graph_plane").data([0]),U.transition().duration(e.draw.timing).attr("transform",L),U.enter().append("g").attr("id","d3plus_graph_plane").attr("transform",L),c=U.selectAll("rect#d3plus_graph_background").data([0]),c.transition().duration(e.draw.timing).attr(d),c.enter().append("rect").attr("id","d3plus_graph_background").attr("x",0).attr("y",0).attr(d),V=U.selectAll("path#d3plus_graph_mirror").data([0]),V.enter().append("path").attr("id","d3plus_graph_mirror").attr("fill","#000").attr("fill-opacity",.03).attr("stroke-width",1).attr("stroke","#ccc").attr("stroke-dasharray","10,10").attr("opacity",0),V.transition().duration(e.draw.timing).attr("opacity",function(){return e.axes.mirror.value?1:0}).attr("d",function(){var e,t;return t=d.width,e=d.height,"M "+t+" "+e+" L 0 "+e+" L "+t+" 0 Z"}),Z=0!==e.x.ticks.rotate,ue=function(t,r){var n,o;return o="x"===r?e.axes.height:0,n=t.attr("transform","translate(0,"+o+")").call(e[r].axis.svg.scale(e[r].scale.viz)).selectAll("g.tick"),n.selectAll("line").attr("y2",function(t){var n;return t.constructor===Date&&(t=+t),n=d3.select(this).attr("y2"),e[r].ticks.visible.indexOf(t)>=0?n:n/2}),n.select("text").style("text-anchor",Z&&"x"===r?"end":Z?"start":"middle").call(ae,r).each(function(t){return d3.select(this).attr("dy","0px").attr("font-size",function(e){return v(r,e,"size")+"px"}),t.constructor===Date&&(t=+t),!e[r].ticks.hidden&&e[r].ticks.visible.indexOf(t)>=0?a().container(d3.select(this)).rotate(e[r].ticks.rotate).valign(Z?"middle":"x"===r?"top":"bottom").width(e[r].ticks.maxWidth).height(e[r].ticks.maxHeight).padding(0).x(-e[r].ticks.maxWidth/2).y("x2"===r?-(e[r].ticks.maxHeight+2*e.labels.padding):0).draw():void 0})},ce=function(t,r){var n,a;return a="y2"===r?e.axes.width:0,n=t.attr("transform","translate("+a+", 0)").call(e[r].axis.svg.scale(e[r].scale.viz)).selectAll("g.tick"),n.selectAll("line").attr("y2",function(t){var r;return t.constructor===Date&&(t=+t),r=d3.select(this).attr("y2"),e.x.ticks.visible.indexOf(t)>=0?r:r/2}),n.select("text").call(ae,r)},W=["x","x2","y","y2"],x=0,A=W.length;A>x;x++)i=W[x],ee=0===i.indexOf("x")?ue:ce,H=s.length&&e[i].value?[0]:[],l=U.selectAll("g#d3plus_graph_"+i+"ticks").data(H),l.transition().duration(e.draw.timing).call(ee,i),l.selectAll("line").transition().duration(e.draw.timing).call(ie,i),y=l.enter().append("g").attr("id","d3plus_graph_"+i+"ticks").call(ee,i),y.selectAll("path").attr("fill","none"),y.selectAll("line").call(ie,i),l.exit().transition().duration(e.data.timing).attr("opacity",0).remove();for(z=function(t,r){return t.attr("x",0===r.indexOf("x")?e.width.viz/2:-(e.axes.height/2+e.axes.margin.top)).attr("y","x"===r?e.height.viz-e[r].label.height/2-e[r].label.padding:"y2"===r?e.width.viz-e[r].label.height/2-e[r].label.padding:e[r].label.height/2+e[r].label.padding).attr("transform",0===r.indexOf("y")?"rotate(-90)":null).attr("font-family",e[r].label.font.family.value).attr("font-weight",e[r].label.font.weight).attr("font-size",e[r].label.font.size+"px").attr("fill",e[r].label.font.color).style("text-anchor","middle").attr("dominant-baseline","central").style("text-transform",e[r].label.font.transform.value).style("letter-spacing",e[r].label.font.spacing+"px")},Q=["x","y"],b=0,j=Q.length;j>b;b++)i=Q[b],e[i].grid.value?m=e[i].ticks.value?e[i].ticks.value:e[i].ticks.values:(m=[],D="x"===i?"y":"x",e[i].ticks.values.indexOf(0)>=0&&e[D].axis.value&&(m=[0])),g=U.selectAll("g#d3plus_graph_"+i+"grid").data([0]),g.enter().append("g").attr("id","d3plus_graph_"+i+"grid"),P=g.selectAll("line").data(m,function(e,t){return e.constructor===Date?e.getTime():e}),P.transition().duration(e.draw.timing).call(oe,i).call(ie,i,!0),P.enter().append("line").style("opacity",0).call(oe,i).call(ie,i,!0).transition().duration(e.draw.timing).delay(e.draw.timing/2).style("opacity",1),P.exit().transition().duration(e.draw.timing/2).style("opacity",0).remove();for(J=["x","x2","y","y2"],w=0,M=J.length;M>w;w++)i=J[w],e[i].value?(u=e[i].label.fetch(e),k=s&&u?[0]:[],t=e.format.affixes.value[e[i].value],u&&!e[i].affixes.value&&t&&($=e[i].affixes.separator.value,$===!0?$=["[","]"]:$===!1&&($=["",""]),u+=" "+$[0]+t[0]+" "+t[1]+$[1])):(u="",k=[]),_=e.group.selectAll("text#d3plus_graph_"+i+"label").data(k),_.text(u).transition().duration(e.draw.timing).call(z,i),_.enter().append("text").attr("id","d3plus_graph_"+i+"label").text(u).call(z,i),_.exit().transition().duration(e.data.timing).attr("opacity",0).remove();for(K=["x","y","x2","y2"],q=0,O=K.length;O>q;q++)if(i=K[q],e[i].value){for(C=U.selectAll("g#d3plus_graph_"+i+"_userlines").data([0]),C.enter().append("g").attr("id","d3plus_graph_"+i+"_userlines"),p=e[i].scale.viz.domain(),0===i.indexOf("y")&&(p=p.slice().reverse()),te=[],S=[],se=e[i].lines.value||[],R=0,E=se.length;E>R;R++)F=se[R],f=o(F)?F.position:F,le=i===e.axes.discrete?p.indexOf(f)>=0:f>=p[0]&&f<=p[1],le&&(f=o(F)?F:{position:f},f.coords={line:e[i].scale.viz(f.position)},S.push(f),f.text&&(f.axis=i,f.padding=.5*e[i].lines.font.padding.value,f.align=e[i].lines.font.align.value,Y=e[i].lines.font.position.text,re="middle"===Y?0:2*f.padding,"top"===Y&&(re=-re),0===i.indexOf("x")?(ne="left"===f.align?e.axes.height:"center"===f.align?e.axes.height/2:0,"left"===f.align&&(ne-=2*f.padding),"right"===f.align&&(ne+=2*f.padding)):(ne="left"===f.align?0:"center"===f.align?e.axes.width/2:e.axes.width,"right"===f.align&&(ne-=2*f.padding),"left"===f.align&&(ne+=2*f.padding)),f.coords.text={},f.coords.text[0===i.indexOf("x")?"y":"x"]=ne,f.coords.text[i]=e[i].scale.viz(f.position)+re,f.transform=0===i.indexOf("x")?"rotate(-90,"+f.coords.text.x+","+f.coords.text.y+")":null,te.push(f)));P=C.selectAll("line.d3plus_graph_"+i+"line").data(S,function(e){return e.position}),P.enter().append("line").attr("class","d3plus_graph_"+i+"line").attr("opacity",0).call(N,i),P.transition().duration(e.draw.timing).attr("opacity",1).call(N,i),P.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),I=C.selectAll("text.d3plus_graph_"+i+"line_text").data(te,function(e){return e.position}),I.enter().append("text").attr("class","d3plus_graph_"+i+"line_text").attr("id",function(e){var t;return t=e.position+"",t=t.replace("-","neg"),t=t.replace(".","p"),"d3plus_graph_"+i+"line_text_"+t}).attr("opacity",0).call(T,i),I.text(function(e){return e.text}).transition().duration(e.draw.timing).attr("opacity",1).call(T,i),I.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),G=function(t){var r;return r=function(e){var t;return t=e.position+"",t=t.replace("-","neg"),t=t.replace(".","p"),U.select("text#d3plus_graph_"+e.axis+"line_text_"+t).node().getBBox()},t.attr("x",function(e){return r(e).x-e.padding}).attr("y",function(e){return r(e).y-e.padding}).attr("transform",function(e){return e.transform}).attr("width",function(e){return r(e).width+2*e.padding}).attr("height",function(e){return r(e).height+2*e.padding}).attr("fill","transparent"!==e.axes.background.color?e.axes.background.color:"white")},X=e[i].lines.font.background.value?te:[],B=C.selectAll("rect.d3plus_graph_"+i+"line_rect").data(X,function(e){return e.position}),B.enter().insert("rect","text.d3plus_graph_"+i+"line_text").attr("class","d3plus_graph_"+i+"line_rect").attr("pointer-events","none").attr("opacity",0).call(G),B.transition().delay(e.draw.timing).each("end",function(t){return d3.select(this).transition().duration(e.draw.timing).attr("opacity",1).call(G)}),B.exit().transition().duration(e.draw.timing).attr("opacity",0).remove()}}},{"../../../../../color/mix.coffee":46,"../../../../../object/validate.coffee":171,"../../../../../textwrap/textwrap.coffee":199}],317:[function(e,t,r){var n,a,o;n=e("../../../../core/fetch/value.coffee"),a=e("../../../../string/strip.js"),o=e("../../../../util/uniques.coffee"),t.exports=function(e,t,r){var i,s,l,u,c,d,f;return void 0===r?r=e.id.nesting.slice(0,e.depth.value+1):r.constructor!==Array&&(r=[r]),void 0===s&&(s=[]),t||(t=e.data.viz),i=e[e.axes.discrete],u=e[e.axes.opposite],f=i.value===e.time.value,f?(d=e.data.time.ticks,l=e.time.solo.value.length?"solo":"mute",e.time[l].value.length&&(c=e.time[l].value.slice().map(function(e){return e.constructor!==Date&&(e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),e=new Date(e)),+e}),d=d.filter(function(e){return"solo"===l?c.indexOf(+e)>=0:c.indexOf(+e)<0}))):d=i.ticks.values?i.ticks.values:o(t,i.value,n,e),d3.nest().key(function(t){var o,i,s,l,u;for(l="nesting",i=0,s=r.length;s>i;i++)o=r[i],u=n(e,t,o),u instanceof Array&&(u=u.join("_")),l+="_"+a(u);return l}).rollup(function(t){var r,a,s,c,p,h,v,g,m,y,x,b;if(r=o(t,i.value,n,e),b=r.length&&r[0].constructor===Date,b&&(r=r.map(Number)),i.zerofill.value)for(a="log"===i.scale.value?u.scale.viz.domain().every(function(e){return 0>e})?-1:1:0,s=c=0,h=d.length;h>c;s=++c)if(x=d[s],y=f?+x:x,r.indexOf(y)<0){for(g={d3plus:{}},m=e.id.nesting,p=0,v=m.length;v>p;p++)l=m[p],l in t[0]&&(g[l]=t[0][l]);g[i.value]=x,g[u.value]=0,g[u.value]=a,t.splice(s,0,g)}return"string"==typeof t[0][i.value]?t:t.sort(function(t,r){var a,o,s,l,c;return a=n(e,t,i.value),s=n(e,r,i.value),(c=a-s)?c:(o=n(e,t,u.value),l=n(e,r,u.value),o-l)})}).entries(t)}},{"../../../../core/fetch/value.coffee":67,"../../../../string/strip.js":174,"../../../../util/uniques.coffee":209}],318:[function(e,t,r){var n;n=e("../../../../core/fetch/value.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,d,f,p,h,v,g,m,y,x;for(m=e.axes.stacked,a=e[m].scale.viz(0),v=e[m].scale.value,p="x"===m?"y":"x",u="y"===m?e.axes.margin.top:e.axes.margin.left,f="share"===v?"expand":"zero",g=d3.layout.stack().values(function(e){return e.values||[e]}).offset(f).x(function(e){return e.d3plus[p]}).y(function(t){return a-e[m].scale.viz(n(e,t,e[m].value))}).out(function(t,r,o){var i,s;return s=n(e,t,e[m].value),i=0>s,"share"===v?(t.d3plus[m+"0"]=(1-r)*a,t.d3plus[m]=t.d3plus[m+"0"]-o*a):(t.d3plus[m+"0"]=a-r,t.d3plus[m]=t.d3plus[m+"0"]-o),t.d3plus[m]+=u,t.d3plus[m+"0"]+=u}),h=[],d=[],o=0,s=t.length;s>o;o++)if(r=t[o],x=n(e,r,e[m].value),x instanceof Array){for(c=!0,i=0,l=x.length;l>i;i++)if(y=x[i],y>=0){c=!1;break}c?d.push(r):h.push(r)}else x>=0&&h.push(r),0>x&&d.push(r);return 0===h.length||0===d.length?g(t):(h.length&&(h=g(h)),d.length&&(d=g(d)),h.concat(d))}},{"../../../../core/fetch/value.coffee":67}],319:[function(e,t,r){var n,a,o,i,s,l;n=e("../../core/fetch/value.coffee"),a=e("./helpers/graph/draw.coffee"),i=e("./helpers/graph/nest.coffee"),s=e("../../array/sort.coffee"),l=e("./helpers/graph/stack.coffee"),o=function(e){var t,r,o,i,u,c,d,f,p,h,v;if(a(e,{buffer:e.axes.opposite,mouse:!0}),o=e.x.domain.viz.concat(e.y.domain.viz),o.indexOf(void 0)>=0)return[];for(r=s(e.data.viz,null,null,null,e),i=0,c=r.length;c>i;i++)for(f=r[i],p=f.values,u=0,d=p.length;d>u;u++)t=p[u],h=n(e,t,e.x.value),h?(t.d3plus.x2=!1,t.d3plus.x=e.x.scale.viz(h)):(t.d3plus.x2=!0,t.d3plus.x=e.x2.scale.viz(n(e,t,e.x2.value))),t.d3plus.x+=e.axes.margin.left,v=n(e,t,e.y.value),v?(t.d3plus.y2=!1,t.d3plus.y=e.y.scale.viz(v)):(t.d3plus.y2=!0,t.d3plus.y=e.y2.scale.viz(n(e,t,e.y2.value))),t.d3plus.y+=e.axes.margin.top;return e.axes.stacked?l(e,r):r},o.filter=function(e,t){return i(e,t)},o.requirements=["data","x","y"],o.setup=function(e){var t;e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"}))},o.shapes=["line"],o.tooltip="static",t.exports=o},{"../../array/sort.coffee":34,"../../core/fetch/value.coffee":67,"./helpers/graph/draw.coffee":311,"./helpers/graph/nest.coffee":317,"./helpers/graph/stack.coffee":318}],320:[function(e,t,r){var n=e("../../network/smallestGap.coffee"),a=e("../../core/fetch/value.coffee"),o=function(e){var t=e.nodes.restricted||e.nodes.value,r=e.edges.restricted||e.edges.value,o=d3.extent(t,function(e){return e.x}),i=d3.extent(t,function(e){return e.y}),s=[1,1];if("number"==typeof e.size.value?s=[e.size.value,e.size.value]:e.size.value&&(s=d3.extent(t,function(t){var r=a(e,t,e.size.value);return 0===r?null:r})),"undefined"==typeof s[0]&&(s=[1,1]),"number"==typeof e.size.value)var l=e.size.value,u=e.size.value;else{var l=n(t,{accessor:function(e){return[e.x,e.y]}}),c=l/2,d=e.size.value?e.nodes.overlap:.4;if(l*=d,e.edges.arrows.value&&(l=.5*l),s[0]===s[1]){var u=c;l=c}else{var f=o[1]+1.1*l-(o[0]-1.1*l),p=i[1]+1.1*l-(i[0]-1.1*l),h=f/p,v=e.width.viz/e.height.viz;if(v>h)var g=e.height.viz/p;else var g=e.width.viz/f;var u=.25*l;2>u*g&&(u=2/g)}}var m=e.size.scale.value.domain(s).range([u,l]);e.zoom.bounds=[[o[0]-1.1*l,i[0]-1.1*l],[o[1]+1.1*l,i[1]+1.1*l]];var y=[],x={};return t.forEach(function(t){var r=e.data.viz.filter(function(r){return r[e.id.value]==t[e.id.value]})[0],n=r||{};n[e.id.value]=t[e.id.value],n.d3plus={},n.d3plus.x=t.x,n.d3plus.y=t.y;var o=a(e,n,e.size.value);n.d3plus.r=o?m(o):m.range()[0],x[n[e.id.value]]={x:n.d3plus.x,y:n.d3plus.y,r:n.d3plus.r},y.push(n)}),y.sort(function(e,t){return t.d3plus.r-e.d3plus.r}),r.forEach(function(t,r){t.d3plus&&delete t.d3plus.spline,t[e.edges.source].d3plus={};var n=x[t[e.edges.source][e.id.value]];t[e.edges.source].d3plus.r=n.r,t[e.edges.source].d3plus.x=n.x,t[e.edges.source].d3plus.y=n.y,t[e.edges.target].d3plus={};var a=x[t[e.edges.target][e.id.value]];t[e.edges.target].d3plus.r=a.r,t[e.edges.target].d3plus.x=a.x,t[e.edges.target].d3plus.y=a.y}),{nodes:y,edges:r}};o.nesting=!1,o.requirements=["nodes","edges"],o.scale=1.05,o.shapes=["circle","square","donut"],o.tooltip="static",o.zoom=!0,t.exports=o},{"../../core/fetch/value.coffee":67,"../../network/smallestGap.coffee":167}],321:[function(e,t,r){var n,a,o,i,s=[].indexOf||function(e){for(var t=0,r=this.length;r>t;t++)if(t in this&&this[t]===e)return t;return-1};a=e("../../network/shortestPath.coffee"),n=e("../../core/fetch/value.coffee"),o=e("../../util/uniques.coffee"),i=function(e){var t,r,a,o,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H,X,G,W,Q,J,K,Z,$,ee,te,re,ne,ae,oe,ie,se,le,ue,ce,de,fe;for(h=[],H={},H[e.focus.value[0]]=0,H[e.focus.value[1]]=0,X={all:[[e.focus.value[0]],[e.focus.value[1]]]},J=i.paths,Y=m=0,k=J.length;k>m;Y=++m)for(L=J[Y],h=h.concat(L.edges),_=e.focus.value[0],X[Y]=[_],K=L.edges,p=y=0,z=K.length;z>y;p=++y)f=K[p],f[e.edges.source]=e.data.viz.filter(function(t){return f[e.edges.source][e.id.value]===t[e.id.value]})[0],f[e.edges.target]=e.data.viz.filter(function(t){return f[e.edges.target][e.id.value]===t[e.id.value]})[0],I=f[e.edges.source][e.id.value]===_?"target":"source",q=f[e.edges[I]][e.id.value],void 0===H[q]&&(H[q]=Y),X[Y].push(q),_=q;oe=0;for(Y in X)if(L=X[Y],"all"!==Y){for(N=0,v=x=0,A=L.length;A>x;v=++x)if(g=L[v],0!==v&&v!==L.length-1&&H[g]===parseFloat(Y)){for(N=1,G=L[v-1],P=L[v+1],W=null,V=null,Z=X.all,u=S=0,j=Z.length;j>S;u=++S)l=Z[u],s.call(l,G)>=0&&(W=u),s.call(l,P)>=0&&(V=u);null!==W&&null===V?W+1===X.all.length-1?X.all.splice(W+1,0,[g]):X.all[W+1].push(g):V-W===1?X.all.splice(V,0,[g]):V-W>1&&X.all[V-1].push(g)}oe+=N}for(ae=Math.floor(e.height.viz/oe),fe=[],v=0;oe>v;)v%2===0?fe.push(v):fe.unshift(v),v++;for(b=e.size.value&&!e.small?30:0,de=d3.scale.ordinal().domain(fe).range(d3.range(ae/2-b,e.height.viz+ae/2-b,(e.height.viz-ae)/(oe-1))),d=X.all.length,c=Math.floor(e.width.viz/d),ue=d3.scale.linear().domain([0,d-1]).rangeRound([c/2,e.width.viz-c/2]),C=5,T=.4*d3.min([c,ae-b]),se=d3.extent(e.data.viz,function(t){var r;return r=n(e,t,e.size.value),r||0}),ie=e.size.scale.value.domain(se).rangeRound([C,T]),$=e.data.viz,B=0,M=$.length;M>B;B++){for(R=$[B],null==R.d3plus&&(R.d3plus={}),ee=X.all,u=D=0,O=ee.length;O>D;u=++D)l=ee[u],te=R[e.id.value],s.call(l,te)>=0&&(R.d3plus.x=ue(u));R.d3plus.y=de(H[R[e.id.value]]),e.size.value?(le=n(e,R,e.size.value),R.d3plus.r=le?ie(le):C):R.d3plus.r=T,R.d3plus.r<.1*c&&!e.small?R.d3plus.label={x:0,y:R.d3plus.r+2*e.labels.padding,w:.6*c,h:b+T-R.d3plus.r,resize:!1}:delete R.d3plus.label}for(re=i.paths,Y=U=0,E=re.length;E>U;Y=++U)for(L=re[Y],_=e.focus.value[0],ne=L.edges,p=Q=0,F=ne.length;F>Q;p=++Q)f=ne[p],I=f[e.edges.source][e.id.value]===_?"target":"source",w="target"===I?"source":"target",q=f[e.edges[I]][e.id.value],H[_]!==H[q]?(f.d3plus={spline:!0},null==(t=f[e.edges.source]).d3plus&&(t.d3plus={}),null==(r=f[e.edges.source].d3plus).edges&&(r.edges={}),null==(a=f[e.edges.target]).d3plus&&(a.d3plus={}),null==(o=f[e.edges.target].d3plus).edges&&(o.edges={}),ce=f[I].d3plus.x-f[w].d3plus.x,f[w].d3plus.edges[f[I][e.id.value]]={angle:Math.PI,radius:c/2},f[I].d3plus.edges[f[w][e.id.value]]={angle:0,radius:c/2,offset:ce-c}):delete f.d3plus,_=q;return{nodes:e.data.viz,edges:h}},i.filter=function(e,t){var r,s,l,u,c,d,f,p,h,v,g,m,y,x,b,w,_,k,z;for(u=e.edges.filtered||e.edges.value,i.paths=a(u,e.focus.value[0],{target:e.focus.value[1],
distance:e.edges.size.value||void 0,nodeid:e.id.value,startpoint:e.edges.source,endpoint:e.edges.target,K:e.edges.limit.value||5}),i.nodes=[],r=[],b=i.paths,f=0,v=b.length;v>f;f++)for(x=b[f],w=x.edges,p=0,g=w.length;g>p;p++)l=w[p],k=l[e.edges.source],z=l[e.edges.target],r.indexOf(k[e.id.value])<0&&(i.nodes.push(k),r.push(k[e.id.value])),r.indexOf(z[e.id.value])<0&&(i.nodes.push(z),r.push(z[e.id.value]));for(d=o(i.nodes,e.id.value,n,e),_=[],h=0,m=d.length;m>h;h++)c=d[h],s=t.filter(function(t){return t[e.id.value]===c}),s[0]?_.push(s[0]):(y={d3plus:{}},y[e.id.value]=c,_.push(y));return _},i.nesting=!1,i.requirements=[function(e){return{status:2===e.focus.value.length,text:e.format.locale.value.method.focus+" x 2"}},"edges"],i.scale=1,i.shapes=["circle","square","donut"],i.tooltip="static",t.exports=i},{"../../core/fetch/value.coffee":67,"../../network/shortestPath.coffee":166,"../../util/uniques.coffee":209}],322:[function(e,t,r){var n,a,o,i;n=e("../../array/comparator.coffee"),a=e("../../core/data/threshold.js"),o=e("../../core/data/group.coffee"),i=function(e){var t,r,a,i,s,l,u,c,d;for(u=d3.layout.pie().value(function(e){return e.value}).sort(function(t,r){return e.order.value?n(t.d3plus,r.d3plus,[e.order.value],e.order.sort.value,[],e):e.id.nesting.length>1?n(t.d3plus,r.d3plus,e.id.nesting.concat([e.size.value]),void 0,[],e):n(t.d3plus,r.d3plus,[e.size.value],"desc",[],e)}),r=o(e,e.data.viz,[]),l=u(r),d=[],c=d3.min([e.width.viz,e.height.viz])/2-2*e.labels.padding,a=0,s=l.length;s>a;a++)t=l[a],i=t.data.d3plus,i.d3plus.startAngle=t.startAngle,i.d3plus.endAngle=t.endAngle,i.d3plus.r=c,i.d3plus.x=e.width.viz/2,i.d3plus.y=e.height.viz/2,i.d3plus.share=(t.endAngle-t.startAngle)/(2*Math.PI),d.push(i);return d},i.filter=a,i.requirements=["data","size"],i.shapes=["arc"],i.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},t.exports=i},{"../../array/comparator.coffee":32,"../../core/data/group.coffee":57,"../../core/data/threshold.js":61}],323:[function(e,t,r){var n,a,o,i,s,l,u,c,d,f,p;a=e("../../array/comparator.coffee"),d=e("../../array/sort.coffee"),o=e("../../core/data/threshold.js"),i=e("../../core/fetch/text.js"),s=e("../../core/fetch/value.coffee"),l=e("../../font/sizes.coffee"),u=e("../../geom/offset.coffee"),f=e("../../textwrap/textwrap.coffee"),n=e("../../util/buckets.coffee"),p=e("../../util/uniques.coffee"),c=function(e){var t,r,a,o,c,d,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,C,B,N,P,I,q,V,R,D,U,L,Y,H,X,G,W,Q,J,K,Z,$,ee,te,re,ne,ae,oe,ie,se;for(m=e.data.viz,L=e.depth.value+1,Y=e.id.nesting[L],v=function(){var e,t,r;for(r=[],e=0,t=m.length;t>e;e++)g=m[e],r.push(g[Y]);return r}(),oe=function(){var t,r,n;for(n=[],t=0,r=m.length;r>t;t++)g=m[t],n.push(p(m,Y,s,e,L));return n}(),oe=p(d3.merge(oe)).length,o=2*Math.PI/oe,D=d3.min([e.width.viz,e.height.viz])/2,F=0,C=0,B=function(){var t,r,n;for(n=[],t=0,r=v.length;r>t;t++)d=v[t],n.push(i(e,d,L)[0]);return n}(),B=p(d3.merge(B)),e.labels.value&&(y=u(Math.PI/2,D),ee=u(o+Math.PI/2,D),F=y.x-ee.x-2*e.labels.padding,ne={fill:e.x.ticks.font.color,"font-family":e.x.ticks.font.family.value,"font-weight":e.x.ticks.font.weight,"font-size":e.x.ticks.font.size+"px"},te=l(B,ne,{mod:function(t){return f().container(d3.select(t)).width(e.height.viz/8).height(F).draw()}}),C=d3.max(te,function(e){return e.width}),D-=C,D-=2*e.labels.padding),R=function(){var t,r,n;for(n=[],t=0,r=v.length;r>t;t++)d=v[t],n.push(function(){var t,r,n;for(n=[],t=0,r=d.length;r>t;t++)g=d[t],n.push(s(e,g,e.size.value));return n}());return n}(),R=d3.max(d3.merge(R)),G=d3.scale.linear().domain([0,R]).range([0,D]),k=function(){var t,r,n;for(n=[],t=0,r=v.length;r>t;t++)d=v[t],n.push(s(e,d,Y));return n}(),k=p(d3.merge(k)),_=d3.scale.ordinal().domain(k).range(d3.range(0,k.length)),A=0,N=m.length;N>A;A++)for(g=m[A],g.d3plus.x=e.width.viz/2+e.margin.top,g.d3plus.y=e.height.viz/2+e.margin.left,W=g[Y],w=j=0,P=W.length;P>j;w=++j)t=W[w],t.d3plus||(t.d3plus={}),t.d3plus.r=G(s(e,t,e.size.value)),t.d3plus.a=_(s(e,t,Y))*o;for(z=1,Q=[10,5,4,2],V=0,I=Q.length;I>V;V++)if(w=Q[V],D/w>=20){z=w;break}for(K=n([D/z,D],z-1).reverse(),K.length===z&&K.shift(),$=e.group.selectAll(".d3plus_radar_rings").data(K,function(e,t){return t}),Z=function(t){return t.attr("fill",function(t,r){return 0===r?e.axes.background.color:"transparent"}).attr("cx",e.width.viz/2+e.margin.top).attr("cy",e.height.viz/2+e.margin.left).attr("stroke",e.x.grid.value?e.x.grid.color:"transparent")},$.enter().append("circle").attr("class","d3plus_radar_rings").call(Z).attr("r",0),$.transition().duration(e.draw.timing).call(Z).attr("r",function(e){return e}),$.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),S=d3.scale.ordinal().domain(B).range(d3.range(0,B.length)),O=[],U=0,q=B.length;q>U;U++)M=B[U],r=o*S(M)-Math.PI/2,t=r*(180/Math.PI),-90>t||t>90?(t-=180,c=-(D+2*e.labels.padding+C),a="end"):(c=D+2*e.labels.padding,a="start"),ae=0>r||r>Math.PI,J=r<Math.PI/2,X=D,e.labels.value&&(X+=e.labels.padding),H=u(r,X),ie=H.x,se=H.y,J||(ie-=C),ae&&(se-=F),h=[0,Math.PI].indexOf(o*S(M))>=0,h&&(ie-=C/2),O.push({text:M,angle:t,x:c,anchor:a,offset:H});return E=e.group.selectAll("g.d3plus_radar_label_group").data([0]),E.enter().append("g").attr("class","d3plus_radar_label_group").attr("transform","translate("+e.width.viz/2+","+e.height.viz/2+")"),E.transition().duration(e.draw.timing).attr("transform","translate("+e.width.viz/2+","+e.height.viz/2+")"),re=E.selectAll(".d3plus_radar_labels").data(e.labels.value?O:[],function(e,t){return t}),T=function(e){return e.attr(ne).each(function(e,t){return f().container(d3.select(this)).height(F).width(C).align(e.anchor).text(e.text).padding(0).valign("middle").x(e.x).y(-F/2).draw()}).attr("transform",function(e){var t;return t=d3.select(this).attr("transform")||"",t.length&&(t=t.split(")").slice(-3).join(")")),"rotate("+e.angle+")"+t})},re.call(T),re.enter().append("text").attr("class","d3plus_radar_labels").attr("opacity",0).call(T).transition().duration(e.draw.timing).attr("opacity",1),re.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),x=e.group.selectAll(".d3plus_radar_lines").data(O,function(e,t){return t}),b=function(t){return t.attr("stroke",e.x.grid.color).attr("x1",e.width.viz/2+e.margin.left).attr("y1",e.height.viz/2+e.margin.top)},x.enter().append("line").attr("class","d3plus_radar_lines").call(b).attr("x2",e.width.viz/2+e.margin.left).attr("y2",e.height.viz/2+e.margin.top),x.transition().duration(e.draw.timing).call(b).attr("x2",function(t){return e.width.viz/2+e.margin.left+t.offset.x}).attr("y2",function(t){return e.height.viz/2+e.margin.top+t.offset.y}),x.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.mouse.viz={click:!1},m},c.requirements=["data","size"],c.shapes=["radial"],t.exports=c},{"../../array/comparator.coffee":32,"../../array/sort.coffee":34,"../../core/data/threshold.js":61,"../../core/fetch/text.js":66,"../../core/fetch/value.coffee":67,"../../font/sizes.coffee":101,"../../geom/offset.coffee":160,"../../textwrap/textwrap.coffee":199,"../../util/buckets.coffee":203,"../../util/uniques.coffee":209}],324:[function(e,t,r){var n=e("../../array/sort.coffee"),o=e("../../client/pointer.coffee"),i=e("../../core/fetch/value.coffee"),s=e("../../core/fetch/color.coffee"),l=e("../../color/legible.coffee"),u=e("../../tooltip/remove.coffee"),c=e("../../network/smallestGap.coffee"),d=e("../../color/text.coffee"),f=e("../../util/uniques.coffee"),p=function(e){var t=d3.min([e.height.viz,e.width.viz])/2,r=e.small||!e.labels.value?(t-2*e.labels.padding)/2:t/3,p=e.small||!e.labels.value?1.4*r:r,h=2*r,v=[],g=[],m=e.data.viz.filter(function(t){return t[e.id.value]===e.focus.value[0]})[0];m||(m={d3plus:{}},m[e.id.value]=e.focus.value[0]),m.d3plus.x=e.width.viz/2,m.d3plus.y=e.height.viz/2,m.d3plus.r=.65*p;var y=[],x=[e.focus.value[0]];e.edges.connections(e.focus.value[0],e.id.value).forEach(function(t){var r=t[e.edges.source][e.id.value]==e.focus.value[0]?t[e.edges.target]:t[e.edges.source],n=e.data.viz.filter(function(t){return t[e.id.value]===r[e.id.value]})[0];n||(n={d3plus:{}},n[e.id.value]=r[e.id.value]),n.d3plus.edges=e.edges.connections(n[e.id.value],e.id.value).filter(function(t){return t[e.edges.source][e.id.value]!=e.focus.value[0]&&t[e.edges.target][e.id.value]!=e.focus.value[0]}),n.d3plus.edge=t,x.push(n[e.id.value]),y.push(n)});var b=e.order.value||e.color.value||e.size.value||e.id.value;y.sort(function(t,r){var a=t.d3plus.edges.length-r.d3plus.edges.length;return a?a:n([t,r],b,e.order.sort.value,e.color.value||[],e)}),"number"==typeof e.edges.limit.value?y=y.slice(0,e.edges.limit.value):"function"==typeof e.edges.limit.value&&(y=e.edges.limit.value(y));var w=[],_=0;y.forEach(function(t){var r=t[e.id.value];t.d3plus.edges=t.d3plus.edges.filter(function(t){var n=t[e.edges.source][e.id.value],a=t[e.edges.target][e.id.value];return x.indexOf(n)<0&&a==r||x.indexOf(a)<0&&n==r}),_+=t.d3plus.edges.length||1,t.d3plus.edges.forEach(function(t){var n=t[e.edges.source],a=t[e.edges.target],o=a[e.id.value]==r?n:a;x.push(o[e.id.value])})}),n(y,b,e.order.sort.value,e.color.value||[],e);var k=0,z=2*Math.PI,A=0;y.forEach(function(t,r){var o=t.d3plus.edges.length||1,i=z/_*o;0==r&&(A=s,k-=i/2);var s=k+i/2;s-=z/4,t.d3plus.radians=s,t.d3plus.x=e.width.viz/2+p*Math.cos(s),t.d3plus.y=e.height.viz/2+p*Math.sin(s),k+=i,t.d3plus.edges.sort(function(r,a){var r=r[e.edges.source][e.id.value]==t[e.id.value]?r[e.edges.target]:r[e.edges.source],a=a[e.edges.source][e.id.value]==t[e.id.value]?a[e.edges.target]:a[e.edges.source];return n([r,a],b,e.order.sort.value,e.color.value||[],e)}),t.d3plus.edges.forEach(function(r,n){var i=r[e.edges.source][e.id.value]==t[e.id.value]?r[e.edges.target]:r[e.edges.source],l=z/_,u=e.data.viz.filter(function(t){return t[e.id.value]===i[e.id.value]})[0];u||(u={d3plus:{}},u[e.id.value]=i[e.id.value]),a=s-l*o/2+l/2+l*n,u.d3plus.radians=a,u.d3plus.x=e.width.viz/2+h*Math.cos(a),u.d3plus.y=e.height.viz/2+h*Math.sin(a),w.push(u)})});var j=c(y,{accessor:function(e){return[e.d3plus.x,e.d3plus.y]}}),M=c(w,{accessor:function(e){return[e.d3plus.x,e.d3plus.y]}});if(j||(j=r/2),M||(M=r/4),8>j/2-4)var O=d3.min([j/2,8]);else var O=j/2-4;if(4>M/2-4)var E=d3.min([M/2,4]);else var E=M/2-4;E>r/10&&(E=r/10),E>O&&E>10&&(E=.75*O),O>1.5*E&&(O=1.5*E),O=Math.floor(O),E=Math.floor(E);var F=f(y,e.id.value,i,e);F=F.concat(f(w,e.id.value,i,e)),F.push(e.focus.value[0]);var S=e.data.viz.filter(function(t){return F.indexOf(t[e.id.value])>=0});if(e.size.value){var T=d3.extent(S,function(t){return i(e,t,e.size.value)});T[0]==T[1]&&(T[0]=0);var t=d3.scale.linear().domain(T).rangeRound([3,d3.min([O,E])]),C=i(e,m,e.size.value);m.d3plus.r=t(C)}else{var t=d3.scale.linear().domain([1,2]).rangeRound([O,E]);e.edges.label&&(m.d3plus.r=1.5*t(1))}w.forEach(function(r){r.d3plus.ring=2;var n=e.size.value?i(e,r,e.size.value):2;r.d3plus.r=t(n)}),y.forEach(function(r){r.d3plus.ring=1;var n=e.size.value?i(e,r,e.size.value):1;r.d3plus.r=t(n)}),g=[m].concat(y).concat(w),y.forEach(function(t,n){var a=[e.edges.source,e.edges.target],o=t.d3plus.edge;a.forEach(function(t){o[t]=g.filter(function(r){return r[e.id.value]==o[t][e.id.value]})[0]}),delete o.d3plus,v.push(o),e.edges.connections(t[e.id.value],e.id.value).forEach(function(n){var a=n[e.edges.source][e.id.value]==t[e.id.value]?n[e.edges.target]:n[e.edges.source];if(a[e.id.value]!=m[e.id.value]){var o=w.filter(function(t){return t[e.id.value]==a[e.id.value]})[0];if(o);else{o=y.filter(function(t){return t[e.id.value]==a[e.id.value]})[0]}if(o){n.d3plus={spline:!0,translate:{x:e.width.viz/2,y:e.height.viz/2}};var i=[e.edges.source,e.edges.target];i.forEach(function(a,i){n[a]=g.filter(function(t){return t[e.id.value]==n[a][e.id.value]})[0],void 0===n[a].d3plus.edges&&(n[a].d3plus.edges={});var s=0===i?n[e.edges.target][e.id.value]:n[e.edges.source][e.id.value];n[a][e.id.value]==t[e.id.value]?n[a].d3plus.edges[s]={angle:t.d3plus.radians+Math.PI,radius:r/2}:n[a].d3plus.edges[s]={angle:o.d3plus.radians,radius:r/2}}),v.push(n)}}})});var B=!1;return e.background.value&&["transparent","none"].indexOf(e.background.value)<0&&d3.hsl(e.background.value).l<.5&&(B=d(e.background.value)),g.forEach(function(t){if(!e.small&&e.labels.value)if(t[e.id.value]!=e.focus.value[0]){t.d3plus.rotate=t.d3plus.radians*(180/Math.PI);var n=t.d3plus.rotate,a=r-3*e.labels.padding-t.d3plus.r;if(-90>n||n>90){n-=180;var o=-(t.d3plus.r+a/2+e.labels.padding),i="end"}else var o=t.d3plus.r+a/2+e.labels.padding,i="start";var u=y.indexOf(t)>=0?!0:!1,c=1==t.d3plus.ring?j:M;t.d3plus.label={x:o,y:0,w:a,h:c,angle:n,anchor:i,valign:"center",color:B||l(s(e,t)),resize:[8,e.labels.font.size],background:u,mouse:!0}}else if(e.size.value||e.edges.label){var c=p-2*t.d3plus.r-2*e.labels.padding;t.d3plus.label={x:0,y:t.d3plus.r+c/2,w:p,h:c,color:B||l(s(e,t)),resize:[10,40],background:!0,mouse:!0}}else delete t.d3plus.rotate,delete t.d3plus.label;else delete t.d3plus.rotate,delete t.d3plus.label}),e.mouse.viz={},e.mouse.viz[o.click]=function(t){t[e.id.value]!=e.focus.value[0]&&(u(e.type.value),e.self.focus(t[e.id.value]).draw())},{edges:v,nodes:g,data:S}};p.filter=function(e,t){var r=e.edges.connections(e.focus.value[0],e.id.value,!0),n=[];r.forEach(function(t){n=n.concat(e.edges.connections(t[e.id.value],e.id.value,!0))});var a=r.concat(n),o=f(a,e.id.value,i,e),s=[];return o.forEach(function(r){var n=t.filter(function(t){return t[e.id.value]==r})[0];if(n)s.push(n);else{var a={d3plus:{}};a[e.id.value]=r,s.push(a)}}),s},p.nesting=!1,p.scale=1,p.shapes=["circle","square","donut"],p.requirements=["edges","focus"],p.tooltip="static",t.exports=p},{"../../array/sort.coffee":34,"../../client/pointer.coffee":38,"../../color/legible.coffee":44,"../../color/text.coffee":50,"../../core/fetch/color.coffee":63,"../../core/fetch/value.coffee":67,"../../network/smallestGap.coffee":167,"../../tooltip/remove.coffee":202,"../../util/uniques.coffee":209}],325:[function(e,t,r){var n,a,o,i,s;n=e("./sankey.js"),a=e("../../client/pointer.coffee"),o=e("../../tooltip/remove.coffee"),s=e("../../util/uniques.coffee"),i=function(e){var t,r,i,s,l,u,c,d,f,p,h,v,g,m,y;for(s=e.focus.value[0],v=2*e.data.stroke.width,y=e.size.value.constructor===Number?e.size.value:20,i=e.edges.connections(s,e.id.value).filter(function(t){return t[e.edges.source][e.id.value]!==s||t[e.edges.target][e.id.value]!==s}),h=[],g=[],i=i.map(function(t){var r,n;return t[e.edges.target][e.id.value]===s?(r={id:"left_"+t[e.edges.source][e.id.value],dupe:"left",data:t[e.edges.source]},n=t[e.edges.target]):(r=t[e.edges.source],n={id:"right_"+t[e.edges.target][e.id.value],dupe:"right",data:t[e.edges.target]}),g.indexOf(r.id)<0&&h.push(r),g.indexOf(n.id)<0&&h.push(n),g.push(r.id),g.push(n.id),{source:r,target:n,value:t[e.edges.strength.value]||1}}),c=n().nodeWidth(y).nodePadding(e.data.padding.value).size([e.width.viz-2*v,e.height.viz-2*v]).nodes(h).links(i).layout(2),m=[],l=0,d=h.length;d>l;l++)p=h[l],t=p.data||p,t={id:t[e.id.value]},t.d3plus={x:p.x+p.dx/2+v,y:p.y+p.dy/2+v,width:p.dx,height:p.dy,suffix:p.dupe},m.push(t);for(e.edges.path=c.link(),u=0,f=i.length;f>u;u++)r=i[u],r.d3plus={x:v,y:v};return e.mouse.viz={},e.mouse.viz[a.click]=function(t){return t[e.id.value]!==e.focus.value[0]?(o(e.type.value),e.self.focus(t[e.id.value]).draw()):void 0},{nodes:m,edges:i}},i.requirements=["edges","focus","nodes"],i.shapes=["square"],t.exports=i},{"../../client/pointer.coffee":38,"../../tooltip/remove.coffee":202,"../../util/uniques.coffee":209,"./sankey.js":326}],326:[function(e,t,r){t.exports=function(){function e(){p.forEach(function(e){e.sourceLinks=[],e.targetLinks=[]}),h.forEach(function(e){var t=e.source,r=e.target;"number"==typeof t&&(t=e.source=p[e.source]),"number"==typeof r&&(r=e.target=p[e.target]),t.sourceLinks.push(e),r.targetLinks.push(e)})}function t(){p.forEach(function(e){e.value=Math.max(d3.sum(e.sourceLinks,l),d3.sum(e.targetLinks,l))})}function r(){for(var e,t=p,r=0;t.length;)e=[],t.forEach(function(t){t.x=r,t.dx=c,t.sourceLinks.forEach(function(t){e.indexOf(t.target)<0&&e.push(t.target)})}),t=e,++r;n(r),a((f[0]-c)/(r-1))}function n(e){p.forEach(function(t){t.sourceLinks.length||(t.x=e-1)})}function a(e){p.forEach(function(t){t.x*=e})}function o(e){function t(){var e=d3.min(i,function(e){return(f[1]-(e.length-1)*d)/d3.sum(e,l)});i.forEach(function(t){t.forEach(function(t,r){t.y=r,t.dy=t.value*e})}),h.forEach(function(t){t.dy=t.value*e})}function r(e){function t(e){return s(e.source)*e.value}i.forEach(function(r,n){r.forEach(function(r){if(r.targetLinks.length){var n=d3.sum(r.targetLinks,t)/d3.sum(r.targetLinks,l);r.y+=(n-s(r))*e}})})}function n(e){function t(e){return s(e.target)*e.value}i.slice().reverse().forEach(function(r){r.forEach(function(r){if(r.sourceLinks.length){var n=d3.sum(r.sourceLinks,t)/d3.sum(r.sourceLinks,l);r.y+=(n-s(r))*e}})})}function a(){i.forEach(function(e){var t,r,n,a=0,i=e.length;for(e.sort(o),n=0;i>n;++n)t=e[n],r=a-t.y,r>0&&(t.y+=r),a=t.y+t.dy+d;if(r=a-d-f[1],r>0)for(a=t.y-=r,n=i-2;n>=0;--n)t=e[n],r=t.y+t.dy+d-a,r>0&&(t.y-=r),a=t.y})}function o(e,t){return e.y-t.y}var i=d3.nest().key(function(e){return e.x}).sortKeys(d3.ascending).entries(p).map(function(e){return e.values});t(),a();for(var u=1;e>0;--e)n(u*=.99),a(),r(u),a()}function i(){function e(e,t){return e.source.y-t.source.y}function t(e,t){return e.target.y-t.target.y}p.forEach(function(r){r.sourceLinks.sort(t),r.targetLinks.sort(e)}),p.forEach(function(e){var t=0,r=0;e.sourceLinks.forEach(function(e){e.sy=t,t+=e.dy}),e.targetLinks.forEach(function(e){e.ty=r,r+=e.dy})})}function s(e){return e.y+e.dy/2}function l(e){return e.value}var u={},c=24,d=8,f=[1,1],p=[],h=[];return u.nodeWidth=function(e){return arguments.length?(c=+e,u):c},u.nodePadding=function(e){return arguments.length?(d=+e,u):d},u.nodes=function(e){return arguments.length?(p=e,u):p},u.links=function(e){return arguments.length?(h=e,u):h},u.size=function(e){return arguments.length?(f=e,u):f},u.layout=function(n){return e(),t(),r(),o(n),i(),u},u.relayout=function(){return i(),u},u.link=function(){function e(e){var r=e.source.x+e.source.dx,n=e.target.x,a=d3.interpolateNumber(r,n),o=a(t),i=a(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+r+","+s+"C"+o+","+s+" "+i+","+l+" "+n+","+l}var t=.5;return e.curvature=function(r){return arguments.length?(t=+r,e):t},e},u}},{}],327:[function(e,t,r){var n,a,o,i,s,l;n=e("../../core/fetch/value.coffee"),a=e("./helpers/graph/draw.coffee"),o=e("../../core/console/print.coffee"),s=e("../../array/sort.coffee"),l=e("./helpers/graph/dataTicks.coffee"),i=function(e){var t,r,o,i,u;if(a(e,{buffer:"size",mouse:!0}),r=e.x.domain.viz.concat(e.y.domain.viz),r.indexOf(void 0)>=0)return[];for(u=e.data.viz,o=0,i=u.length;i>o;o++)t=u[o],t.d3plus.x=e.x.scale.viz(n(e,t,e.x.value)),t.d3plus.x+=e.axes.margin.left,t.d3plus.y=e.y.scale.viz(n(e,t,e.y.value)),t.d3plus.y+=e.axes.margin.top,"number"!=typeof e.size.value&&e.size.value?t.d3plus.r=e.axes.scale(n(e,t,e.size.value)):t.d3plus.r=e.axes.scale(0);return l(e),s(e.data.viz,e.order.value||e.size.value||e.id.value,"desc"===e.order.sort.value?"asc":"desc",e.color.value||[],e)},i.fill=!0,i.requirements=["data","x","y"],i.scale=1.1,i.setup=function(e){return e.time.value&&!e.axes.discrete&&(e.time.value===e.x.value&&e.self.x({scale:"discrete"}),e.time.value===e.y.value)?e.self.y({scale:"discrete"}):void 0},i.shapes=["circle","square","donut"],i.tooltip="static",t.exports=i},{"../../array/sort.coffee":34,"../../core/console/print.coffee":52,"../../core/fetch/value.coffee":67,"./helpers/graph/dataTicks.coffee":310,"./helpers/graph/draw.coffee":311}],328:[function(e,t,r){var n,a,o,i,s,l,u,c;n=e("../../util/closest.coffee"),a=e("../../core/fetch/value.coffee"),o=e("./helpers/graph/draw.coffee"),i=e("./helpers/graph/nest.coffee"),s=e("../../array/sort.coffee"),l=e("./helpers/graph/stack.coffee"),c=e("../../core/data/threshold.js"),u=function(e){var t,r,n,i,u,c,d,f,p,h,v;if(o(e,{buffer:e.axes.opposite}),i=e.x.domain.viz.concat(e.y.domain.viz),i.indexOf(void 0)>=0)return[];for(r=s(e.data.viz,null,null,null,e),n=e[e.axes.discrete],p=e[e.axes.opposite],u=0,d=r.length;d>u;u++)for(h=r[u],h.d3plus||(h.d3plus={}),v=h.values,c=0,f=v.length;f>c;c++)t=v[c],t.d3plus||(t.d3plus={}),t.d3plus.x=n.scale.viz(a(e,t,n.value)),t.d3plus.x+=e.axes.margin.left,t.d3plus.y=p.scale.viz(a(e,t,p.value)),t.d3plus.y+=e.axes.margin.top,t.d3plus.merged instanceof Array&&(h.d3plus.merged||(h.d3plus.merged=[]),h.d3plus.merged=h.d3plus.merged.concat(t.d3plus.merged)),t.d3plus.text&&!h.d3plus.text&&(h.d3plus.text=t.d3plus.text);return l(e,r)},u.filter=function(e,t){return i(e,c(e,t,e[e.axes.discrete].value))},u.requirements=["data","x","y"],u.setup=function(e){var t,r,n;return e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"})),e[e.axes.discrete].zerofill.value||e.self[e.axes.discrete]({zerofill:!0}),e[e.axes.opposite].stacked.value||e.self[e.axes.opposite]({stacked:!0}),n=e[e.axes.opposite],r=e.size,!n.value&&r.value||r.changed&&r.previous===n.value?e.self[e.axes.opposite](r.value):!r.value&&n.value||n.changed&&n.previous===r.value?e.self.size(n.value):void 0},u.shapes=["area"],u.threshold=function(e){return 20/e.height.viz},u.tooltip="static",t.exports=u},{"../../array/sort.coffee":34,"../../core/data/threshold.js":61,"../../core/fetch/value.coffee":67,"../../util/closest.coffee":205,"./helpers/graph/draw.coffee":311,"./helpers/graph/nest.coffee":317,"./helpers/graph/stack.coffee":318}],329:[function(e,t,r){var n=e("../../core/fetch/value.coffee"),a=e("../../util/uniques.coffee"),o=e("../../util/copy.coffee"),i=e("../../color/random.coffee"),s=function(e){var t=a(e.data.viz,e.id.value,n,e),r=a(e.cols.value);r.indexOf("label")<0&&e.cols.index.value&&r.unshift("label");var s=e.height.viz/(t.length+1),l=e.width.viz/r.length;e.group.selectAll("rect").data([0]).enter().append("rect").attr("class","background").attr("height",e.height.viz).attr("width",e.width.viz).style("fill",e.color.missing);var u=e.group.selectAll("line.horiz").data(e.data.viz);u.enter().append("line").attr("class","horiz"),u.attr("x1",0).attr("y1",function(e,t){return s*t+s}).attr("x2",e.width.viz).attr("y2",function(e,t){return s*t+s}).style("fill","#fff").style("stroke","#fff"),u.exit().remove();var c=e.group.selectAll("line.vert").data(r);c.enter().append("line").attr("class","vert"),c.attr("x1",function(e,t){return l*t+l}).attr("y1",0).attr("x2",function(e,t){return l*t+l}).attr("y2",e.height.viz).style("fill","#fff").style("stroke","#fff"),c.exit().remove();var d=[],f={};return r.forEach(function(t,r){var n={d3plus:{x:l*r+l/2,y:s/2,width:l,height:s,id:"d3p_header_"+t.toString().replace(/ /g,"_"),shape:"square",color:"#fff",text:e.format.value(t)}};if(t==e.id.value&&(n.d3plus.color="#fff"),"label"==t&&(n.d3plus.label=!1,n.d3plus.color="#fff",n.d3plus.stroke="#fff"),d.push(n),"number"==e.data.keys[t]){var a=d3.extent(e.data.viz,function(e){return e[t]});a[0]==a[1]&&(a=[a[0]-1,a[1]]),f[t]=d3.scale.linear().domain(a).range([e.color.missing,i(t)])}else"boolean"==e.data.keys[t]&&(f[t]=function(r){return r?i(t):e.color.missing})}),e.data.viz.forEach(function(t,n){n+=1,r.forEach(function(r,a){var i=o(t);i.d3plus.id="d3p_"+i[e.id.value].toString().replace(/ /g,"_")+"_"+r,i.d3plus.x=l*a+l/2,i.d3plus.y=s*n+s/2,i.d3plus.width=l,i.d3plus.height=s,"label"==r&&(i.d3plus.shape="square",i.d3plus.color="#fff",d.push(i)),d3.keys(t).indexOf(r)>=0&&r in t&&(f[r]&&(i.d3plus.color=f[r](i[r])),i.d3plus.text=e.format.value(i[r]),"boolean"==e.data.keys[r]?i.d3plus.label=!1:"string"==e.data.keys[r]&&(i.d3plus.color=e.color.missing,i.d3plus.stroke="#fff",i.d3plus.shape="square"),d.push(i))})}),d};s.shapes=["check","cross","diamond","square","triangle","triangle_up","triangle_down"],s.requirements=["data","cols"],t.exports=s},{"../../color/random.coffee":47,"../../core/fetch/value.coffee":67,"../../util/copy.coffee":206,"../../util/uniques.coffee":209}],330:[function(e,t,r){var n,a,o,i;n=e("../../core/data/threshold.js"),a=e("../../core/data/group.coffee"),o=e("../../object/merge.coffee"),i=function(e){var t,r,n,i,s,l,u;if(n=a(e,e.data.viz),r=d3.layout.treemap().mode(e.type.mode.value).round(!0).size([e.width.viz,e.height.viz]).children(function(e){return e.values}).padding(e.data.padding.value).sort(function(e,t){var r;return r=e.value-t.value,0===r?e.id<t.id:r}).nodes({name:"root",values:n}).filter(function(e){return!e.values&&e.area}),r.length){for(u=r[0];u.parent;)u=u.parent;for(l=[],i=0,s=r.length;s>i;i++)t=r[i],t.d3plus.d3plus=o(t.d3plus.d3plus,{x:t.x+t.dx/2,y:t.y+t.dy/2,width:t.dx,height:t.dy,share:t.value/u.value}),l.push(t.d3plus)}return l},i.filter=n,i.modes=["squarify","slice","dice","slice-dice"],i.requirements=["data","size"],i.shapes=["square"],i.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},t.exports=i},{"../../core/data/group.coffee":57,"../../core/data/threshold.js":61,"../../object/merge.coffee":170}],331:[function(e,t,r){var n,a,o,i,s,l,u;n=e("../core/methods/attach.coffee"),a=e("./methods/helpers/axis.coffee"),i=e("./helpers/ui/message.js"),s=e("./helpers/drawSteps.js"),l=e("../core/console/print.coffee"),o=e("./helpers/container.coffee"),u=e("../object/validate.coffee"),t.exports=function(){var t;return t={g:{apps:{}},types:{bar:e("./types/bar.coffee"),bubbles:e("./types/bubbles.coffee"),box:e("./types/box.coffee"),chart:e("./types/deprecated/chart.coffee"),geo_map:e("./types/geo_map.coffee"),line:e("./types/line.coffee"),network:e("./types/network.js"),paths:e("./types/paths.coffee"),pie:e("./types/pie.coffee"),radar:e("./types/radar.coffee"),rings:e("./types/rings.js"),sankey:e("./types/sankey.coffee"),scatter:e("./types/scatter.coffee"),stacked:e("./types/stacked.coffee"),table:e("./types/table.js"),tree_map:e("./types/tree_map.coffee")}},t.self=function(e){return e.each(function(){var e,r,n,a,u,c,d;t.draw.frozen=!0,t.error.internal=null,"timing"in t.draw||(t.draw.timing=t.timing.transitions),t.error.value&&(t.draw.timing=0),t.container.changed&&o(t),c=t.width.value<=t.width.small,u=t.height.value<=t.height.small,t.small=c||u,t.width.viz=t.width.value,t.height.viz=t.height.value,e=!1,r=function(){d.length?a():t.dev.value&&(l.groupEnd(),l.timeEnd("total draw time"),l.log("\n"))},n=function(e,n){n=n||"function",e[n]instanceof Array?e[n].forEach(function(e){e(t,r)}):"function"==typeof e[n]&&e[n](t,r),e.wait||r()},a=function(){var a,o,s,u;u=d.shift(),s=t.g.message&&e===u.message,o="check"in u?u.check:!0,"function"==typeof o&&(o=o(t)),o?s?n(u):(t.dev.value&&(e!==!1&&l.groupEnd(),l.group(u.message)),"string"==typeof t.messages.value?(e=t.messages.value,a=t.messages.value):(e=u.message,a=t.format.value(u.message)),t.draw.update?(i(t,a),t.error.value?n(u):setTimeout(function(){return n(u)},10)):n(u)):"otherwise"in u?t.error.value?n(u,"otherwise"):setTimeout(function(){return n(u,"otherwise")},10):r()},t.messages.style.backup=t.group&&"1"===t.group.attr("opacity")?"small":"large",d=s(t),a()}),t.self},n(t,{active:e("./methods/active.coffee"),aggs:e("./methods/aggs.coffee"),attrs:e("./methods/attrs.coffee"),axes:e("./methods/axes.coffee"),background:e("./methods/background.coffee"),"class":e("./methods/class.coffee"),color:e("./methods/color.coffee"),cols:e("./methods/cols.js"),config:e("./methods/config.coffee"),container:e("./methods/container.coffee"),coords:e("./methods/coords.coffee"),csv:e("./methods/csv.coffee"),data:e("./methods/data.coffee"),depth:e("./methods/depth.coffee"),descs:e("./methods/descs.coffee"),dev:e("./methods/dev.coffee"),draw:e("./methods/draw.js"),edges:e("./methods/edges.js"),error:e("./methods/error.coffee"),focus:e("./methods/focus.coffee"),font:e("./methods/font.coffee"),footer:e("./methods/footer.coffee"),format:e("./methods/format.coffee"),height:e("./methods/height.coffee"),history:e("./methods/history.coffee"),icon:e("./methods/icon.coffee"),id:e("./methods/id.coffee"),labels:e("./methods/labels.coffee"),legend:e("./methods/legend.coffee"),links:e("./methods/links.coffee"),margin:e("./methods/margin.coffee"),messages:e("./methods/messages.coffee"),mouse:e("./methods/mouse.coffee"),nodes:e("./methods/nodes.coffee"),order:e("./methods/order.coffee"),shape:e("./methods/shape.coffee"),size:e("./methods/size.coffee"),style:e("./methods/style.coffee"),temp:e("./methods/temp.coffee"),text:e("./methods/text.coffee"),time:e("./methods/time.coffee"),timeline:e("./methods/timeline.coffee"),timing:e("./methods/timing.coffee"),title:e("./methods/title.coffee"),tooltip:e("./methods/tooltip.coffee"),total:e("./methods/total.coffee"),type:e("./methods/type.coffee"),ui:e("./methods/ui.coffee"),width:e("./methods/width.coffee"),x:a("x"),x2:a("x2"),y:a("y"),y2:a("y2"),zoom:e("./methods/zoom.js")}),t.self}},{"../core/console/print.coffee":52,"../core/methods/attach.coffee":79,"../object/validate.coffee":171,"./helpers/container.coffee":210,"./helpers/drawSteps.js":211,"./helpers/ui/message.js":245,"./methods/active.coffee":254,"./methods/aggs.coffee":255,"./methods/attrs.coffee":256,"./methods/axes.coffee":257,"./methods/background.coffee":258,"./methods/class.coffee":259,"./methods/color.coffee":260,"./methods/cols.js":261,"./methods/config.coffee":262,"./methods/container.coffee":263,"./methods/coords.coffee":264,"./methods/csv.coffee":265,"./methods/data.coffee":266,"./methods/depth.coffee":267,"./methods/descs.coffee":268,"./methods/dev.coffee":269,"./methods/draw.js":270,"./methods/edges.js":271,"./methods/error.coffee":272,"./methods/focus.coffee":273,"./methods/font.coffee":274,"./methods/footer.coffee":275,"./methods/format.coffee":276,"./methods/height.coffee":277,"./methods/helpers/axis.coffee":278,"./methods/history.coffee":279,"./methods/icon.coffee":280,"./methods/id.coffee":281,"./methods/labels.coffee":282,"./methods/legend.coffee":283,"./methods/links.coffee":284,"./methods/margin.coffee":285,"./methods/messages.coffee":286,"./methods/mouse.coffee":287,"./methods/nodes.coffee":288,"./methods/order.coffee":289,"./methods/shape.coffee":290,"./methods/size.coffee":291,"./methods/style.coffee":292,"./methods/temp.coffee":293,"./methods/text.coffee":294,"./methods/time.coffee":295,"./methods/timeline.coffee":296,"./methods/timing.coffee":297,"./methods/title.coffee":298,"./methods/tooltip.coffee":299,"./methods/total.coffee":300,"./methods/type.coffee":301,"./methods/ui.coffee":302,"./methods/width.coffee":303,"./methods/zoom.js":304,"./types/bar.coffee":305,"./types/box.coffee":306,"./types/bubbles.coffee":307,"./types/deprecated/chart.coffee":308,"./types/geo_map.coffee":309,"./types/line.coffee":319,"./types/network.js":320,"./types/paths.coffee":321,"./types/pie.coffee":322,"./types/radar.coffee":323,"./types/rings.js":324,"./types/sankey.coffee":325,"./types/scatter.coffee":327,"./types/stacked.coffee":328,"./types/table.js":329,"./types/tree_map.coffee":330}]},{},[162]);